From 7c291669bab5cf44b615a7073eb0752be7a44612 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Sun, 10 Feb 2008 14:24:43 +0000 Subject: name harmonization --- Makefile | 4 ++-- fix-eol | 56 --------------------------------------------------- fix-mo | 41 ------------------------------------- fix_eol | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ fix_mo | 41 +++++++++++++++++++++++++++++++++++++ fix_pamd | 11 ++++++++++ fixpamd | 11 ---------- spec-helper.macros.in | 6 +++--- 8 files changed, 113 insertions(+), 113 deletions(-) delete mode 100755 fix-eol delete mode 100755 fix-mo create mode 100755 fix_eol create mode 100755 fix_mo create mode 100755 fix_pamd delete mode 100755 fixpamd diff --git a/Makefile b/Makefile index 7baa897..3813780 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,8 @@ VERSION = 0.28.0 SVNPATH = svn+ssh://svn.mandriva.com/svn/soft/rpm/$(PACKAGE) SCRIPT_FILES = clean_files clean_perl compress_files strip_files \ - lib_symlinks gprintify.py fix-mo translate_menu \ - fixpamd gprintify remove_info_dir relink_symlinks fix-eol + lib_symlinks gprintify.py fix_mo translate_menu \ + fix_pamd gprintify remove_info_dir relink_symlinks fix_eol BIN_FILES = macroszification MACROS_FILES = spec-helper.macros FILES = AUTHORS Makefile NEWS README \ diff --git a/fix-eol b/fix-eol deleted file mode 100755 index c546fed..0000000 --- a/fix-eol +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl -# $Id$ -# convert end of line patterns from DOS to UNIX - -use strict; -use warnings; -use File::Find; -use File::Temp; - -my $buildroot = $ENV{RPM_BUILD_ROOT}; -die "No build root defined" unless $buildroot; -die "Invalid build root" unless -d $buildroot; -# normalize build root -$buildroot =~ s|/$||; - -my $exclude_pattern = join('|', - map { '(:?' . quotemeta($_) . ')' } - $ENV{EXCLUDE_FROM_EOL_CONVERSION} ? - split(' ', $ENV{EXCLUDE_FROM_EOL_CONVERSION}) : () -); -$exclude_pattern = qr/$exclude_pattern/; - -find(\&convert, $buildroot); - -sub convert { - # skip symlinks - return if -l $_; - # skip directories - return if -d $_; - # skip binary files - return unless -T $_; - # skip excluded files - return if $File::Find::name =~ $exclude_pattern; - - # check if first line has less than 80 characters and ends with \r\n - open(my $in, '<', $_) or die "Unable to open file $_: $!"; - my $line = <$in>; - if (defined $line && length($line) <= 80 && $line =~ s/\r\n$/\n/) { - # process all file - my $out = File::Temp->new(DIR => '.', UNLINK => 0); - print $out $line; - while (defined ($line = <$in>)) { - $line =~ s/\r\n$/\n/; - print $out $line; - } - my $tmp = $out->filename; - $out = undef; - - # rename file, taking care to keep original permissions - my $perms = (stat $_)[2] & 07777; - rename($tmp, $_) or die "Unable to rename $tmp to $_: $!"; - chmod($perms, $_); - } - - close($in); -} diff --git a/fix-mo b/fix-mo deleted file mode 100755 index 0c11e3a..0000000 --- a/fix-mo +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -#--------------------------------------------------------------- -# Project : Mandrake Linux -# Module : spec-helper -# File : fix-mo -# Version : $Id$ -# Author : Pablo Saratxaga -# Created On : Fri Feb 14 08:27:47 2003 -# Purpose : Fix bad translations -#--------------------------------------------------------------- - -# HP people wants to have 'Gnome' in ascii; -# so "±×³ð" is converted to 'GNOME' - -KO_MESSAGES=$RPM_BUILD_ROOT/usr/share/locale/ko/LC_MESSAGES - -TMP=$KO_MESSAGES/tmpfile -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 - sed 's:±×³ð:GNOME:g' < $TMP > $TMP2 && msgfmt -o $i $TMP2 - ret=$? - elif grep -qi '^"Content-Type: text/plain; charset=utf-8.n"$' $TMP; then - sed 's:그놈:GNOME:g' < $TMP > $TMP2 && msgfmt -o $i $TMP2 - ret=$? - else - echo "Unsupported encoding" 1>&2 - fi -done - -rm -f $TMP $TMP2 - -exit $ret - -# fix-mo ends here diff --git a/fix_eol b/fix_eol new file mode 100755 index 0000000..c546fed --- /dev/null +++ b/fix_eol @@ -0,0 +1,56 @@ +#!/usr/bin/perl +# $Id$ +# convert end of line patterns from DOS to UNIX + +use strict; +use warnings; +use File::Find; +use File::Temp; + +my $buildroot = $ENV{RPM_BUILD_ROOT}; +die "No build root defined" unless $buildroot; +die "Invalid build root" unless -d $buildroot; +# normalize build root +$buildroot =~ s|/$||; + +my $exclude_pattern = join('|', + map { '(:?' . quotemeta($_) . ')' } + $ENV{EXCLUDE_FROM_EOL_CONVERSION} ? + split(' ', $ENV{EXCLUDE_FROM_EOL_CONVERSION}) : () +); +$exclude_pattern = qr/$exclude_pattern/; + +find(\&convert, $buildroot); + +sub convert { + # skip symlinks + return if -l $_; + # skip directories + return if -d $_; + # skip binary files + return unless -T $_; + # skip excluded files + return if $File::Find::name =~ $exclude_pattern; + + # check if first line has less than 80 characters and ends with \r\n + open(my $in, '<', $_) or die "Unable to open file $_: $!"; + my $line = <$in>; + if (defined $line && length($line) <= 80 && $line =~ s/\r\n$/\n/) { + # process all file + my $out = File::Temp->new(DIR => '.', UNLINK => 0); + print $out $line; + while (defined ($line = <$in>)) { + $line =~ s/\r\n$/\n/; + print $out $line; + } + my $tmp = $out->filename; + $out = undef; + + # rename file, taking care to keep original permissions + my $perms = (stat $_)[2] & 07777; + rename($tmp, $_) or die "Unable to rename $tmp to $_: $!"; + chmod($perms, $_); + } + + close($in); +} diff --git a/fix_mo b/fix_mo new file mode 100755 index 0000000..0c11e3a --- /dev/null +++ b/fix_mo @@ -0,0 +1,41 @@ +#!/bin/sh +#--------------------------------------------------------------- +# Project : Mandrake Linux +# Module : spec-helper +# File : fix-mo +# Version : $Id$ +# Author : Pablo Saratxaga +# Created On : Fri Feb 14 08:27:47 2003 +# Purpose : Fix bad translations +#--------------------------------------------------------------- + +# HP people wants to have 'Gnome' in ascii; +# so "±×³ð" is converted to 'GNOME' + +KO_MESSAGES=$RPM_BUILD_ROOT/usr/share/locale/ko/LC_MESSAGES + +TMP=$KO_MESSAGES/tmpfile +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 + sed 's:±×³ð:GNOME:g' < $TMP > $TMP2 && msgfmt -o $i $TMP2 + ret=$? + elif grep -qi '^"Content-Type: text/plain; charset=utf-8.n"$' $TMP; then + sed 's:그놈:GNOME:g' < $TMP > $TMP2 && msgfmt -o $i $TMP2 + ret=$? + else + echo "Unsupported encoding" 1>&2 + fi +done + +rm -f $TMP $TMP2 + +exit $ret + +# fix-mo ends here diff --git a/fix_pamd b/fix_pamd new file mode 100755 index 0000000..d9a332d --- /dev/null +++ b/fix_pamd @@ -0,0 +1,11 @@ +#!/bin/sh + +if test -z "$DONT_FIX_PAMD_CONFIGS"; then + configs=`find $RPM_BUILD_ROOT/etc/pam.d/ -type f ! -type l 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/fixpamd b/fixpamd deleted file mode 100755 index d9a332d..0000000 --- a/fixpamd +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if test -z "$DONT_FIX_PAMD_CONFIGS"; then - configs=`find $RPM_BUILD_ROOT/etc/pam.d/ -type f ! -type l 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/spec-helper.macros.in b/spec-helper.macros.in index 23914d4..198951a 100644 --- a/spec-helper.macros.in +++ b/spec-helper.macros.in @@ -10,10 +10,10 @@ %{?!dont_cleanup_perl: [ -n "$DONT_CLEAN_PERL" ] || %_spec_helper_dir/clean_perl} \ %{?!dont_symlinks_libs: [ -n "$DONT_SYMLINK_LIBS" ] || %_spec_helper_dir/lib_symlinks} \ %{?!dont_gprintify: [ -n "$DONT_GPRINTIFY" ] || %_spec_helper_dir/gprintify} \ - %{?!dont_fix_mo: [ -n "$DONT_FIX_MO" ] || %_spec_helper_dir/fix-mo} \ + %{?!dont_fix_mo: [ -n "$DONT_FIX_MO" ] || %_spec_helper_dir/fix_mo} \ %{?!dont_translate_menu: [ -n "$DONT_TRANSLATE_MENU" ] || %_spec_helper_dir/translate_menu} \ - %{?!dont_fix_pamd: [ -n "$DONT_FIX_PAMD_CONFIGS" ] || %_spec_helper_dir/fixpamd} \ + %{?!dont_fix_pamd: [ -n "$DONT_FIX_PAMD_CONFIGS" ] || %_spec_helper_dir/fix_pamd} \ %{?!dont_remove_info_dir: [ -n "$DONT_REMOVE_INFO_DIR" ] || %_spec_helper_dir/remove_info_dir} \ - %{?!dont_fix_eol: [ -n "$DONT_FIX_EOL" ] || %_spec_helper_dir/fix-eol} \ + %{?!dont_fix_eol: [ -n "$DONT_FIX_EOL" ] || %_spec_helper_dir/fix_eol} \ %nil -- cgit v1.2.1