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

Update custom-console
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 27 10:51:46 2016 +0100 (2016-02-27)
parents 48d2c4c7a227
children 10cf1a5f187d
line source
1 # SliTaz package receipt.
3 PACKAGE="lpd-config"
4 VERSION="1.0"
5 CATEGORY="system"
6 SHORT_DESC="Line printer server configuration (without spooling)"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="http://tiny.slitaz.org/"
10 DEPENDS="base-tiny"
11 SUGGESTED="module-lp module-usblp"
13 # Rules to gen a SliTaz package suitable for Tazpkg.
14 genpkg_rules()
15 {
16 mkdir -p $fs/var/spool $fs/dev
17 }
19 config_form()
20 {
21 cat <<EOT
22 Respective printer names for lp0, lp1 ...
23 <input type="text" name="LP_NAMES" value="$LP_NAMES" >
24 EOT
25 }
27 post_install()
28 {
29 local n
30 grep -q inetd $1/etc/rcS.conf ||
31 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
32 cat >> $1/etc/inetd.conf <<EOT
33 printer stream tcp nowait root lpd lpd /var/spool
34 EOT
35 n=0
36 for i in $(echo $LP_NAMES | sed 's/,/ /g') ; do
37 mknod $1/dev/lp$n c 6 $n
38 ln -s /dev/lp$n $1/var/spool/$i
39 n=$(($n + 1))
40 done
41 }