wok-tiny diff p910nd/receipt @ rev 16
Add p910nd
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Feb 02 22:03:43 2011 +0100 (2011-02-02) |
parents | |
children | a53953f4078e |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/p910nd/receipt Wed Feb 02 22:03:43 2011 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="p910nd" 1.7 +VERSION="0.93" 1.8 +CATEGORY="network" 1.9 +SHORT_DESC="Forward printer device to 9100+ ports" 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +TARBALL="$PACKAGE-$VERSION.tar.bz2" 1.12 +WEB_SITE="http://p910nd.sourceforge.net/" 1.13 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" 1.14 +[ -n "$TARGET" ] || TARGET="i486" 1.15 +BUILD_DEPENDS="uclibc-cross-compiler-$TARGET" 1.16 +DEPENDS="base-tiny" 1.17 +CONFIG_FILES="/etc/inetd.conf /etc/rcS.conf" 1.18 + 1.19 +# Rules to configure and make the package. 1.20 +compile_rules() 1.21 +{ 1.22 + cd $src 1.23 + make CC=uclibc-$TARGET-cc CFLAGS=-DLOCKFILE_DIR=\\\"/var/lock\\\" && 1.24 + make DESTDIR=$PWD/_pkg install 1.25 +} 1.26 + 1.27 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.28 +genpkg_rules() 1.29 +{ 1.30 + mkdir -p $fs/usr $fs/etc/init.d $fs/dev 1.31 + cp -a $_pkg/usr/sbin $fs/usr 1.32 + mknod -m 660 $fs/dev/lp0 c 6 0 1.33 + ln -s daemon $fs/etc/init.d/p910nd 1.34 +} 1.35 + 1.36 +post_install() 1.37 +{ 1.38 + [ -n "$DEVICES" ] || DEVICES="/dev/lp0" 1.39 + grep -q inetd $1/etc/rcS.conf || 1.40 + sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf 1.41 + grep -q p910nd $1/etc/rcS.conf || 1.42 + sed -i 's/^RUN_DAEMONS="/&p910nd /' $1/etc/rcS.conf 1.43 + grep -q p910nd $1/etc/inetd.conf || 1.44 + echo "$DEVICES" | dos2unix | awk '{ if ($1 != "") printf \ 1.45 +"%d stream tcp nowait root %s %s -b -f %s\n", 9100 + n++, \ 1.46 +"/usr/sbin/p910nd", "/usr/sbin/p910nd", $1 }' >> $1/etc/inetd.conf 1.47 +} 1.48 + 1.49 +config_form() 1.50 +{ 1.51 + [ -n "$DEVICES" ] || DEVICES=/dev/lp0 1.52 + grep -q p910nd $1/etc/inetd.conf && return 1 1.53 + cat <<EOT 1.54 +Printer device(s): 1.55 +<textarea name="DEVICES"> 1.56 +$DEVICES 1.57 +</textarea> 1.58 +EOT 1.59 +}