wok-next view cups/receipt @ rev 20534

Clean default configure options when site script used.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Mar 30 19:31:50 2018 +0300 (2018-03-30)
parents 0e7893ac206d
children b9682d966530
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 pam pam-dev"
16 SPLIT="libcups cups cups-pam:pam cups-doc cups-dev"
18 compile_rules() {
19 case $SET in
20 '') SET_ARGS='--disable-pam';;
21 pam) SET_ARGS='--enable-pam';;
22 esac
24 # gid 19 suggested by the BLFS is in use in SliTaz (by cdrom group),
25 # using 23 instead
26 addgroup -g 23 lpadmin
28 sed -i 's:555:755:g;s:444:644:g' Makedefs.in
29 sed -i '/MAN.EXT/s:.gz::g' configure config-scripts/cups-manpages.m4
30 sed -i '/LIBGCRYPTCONFIG/d' config-scripts/cups-ssl.m4
32 aclocal -I config-scripts
33 autoconf -I config-scripts
35 cp -a $src $src-pam
37 CC=gcc \
38 ./configure \
39 --libdir=/usr/lib \
40 --disable-systemd \
41 --with-rcdir=/tmp/cupsinit \
42 --with-system-groups=lpadmin \
43 --with-docdir=/usr/share/doc/cups-$VERSION \
44 $SET_ARGS \
45 $CONFIGURE_ARGS &&
46 make &&
47 make BUILDROOT=$install install || return 1
49 rm -rf $install/tmp &&
51 ln -svnf ../doc/cups-$VERSION $install/usr/share/cups/doc-$VERSION
53 echo "ServerName /var/run/cups/cups.sock" > $install/etc/cups/client.conf
55 sed -i 's|hostname:9100|&\n\n parallel:/dev/usb/lp0|' \
56 $install/usr/share/cups/templates/choose-uri.tmpl
57 sed -i 's|htmlview|browser|' $install/usr/share/applications/cups.desktop
58 sed -i 's|^#Group .*|Group lp|' $install/etc/cups/cups-files.conf
60 # Daemon script
61 cp -a $stuff/etc $install
62 chown -R root:root $install/etc
63 # TazPanel link
64 cp -a $stuff/var $install
65 chown -R root:root $install/var
67 # Install ssl directory where to store the certs, solves some samba issues
68 install -dm700 -g lp $install/etc/cups/ssl
70 # Install some more configuration files that will get filled by cupsd
71 touch $install/etc/cups/printers.conf
72 touch $install/etc/cups/classes.conf
73 touch $install/etc/cups/subscriptions.conf
74 chgrp -R lp $install/etc/cups
76 # Comment out unnecessary PageLogFormat entry
77 sed -i -e 's:PageLogFormat:#PageLogFormat:' $install/etc/cups/cupsd.conf*
79 # Change files permissions to be accessible via web interface - will be
80 # fixed in post_install
81 chmod -c o+r \
82 $install/etc/cups/* \
83 $install/usr/sbin/cupsd \
84 $install/usr/lib/cups/backend/ipp \
85 $install/usr/lib/cups/backend/lpd
86 }
88 genpkg_rules() {
89 case $PACKAGE in
90 libcups)
91 copy libcups.so*
92 CAT="system-tools|common libraries"
93 TAGS="printer printing"
94 DEPENDS="libgnutls zlib"
95 ;;
96 cups)
97 copy @std @rm
98 DEPENDS="acl dbus libcups libgnutls libusb zlib"
99 CONFIG_FILES="/etc/cups/"
100 TAGS="printer printing"
101 ;;
102 cups-pam)
103 copy @std
104 rm -f $fs/usr/lib/libcups.so*
105 CAT="system-tools|with PAM support"
106 DEPENDS="acl dbus libcups libgnutls libusb zlib pam"
107 PROVIDE="cups:pam"
108 CONFIG_FILES="/etc/cups/"
109 TAGS="printer printing"
110 ;;
111 cups-doc)
112 # We need the doc for CSS, images and help in the web interface.
113 copy doc/
114 CAT="docs|documentation"
115 DEPENDS="cups"
116 ;;
117 cups-dev)
118 copy @dev
119 ;;
120 esac
121 }
123 post_install_cups() {
124 # Start CUPS daemon
125 if [ -z "$1" -a ! -s /aufs-umount.sh ]; then
126 /etc/init.d/cupsd start || continue
127 fi
129 # Clean TazPanel menu cache
130 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null
132 # Edit daemons.conf
133 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then
134 cat >> "$1/etc/daemons.conf" <<EOT
135 # CUPS printing daemon options.
136 CUPSD_OPTIONS=""
138 EOT
139 fi
141 # Add lpadmin group
142 addgroup -g 23 lpadmin
144 # Return permissions to previous state
145 chmod 640 $1/etc/cups/*
146 chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd
147 chmod 500 $1/usr/sbin/cupsd
148 }
150 pre_remove_cups() {
151 # Stop CUPS daemon before rm.
152 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
153 :
154 }
156 post_install_cups_pam() {
157 # Start CUPS daemon
158 if [ -z "$1" -a ! -s /aufs-umount.sh ]; then
159 /etc/init.d/cupsd start || continue
160 fi
162 # Clean TazPanel menu cache
163 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null
165 # Edit daemons.conf
166 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then
167 cat >> "$1/etc/daemons.conf" <<EOT
168 # CUPS printing daemon options.
169 CUPSD_OPTIONS=""
171 EOT
172 fi
174 # Add lpadmin group
175 addgroup -g 23 lpadmin
177 # Return permissions to previous state
178 chmod 640 $1/etc/cups/*
179 chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd
180 chmod 500 $1/usr/sbin/cupsd
181 }
183 pre_remove_cups_pam() {
184 # Stop CUPS daemon before rm.
185 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
186 :
187 }