wok-6.x view iaxmodem/receipt @ rev 17939

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