wok-tiny view p910nd/receipt @ rev 94

Refresh, remove kernel*, add linux
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 02 21:45:05 2015 +0200 (2015-10-02)
parents a592b36892ba
children 48d2c4c7a227
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 make CC=uclibc-$TARGET-cc CFLAGS=-DLOCKFILE_DIR=\\\"/var/lock\\\" &&
21 make DESTDIR=$DESTDIR install
22 }
24 # Rules to gen a SliTaz package suitable for Tazpkg.
25 genpkg_rules()
26 {
27 mkdir -p $fs/usr $fs/etc/init.d $fs/dev
28 cp -a $install/usr/sbin $fs/usr
29 ln -s daemon $fs/etc/init.d/p910nd
30 }
32 post_install()
33 {
34 [ -n "$DEVICES" ] || DEVICES="/dev/lp0"
35 grep -q inetd $1/etc/rcS.conf ||
36 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
37 grep -q p910nd $1/etc/inetd.conf ||
38 echo "$DEVICES" | dos2unix | awk '{ if ($1 != "") printf \
39 "%d stream tcp nowait root %s %s -b -f %s\n", 9100 + n++, \
40 "/usr/sbin/p910nd", "/usr/sbin/p910nd", $1 }' >> $1/etc/inetd.conf
41 mkdir $1/dev
42 for dev in $(echo $DEVICES | dos2unix); do
43 mknod -m 660 $1$dev c 6 ${dev#*lp}
44 done
45 }
47 config_form()
48 {
49 [ -n "$DEVICES" ] || DEVICES=/dev/lp0
50 grep -q p910nd $1/etc/inetd.conf && return 1
51 cat <<EOT
52 Printer device(s):
53 <textarea name="DEVICES">
54 $DEVICES
55 </textarea>
56 EOT
57 }