wok-next annotate cups/receipt @ rev 20269

remove cups-pam
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 08 08:49:56 2017 +0100 (2017-11-08)
parents 831ee4103c8f
children b0ca1120aeaa
rev   line source
al@19800 1 # SliTaz package receipt v2.
pankso@632 2
pankso@632 3 PACKAGE="cups"
al@19800 4 VERSION="2.2.2"
pankso@632 5 CATEGORY="system-tools"
al@19800 6 SHORT_DESC="Common UNIX Printing System"
erjo@784 7 MAINTAINER="erjo@slitaz.org"
pascal@15198 8 LICENSE="GPL2 LGPL2"
al@19681 9 WEB_SITE="https://www.cups.org/"
pankso@632 10
al@19800 11 TARBALL="cups-$VERSION-source.tar.gz"
al@19800 12 WGET_URL="https://github.com/apple/cups/releases/download/v$VERSION/$TARBALL"
al@19681 13
al@19800 14 BUILD_DEPENDS="automake libusb-dev zlib-dev acl-dev dbus-dev gnutls-dev perl \
pascal@20269 15 python pam pam-dev"
pascal@20269 16 SPLIT="libcups cups cups-pam cups-doc cups-dev"
slaxemulator@14621 17
pankso@632 18 # Rules to configure and make the package.
pankso@632 19 compile_rules()
pankso@632 20 {
al@19800 21 # gid 19 suggested by the BLFS is in use in SliTaz (by cdrom group),
al@19800 22 # using 23 instead
al@19800 23 addgroup -g 23 lpadmin &&
al@19800 24
al@19681 25 sed -i 's:555:755:g;s:444:644:g' Makedefs.in &&
al@19681 26 sed -i '/MAN.EXT/s:.gz::g' configure config-scripts/cups-manpages.m4 &&
al@19681 27 sed -i '/LIBGCRYPTCONFIG/d' config-scripts/cups-ssl.m4 &&
al@19681 28
al@19681 29 aclocal -I config-scripts &&
al@19681 30 autoconf -I config-scripts &&
al@19681 31
pascal@20269 32 cp -a $src $src-pam
pascal@20269 33
al@19681 34 CC=gcc \
pankso@632 35 ./configure \
pankso@664 36 --sysconfdir=/etc \
al@19681 37 --libdir=/usr/lib \
pankso@664 38 --localstatedir=/var \
pascal@20269 39 --disable-pam \
al@19681 40 --disable-systemd \
al@19681 41 --with-rcdir=/tmp/cupsinit \
al@19681 42 --with-system-groups=lpadmin \
al@19681 43 --with-docdir=/usr/share/doc/cups-$VERSION \
pascal@1660 44 $CONFIGURE_ARGS &&
al@19800 45 make &&
al@19681 46 make BUILDROOT=$install install &&
al@19800 47
pascal@20269 48 cd $src-pam &&
pascal@20269 49 CC=gcc \
pascal@20269 50 ./configure \
pascal@20269 51 --sysconfdir=/etc \
pascal@20269 52 --libdir=/usr/lib \
pascal@20269 53 --localstatedir=/var \
pascal@20269 54 --enable-pam \
pascal@20269 55 --disable-systemd \
pascal@20269 56 --with-rcdir=/tmp/cupsinit \
pascal@20269 57 --with-system-groups=lpadmin \
pascal@20269 58 --with-docdir=/usr/share/doc/cups-$VERSION \
pascal@20269 59 $CONFIGURE_ARGS &&
pascal@20269 60 make &&
pascal@20269 61 make BUILDROOT=$install-pam install &&
al@19800 62
pascal@20269 63 for inst in $install $install-pam ; done
pascal@20269 64 rm -rf $inst/tmp &&
al@19800 65
pascal@20269 66 ln -svnf ../doc/cups-$VERSION $inst/usr/share/cups/doc-$VERSION
al@19681 67
pascal@20269 68 echo "ServerName /var/run/cups/cups.sock" > $inst/etc/cups/client.conf &&
al@19800 69
pascal@20269 70 sed -i 's|hostname:9100|&\n\n parallel:/dev/usb/lp0|' \
pascal@20269 71 $inst/usr/share/cups/templates/choose-uri.tmpl &&
pascal@20269 72 sed -i 's|htmlview|browser|' $inst/usr/share/applications/cups.desktop &&
pascal@20269 73 sed -i 's|^#Group .*|Group lp|' $inst/etc/cups/cups-files.conf &&
al@19800 74
pascal@20269 75 # Daemon script
pascal@20269 76 cp -a $stuff/etc $inst &&
pascal@20269 77 chown -R root:root $inst/etc &&
pascal@20269 78 # TazPanel link
pascal@20269 79 cp -a $stuff/var $inst &&
pascal@20269 80 chown -R root:root $inst/var &&
al@19800 81
pascal@20269 82 # Install ssl directory where to store the certs, solves some samba issues
pascal@20269 83 install -dm700 -g lp $inst/etc/cups/ssl &&
al@19800 84
pascal@20269 85 # Install some more configuration files that will get filled by cupsd
pascal@20269 86 touch $inst/etc/cups/printers.conf &&
pascal@20269 87 touch $inst/etc/cups/classes.conf &&
pascal@20269 88 touch $inst/etc/cups/subscriptions.conf &&
pascal@20269 89 chgrp -R lp $inst/etc/cups &&
al@19800 90
pascal@20269 91 # Comment out unnecessary PageLogFormat entry
pascal@20269 92 sed -i -e 's:PageLogFormat:#PageLogFormat:' $inst/etc/cups/cupsd.conf* &&
pascal@20269 93
pascal@20269 94 # Change files permissions to be accessible via web interface - will be
pascal@20269 95 # fixed in post_install
pascal@20269 96 chmod -c o+r $inst/etc/cups/* $inst/usr/sbin/cupsd \
pascal@20269 97 $inst/usr/lib/cups/backend/ipp $inst/usr/lib/cups/backend/lpd
pascal@20269 98 done
pankso@632 99 }
pankso@632 100
pankso@632 101 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@632 102 genpkg_rules()
pankso@632 103 {
al@19800 104 case $PACKAGE in
al@19800 105 libcups)
al@19800 106 copy libcups.so*
al@19800 107 CAT="system-tools|common libraries"
al@19800 108 TAGS="printer printing"
al@19800 109 DEPENDS="libgnutls zlib"
al@19800 110 ;;
al@19800 111 cups)
al@19800 112 copy @std var/ # copy empty dirs in var/
al@19800 113 remove_already_packed
al@19800 114 DEPENDS="acl dbus libcups libgnutls libusb zlib"
al@19800 115 CONFIG_FILES="/etc/cups/"
al@19800 116 TAGS="printer printing"
al@19800 117 ;;
pascal@20269 118 cups-pam)
pascal@20269 119 install=$install-pam
pascal@20269 120 copy @std var/ # copy empty dirs in var/
pascal@20269 121 remove_already_packed
pascal@20269 122 DEPENDS="acl dbus libcups libgnutls libusb zlib pam"
pascal@20269 123 PROVIDE="cups:pam"
pascal@20269 124 CONFIG_FILES="/etc/cups/"
pascal@20269 125 TAGS="printer printing"
pascal@20269 126 ;;
al@19800 127 cups-doc)
al@19800 128 # We need the doc for CSS, images and help in the web interface.
al@19800 129 copy doc/
al@19800 130 CAT="docs|documentation"
al@19800 131 DEPENDS="cups"
al@19800 132 ;;
al@19800 133 cups-dev)
al@19800 134 copy @dev
al@19800 135 ;;
al@19800 136 esac
pankso@632 137 }
pankso@632 138
al@19800 139 post_install_cups() {
al@19800 140 # Start CUPS daemon
al@18716 141 if [ -z "$1" -a ! -s /aufs-umount.sh ]; then
pascal@2219 142 /etc/init.d/cupsd start || continue
pascal@2219 143 fi
al@19800 144
al@19800 145 # Clean TazPanel menu cache
al@19681 146 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null
al@19800 147
al@19800 148 # Edit daemons.conf
al@18716 149 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then
al@18716 150 cat >> "$1/etc/daemons.conf" <<EOT
al@18716 151 # CUPS printing daemon options.
al@18716 152 CUPSD_OPTIONS=""
al@18716 153
al@18716 154 EOT
pankso@632 155 fi
al@19800 156
al@19800 157 # Add lpadmin group
al@19800 158 addgroup -g 23 lpadmin
al@19800 159
al@19800 160 # Return permissions to previous state
al@19800 161 chmod 640 $1/etc/cups/*
al@19800 162 chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd
al@19800 163 chmod 500 $1/usr/sbin/cupsd
pankso@632 164 }
pankso@632 165
al@19800 166 pre_remove_cups() {
al@18716 167 # Stop CUPS daemon before rm.
al@18716 168 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
al@18716 169 :
pascal@8875 170 }
pascal@20269 171
pascal@20269 172 post_install_cups_pam() {
pascal@20269 173 post_install_cups "$1"
pascal@20269 174 }
pascal@20269 175
pascal@20269 176 pre_remove_cups_pam() {
pascal@20269 177 pre_remove_cups "$1"
pascal@20269 178 }