wok view ntpclient/receipt @ rev 25794
created recipe for exo-lang
author | Hans-G?nter Theisgen |
---|---|
date | Wed Oct 23 16:19:52 2024 +0100 (4 weeks ago) |
parents | ad8b9ff412d2 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="ntpclient"
4 VERSION="3.1"
5 CATEGORY="system-tools"
6 SHORT_DESC="Tiny NTP Client"
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="https://github.com/troglobit/sntpd"
11 WGET_URL="https://github.com/troglobit/sntpd/archive/refs/tags/v$VERSION.tar.gz"
12 HOST_ARCH="i486 arm"
13 PROVIDES="sntpd"
15 BUILD_DEPENDS="automake"
17 # What is the latest version available today?
18 current_version()
19 {
20 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
21 sed '/tag\//!d;s|.*tag/v*||;s|".*||;q'
22 }
24 # Rules to configure and make the package.
25 compile_rules()
26 {
27 ./autogen.sh
28 ./configure LIBS="-lrt" --prefix=/usr &&
29 make
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p $fs/usr/bin
36 cp -a $src/src/sntpd $fs/usr/bin/
37 ln $fs/usr/bin/sntpd $fs/usr/bin/ntpclient
38 }
40 post_install()
41 {
42 [ -n "$1" -o -n "$quiet" ] && return
43 echo -en '\nDo you want to run ntpclient in automatic mode (y/N): '
44 read -t 30 anser
45 if [ "$anser" = 'y' ]; then
46 srv='fr.pool.ntp.org'
47 action 'Setting up crontab for ntpclient...'
48 crontab -l 2>/dev/null | grep -q '/usr/bin/ntpclient -s -h' ||
49 crontab - -u root <<EOT
50 $(crontab -l 2>/dev/null)
51 0 0 * * * /usr/bin/ntpclient -s -h $srv
52 EOT
53 else
54 echo "Don't forget to run ntpclient -s -h <NTP Server>"
55 fi
56 }