aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xclean_files3
-rwxr-xr-xfix-mo2
-rwxr-xr-xfixpamd11
-rwxr-xr-xgprintify14
-rwxr-xr-xremove_info_dir12
-rwxr-xr-xspec-helper42
6 files changed, 51 insertions, 33 deletions
diff --git a/clean_files b/clean_files
index f0ae5e8..9955454 100755
--- a/clean_files
+++ b/clean_files
@@ -10,7 +10,10 @@
#---------------------------------------------------------------
################################################################################
+$ENV{DONT_CLEANUP} and exit(0);
+
my $RPM_BUILD_ROOT = $ENV{RPM_BUILD_ROOT};
+$RPM_BUILD_ROOT or exit(0); # case RPM_BUILD_ROOT is not used
chdir($RPM_BUILD_ROOT) or die "Can't cd to $ENV{RPM_BUILD_ROOT}: $!";
system(split(/\s+/, "find . -type f -a
diff --git a/fix-mo b/fix-mo
index 304c4f2..0c11e3a 100755
--- a/fix-mo
+++ b/fix-mo
@@ -19,6 +19,8 @@ TMP2=$KO_MESSAGES/tmpfile2
ret=0
+[ -f "$KO_MESSAGES/*.mo" ] || exit 0
+
for i in $KO_MESSAGES/*.mo ; do
msgunfmt -o $TMP $i
if grep -qi '^"Content-Type: text/plain; charset=euc-kr.n"$' $TMP; then
diff --git a/fixpamd b/fixpamd
new file mode 100755
index 0000000..3bc042a
--- /dev/null
+++ b/fixpamd
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if test -z "$DONT_FIX_PAMD_CONFIGS"; then
+ configs=`ls $RPM_BUILD_ROOT/etc/pam.d/* 2> /dev/null`
+ if [ -n "$configs" ]; then
+ echo -n "Fixing pam.d config files..."
+ perl -pi -e "s,/(lib|lib64)/security/,," $configs
+ echo "done"
+ fi
+fi
+
diff --git a/gprintify b/gprintify
new file mode 100755
index 0000000..85bf0cf
--- /dev/null
+++ b/gprintify
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# $Id$
+
+if test -z "$DONT_GPRINTIFY"; then
+ scripts=
+ for f in `ls $RPM_BUILD_ROOT/etc/rc.d/init.d/* $RPM_BUILD_ROOT/etc/init.d/* 2> /dev/null`; do
+ test -f $f && egrep -q '[[:space:]]*\.[[:space:]]+.*/functions' $f && scripts="$scripts $f"
+ done
+ if [ -n "$scripts" ]; then
+ echo -n "Gprintifying init scripts..." && gprintify.py $scripts && echo "done"
+ fi
+fi
+
diff --git a/remove_info_dir b/remove_info_dir
new file mode 100755
index 0000000..ae21fcb
--- /dev/null
+++ b/remove_info_dir
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+INFODIR=`rpm --eval %{_infodir}/dir`
+
+test -n "$RPM_BUILD_ROOT" || exit 0
+
+dir="$RPM_BUILD_ROOT/$INFODIR"
+
+if test -z "$DONT_REMOVE_INFO_DIR" -a -f $dir -a ! -L $dir; then
+ rm -f $dir
+fi
+
diff --git a/spec-helper b/spec-helper
index c29e754..aa49114 100755
--- a/spec-helper
+++ b/spec-helper
@@ -1,4 +1,8 @@
#!/bin/sh
+
+# Olivier Thauvin Sat May 20 14:47:17 CEST 2006:
+# This file is now deprecated, see spec-helper.macro.in
+
#---------------------------------------------------------------
# Project : Mandrake Linux
# Module : spec-helper
@@ -61,39 +65,11 @@ test -z "$DONT_STRIP" && echo -n "Stripping files..." && strip_files && echo "do
test -z "$DONT_RELINK" && echo -n "Relativisation of symlinks..." && relative_me_babe && echo "done"
test -z "$DONT_CLEAN_PERL" && echo -n "Clean perl..." && clean_perl && echo "done"
test -z "$DONT_SYMLINK_LIBS" && echo -n "Building libraries symlinks..." && lib_symlinks && echo "done"
-
-if test -z "$DONT_GPRINTIFY"; then
- scripts=
- for f in `ls $RPM_BUILD_ROOT/etc/rc.d/init.d/* $RPM_BUILD_ROOT/etc/init.d/* 2> /dev/null`; do
- test -f $f && egrep -q '[[:space:]]*\.[[:space:]]+.*/functions' $f && scripts="$scripts $f"
- done
- if [ -n "$scripts" ]; then
- echo -n "Gprintifying init scripts..." && gprintify.py $scripts && echo "done"
- fi
-fi
-
-if test -z "$DONT_FIX_PAMD_CONFIGS"; then
- configs=`ls $RPM_BUILD_ROOT/etc/pam.d/* 2> /dev/null`
- if [ -n "$configs" ]; then
- echo -n "Fixing pam.d config files..."
- perl -pi -e "s,/(lib|lib64)/security/,," $configs
- echo "done"
- fi
-fi
-
-dir=$RPM_BUILD_ROOT/usr/share/info/dir
-
-if test -z "$DONT_REMOVE_INFO_DIR" -a -f $dir -a ! -L $dir; then
- echo -n "Removing info dir..." && rm -f $dir && echo done
-fi
-
-if test -z "$DONT_FIX_MO" -a -n "$(ls $RPM_BUILD_ROOT/usr/share/locale/ko/LC_MESSAGES/*.mo 2> /dev/null)"; then
- echo -n "Fixing translations..." && fix-mo && echo done
-fi
-
-if test -z "$DONT_TRANSLATE_MENU" -a -d $RPM_BUILD_ROOT/usr/lib/menu; then
- echo "Translating menus:" && translate_menu.pl $RPM_BUILD_ROOT/usr/lib/menu/* && echo done
-fi
+test -z "$DONT_GPRINTIFY" && echo -n "printify initscripts..." && gprintify && echo "done"
+test -z "$DONT_FIX_PAMD_CONFIGS" && echo -n "Fixing pam.d config files..." && fixpamd && echo "done"
+test -z "$DONT_REMOVE_INFO_DIR" && echo -n "Removing info dir..." && remove_info_dir && echo "done"
+test -z "$DONT_FIX_MO" && echo -n "Fixing translations..." && fix-mo && echo "done"
+test -z "$DONT_TRANSLATE_MENU" && echo -n "Translating menus..." && translate_menu.pl && echo "done"
exit 0