SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "ntpclient"

# SliTaz package receipt.

PACKAGE="ntpclient"
VERSION="2015_365"
CATEGORY="system-tools"
SHORT_DESC="Tiny NTP Client"
MAINTAINER="erjo@slitaz.org"
LICENSE="GPL2"
TARBALL="${PACKAGE}_$VERSION.tar.gz"
WEB_SITE="http://doolittle.icarus.com/ntpclient/"
WGET_URL="${WEB_SITE}$TARBALL"
HOST_ARCH="i486 arm"

# What is the latest version available today?
current_version()
{
    wget -O - $WEB_SITE 2>/dev/null | \
    sed "/latest/d;/${PACKAGE}_[0-9]/!d;/tar/!d;s|.*${PACKAGE}_\\(.*\\).tar..*|\\1|" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    # disable debug
    sed -i 's/\(^CFLAGS += -DENABLE_DEBUG\)/#\1/' Makefile &&
    make
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/bin
    cp -a $src/ntpclient  $fs/usr/bin
}

post_install()
{
    [ -n "$1" -o -n "$quiet" ] && return
    echo -en '\nDo you want to run ntpclient in automatic mode (y/N): '
    read -t 30 anser
        if [ "$anser" = 'y' ]; then
            srv='fr.pool.ntp.org'
            action 'Setting up crontab for ntpclient...'
            crontab -l  2>/dev/null | grep -q '/usr/bin/ntpclient -s -h' ||
            crontab - -u root <<EOT
$(crontab -l 2>/dev/null)
0 0 * * * /usr/bin/ntpclient -s -h $srv
EOT
        else
            echo "Don't forget to run ntpclient -s -h <NTP Server>"
        fi
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)