From 944d84608d9bf501dd16124307fcab77ee5d688d Mon Sep 17 00:00:00 2001 From: dsomero Date: Fri, 9 Jul 2010 02:36:56 -0400 Subject: libraries/perl-Date-Manip: Added /etc/timezone file. Signed-off-by: dsomero --- libraries/perl-Date-Manip/doinst.sh | 20 ++++++++++++++++++++ libraries/perl-Date-Manip/perl-Date-Manip.SlackBuild | 11 +++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 libraries/perl-Date-Manip/doinst.sh diff --git a/libraries/perl-Date-Manip/doinst.sh b/libraries/perl-Date-Manip/doinst.sh new file mode 100644 index 0000000000..3b1811064d --- /dev/null +++ b/libraries/perl-Date-Manip/doinst.sh @@ -0,0 +1,20 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +if [ -L etc/localtime-copied-from ]; then + localTime="$(readlink etc/localtime-copied-from)" + echo $localTime | cut -d/ -f5- > etc/timezone.new +fi + +config etc/timezone.new + diff --git a/libraries/perl-Date-Manip/perl-Date-Manip.SlackBuild b/libraries/perl-Date-Manip/perl-Date-Manip.SlackBuild index 76c8b6457e..bd53d5be70 100644 --- a/libraries/perl-Date-Manip/perl-Date-Manip.SlackBuild +++ b/libraries/perl-Date-Manip/perl-Date-Manip.SlackBuild @@ -25,7 +25,7 @@ SRCNAM=Date-Manip PRGNAM=perl-$SRCNAM VERSION=${VERSION:-6.11} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -82,7 +82,7 @@ perl Build.PL \ find $PKG/usr/man -type f -exec gzip -9 {} \; -find $PKG -name "perllocal.pod" -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true +find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true find $PKG -depth -type d -empty -delete || true @@ -92,8 +92,15 @@ cp -a \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +# Date::Manip seems to need a correctly set /etc/timezone file in some cases. +# We will create a placeholder and update it with the correct info from the +# doinst.sh script. +mkdir -p $PKG/etc +touch $PKG/etc/timezone.new + mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} -- cgit v1.2.3