wok-6.x annotate ntpclient/receipt @ rev 6934
ntpclient: one call in crontab only
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Oct 23 12:53:58 2010 +0200 (2010-10-23) |
parents | bcb2999e13f6 |
children | a1c1d35d9f92 |
rev | line source |
---|---|
erjo@506 | 1 # SliTaz package receipt. |
erjo@506 | 2 |
erjo@506 | 3 PACKAGE="ntpclient" |
erjo@3125 | 4 VERSION="2007_365" |
erjo@506 | 5 CATEGORY="system-tools" |
erjo@506 | 6 SHORT_DESC="Tiny NTP Client" |
erjo@784 | 7 MAINTAINER="erjo@slitaz.org" |
erjo@506 | 8 DEPENDS="" |
erjo@506 | 9 TARBALL="${PACKAGE}_${VERSION}.tar.gz" |
erjo@506 | 10 WEB_SITE="http://www.busybox.net/tinyutils.html" |
erjo@506 | 11 WGET_URL="http://doolittle.icarus.com/ntpclient/$TARBALL" |
erjo@506 | 12 |
erjo@506 | 13 # Rules to configure and make the package. |
erjo@506 | 14 compile_rules() |
erjo@506 | 15 { |
erjo@3125 | 16 src=$PACKAGE-2007 |
erjo@506 | 17 cd $src |
erjo@3125 | 18 |
erjo@3125 | 19 # disable debug |
erjo@3125 | 20 sed -i 's/\(^CFLAGS += -DENABLE_DEBUG\)/#\1/' Makefile |
erjo@506 | 21 make |
erjo@506 | 22 } |
erjo@506 | 23 |
erjo@506 | 24 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@506 | 25 genpkg_rules() |
erjo@506 | 26 { |
erjo@3125 | 27 src=$PACKAGE-2007 |
erjo@506 | 28 mkdir -p $fs/usr/bin |
erjo@506 | 29 cp -a $src/ntpclient $fs/usr/bin |
erjo@506 | 30 strip -s $fs/usr/bin/* |
erjo@506 | 31 } |
erjo@506 | 32 |
erjo@506 | 33 |
erjo@506 | 34 clen_rules() |
erjo@506 | 35 { |
erjo@506 | 36 rm -rf $PWD/$PACKAGE |
erjo@506 | 37 } |
erjo@506 | 38 |
erjo@506 | 39 post_install() |
erjo@506 | 40 { |
pascal@1137 | 41 [ -n "$1" ] && return |
erjo@506 | 42 echo "" |
erjo@506 | 43 echo -n "Do you want to run ntpclient in automatic mode (y/N): "; read anser |
erjo@506 | 44 if [ "$anser" == "y" ]; then |
erjo@506 | 45 srv="fr.pool.ntp.org" |
erjo@506 | 46 echo "" |
erjo@506 | 47 echo -n "Setting up crontab for ntpclient..." |
pascal@6934 | 48 crontab -l 2> /dev/null | grep -q '/usr/bin/ntpclient -s -h' || |
pascal@6934 | 49 crontab - -u root << EOT |
pascal@1926 | 50 $(crontab -l 2> /dev/null) |
pascal@6934 | 51 0 0 * * * /usr/bin/ntpclient -s -h $srv |
pascal@1926 | 52 EOT |
erjo@506 | 53 status |
erjo@506 | 54 else |
erjo@506 | 55 echo "Don't forget to run ntpclient -s -h <NTP Server>" |
erjo@506 | 56 fi |
erjo@506 | 57 } |
erjo@506 | 58 |