wok-tiny view p910nd/receipt @ rev 92

base-tiny: may reuse passwd
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 18 13:11:03 2013 +0000 (2013-07-18)
parents a6d2ddc65590
children 371673f39e46
line source
1 # SliTaz package receipt.
3 PACKAGE="p910nd"
4 VERSION="0.93"
5 CATEGORY="network"
6 SHORT_DESC="Forward printer device to 9100+ ports"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 LICENSE="GPL2"
10 WEB_SITE="http://p910nd.sourceforge.net/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 [ -n "$TARGET" ] || TARGET="i486"
13 BUILD_DEPENDS="uclibc-cross-compiler-$TARGET"
14 DEPENDS="base-tiny"
15 CONFIG_FILES="/etc/inetd.conf /etc/rcS.conf"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 make CC=uclibc-$TARGET-cc CFLAGS=-DLOCKFILE_DIR=\\\"/var/lock\\\" &&
22 make DESTDIR=$PWD/_pkg install
23 }
25 # Rules to gen a SliTaz package suitable for Tazpkg.
26 genpkg_rules()
27 {
28 mkdir -p $fs/usr $fs/etc/init.d $fs/dev
29 cp -a $_pkg/usr/sbin $fs/usr
30 ln -s daemon $fs/etc/init.d/p910nd
31 }
33 post_install()
34 {
35 [ -n "$DEVICES" ] || DEVICES="/dev/lp0"
36 grep -q inetd $1/etc/rcS.conf ||
37 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
38 grep -q p910nd $1/etc/inetd.conf ||
39 echo "$DEVICES" | dos2unix | awk '{ if ($1 != "") printf \
40 "%d stream tcp nowait root %s %s -b -f %s\n", 9100 + n++, \
41 "/usr/sbin/p910nd", "/usr/sbin/p910nd", $1 }' >> $1/etc/inetd.conf
42 mkdir $1/dev
43 for dev in $(echo $DEVICES | dos2unix); do
44 mknod -m 660 $1$dev c 6 ${dev#*lp}
45 done
46 }
48 config_form()
49 {
50 [ -n "$DEVICES" ] || DEVICES=/dev/lp0
51 grep -q p910nd $1/etc/inetd.conf && return 1
52 cat <<EOT
53 Printer device(s):
54 <textarea name="DEVICES">
55 $DEVICES
56 </textarea>
57 EOT
58 }