1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_HARDENING=1
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/dpatch.mk
unpatch: deapply-dpatches
DEB_CONFIGURE_EXTRA_FLAGS := --with-optim=$(DEB_OPTFLAGS) --libdir=/usr/lib --mandir=/usr/share/man --with-docdir=/usr/share/cups/doc-root --localedir=/usr/share/cups/locale --enable-slp --enable-libpaper --enable-ssl --enable-gnutls --disable-openssl --disable-threads --enable-static --enable-libusb --enable-dbus --with-dbusdir=/etc/dbus-1 --enable-gssapi --enable-avahi --with-pdftops=pdftops --disable-launchd --with-cups-group=lp --with-system-groups=lpadmin --with-printcap=/var/run/cups/printcap --with-log-file-perm=0640 CFLAGS="$(CFLAGS)"
DEB_MAKE_INSTALL_TARGET := install BUILDROOT=$(DEB_DESTDIR)
DEB_INSTALL_CHANGELOGS_ALL := CHANGES.txt
ifeq ($(shell dpkg-vendor --query vendor), Ubuntu)
DEB_DH_INSTALLINIT_ARGS := --upstart-only
else
DEB_DH_INSTALLINIT_ARGS := -u'start 50 2 3 4 5 . stop 80 1 .'
endif
DEB_DH_STRIP_ARGS := --dbg-package=cups-dbg
DEB_DH_FIXPERMS_ARGS := -Xusr/lib/cups/backend-available
DEB_DH_COMPRESS_ARGS := -Xusr/share/doc/libcups2-dev/examples/scripting
DEB_DH_INSTALL_SOURCEDIR := debian/tmp
ifneq ($(findstring $(DEB_BUILD_ARCH), arm m68k),)
DEB_MAKE_CHECK_TARGET := check || true
else
DEB_MAKE_CHECK_TARGET := check
endif
LDFLAGS := -Wl,--as-needed
DPKG_GENSYMBOLS_CHECK_LEVEL=4
export DPKG_GENSYMBOLS_CHECK_LEVEL
post-patches::
# Add source code of extra filters for PDF printing workflow
( cd debian/local/filters/pdf-filters/; sh ./addtocups ../../../.. )
touch pdftopdf/Dependencies
touch pdftoopvp/Dependencies
touch pdftoopvp/oprs/Dependencies
common-post-build-arch::
# Fix permissions of filters/backends installed from debian/local/
chmod 755 debian/local/filters/*
#chmod 755 debian/local/backends/*
cleanbuilddir::
rm -f man/client.conf.man packaging/cups.list
rm -f conf/mime.convs conf/snmp.conf init/org.cups.cups-lpd.plist
[ ! -f Makedefs ] || make distclean
# Remove source code of extra filters for PDF printing workflow
( cd debian/local/filters/pdf-filters/; sh ./removefromcups ../../../.. )
common-install-prehook-impl::
(cd fonts && $(MAKE) install BUILDROOT=$(DEB_DESTDIR))
binary-post-install/cups::
(cd $(DEB_DESTDIR)/../cups/usr/share/doc/cups && ln -sf ../../cups/doc-root online-docs)
# Ensure that we don't ship anything in /var/run
rm -rf $(DEB_DESTDIR)/../cups/var/run
# PPD directories
rmdir $(DEB_DESTDIR)/../cups/usr/share/cups/model
mkdir -p "$(DEB_DESTDIR)/../cups/usr/share/ppd/cups-included/"
dh_usrlocal
# Install AppArmor, ufw profile, and Apport hook on Ubuntu
if dpkg-vendor --is ubuntu; then \
install -D -m 644 debian/local/apparmor-profile debian/$(cdbs_curpkg)/etc/apparmor.d/usr.sbin.cupsd; \
install -D -m 644 debian/local/cups.ufw.profile debian/$(cdbs_curpkg)/etc/ufw/applications.d/cups; \
install -D -m 644 debian/local/apport-hook.py debian/$(cdbs_curpkg)/usr/share/apport/package-hooks/source_cups.py; \
fi
# Make the usb backend run as root, since /dev/bus/usb/* are
# root:root in udev < 147, and cups does not use the usblp kernel
# module any more; udev 147 makes most of those printers accessible to
# lp, but apparently not all of them
chmod go-x debian/$(cdbs_curpkg)/usr/lib/cups/backend-available/usb; \
# Install documentation of the PDF CUPS filters
install -m 644 debian/local/filters/pdf-filters/README $(DEB_DESTDIR)/../cups/usr/share/doc/cups/README.pdf-filters
install -m 644 debian/local/filters/pdf-filters/filter/test.sh $(DEB_DESTDIR)/../cups/usr/share/doc/cups/examples/texttopdf-text.sh
install -m 644 debian/local/filters/pdf-filters/conf/HP-PhotoSmart_Pro_B8300-hpijs-pdftoijs.ppd $(DEB_DESTDIR)/../cups/usr/share/doc/cups/examples/
# Simple Ghostscript-based PostScript-to-PDF filter
install -m 0755 debian/filters/pstopdf $(DEB_DESTDIR)/../cups/usr/lib/cups/filter
# Increase the cost of pstops to prefer the PDF filter chain for
# PostScript printers.
sed -i -r -e '/\spstops$$/ { s/66/100/ }' \
debian/tmp/usr/share/cups/mime/mime.convs
# Make the serial backend run as root, since /dev/ttyS* are
# root:dialout and thus not accessible as user lp
chmod go-x debian/$(cdbs_curpkg)/usr/lib/cups/backend-available/serial
binary-post-install/cups-common::
# Compress charmaps
gzip -9 debian/$(cdbs_curpkg)/usr/share/cups/charmaps/*.txt
binary-post-install/libcupsimage2-dev::
rm -r debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev
ln -s libcupsimage2 debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev
binary-post-install/cups-bsd::
rm -r debian/cups-bsd/usr/share/doc/cups-bsd
ln -s libcups2 debian/cups-bsd/usr/share/doc/cups-bsd
binary-post-install/libcups2-dev::
rm -f debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples/scripting/php/*.o
rm -f debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples/scripting/php/*.so
binary-post-install/cups-client::
rm -r debian/cups-client/usr/share/doc/cups-client
ln -s libcups2 debian/cups-client/usr/share/doc/cups-client
|