From 8c724a6d603ec825511a6d0ad666274623a41f25 Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 24 Nov 2008 18:46:30 +0000 Subject: anacron: rebuilt from mkbuild git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1965 370017ae-e619-0410-ac65-c121f96126d4 --- sys/process/anacron/anacron.SlackBuild | 46 ++++++++++++++++++++++++++++++++-- sys/process/anacron/anacrontab.new | 7 ++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 sys/process/anacron/anacrontab.new (limited to 'sys/process/anacron') diff --git a/sys/process/anacron/anacron.SlackBuild b/sys/process/anacron/anacron.SlackBuild index 0c5ffbfa..62b8a36c 100644 --- a/sys/process/anacron/anacron.SlackBuild +++ b/sys/process/anacron/anacron.SlackBuild @@ -134,12 +134,12 @@ fi make $NUMJOBS || exit $ERROR_MAKE # Install -mkdir -p $PKG -mkdir -p $PKG/usr/sbin $PKG/var/spool/anacron $PKG/usr/man/man5 $PKG/usr/man/man8 +mkdir -p $PKG/usr/sbin $PKG/var/spool/anacron $PKG/usr/man/man5 $PKG/usr/man/man8 $PKG/etc cp anacron $PKG/usr/sbin cp anacrontab.5 $PKG/usr/man/man5 cp anacron.8 $PKG/usr/man/man8 +cp $CWD/anacrontab.new $PKG/etc gzip $PKG/usr/man/man5/anacrontab.5 gzip $PKG/usr/man/man8/anacron.8 @@ -185,6 +185,48 @@ anacron: machine-uptime permits. anacron: EODESC +# Add a post-installation script (doinst.sh) +cat << EOSCRIPT > "$PKG/install/doinst.sh" +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .sample)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .dist)" + + # 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... +} + +mkgroup() { + GROUP="\$1" + if ! grep -qe "^\$GROUP:" etc/group; then + echo Creating group \$GROUP... + chroot . /usr/sbin/groupadd \$GROUP + fi +} + +mkuser() { + USER="\$1" + if [ ! -z "\$2" ]; then + GROUP="\$2" + else + GROUP="\$USER" + fi + if ! grep -qe "^\$USER:" etc/passwd; then + echo Creating user \$USER... + chroot . /usr/sbin/useradd \$USER -g \$GROUP + fi +} + +config etc/anacrontab.new +EOSCRIPT + # Build the package cd "$PKG" makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG diff --git a/sys/process/anacron/anacrontab.new b/sys/process/anacron/anacrontab.new new file mode 100644 index 00000000..793cf3e0 --- /dev/null +++ b/sys/process/anacron/anacrontab.new @@ -0,0 +1,7 @@ +# /etc/anacrontab +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +# format: period delay job-identifier command +1 5 cron.daily run-parts /etc/cron.daily +7 10 cron.weekly run-parts /etc/cron.weekly +@monthly 15 cron.monthly run-parts /etc/cron.monthly -- cgit v1.2.3