# SliTaz package receipt. PACKED_SIZE="16.0K" UNPACKED_SIZE="48.0K" PACKAGE="p910nd" VERSION="0.93" CATEGORY="network" SHORT_DESC="Forward printer device to 9100+ ports" MAINTAINER="pascal.bellard@slitaz.org" TARBALL="$PACKAGE-$VERSION.tar.bz2" LICENSE="GPL2" WEB_SITE="http://p910nd.sourceforge.net/" WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" [ -n "$TARGET" ] || TARGET="i486" BUILD_DEPENDS="uclibc-cross-compiler-$TARGET" DEPENDS="base-tiny busybox-net" SUGGESTED="module-lp module-usblp" CONFIG_FILES="/etc/inetd.conf /etc/rcS.conf" # Rules to configure and make the package. compile_rules() { make CC=uclibc-$TARGET-cc CFLAGS=-DLOCKFILE_DIR=\\\"/var/lock\\\" && make DESTDIR=$DESTDIR install } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr $fs/etc/init.d $fs/dev cp -a $install/usr/sbin $fs/usr ln -s daemon $fs/etc/init.d/p910nd } post_install() { [ -n "$DEVICES" ] || DEVICES="/dev/lp0" grep -q inetd $1/etc/rcS.conf || sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf grep -q p910nd $1/etc/inetd.conf || echo "$DEVICES" | dos2unix | awk '{ if ($1 != "") printf \ "%d stream tcp nowait root %s %s -b -f %s\n", 9100 + n++, \ "/usr/sbin/p910nd", "/usr/sbin/p910nd", $1 }' >> $1/etc/inetd.conf for dev in $(echo $DEVICES | dos2unix); do mknod -m 660 $1$dev c 6 ${dev#*lp} done } config_form() { [ -n "$DEVICES" ] || DEVICES=/dev/lp0 grep -q p910nd $1/etc/inetd.conf && return 1 cat < $DEVICES EOT }