wok-next annotate cups/receipt @ rev 19800
Up cups.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sun Jun 25 21:14:27 2017 +0300 (2017-06-25) |
parents | f463de72afe3 |
children | ec55d50b1067 |
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 \ |
al@19800 | 15 python" |
al@19800 | 16 SPLIT="libcups cups 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 |
al@19681 | 32 CC=gcc \ |
pankso@632 | 33 ./configure \ |
pankso@664 | 34 --sysconfdir=/etc \ |
al@19681 | 35 --libdir=/usr/lib \ |
pankso@664 | 36 --localstatedir=/var \ |
al@19681 | 37 --disable-systemd \ |
al@19681 | 38 --with-rcdir=/tmp/cupsinit \ |
al@19681 | 39 --with-system-groups=lpadmin \ |
al@19681 | 40 --with-docdir=/usr/share/doc/cups-$VERSION \ |
pascal@1660 | 41 $CONFIGURE_ARGS && |
al@19800 | 42 make && |
al@19681 | 43 make BUILDROOT=$install install && |
al@19800 | 44 |
al@19681 | 45 rm -rf $install/tmp && |
al@19800 | 46 |
al@19681 | 47 ln -svnf ../doc/cups-$VERSION $install/usr/share/cups/doc-$VERSION |
al@19800 | 48 |
al@19681 | 49 echo "ServerName /var/run/cups/cups.sock" > $install/etc/cups/client.conf && |
al@19681 | 50 |
al@19681 | 51 sed -i 's|hostname:9100|&\n\n parallel:/dev/usb/lp0|' \ |
al@19681 | 52 $install/usr/share/cups/templates/choose-uri.tmpl && |
al@19800 | 53 sed -i 's|htmlview|browser|' $install/usr/share/applications/cups.desktop && |
al@19800 | 54 sed -i 's|^#Group .*|Group lp|' $install/etc/cups/cups-files.conf && |
al@19800 | 55 |
al@19800 | 56 # Daemon script |
al@19800 | 57 cp -a $stuff/etc $install && |
al@19800 | 58 chown -R root:root $install/etc && |
al@19800 | 59 # TazPanel link |
al@19800 | 60 cp -a $stuff/var $install && |
al@19800 | 61 chown -R root:root $install/var && |
al@19800 | 62 |
al@19800 | 63 # Install ssl directory where to store the certs, solves some samba issues |
al@19800 | 64 install -dm700 -g lp $install/etc/cups/ssl && |
al@19800 | 65 |
al@19800 | 66 # Install some more configuration files that will get filled by cupsd |
al@19800 | 67 touch $install/etc/cups/printers.conf && |
al@19800 | 68 touch $install/etc/cups/classes.conf && |
al@19800 | 69 touch $install/etc/cups/subscriptions.conf && |
al@19800 | 70 chgrp -R lp $install/etc/cups && |
al@19800 | 71 |
al@19800 | 72 # Comment out unnecessary PageLogFormat entry |
al@19800 | 73 sed -i -e 's:PageLogFormat:#PageLogFormat:' $install/etc/cups/cupsd.conf* && |
al@19800 | 74 |
al@19800 | 75 # Change files permissions to be accessible via web interface - will be |
al@19800 | 76 # fixed in post_install |
al@19800 | 77 chmod -c o+r $install/etc/cups/* $install/usr/sbin/cupsd \ |
al@19800 | 78 $install/usr/lib/cups/backend/ipp $install/usr/lib/cups/backend/lpd |
pankso@632 | 79 } |
pankso@632 | 80 |
pankso@632 | 81 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@632 | 82 genpkg_rules() |
pankso@632 | 83 { |
al@19800 | 84 case $PACKAGE in |
al@19800 | 85 libcups) |
al@19800 | 86 copy libcups.so* |
al@19800 | 87 CAT="system-tools|common libraries" |
al@19800 | 88 TAGS="printer printing" |
al@19800 | 89 DEPENDS="libgnutls zlib" |
al@19800 | 90 ;; |
al@19800 | 91 cups) |
al@19800 | 92 copy @std var/ # copy empty dirs in var/ |
al@19800 | 93 remove_already_packed |
al@19800 | 94 DEPENDS="acl dbus libcups libgnutls libusb zlib" |
al@19800 | 95 CONFIG_FILES="/etc/cups/" |
al@19800 | 96 TAGS="printer printing" |
al@19800 | 97 ;; |
al@19800 | 98 cups-doc) |
al@19800 | 99 # We need the doc for CSS, images and help in the web interface. |
al@19800 | 100 copy doc/ |
al@19800 | 101 CAT="docs|documentation" |
al@19800 | 102 DEPENDS="cups" |
al@19800 | 103 ;; |
al@19800 | 104 cups-dev) |
al@19800 | 105 copy @dev |
al@19800 | 106 ;; |
al@19800 | 107 esac |
pankso@632 | 108 } |
pankso@632 | 109 |
al@19800 | 110 post_install_cups() { |
al@19800 | 111 # Start CUPS daemon |
al@18716 | 112 if [ -z "$1" -a ! -s /aufs-umount.sh ]; then |
pascal@2219 | 113 /etc/init.d/cupsd start || continue |
pascal@2219 | 114 fi |
al@19800 | 115 |
al@19800 | 116 # Clean TazPanel menu cache |
al@19681 | 117 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null |
al@19800 | 118 |
al@19800 | 119 # Edit daemons.conf |
al@18716 | 120 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then |
al@18716 | 121 cat >> "$1/etc/daemons.conf" <<EOT |
al@18716 | 122 # CUPS printing daemon options. |
al@18716 | 123 CUPSD_OPTIONS="" |
al@18716 | 124 |
al@18716 | 125 EOT |
pankso@632 | 126 fi |
al@19800 | 127 |
al@19800 | 128 # Add lpadmin group |
al@19800 | 129 addgroup -g 23 lpadmin |
al@19800 | 130 |
al@19800 | 131 # Return permissions to previous state |
al@19800 | 132 chmod 640 $1/etc/cups/* |
al@19800 | 133 chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd |
al@19800 | 134 chmod 500 $1/usr/sbin/cupsd |
pankso@632 | 135 } |
pankso@632 | 136 |
al@19800 | 137 pre_remove_cups() { |
al@18716 | 138 # Stop CUPS daemon before rm. |
al@18716 | 139 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop |
al@18716 | 140 : |
pascal@8875 | 141 } |