wok-tiny view p910nd/receipt @ rev 183

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