wok-6.x annotate pdnsd/receipt @ rev 24545
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Feb 24 19:32:16 2022 +0000 (2022-02-24) |
parents | 9e01bc6321ea |
children | a6b997a82f39 |
rev | line source |
---|---|
pascal@13600 | 1 # SliTaz package receipt. |
pascal@13600 | 2 |
pascal@13600 | 3 PACKAGE="pdnsd" |
pascal@13600 | 4 VERSION="1.2.9a" |
pascal@13600 | 5 CATEGORY="network" |
pascal@13600 | 6 SHORT_DESC="A proxy DNS server with permanent caching." |
pascal@13600 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@14999 | 8 LICENSE="GPL3" |
pascal@13600 | 9 WEB_SITE="http://members.home.nl/p.a.rombouts/pdnsd" |
pascal@13600 | 10 TARBALL="$PACKAGE-$VERSION-par.tar.gz" |
pascal@13600 | 11 WGET_URL="$WEB_SITE/releases/$TARBALL" |
pascal@13600 | 12 CONFIG_FILES="/etc/pdnsd.conf" |
pascal@13600 | 13 |
pascal@13600 | 14 DEPENDS="" |
pascal@13600 | 15 BUILD_DEPENDS="" |
pascal@13600 | 16 |
pascal@24545 | 17 # What is the latest version available today? |
pascal@24545 | 18 current_version() |
pascal@24545 | 19 { |
pascal@24545 | 20 wget -O - https://github.com/kwarunek/pdnsd/tags 2>/dev/null | \ |
pascal@24545 | 21 sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q' |
pascal@24545 | 22 } |
pascal@24545 | 23 |
pascal@13600 | 24 # Rules to configure and make the package. |
pascal@13600 | 25 compile_rules() |
pascal@13600 | 26 { |
pascal@13600 | 27 cd $src |
pascal@13600 | 28 ./configure --prefix=/usr --sysconfdir=/etc $CONFIGURE_ARGS && |
pascal@13600 | 29 make && make DESTDIR=$DESTDIR install |
pascal@13600 | 30 } |
pascal@13600 | 31 |
pascal@13600 | 32 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@13600 | 33 genpkg_rules() |
pascal@13600 | 34 { |
pascal@13600 | 35 cp -a $install/* $fs |
pascal@13600 | 36 rm -rf $fs/usr/share |
pascal@13600 | 37 mv $fs/etc/pdnsd.conf.sample $fs/etc/pdnsd.conf |
pascal@13600 | 38 } |
pascal@13601 | 39 |
pascal@13601 | 40 # Pre and post install commands for Tazpkg. |
pascal@13601 | 41 pre_remove() |
pascal@13601 | 42 { |
pascal@18730 | 43 sed -i 's/pdnsd//' "$1/etc/rcS.conf" |
pascal@18730 | 44 rm -f "$1/etc/init.d/pdnsd" |
pascal@13601 | 45 } |
pascal@13601 | 46 |
pascal@13601 | 47 post_install() |
pascal@13601 | 48 { |
pascal@13601 | 49 local tmp |
pascal@13601 | 50 tmp=$(route -n | awk '/^0.0.0.0/ { print $8; }') |
pascal@18730 | 51 [ -n "$tmp" ] && sed -i "s/eth0/$tmp/" "$1/etc/pdnsd.conf" |
pascal@13601 | 52 tmp=$(sed '/nameserver/!d;s/nameserver //;q' < /etc/resolv.conf) |
pascal@18730 | 53 [ -n "$tmp" ] && sed -i "s/192\.168\.0\.1/$tmp/" "$1/etc/pdnsd.conf" |
pascal@13601 | 54 tmp= |
pascal@18730 | 55 [ -s "$1/etc/init.d/daemon" ] && ln -s daemon "$1/etc/init.d/pdnsd" && |
pascal@13602 | 56 tmp=" and add pdnsd to RUN_DAEMONS in /etc/rcS.conf" |
pascal@13601 | 57 cat <<EOT |
pascal@13602 | 58 Now you can check /etc/pdnsd.conf$tmp. |
pascal@13601 | 59 EOT |
pascal@13601 | 60 } |