wok-next annotate iaxmodem/receipt @ rev 18730

Quote root dir in post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 20 15:13:45 2015 +0100 (2015-12-20)
parents 92bb72113a36
children e1c0edabdcb2
rev   line source
pascal@14765 1 # SliTaz package receipt.
pascal@14765 2
pascal@14765 3 PACKAGE="iaxmodem"
pascal@14765 4 VERSION="1.2.0"
pascal@14765 5 CATEGORY="network"
pascal@14765 6 SHORT_DESC="Software modem for libiax2."
pascal@14765 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14765 8 LICENSE="GPL2"
pascal@14765 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@14765 10 WEB_SITE="http://iaxmodem.sourceforge.net/"
pascal@14765 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
pascal@14765 12 CONFIG_FILES="/etc/iaxmodem"
pascal@14765 13
pascal@14765 14 DEPENDS="jpeg tiff zlib hylafax"
pascal@14765 15 BUILD_DEPENDS="jpeg-dev tiff-dev zlib-dev"
pascal@14765 16
pascal@14765 17 # Rules to configure and make the package.
pascal@14765 18 compile_rules()
pascal@14765 19 {
pascal@14765 20 cd $src
pascal@14765 21 #sed -i 's/uucp/root/' iaxmodem.c
pascal@14765 22 ./configure --prefix=/usr --infodir=/usr/share/info \
pascal@14765 23 --mandir=/usr/share/man \
pascal@14765 24 $CONFIGURE_ARGS && make
pascal@14765 25 }
pascal@14765 26
pascal@14765 27 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@14765 28 genpkg_rules()
pascal@14765 29 {
pascal@14765 30 mkdir -p $fs/usr/bin $fs/etc/iaxmodem $fs/var/log/iaxmodem
pascal@14765 31 cp -a $src/iaxmodem $fs/usr/bin
pascal@14765 32 cat > $fs/etc/iaxmodem/ttyIAX0 <<EOT
pascal@14765 33 device /dev/ttyIAX0
pascal@14765 34 owner root:root
pascal@14765 35 mode 660
pascal@14765 36 port 4570
pascal@14765 37 refresh 60
pascal@14765 38 server 127.0.0.1
pascal@14765 39 peername iaxmodem
pascal@14765 40 secret password
pascal@14765 41 codec alaw
pascal@14765 42 EOT
pascal@14765 43 #owner uucp:uucp
pascal@14765 44 #refresh 50
pascal@14765 45 }
pascal@14765 46
pascal@14765 47 pre_remove()
pascal@14765 48 {
pascal@18730 49 sed -i '/iaxmodem/d' "$1/etc/inittab"
pascal@14765 50 }
pascal@14765 51
pascal@14765 52 # Pre and post install commands for Tazpkg.
pascal@14765 53 post_install()
pascal@14765 54 {
pascal@18730 55 grep -q ^uucp: "$1/etc/passwd" || {
pascal@18730 56 chroot "$1/" adduser -s /bin/false -S -D -H uucp
pascal@18730 57 sed -i 's/^uucp:x:[0-9]*:[0-9]*:/uucp:x:0:0:/' "$1/etc/passwd"
pascal@14765 58 }
pascal@18730 59 grep -q ^uucp: "$1/etc/group" || chroot "$1/" addgroup uucp
pascal@18730 60 touch "$1/var/log/iaxmodem/ttyIAX0" "$1/var/log/iaxmodem/iaxmodem"
pascal@18730 61 grep iaxmodem "$1/etc/inittab" || cat >> "$1/etc/inittab" << EOT
pascal@14765 62 ::respawn:/usr/bin/iaxmodem ttyIAX0 > /var/log/iaxmodem.log 2>&1
pascal@14765 63 ::respawn:/usr/sbin/faxgetty ttyIAX0
pascal@14765 64 EOT
pascal@18730 65 [ "$1" ] || kill -1 1
pascal@14765 66 }