wok annotate mgetty/receipt @ rev 24497

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 19 14:19:02 2022 +0000 (2022-02-19)
parents a5ee74db1fee
children
rev   line source
pascal@1337 1 # SliTaz package receipt.
pascal@1337 2
pascal@1337 3 PACKAGE="mgetty"
Hans-G?nter@23179 4 VERSION="1.2.1"
pascal@1337 5 CATEGORY="network"
Hans-G?nter@23179 6 SHORT_DESC="Reliable and proven fax send and receive solution."
pascal@1337 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15002 8 LICENSE="GPL2"
pascal@1337 9 WEB_SITE="http://mgetty.greenie.net/"
Hans-G?nter@23179 10
Hans-G?nter@23179 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@17869 12 WGET_URL="ftp://mgetty.greenie.net/pub/$PACKAGE/source/${VERSION%.*}/$TARBALL"
Hans-G?nter@23179 13
pascal@1977 14 DEPENDS="slitaz-base-files"
Hans-G?nter@23179 15
pascal@1337 16 CONFIG_FILES="/etc/mgetty+sendfax"
pascal@1337 17
pascal@24497 18 # What is the latest version available today?
pascal@24497 19 current_version()
pascal@24497 20 {
pascal@24497 21 wget -O - $WEB_SITE 2>/dev/null | \
pascal@24497 22 sed '/mgetty-[0-9]/!d;s|.*mgetty-||;s|.tar.*||;q'
pascal@24497 23 }
pascal@24497 24
pascal@1337 25 # Rules to configure and make the package.
pascal@1337 26 compile_rules()
pascal@1337 27 {
Hans-G?nter@23179 28 chmod a+x mkidirs
Hans-G?nter@23179 29
pascal@1337 30 [ -f Makefile.dist ] && mv -f Makefile.dist Makefile
pascal@1337 31 cp Makefile Makefile.dist
pascal@1337 32 cp Makefile Makefile.install
pascal@1337 33 cp policy.h-dist policy.h
Hans-G?nter@23179 34 sed -i -e 's|/* #define AUTO_PPP */|#define AUTO_PPP|' \
Hans-G?nter@23179 35 policy.h
pascal@1337 36 sed -i -e "s|^prefix=/usr/local|prefix=/usr|" \
pascal@1337 37 -e "s|^spool=/var/spool|spool=/var/spool|" \
pascal@1337 38 -e "s|^CONFDIR=.*|CONFDIR=/etc/mgetty+sendfax|" \
pascal@19291 39 -e 's|/man/|/share&|' \
pascal@1337 40 Makefile
slaxemulator@13199 41 sed -i -e "s|^prefix=/usr/local|prefix=$DESTDIR/usr|" \
slaxemulator@13199 42 -e "s|^spool=/var/spool|spool=$DESTDIR/var/spool|" \
slaxemulator@13199 43 -e "s|^CONFDIR=.*|CONFDIR=$DESTDIR/etc/mgetty+sendfax|" \
pascal@19291 44 -e 's|/man/|/share&|' \
pascal@1337 45 -e 's|^INSTALL=install .*|INSTALL=install -c -o root -g root|' \
pascal@1337 46 Makefile.install
pascal@23881 47 make -j 1 bin-all vgetty
Hans-G?nter@23179 48 mkdir -p $DESTDIR/var/spool $DESTDIR/usr/share/man/man1
Hans-G?nter@23179 49 mkdir -p $DESTDIR/usr/share/man/man8
pascal@1337 50 mv -f Makefile.install Makefile
pascal@18425 51 sed -i 's|chown|echo chown|' Makefile fax/Makefile
pascal@23881 52 make -j 1 -k install.bin vgetty-install
pascal@1337 53 }
pascal@1337 54
pascal@1337 55 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1337 56 genpkg_rules()
pascal@1337 57 {
pascal@1337 58 mkdir -p $fs/usr
Hans-G?nter@23179 59 cp -a $install/usr/lib $fs/usr
Hans-G?nter@23179 60 cp -a $install/usr/sbin $fs/usr
Hans-G?nter@23179 61 cp -a $install/etc $fs
Hans-G?nter@23179 62 cp -a $install/var $fs
Hans-G?nter@23179 63 chmod 755 $fs/var/spool/fax
pascal@1337 64 }
pascal@1337 65
pascal@1337 66 # Pre and post install commands for Tazpkg.
pascal@1337 67 post_install()
pascal@1337 68 {
pascal@1337 69 # adduser fax if needed
Hans-G?nter@23179 70 if ! grep -q fax "$1/etc/passwd"
Hans-G?nter@23179 71 then
pascal@20319 72 echo
pascal@1337 73 echo -n "Adding user fax..."
pascal@18730 74 chroot "$1/" adduser fax -D -H -S
pascal@1337 75 status
pascal@1337 76 fi
pascal@18730 77 chroot "$1/" chown fax /var/spool/fax
pascal@1337 78 }
pascal@1337 79
pascal@1337 80 post_remove()
pascal@1337 81 {
pascal@18730 82 chroot "$1/" deluser fax
pascal@1337 83 }