wok-6.x annotate mgetty/receipt @ rev 1337

Add mgetty
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Aug 31 12:13:06 2008 +0000 (2008-08-31)
parents
children bd6010223726
rev   line source
pascal@1337 1 # SliTaz package receipt.
pascal@1337 2
pascal@1337 3 PACKAGE="mgetty"
pascal@1337 4 VERSION="1.1.35"
pascal@1337 5 CATEGORY="network"
pascal@1337 6 SHORT_DESC="reliable and proven fax send and receive solution."
pascal@1337 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1337 8 TARBALL="$PACKAGE$VERSION-Feb22.tar.gz"
pascal@1337 9 WEB_SITE="http://mgetty.greenie.net/"
pascal@1337 10 WGET_URL="ftp://mgetty.greenie.net/pub/$PACKAGE/source/1.1/$TARBALL"
pascal@1337 11 CONFIG_FILES="/etc/mgetty+sendfax"
pascal@1337 12
pascal@1337 13 # Rules to configure and make the package.
pascal@1337 14 compile_rules()
pascal@1337 15 {
pascal@1337 16
pascal@1337 17 cd $src
pascal@1337 18 [ -f Makefile.dist ] && mv -f Makefile.dist Makefile
pascal@1337 19 cp Makefile Makefile.dist
pascal@1337 20 cp Makefile Makefile.install
pascal@1337 21 cp policy.h-dist policy.h
pascal@1337 22 sed -i -e 's|/* #define AUTO_PPP */|#define AUTO_PPP|' policy.h
pascal@1337 23 sed -i -e "s|^prefix=/usr/local|prefix=/usr|" \
pascal@1337 24 -e "s|^spool=/var/spool|spool=/var/spool|" \
pascal@1337 25 -e "s|^CONFDIR=.*|CONFDIR=/etc/mgetty+sendfax|" \
pascal@1337 26 Makefile
pascal@1337 27 sed -i -e "s|^prefix=/usr/local|prefix=$PWD/_pkg/usr|" \
pascal@1337 28 -e "s|^spool=/var/spool|spool=$PWD/_pkg/var/spool|" \
pascal@1337 29 -e "s|^CONFDIR=.*|CONFDIR=$PWD/_pkg/etc/mgetty+sendfax|" \
pascal@1337 30 -e 's|^INSTALL=install .*|INSTALL=install -c -o root -g root|' \
pascal@1337 31 Makefile.install
pascal@1337 32 make bin-all vgetty
pascal@1337 33 mkdir -p _pkg/var/spool
pascal@1337 34 mv -f Makefile.install Makefile
pascal@1337 35 make -k install.bin vgetty-install || true
pascal@1337 36 }
pascal@1337 37
pascal@1337 38 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1337 39 genpkg_rules()
pascal@1337 40 {
pascal@1337 41 mkdir -p $fs/usr
pascal@1337 42 cp -a $_pkg/usr/lib $fs/usr
pascal@1337 43 cp -a $_pkg/usr/sbin $fs/usr
pascal@1337 44 cp -a $_pkg/etc $fs
pascal@1337 45 cp -a $_pkg/var $fs
pascal@1337 46 chmod 755 $fs/var/spool/fax
pascal@1337 47 for i in $(cd $WOK; ls -d mgetty-*)
pascal@1337 48 do
pascal@1337 49 tazwok cook $i
pascal@1337 50 done
pascal@1337 51 }
pascal@1337 52
pascal@1337 53 # Pre and post install commands for Tazpkg.
pascal@1337 54 post_install()
pascal@1337 55 {
pascal@1337 56 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
pascal@1337 57 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
pascal@1337 58 $(cd $1/ ; find etc/mgetty+sendfax -type f)
pascal@1337 59 EOT
pascal@1337 60 # adduser fax if needed
pascal@1337 61 if ! grep -q fax $1/etc/passwd; then
pascal@1337 62 echo -n "Adding user fax..."
pascal@1337 63 chroot $1/ adduser fax -D -H -S
pascal@1337 64 status
pascal@1337 65 fi
pascal@1337 66 chown fax $fs/var/spool/fax
pascal@1337 67 }
pascal@1337 68
pascal@1337 69 post_remove()
pascal@1337 70 {
pascal@1337 71 deluser fax
pascal@1337 72 }
pascal@1337 73
pascal@1337 74 repack_cleanup()
pascal@1337 75 {
pascal@1337 76 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
pascal@1337 77 }