wok-next view cups/receipt @ rev 19864

slitaz-base-files: fix typo; up slitaz-boot-scripts (443)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Sep 12 02:09:10 2017 +0300 (2017-09-12)
parents f463de72afe3
children ec55d50b1067
line source
1 # SliTaz package receipt v2.
3 PACKAGE="cups"
4 VERSION="2.2.2"
5 CATEGORY="system-tools"
6 SHORT_DESC="Common UNIX Printing System"
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2 LGPL2"
9 WEB_SITE="https://www.cups.org/"
11 TARBALL="cups-$VERSION-source.tar.gz"
12 WGET_URL="https://github.com/apple/cups/releases/download/v$VERSION/$TARBALL"
14 BUILD_DEPENDS="automake libusb-dev zlib-dev acl-dev dbus-dev gnutls-dev perl \
15 python"
16 SPLIT="libcups cups cups-doc cups-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 # gid 19 suggested by the BLFS is in use in SliTaz (by cdrom group),
22 # using 23 instead
23 addgroup -g 23 lpadmin &&
25 sed -i 's:555:755:g;s:444:644:g' Makedefs.in &&
26 sed -i '/MAN.EXT/s:.gz::g' configure config-scripts/cups-manpages.m4 &&
27 sed -i '/LIBGCRYPTCONFIG/d' config-scripts/cups-ssl.m4 &&
29 aclocal -I config-scripts &&
30 autoconf -I config-scripts &&
32 CC=gcc \
33 ./configure \
34 --sysconfdir=/etc \
35 --libdir=/usr/lib \
36 --localstatedir=/var \
37 --disable-systemd \
38 --with-rcdir=/tmp/cupsinit \
39 --with-system-groups=lpadmin \
40 --with-docdir=/usr/share/doc/cups-$VERSION \
41 $CONFIGURE_ARGS &&
42 make &&
43 make BUILDROOT=$install install &&
45 rm -rf $install/tmp &&
47 ln -svnf ../doc/cups-$VERSION $install/usr/share/cups/doc-$VERSION
49 echo "ServerName /var/run/cups/cups.sock" > $install/etc/cups/client.conf &&
51 sed -i 's|hostname:9100|&\n\n parallel:/dev/usb/lp0|' \
52 $install/usr/share/cups/templates/choose-uri.tmpl &&
53 sed -i 's|htmlview|browser|' $install/usr/share/applications/cups.desktop &&
54 sed -i 's|^#Group .*|Group lp|' $install/etc/cups/cups-files.conf &&
56 # Daemon script
57 cp -a $stuff/etc $install &&
58 chown -R root:root $install/etc &&
59 # TazPanel link
60 cp -a $stuff/var $install &&
61 chown -R root:root $install/var &&
63 # Install ssl directory where to store the certs, solves some samba issues
64 install -dm700 -g lp $install/etc/cups/ssl &&
66 # Install some more configuration files that will get filled by cupsd
67 touch $install/etc/cups/printers.conf &&
68 touch $install/etc/cups/classes.conf &&
69 touch $install/etc/cups/subscriptions.conf &&
70 chgrp -R lp $install/etc/cups &&
72 # Comment out unnecessary PageLogFormat entry
73 sed -i -e 's:PageLogFormat:#PageLogFormat:' $install/etc/cups/cupsd.conf* &&
75 # Change files permissions to be accessible via web interface - will be
76 # fixed in post_install
77 chmod -c o+r $install/etc/cups/* $install/usr/sbin/cupsd \
78 $install/usr/lib/cups/backend/ipp $install/usr/lib/cups/backend/lpd
79 }
81 # Rules to gen a SliTaz package suitable for Tazpkg.
82 genpkg_rules()
83 {
84 case $PACKAGE in
85 libcups)
86 copy libcups.so*
87 CAT="system-tools|common libraries"
88 TAGS="printer printing"
89 DEPENDS="libgnutls zlib"
90 ;;
91 cups)
92 copy @std var/ # copy empty dirs in var/
93 remove_already_packed
94 DEPENDS="acl dbus libcups libgnutls libusb zlib"
95 CONFIG_FILES="/etc/cups/"
96 TAGS="printer printing"
97 ;;
98 cups-doc)
99 # We need the doc for CSS, images and help in the web interface.
100 copy doc/
101 CAT="docs|documentation"
102 DEPENDS="cups"
103 ;;
104 cups-dev)
105 copy @dev
106 ;;
107 esac
108 }
110 post_install_cups() {
111 # Start CUPS daemon
112 if [ -z "$1" -a ! -s /aufs-umount.sh ]; then
113 /etc/init.d/cupsd start || continue
114 fi
116 # Clean TazPanel menu cache
117 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null
119 # Edit daemons.conf
120 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then
121 cat >> "$1/etc/daemons.conf" <<EOT
122 # CUPS printing daemon options.
123 CUPSD_OPTIONS=""
125 EOT
126 fi
128 # Add lpadmin group
129 addgroup -g 23 lpadmin
131 # Return permissions to previous state
132 chmod 640 $1/etc/cups/*
133 chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd
134 chmod 500 $1/usr/sbin/cupsd
135 }
137 pre_remove_cups() {
138 # Stop CUPS daemon before rm.
139 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
140 :
141 }