wok-tiny view p910nd/receipt @ rev 100

Update wiki, add module-serial
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 31 16:32:19 2015 +0100 (2015-10-31)
parents 371673f39e46
children a28c45a86936
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 SUGGESTED="module-lp module-usblp"
16 CONFIG_FILES="/etc/inetd.conf /etc/rcS.conf"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 make CC=uclibc-$TARGET-cc CFLAGS=-DLOCKFILE_DIR=\\\"/var/lock\\\" &&
22 make DESTDIR=$DESTDIR 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 $install/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 }