wok-next diff cups/receipt @ rev 19865

slitaz-base-files: typo
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Sep 12 03:41:56 2017 +0300 (2017-09-12)
parents f463de72afe3
children ec55d50b1067
line diff
     1.1 --- a/cups/receipt	Sun Jun 18 04:38:10 2017 +0300
     1.2 +++ b/cups/receipt	Tue Sep 12 03:41:56 2017 +0300
     1.3 @@ -1,25 +1,27 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="cups"
     1.8 -VERSION="2.1.4"
     1.9 +VERSION="2.2.2"
    1.10  CATEGORY="system-tools"
    1.11 -SHORT_DESC="Common UNIX Printing System."
    1.12 +SHORT_DESC="Common UNIX Printing System"
    1.13  MAINTAINER="erjo@slitaz.org"
    1.14  LICENSE="GPL2 LGPL2"
    1.15  WEB_SITE="https://www.cups.org/"
    1.16 -TAGS="printer printing"
    1.17  
    1.18 -TARBALL="$PACKAGE-$VERSION-source.tar.gz"
    1.19 -WGET_URL="https://github.com/apple/cups/releases/download/release-$VERSION/$TARBALL"
    1.20 +TARBALL="cups-$VERSION-source.tar.gz"
    1.21 +WGET_URL="https://github.com/apple/cups/releases/download/v$VERSION/$TARBALL"
    1.22  
    1.23 -DEPENDS="acl dbus libcups libgnutls libusb zlib"
    1.24 -BUILD_DEPENDS="automake libusb-dev zlib-dev dbus-dev gnutls-dev perl python \
    1.25 -acl-dev"
    1.26 -SPLIT="libcups cups-doc"
    1.27 +BUILD_DEPENDS="automake libusb-dev zlib-dev acl-dev dbus-dev gnutls-dev perl \
    1.28 +python"
    1.29 +SPLIT="libcups cups cups-doc cups-dev"
    1.30  
    1.31  # Rules to configure and make the package.
    1.32  compile_rules()
    1.33  {
    1.34 +	# gid 19 suggested by the BLFS is in use in SliTaz (by cdrom group),
    1.35 +	# using 23 instead
    1.36 +	addgroup -g 23 lpadmin &&
    1.37 +
    1.38  	sed -i 's:555:755:g;s:444:644:g' Makedefs.in &&
    1.39  	sed -i '/MAN.EXT/s:.gz::g' configure config-scripts/cups-manpages.m4 &&
    1.40  	sed -i '/LIBGCRYPTCONFIG/d' config-scripts/cups-ssl.m4 &&
    1.41 @@ -37,46 +39,84 @@
    1.42  		--with-system-groups=lpadmin \
    1.43  		--with-docdir=/usr/share/doc/cups-$VERSION \
    1.44  		$CONFIGURE_ARGS &&
    1.45 -	make
    1.46 +	make &&
    1.47  	make BUILDROOT=$install install &&
    1.48 +
    1.49  	rm -rf $install/tmp &&
    1.50 +
    1.51  	ln -svnf ../doc/cups-$VERSION $install/usr/share/cups/doc-$VERSION
    1.52 +
    1.53  	echo "ServerName /var/run/cups/cups.sock" > $install/etc/cups/client.conf &&
    1.54  
    1.55  	sed -i 's|hostname:9100|&\n\n    parallel:/dev/usb/lp0|' \
    1.56  		$install/usr/share/cups/templates/choose-uri.tmpl &&
    1.57 -	sed -i 's|htmlview|browser|' $install/usr/share/applications/cups.desktop
    1.58 +	sed -i 's|htmlview|browser|' $install/usr/share/applications/cups.desktop &&
    1.59 +	sed -i 's|^#Group .*|Group lp|' $install/etc/cups/cups-files.conf &&
    1.60 +
    1.61 +	# Daemon script
    1.62 +	cp -a $stuff/etc $install &&
    1.63 +	chown -R root:root $install/etc &&
    1.64 +	# TazPanel link
    1.65 +	cp -a $stuff/var $install &&
    1.66 +	chown -R root:root $install/var &&
    1.67 +
    1.68 +	# Install ssl directory where to store the certs, solves some samba issues
    1.69 +	install -dm700 -g lp $install/etc/cups/ssl &&
    1.70 +
    1.71 +	# Install some more configuration files that will get filled by cupsd
    1.72 +	touch $install/etc/cups/printers.conf &&
    1.73 +	touch $install/etc/cups/classes.conf &&
    1.74 +	touch $install/etc/cups/subscriptions.conf &&
    1.75 +	chgrp -R lp $install/etc/cups &&
    1.76 +
    1.77 +	# Comment out unnecessary PageLogFormat entry
    1.78 +	sed -i -e 's:PageLogFormat:#PageLogFormat:' $install/etc/cups/cupsd.conf* &&
    1.79 +
    1.80 +	# Change files permissions to be accessible via web interface - will be
    1.81 +	# fixed in post_install
    1.82 +	chmod -c o+r $install/etc/cups/* $install/usr/sbin/cupsd \
    1.83 +	$install/usr/lib/cups/backend/ipp $install/usr/lib/cups/backend/lpd
    1.84  }
    1.85  
    1.86  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.87  genpkg_rules()
    1.88  {
    1.89 -	copy dbus-1/ bin/ sbin/ cups/ applications/ icons/ var/ *.so*
    1.90 -
    1.91 -	# -> cups-dev
    1.92 -	rm -f $fs/usr/bin/cups-config
    1.93 -	rm -rf $fs/usr/include
    1.94 -	# -> libcups
    1.95 -	rm -f $fs/usr/lib/libcups.so*
    1.96 -
    1.97 -	# Daemon script
    1.98 -	cp -a $stuff/etc $fs
    1.99 -	chown -R root:root $fs/etc/init.d
   1.100 -	sed -i 's|^#Group .*|Group lp|' $fs/etc/cups/cups-files.conf
   1.101 -
   1.102 -	# TazPanel link
   1.103 -	cp -a $stuff/var $fs
   1.104 -	chown -R root:root $fs/var/www
   1.105 -
   1.106 +	case $PACKAGE in
   1.107 +		libcups)
   1.108 +			copy libcups.so*
   1.109 +			CAT="system-tools|common libraries"
   1.110 +			TAGS="printer printing"
   1.111 +			DEPENDS="libgnutls zlib"
   1.112 +			;;
   1.113 +		cups)
   1.114 +			copy @std var/ # copy empty dirs in var/
   1.115 +			remove_already_packed
   1.116 +			DEPENDS="acl dbus libcups libgnutls libusb zlib"
   1.117 +			CONFIG_FILES="/etc/cups/"
   1.118 +			TAGS="printer printing"
   1.119 +			;;
   1.120 +		cups-doc)
   1.121 +			# We need the doc for CSS, images and help in the web interface.
   1.122 +			copy doc/
   1.123 +			CAT="docs|documentation"
   1.124 +			DEPENDS="cups"
   1.125 +			;;
   1.126 +		cups-dev)
   1.127 +			copy @dev
   1.128 +			;;
   1.129 +	esac
   1.130  }
   1.131  
   1.132 -post_install()
   1.133 -{
   1.134 -	# Start CUPS daemon and edit daemons.conf
   1.135 +post_install_cups() {
   1.136 +	# Start CUPS daemon
   1.137  	if [ -z "$1" -a ! -s /aufs-umount.sh ]; then
   1.138  		/etc/init.d/cupsd start || continue
   1.139  	fi
   1.140 +
   1.141 +	# Clean TazPanel menu cache
   1.142  	rm -f "$1"/var/cache/tazpanel/* 2>/dev/null
   1.143 +
   1.144 +	# Edit daemons.conf
   1.145  	if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then
   1.146  		cat >> "$1/etc/daemons.conf" <<EOT
   1.147  # CUPS printing daemon options.
   1.148 @@ -84,10 +124,17 @@
   1.149  
   1.150  EOT
   1.151  	fi
   1.152 +
   1.153 +	# Add lpadmin group
   1.154 +	addgroup -g 23 lpadmin
   1.155 +
   1.156 +	# Return permissions to previous state
   1.157 +	chmod 640 $1/etc/cups/*
   1.158 +	chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd
   1.159 +	chmod 500 $1/usr/sbin/cupsd
   1.160  }
   1.161  
   1.162 -pre_remove()
   1.163 -{
   1.164 +pre_remove_cups() {
   1.165  	# Stop CUPS daemon before rm.
   1.166  	[ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
   1.167  	: