wok-tiny view lpd-config/receipt @ rev 86

Add lpd-config
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 21 19:04:10 2012 +0200 (2012-08-21)
parents
children a6d2ddc65590
line source
1 # SliTaz package receipt.
3 PACKAGE="lpd-config"
4 VERSION="1.0"
5 CATEGORY="configuration"
6 SHORT_DESC="Line printer server configuration (without spooling)"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 WEB_SITE="http://tiny.slitaz.org/"
9 DEPENDS="base-tiny"
11 # Rules to gen a SliTaz package suitable for Tazpkg.
12 genpkg_rules()
13 {
14 mkdir -p $fs/var/spool $fs/dev
15 }
17 config_form()
18 {
19 cat <<EOT
20 Respective printer names for lp0, lp1 ...
21 <input type="text" name="LP_NAMES" value="$LP_NAMES" >
22 EOT
23 }
25 post_install()
26 {
27 local n
28 grep -q inetd $1/etc/rcS.conf ||
29 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
30 cat >> $1/etc/inetd.conf <<EOT
31 printer stream tcp nowait root /usr/sbin/lpd /usr/sbin/lpd /var/spool
32 EOT
33 n=0
34 for i in $(echo $LP_NAMES | sed 's/,/ /g') ; do
35 mknod $1/dev/lp$n c 6 $n
36 ln -s /dev/lp$n $1/var/spool/$i
37 n=$(($n + 1))
38 done
39 }