SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "pdnsd"

# SliTaz package receipt.

PACKAGE="pdnsd"
VERSION="1.2.9a"
CATEGORY="network"
SHORT_DESC="A proxy DNS server with permanent caching."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL3"
WEB_SITE="https://web.archive.org/web/20201203080556/members.home.nl/p.a.rombouts/pdnsd/"
TARBALL="$PACKAGE-$VERSION-par.tar.gz"
WGET_URL="$WEB_SITE/releases/$TARBALL"
CONFIG_FILES="/etc/pdnsd.conf"

DEPENDS=""
BUILD_DEPENDS=""

# What is the latest version available today?
current_version()
{
    wget -O - https://github.com/kwarunek/pdnsd/tags 2>/dev/null | \
    sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    ./configure --prefix=/usr --sysconfdir=/etc $CONFIGURE_ARGS &&
    make && make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    cp -a $install/* $fs
    rm -rf $fs/usr/share
    mv $fs/etc/pdnsd.conf.sample $fs/etc/pdnsd.conf
}

# Pre and post install commands for Tazpkg.
pre_remove()
{
    sed -i 's/pdnsd//' "$1/etc/rcS.conf"
    rm -f "$1/etc/init.d/pdnsd"
}

post_install()
{
    local tmp
    tmp=$(route -n | awk '/^0.0.0.0/ { print $8; }')
    [ -n "$tmp" ] && sed -i "s/eth0/$tmp/" "$1/etc/pdnsd.conf"
    tmp=$(sed '/nameserver/!d;s/nameserver //;q' < /etc/resolv.conf)
    [ -n "$tmp" ] && sed -i "s/192\.168\.0\.1/$tmp/" "$1/etc/pdnsd.conf"
    tmp=
    [ -s "$1/etc/init.d/daemon" ] && ln -s daemon "$1/etc/init.d/pdnsd" &&
        tmp=" and add pdnsd to RUN_DAEMONS in /etc/rcS.conf"
    cat <<EOT
Now you can check /etc/pdnsd.conf$tmp.
EOT
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)