summaryrefslogtreecommitdiff
path: root/net-print/cups
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-print/cups
reinit the tree, so we can have metadata
Diffstat (limited to 'net-print/cups')
-rw-r--r--net-print/cups/Manifest21
-rw-r--r--net-print/cups/cups-2.1.4.ebuild354
-rw-r--r--net-print/cups/cups-2.2.3.ebuild347
-rw-r--r--net-print/cups/cups-2.2.4.ebuild349
-rw-r--r--net-print/cups/cups-9999.ebuild346
-rw-r--r--net-print/cups/files/cups-1.4.4-nostrip.patch14
-rw-r--r--net-print/cups/files/cups-1.6.0-dont-compress-manpages.patch17
-rw-r--r--net-print/cups/files/cups-1.6.0-fix-install-perms.patch23
-rw-r--r--net-print/cups/files/cups-2.0.1-xinetd-installation-fix.patch9
-rw-r--r--net-print/cups/files/cups-2.0.2-rename-systemd-service-files.patch46
-rw-r--r--net-print/cups/files/cups-2.0.3-cross-compile.patch30
-rw-r--r--net-print/cups/files/cups-2.1.2-systemd-socket.patch51
-rw-r--r--net-print/cups/files/cups-2.2.0-dont-compress-manpages.patch17
-rw-r--r--net-print/cups/files/cups-2.2.4-fix-install-perms.patch18
-rw-r--r--net-print/cups/files/cupsd.init.d-r219
-rw-r--r--net-print/cups/files/cupsd.init.d-r322
-rw-r--r--net-print/cups/metadata.xml22
17 files changed, 1705 insertions, 0 deletions
diff --git a/net-print/cups/Manifest b/net-print/cups/Manifest
new file mode 100644
index 000000000000..896274c3e137
--- /dev/null
+++ b/net-print/cups/Manifest
@@ -0,0 +1,21 @@
+AUX cups-1.4.4-nostrip.patch 487 SHA256 b96448896f08c5f91d5afb0c093f2638a262d1c45e716c29d5164cefee18bc61 SHA512 10f46e841aa5646f40564e92b6c5b90a5d27702ea8a4dd8652cfd39834be54feec20a2c8d4fea663b90685865deae17851e57161aad7ff250916ce4accbb01fa WHIRLPOOL d55a6bf19e55e3cdb04510eb55b67c011ccdb8b3b73d8787b2da15a584f3e91437c0dc4b53bb62aac2b67c9985c18dddac85e06ca866722fa246a952eda16c0b
+AUX cups-1.6.0-dont-compress-manpages.patch 300 SHA256 613f2c94b6ab1e4d93fe81d8fc6e06b852bf4f82044121c33e76c33af0691737 SHA512 f61189be61f2be4963f3feeafe281fcf69ccf968cfddf262b30636e5a09584feadecbdf187bb9206c0cd7b5945053f602a9d715ec4d1a1b766323085407f58a6 WHIRLPOOL 28abb37bff6ef3f48b4591d2bad1b7514631e500d23ae871d06b8dd80a27fa790e8b3e193721205574bd2c60cddb6db6b03288a57b81ef7e3ca6e58d628a29f4
+AUX cups-1.6.0-fix-install-perms.patch 833 SHA256 3a2198f126eb4707ea0c594a3632ccbd287e072290b71e7dd06c3ec6fa909644 SHA512 b8ffec939651ef2114bb8cf53aad82262ada883cee90efa84f2f8fe73de6b0d3ea0997991e1d002b8c707f2b159cc52d9039282aa0894d73bd8122493c72683c WHIRLPOOL 8663726ddbfc0b81179f0f5fa13378c3f00c7ed9c72f61591ba9e84272adabdd310f2723bdf1ea240502f2bb4f829c115585cb1211f1964e1703f69ecdcc2a08
+AUX cups-2.0.1-xinetd-installation-fix.patch 332 SHA256 f533f03cac8f40bd0a1ca9eb91307781e7ae80be24fd1a48ead8133729c1b842 SHA512 e4111fb05ac381f5639868464734fbbc9296252bda288fc415274cb0eda37ff57d4d2816e34960a3e30a1c73c3aa6911267a5d2c29f1480d8e44fdb6e95f3836 WHIRLPOOL 1b4360e7aab326f0992d69941b69f604297eaafa3eb284b498c08bafdc5e72d107988f48986e7fe09d568a69726147cbc1baee99caefbbc1fbc3054453be63ef
+AUX cups-2.0.2-rename-systemd-service-files.patch 2092 SHA256 f6ef6f3fcbf96d383e7207130393660630a3c159b19d2c6a5437106e52bee1d6 SHA512 409a7508dccbbcfca60ba448f8cea84ecb2710890e7655c67b8292c34c8d555884e7e82e70c2c700691af1a786ce0d8c8c799b6fb471a18f1b87eda99eacd9cb WHIRLPOOL 388300e7e95fee7e6b1ed49885ae13ef79ad743b335d60f44e2745c75d4b203ac84401a9bda1a5e5a6a67c2a599243d8f2a9fd714a58ab76b74ca97041ca9a62
+AUX cups-2.0.3-cross-compile.patch 773 SHA256 5d9b8d5b79c5c34e9a992cf530a6f03f78f262ef3685fcac984029ba08a11a9c SHA512 0a99089f5f6dd231c34a017cfba91182717926943c2865ab0857b2c1aec2efac4e6fc1b9eee9cd1a1f6a99b810f272e8e69bc6fe2275f3d7ff001be3a3bf8ccc WHIRLPOOL d51a871229d9a3746989622b88dfeb009701efca3c94f855b7fae8f39049c8861678f9ddd1a273ef38b90da5c427856917a6303948c6a3ec2092ab9810b08515
+AUX cups-2.1.2-systemd-socket.patch 1542 SHA256 d24e13eee72917882ed4143989046f143f720e0fe10d01b6dee08ef36834a3aa SHA512 56759eafbac1e9947bcc445c850acd0c176687ae6360bc925bbb62153d4a049143d1d41efb3fcc78bbdeba18b0f11ef9a0c5452ec20fae7ef689518781cac48e WHIRLPOOL 8d6e20d02cef902fd8e9491ee51256e02f3b17dd10c96fde6fdb20c798c1d33ed6544d2a180318c73455353f1b013fa997f2b08d2a1f1acb80a50c0945053fa6
+AUX cups-2.2.0-dont-compress-manpages.patch 319 SHA256 f0a2d485d97734c3a7d17483d366cd8f03619d7ceb7ebac1baf2e8c8221d9246 SHA512 0f4822e50f9376dc2e8c87b55f6526ab514f5f08f737071f5b15696e71b51416203df6c9219d78989544bbc135cd92be91ef351a377be7ab4052e98c25c0c4f5 WHIRLPOOL 9897c0fc34ed29937129db10c431704d99ce95d5d452bc6cb9fc5f7570eaa41c2fe9351e52f26872a26ab4bd25e025f42aee7ca3898b171e9d158d11839c485a
+AUX cups-2.2.4-fix-install-perms.patch 646 SHA256 c070e555cda7bb2745a48e55bc652b9ebed0053862c69a026f2a62fb62a3afb8 SHA512 8ead1792208d0190aff22ec1c648e215ab456435c3ecb135b0318585789009cb27b67de939164637f58563fbed809c25ba1a39e39232e17e9470133ead387a5d WHIRLPOOL 24921f7951aa48c73eda8ed9f790976a3470c9e570e47935d310f68eb2f0ffedfcf43bafbd36185225129f195e33c95fe5a61bc28ae4cb27734a6ca52db1b622
+AUX cupsd.init.d-r2 432 SHA256 54b86ec2d7086004cde4e8b69aa49b7334718cad42a4426382f56269bb0f5a78 SHA512 d14973383158dd78e4970dce3037b73e812788f9e61ad9348b580cc8891e7ad6c2214709cac4a43829f7010720a755855c8357d1ada11d048deccf59aa4e83d5 WHIRLPOOL 42b5e0107d1d2fe8399a2ebe8a7d559d56d8c96bca63a587e8a79fc6b04096d072f2dedbc9ae3551fa0238ac169de178f63ea32436790a84354e308baf566a80
+AUX cupsd.init.d-r3 584 SHA256 06ccf2b8166cbe0046da899e4800ceb879d97d10544c40788d1117d0c1e2591a SHA512 ace66b46c17f99f8c6487188c14e8a1baf7acad602156b88cdae7fb4738c163a045240a1b28c6db4af86caa317723357186812eed81f9553a9ef3517c966c6b3 WHIRLPOOL 50020193e046da70f9236bbe3d6ca68acb27d337eaf7d5804156492c7d46885ebe8a873ea32770abbf063f8d1ccf8ef87407e6f39d14b53d1f8c1fa9385a61fd
+DIST cups-2.1.4.tar.gz 9572653 SHA256 1f182f145489e2454969b221056b6b9bac2beb4e38cd75fa12a9ec15d24d5301 SHA512 5f36d21e1e094323f1811229b452f096f3f0b264757b3c3b1742bbd7ea0059e34d3cd2fbf3b6856d25a04ae1779babafa6d598a8ba249448fce3bf7cafa59aae WHIRLPOOL 217b9024c34369c8839b0a1b2b3924eb00e9b8d87cfd8d50a59ad0c33c1044f53d479246d67dff4598049efd15259def90e4bcddc6c3c20dff38811e159d2c4b
+DIST cups-2.2.3.tar.gz 9496214 SHA256 7aa7e8d581f0eb204f75203082403bfa931f8c058bffae71b210800102e5feb5 SHA512 95d8f18fad5b3fd25fe88cc29d159723dcfa735248503d0285949fcd7451f0ccac286719077d0f8a8eda7ee9a053a3d30fa3fd28cb74b59336b6718552d9d2e8 WHIRLPOOL 3aa43f1b83ee62939939bd148c2ab13985143746f7acc3d9c82283e1b096524c7738ae5e1670e717c9329f8d3e917cfcc1c8a7e33af93baa74ea83837d92b5f9
+DIST cups-2.2.4.tar.gz 9984903 SHA256 339fb0c0a70a1edf1ef169f2afb21bab92cdd3074adf630352c427b795f20fa7 SHA512 765fe49d1a7a491d7d5db051f73d039d183d0f7a560e9fd89f6732b8a699d3246080e1aaed4ddfed3a9fbdb876b09aa22939d6ee5da2280b1246e4ba933c55f0 WHIRLPOOL 86557f6244b7aa7b19cc67caff7c845291d09699353bd337090111f92b6afb6b9e175ca68df8a15d8915a5a15fd72348805e4ecb7da532a994f46b2c2d4cdada
+EBUILD cups-2.1.4.ebuild 10392 SHA256 e864a9be631312db0bca0bd340affd29e8e23b7065f37e8fa18de142ee4b48f4 SHA512 bbf47ec4c8392a862ca8f559b6a80fb77f9b9997b8a42aabfd99d1b26b5dac53cc05518617af5313e172a4acd9d5a63e88aaf13836217ecbdaf2756c4897ae61 WHIRLPOOL e4bf4f9bb210ea40ee845d90d02d608e2a5eee18c6a1128d507b528874c42b52f1a262d51863bbf6362989e24bdd63111d5ead886b239fca7a6e002c2c1e3214
+EBUILD cups-2.2.3.ebuild 10140 SHA256 a8be1b257bbb8ad58f9d066579b65bff077a83f3e2bf8501f9cf7814ca9e8fa3 SHA512 85cbee64c1d1e6a876849081eef72c89962314e144a98426d6c98907939b94663c67245db8b40986c2bf17e75c5ee1ae4c8cde763cd28b98a259769a80226adb WHIRLPOOL a979d4f33391b1cbdbcd2c7003585275a0aa92a4c2ab8230f1764fb9283ba8b15a22be4b45e1d658b782d3e6575cfd38d792b7391215b3557189c3643eb01156
+EBUILD cups-2.2.4.ebuild 10088 SHA256 0a5c480875fda7bab575107e8f6fbf9e3560bcb5a3d615338e316cb94f927868 SHA512 4f2f9685c9c509e05e802221eca3263fc18f4c5cab1685f3d001834e04ef1749323f82ac4ad574b45649f7dfad73e0b9e5608dbf6a2f6e058fea5f82e6ff6c32 WHIRLPOOL f20547ee711d6757d593c68868aef375350235514d9b83baca2ab8fd582d4712ede8243a39565b40f794d7143c12559b697b562399570af740206dac96ff6a29
+EBUILD cups-9999.ebuild 10090 SHA256 45415cc15505918653a04186465c71ebacfc68acfd35b28b9381a6c5917a7d82 SHA512 a664a8b880bc7713dc0b2e933941d009ddbffda099573737723be296097070f1ba3ed455e59c83546ece9038e4a3983b7b247f9fdf9fbcc5510d73deae962200 WHIRLPOOL ea2def95369d12ae6ebe66cb247e966f7df51781716c8c5a38459eb35343a1e7f68fb6bc9cf6db0d2ae990258e0580274ffe431a508d98cc88105295cdf22c26
+MISC ChangeLog 10454 SHA256 aac7bd2c8e875aec6f463a11fcf12c4e9565cf0c679ea68bb84d243eafc5eab8 SHA512 bd76be7dfe667b8e18c66bf6bd6c17326c781394690150eb5d89908b1058866d78b0662ada5be3bdfdca30e7654f4324b4e74a30469eb6fe82692f6ce8fad7f6 WHIRLPOOL 620bd44336602b2542c30b37ae0955562ffbeb8308d2d8b37c6bae5c4ab37cc35eac769050519d615766e50127a7b32acbf979fd145587a9cef05ad85aed4486
+MISC ChangeLog-2015 103648 SHA256 adcf00fa34197ba3b90d67437030427fc35ac3451d485d2e9c9fa8801243deaa SHA512 745e845ddf34c1a961b7e7571a7a5b3008a356eaf21ea1bd0dc8b5010b6ff271b937a78f3dae215070854d266aa57204679662b3c855bb62e396205bdfc03a7a WHIRLPOOL 8a35e77792b4faa2310ce4ed46a2e528488eb488485c68248b2f67d137d2e016da618fafb3697230df841ed51a18269ab5895fb74433425445dd6da001af62c8
+MISC metadata.xml 677 SHA256 30911b798a3853b5f838878037fd188d98e986183b11cbc6c93e54ae92976865 SHA512 f7ed769c4f662ea52ed9e24702b91948a376e7d5a59b305f6d89950d0ea40130e6d471cc0bee373a63338f590bce3b6df5a09e56a166ba7fdd960f82e7648717 WHIRLPOOL 927f62af1c4c4066398c9f66fbef08ce598382081ff0016b5ce3eb16d51f2b0c9390b9595e631ab6b7dab467b22bcadef1e67747fc7e512cc56694c9e66e7a1b
diff --git a/net-print/cups/cups-2.1.4.ebuild b/net-print/cups/cups-2.1.4.ebuild
new file mode 100644
index 000000000000..775f7c2fb644
--- /dev/null
+++ b/net-print/cups/cups-2.1.4.ebuild
@@ -0,0 +1,354 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools fdo-mime gnome2-utils flag-o-matic linux-info \
+ multilib multilib-minimal pam python-single-r1 user versionator \
+ java-pkg-opt-2 systemd toolchain-funcs
+
+MY_P=${P/_rc/rc}
+MY_P=${MY_P/_beta/b}
+MY_PV=${PV/_rc/rc}
+MY_PV=${MY_PV/_beta/b}
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/apple/cups.git"
+ if [[ ${PV} != 9999 ]]; then
+ EGIT_BRANCH=branch-${PV/.9999}
+ fi
+else
+ SRC_URI="https://github.com/apple/${PN}/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint"
+fi
+
+DESCRIPTION="The Common Unix Printing System"
+HOMEPAGE="https://www.cups.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="acl dbus debug java kerberos lprng-compat pam
+ python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf"
+
+LANGS="ca cs de es fr it ja ru"
+for X in ${LANGS} ; do
+ IUSE="${IUSE} +linguas_${X}"
+done
+
+CDEPEND="
+ app-text/libpaper
+ sys-libs/zlib
+ acl? (
+ kernel_linux? (
+ sys-apps/acl
+ sys-apps/attr
+ )
+ )
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.6:* )
+ kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
+ !lprng-compat? ( !net-print/lprng )
+ pam? ( virtual/pam )
+ python? ( ${PYTHON_DEPS} )
+ ssl? (
+ >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}]
+ >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+ )
+ systemd? ( sys-apps/systemd )
+ usb? ( virtual/libusb:1 )
+ X? ( x11-misc/xdg-utils )
+ xinetd? ( sys-apps/xinetd )
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+
+DEPEND="${CDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-cups )
+"
+
+PDEPEND=">=net-print/cups-filters-1.0.43"
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ usb? ( threads )
+"
+
+# upstream includes an interactive test which is a nono for gentoo
+RESTRICT="test"
+
+S="${WORKDIR}/${PN}-release-${MY_PV}"
+
+# systemd-socket.patch from Fedora
+PATCHES=(
+ "${FILESDIR}/${PN}-1.6.0-dont-compress-manpages.patch"
+ "${FILESDIR}/${PN}-1.6.0-fix-install-perms.patch"
+ "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
+ "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
+ "${FILESDIR}/${PN}-2.1.2-systemd-socket.patch"
+ "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
+ "${FILESDIR}/${PN}-2.0.3-cross-compile.patch"
+)
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/cups-config
+)
+
+pkg_setup() {
+ enewgroup lp
+ enewuser lp -1 -1 -1 lp
+ enewgroup lpadmin 106
+
+ use python && python-single-r1_pkg_setup
+
+ if use kernel_linux; then
+ linux-info_pkg_setup
+ if ! linux_config_exists; then
+ ewarn "Can't check the linux kernel configuration."
+ ewarn "You might have some incompatible options enabled."
+ else
+ # recheck that we don't have usblp to collide with libusb
+ if use usb; then
+ if linux_chkconfig_present USB_PRINTER; then
+ eerror "Your usb printers will be managed via libusb. In this case, "
+ eerror "${P} requires the USB_PRINTER support disabled."
+ eerror "Please disable it:"
+ eerror " CONFIG_USB_PRINTER=n"
+ eerror "in /usr/src/linux/.config or"
+ eerror " Device Drivers --->"
+ eerror " USB support --->"
+ eerror " [ ] USB Printer support"
+ eerror "Alternatively, just disable the usb useflag for cups (your printer will still work)."
+ fi
+ else
+ #here we should warn user that he should enable it so he can print
+ if ! linux_chkconfig_present USB_PRINTER; then
+ ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
+ ewarn "support in your kernel."
+ ewarn "Please enable it:"
+ ewarn " CONFIG_USB_PRINTER=y"
+ ewarn "in /usr/src/linux/.config or"
+ ewarn " Device Drivers --->"
+ ewarn " USB support --->"
+ ewarn " [*] USB Printer support"
+ ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
+ fi
+ fi
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Remove ".SILENT" rule for verbose output (bug 524338).
+ sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed"
+
+ # Fix install-sh, posix sh does not have 'function'.
+ sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh"
+
+ AT_M4DIR=config-scripts eaclocal
+ eautoconf
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ export DSOFLAGS="${LDFLAGS}"
+
+ einfo LANGS=\"${LANGS}\"
+ einfo LINGUAS=\"${LINGUAS}\"
+
+ local myconf=()
+
+ if tc-is-static-only; then
+ myconf+=(
+ --disable-shared
+ )
+ fi
+
+ # explicitly specify compiler wrt bug 524340
+ #
+ # need to override KRB5CONFIG for proper flags
+ # https://github.com/apple/cups/issues/4423
+ econf \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --localstatedir="${EPREFIX}"/var \
+ --with-rundir="${EPREFIX}"/run/cups \
+ --with-cups-user=lp \
+ --with-cups-group=lp \
+ --with-docdir="${EPREFIX}"/usr/share/cups/html \
+ --with-languages="${LINGUAS}" \
+ --with-system-groups=lpadmin \
+ --with-xinetd=/etc/xinetd.d \
+ $(multilib_native_use_enable acl) \
+ $(use_enable dbus) \
+ $(use_enable debug) \
+ $(use_enable debug debug-guards) \
+ $(use_enable debug debug-printfs) \
+ $(multilib_native_use_with java) \
+ $(use_enable kerberos gssapi) \
+ $(multilib_native_use_enable pam) \
+ $(multilib_native_use_with python python "${PYTHON}") \
+ $(use_enable static-libs static) \
+ $(use_enable threads) \
+ $(use_enable ssl gnutls) \
+ $(use_enable systemd) \
+ $(multilib_native_use_enable usb libusb) \
+ $(use_enable zeroconf avahi) \
+ --disable-dnssd \
+ --without-perl \
+ --without-php \
+ $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper) \
+ "${myconf[@]}"
+
+ # install in /usr/libexec always, instead of using /usr/lib/cups, as that
+ # makes more sense when facing multilib support.
+ sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
+ sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
+ sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake libs
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake BUILDROOT="${D}" install
+ else
+ emake BUILDROOT="${D}" install-libs install-headers
+ dobin cups-config
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc {CHANGES,CREDITS,README}.txt
+
+ # move the default config file to docs
+ dodoc "${ED}"/etc/cups/cupsd.conf.default
+ rm -f "${ED}"/etc/cups/cupsd.conf.default
+
+ # clean out cups init scripts
+ rm -rf "${ED}"/etc/{init.d/cups,rc*,pam.d/cups}
+
+ # install our init script
+ local neededservices
+ use zeroconf && neededservices+=" avahi-daemon"
+ use dbus && neededservices+=" dbus"
+ [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
+ cp "${FILESDIR}"/cupsd.init.d-r2 "${T}"/cupsd || die
+ sed -i \
+ -e "s/@neededservices@/$neededservices/" \
+ "${T}"/cupsd || die
+ doinitd "${T}"/cupsd
+
+ # install our pam script
+ pamd_mimic_system cups auth account
+
+ if use xinetd ; then
+ # correct path
+ sed -i \
+ -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
+ "${ED}"/etc/xinetd.d/cups-lpd || die
+ # it is safer to disable this by default, bug #137130
+ grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
+ { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
+ # write permission for file owner (root), bug #296221
+ fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed"
+ else
+ # always configure with --with-xinetd= and clean up later,
+ # bug #525604
+ rm -rf "${ED}"/etc/xinetd.d
+ fi
+
+ keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \
+ /var/log/cups /var/spool/cups/tmp
+
+ keepdir /etc/cups/{interfaces,ppd,ssl}
+
+ use X || rm -r "${ED}"/usr/share/applications
+
+ # create /etc/cups/client.conf, bug #196967 and #266678
+ echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
+
+ # the following file is now provided by cups-filters:
+ rm -r "${ED}"/usr/share/cups/banners || die
+
+ # the following are created by the init script
+ rm -r "${ED}"/var/cache/cups || die
+ rm -r "${ED}"/run || die
+
+ # for the special case of running lprng and cups together, bug 467226
+ if use lprng-compat ; then
+ rm -fv "${ED}"/usr/bin/{lp*,cancel}
+ rm -fv "${ED}"/usr/sbin/lp*
+ rm -fv "${ED}"/usr/share/man/man1/{lp*,cancel*}
+ rm -fv "${ED}"/usr/share/man/man8/lp*
+ ewarn "Not installing lp... binaries, since the lprng-compat useflag is set."
+ ewarn "Unless you plan to install an exotic server setup, you most likely"
+ ewarn "do not want this. Disable the useflag then and all will be fine."
+ fi
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ # not slotted - at most one value
+ if ! [[ "${REPLACING_VERSIONS}" ]]; then
+ echo
+ elog "For information about installing a printer and general cups setup"
+ elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
+ echo
+ fi
+
+ if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "1.6" ]]; then
+ echo
+ elog "CUPS-1.6 no longer supports automatic remote printers or implicit classes"
+ elog "via the CUPS, LDAP, or SLP protocols, i.e. \"network browsing\"."
+ elog "You will have to find printers using zeroconf/avahi instead, enter"
+ elog "the location manually, or run cups-browsed from net-print/cups-filters"
+ elog "which re-adds that functionality as a separate daemon."
+ echo
+ fi
+
+ if [[ "${REPLACING_VERSIONS}" == "1.6.2-r4" ]]; then
+ ewarn
+ ewarn "You are upgrading from the broken version net-print/cups-1.6.2-r4."
+ ewarn "Please rebuild net-print/cups-filters now to make sure everything is OK."
+ ewarn
+ fi
+}
+
+pkg_postrm() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/net-print/cups/cups-2.2.3.ebuild b/net-print/cups/cups-2.2.3.ebuild
new file mode 100644
index 000000000000..8afa9e83e60c
--- /dev/null
+++ b/net-print/cups/cups-2.2.3.ebuild
@@ -0,0 +1,347 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools fdo-mime gnome2-utils flag-o-matic linux-info \
+ multilib multilib-minimal pam python-single-r1 user versionator \
+ java-pkg-opt-2 systemd toolchain-funcs
+
+MY_P=${P/_rc/rc}
+MY_P=${MY_P/_beta/b}
+MY_PV=${PV/_rc/rc}
+MY_PV=${MY_PV/_beta/b}
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/apple/cups.git"
+ if [[ ${PV} != 9999 ]]; then
+ EGIT_BRANCH=branch-${PV/.9999}
+ fi
+else
+ SRC_URI="https://github.com/apple/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint"
+fi
+
+DESCRIPTION="The Common Unix Printing System"
+HOMEPAGE="https://www.cups.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="acl dbus debug java kerberos lprng-compat pam
+ python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf"
+
+LANGS="ca cs de es fr it ja ru"
+for X in ${LANGS} ; do
+ IUSE="${IUSE} +linguas_${X}"
+done
+
+CDEPEND="
+ app-text/libpaper
+ sys-libs/zlib
+ acl? (
+ kernel_linux? (
+ sys-apps/acl
+ sys-apps/attr
+ )
+ )
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.6:* )
+ kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
+ !lprng-compat? ( !net-print/lprng )
+ pam? ( virtual/pam )
+ python? ( ${PYTHON_DEPS} )
+ ssl? (
+ >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}]
+ )
+ systemd? ( sys-apps/systemd )
+ usb? ( virtual/libusb:1 )
+ X? ( x11-misc/xdg-utils )
+ xinetd? ( sys-apps/xinetd )
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+
+DEPEND="${CDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-cups )
+"
+
+PDEPEND=">=net-print/cups-filters-1.0.43"
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ usb? ( threads )
+"
+
+# upstream includes an interactive test which is a nono for gentoo
+RESTRICT="test"
+
+# systemd-socket.patch from Fedora
+PATCHES=(
+ "${FILESDIR}/${PN}-2.2.0-dont-compress-manpages.patch"
+ "${FILESDIR}/${PN}-1.6.0-fix-install-perms.patch"
+ "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
+ "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
+ "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
+ "${FILESDIR}/${PN}-2.0.3-cross-compile.patch"
+)
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/cups-config
+)
+
+pkg_setup() {
+ enewgroup lp
+ enewuser lp -1 -1 -1 lp
+ enewgroup lpadmin 106
+
+ use python && python-single-r1_pkg_setup
+
+ if use kernel_linux; then
+ linux-info_pkg_setup
+ if ! linux_config_exists; then
+ ewarn "Can't check the linux kernel configuration."
+ ewarn "You might have some incompatible options enabled."
+ else
+ # recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug 501122)
+ if use usb; then
+ if linux_chkconfig_present USB_PRINTER; then
+ elog "Your USB printers will be managed via libusb. In case you run into problems, "
+ elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
+ elog "usblp kernel module."
+ elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
+ fi
+ else
+ #here we should warn user that he should enable it so he can print
+ if ! linux_chkconfig_present USB_PRINTER; then
+ ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
+ ewarn "support in your kernel."
+ ewarn "Please enable it:"
+ ewarn " CONFIG_USB_PRINTER=y"
+ ewarn "in /usr/src/linux/.config or"
+ ewarn " Device Drivers --->"
+ ewarn " USB support --->"
+ ewarn " [*] USB Printer support"
+ ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
+ fi
+ fi
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Remove ".SILENT" rule for verbose output (bug 524338).
+ sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed"
+
+ # Fix install-sh, posix sh does not have 'function'.
+ sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh"
+
+ AT_M4DIR=config-scripts eaclocal
+ eautoconf
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ export DSOFLAGS="${LDFLAGS}"
+
+ einfo LANGS=\"${LANGS}\"
+ einfo LINGUAS=\"${LINGUAS}\"
+
+ local myconf=()
+
+ if tc-is-static-only; then
+ myconf+=(
+ --disable-shared
+ )
+ fi
+
+ # explicitly specify compiler wrt bug 524340
+ #
+ # need to override KRB5CONFIG for proper flags
+ # https://github.com/apple/cups/issues/4423
+ econf \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --localstatedir="${EPREFIX}"/var \
+ --with-rundir="${EPREFIX}"/run/cups \
+ --with-cups-user=lp \
+ --with-cups-group=lp \
+ --with-docdir="${EPREFIX}"/usr/share/cups/html \
+ --with-languages="${LINGUAS}" \
+ --with-system-groups=lpadmin \
+ --with-xinetd="${EPREFIX}"/etc/xinetd.d \
+ $(multilib_native_use_enable acl) \
+ $(use_enable dbus) \
+ $(use_enable debug) \
+ $(use_enable debug debug-guards) \
+ $(use_enable debug debug-printfs) \
+ $(multilib_native_use_with java) \
+ $(use_enable kerberos gssapi) \
+ $(multilib_native_use_enable pam) \
+ $(multilib_native_use_with python python "${PYTHON}") \
+ $(use_enable static-libs static) \
+ $(use_enable threads) \
+ $(use_enable ssl gnutls) \
+ $(use_enable systemd) \
+ $(multilib_native_use_enable usb libusb) \
+ $(use_enable zeroconf avahi) \
+ --disable-dnssd \
+ --without-perl \
+ --without-php \
+ $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper) \
+ "${myconf[@]}"
+
+ # install in /usr/libexec always, instead of using /usr/lib/cups, as that
+ # makes more sense when facing multilib support.
+ sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
+ sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
+ sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
+
+ # additional path corrections needed for prefix, see bug 597728
+ sed -i -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" Makedefs || die
+ sed -i -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" Makedefs || die
+ sed -i -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" Makedefs || die
+ sed -i -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" Makedefs || die
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake libs
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake BUILDROOT="${D}" install
+ else
+ emake BUILDROOT="${D}" install-libs install-headers
+ dobin cups-config
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc {CHANGES,CREDITS,README}.txt
+
+ # move the default config file to docs
+ dodoc "${ED}"/etc/cups/cupsd.conf.default
+ rm -f "${ED}"/etc/cups/cupsd.conf.default
+
+ # clean out cups init scripts
+ rm -rf "${ED}"/etc/{init.d/cups,rc*,pam.d/cups}
+
+ # install our init script
+ local neededservices
+ use zeroconf && neededservices+=" avahi-daemon"
+ use dbus && neededservices+=" dbus"
+ [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
+ cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
+ sed -i \
+ -e "s/@neededservices@/$neededservices/" \
+ "${T}"/cupsd || die
+ doinitd "${T}"/cupsd
+
+ # install our pam script
+ pamd_mimic_system cups auth account
+
+ if use xinetd ; then
+ # correct path
+ sed -i \
+ -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
+ "${ED}"/etc/xinetd.d/cups-lpd || die
+ # it is safer to disable this by default, bug #137130
+ grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
+ { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
+ # write permission for file owner (root), bug #296221
+ fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed"
+ else
+ # always configure with --with-xinetd= and clean up later,
+ # bug #525604
+ rm -rf "${ED}"/etc/xinetd.d
+ fi
+
+ keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \
+ /var/log/cups /var/spool/cups/tmp
+
+ keepdir /etc/cups/{interfaces,ppd,ssl}
+
+ use X || rm -r "${ED}"/usr/share/applications
+
+ # create /etc/cups/client.conf, bug #196967 and #266678
+ echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
+
+ # the following file is now provided by cups-filters:
+ rm -r "${ED}"/usr/share/cups/banners || die
+
+ # the following are created by the init script
+ rm -r "${ED}"/var/cache/cups || die
+ rm -r "${ED}"/run || die
+
+ # for the special case of running lprng and cups together, bug 467226
+ if use lprng-compat ; then
+ rm -fv "${ED}"/usr/bin/{lp*,cancel}
+ rm -fv "${ED}"/usr/sbin/lp*
+ rm -fv "${ED}"/usr/share/man/man1/{lp*,cancel*}
+ rm -fv "${ED}"/usr/share/man/man8/lp*
+ ewarn "Not installing lp... binaries, since the lprng-compat useflag is set."
+ ewarn "Unless you plan to install an exotic server setup, you most likely"
+ ewarn "do not want this. Disable the useflag then and all will be fine."
+ fi
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ local v
+
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 2.2.2-r2 ${v}; then
+ echo
+ ewarn "The cupsd init script switched to using pidfiles. Shutting down"
+ ewarn "cupsd will fail the next time. To fix this, please run once as root"
+ ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
+ echo
+ break
+ fi
+ done
+
+ for v in ${REPLACING_VERSIONS}; do
+ echo
+ elog "For information about installing a printer and general cups setup"
+ elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
+ echo
+ break
+ done
+}
+
+pkg_postrm() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/net-print/cups/cups-2.2.4.ebuild b/net-print/cups/cups-2.2.4.ebuild
new file mode 100644
index 000000000000..1022bea6f56a
--- /dev/null
+++ b/net-print/cups/cups-2.2.4.ebuild
@@ -0,0 +1,349 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools fdo-mime gnome2-utils flag-o-matic linux-info \
+ multilib multilib-minimal pam python-single-r1 user versionator \
+ java-pkg-opt-2 systemd toolchain-funcs
+
+MY_P=${P/_rc/rc}
+MY_P=${MY_P/_beta/b}
+MY_PV=${PV/_rc/rc}
+MY_PV=${MY_PV/_beta/b}
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/apple/cups.git"
+ if [[ ${PV} != 9999 ]]; then
+ EGIT_BRANCH=branch-${PV/.9999}
+ fi
+else
+ SRC_URI="https://github.com/apple/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint"
+fi
+
+DESCRIPTION="The Common Unix Printing System"
+HOMEPAGE="https://www.cups.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="acl dbus debug java kerberos lprng-compat pam
+ python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf"
+
+LANGS="ca cs de es fr it ja ru"
+for X in ${LANGS} ; do
+ IUSE="${IUSE} +linguas_${X}"
+done
+
+CDEPEND="
+ app-text/libpaper
+ sys-libs/zlib
+ acl? (
+ kernel_linux? (
+ sys-apps/acl
+ sys-apps/attr
+ )
+ )
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.6:* )
+ kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
+ !lprng-compat? ( !net-print/lprng )
+ pam? ( virtual/pam )
+ python? ( ${PYTHON_DEPS} )
+ ssl? (
+ >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}]
+ )
+ systemd? ( sys-apps/systemd )
+ usb? ( virtual/libusb:1 )
+ X? ( x11-misc/xdg-utils )
+ xinetd? ( sys-apps/xinetd )
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+
+DEPEND="${CDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-cups )
+"
+
+PDEPEND=">=net-print/cups-filters-1.0.43"
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ usb? ( threads )
+"
+
+# upstream includes an interactive test which is a nono for gentoo
+RESTRICT="test"
+
+# systemd-socket.patch from Fedora
+PATCHES=(
+ "${FILESDIR}/${PN}-2.2.0-dont-compress-manpages.patch"
+ "${FILESDIR}/${PN}-2.2.4-fix-install-perms.patch"
+ "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
+ "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
+ "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
+)
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/cups-config
+)
+
+pkg_setup() {
+ enewgroup lp
+ enewuser lp -1 -1 -1 lp
+ enewgroup lpadmin 106
+
+ use python && python-single-r1_pkg_setup
+
+ if use kernel_linux; then
+ linux-info_pkg_setup
+ if ! linux_config_exists; then
+ ewarn "Can't check the linux kernel configuration."
+ ewarn "You might have some incompatible options enabled."
+ else
+ # recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug 501122)
+ if use usb; then
+ if linux_chkconfig_present USB_PRINTER; then
+ elog "Your USB printers will be managed via libusb. In case you run into problems, "
+ elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
+ elog "usblp kernel module."
+ elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
+ fi
+ else
+ #here we should warn user that he should enable it so he can print
+ if ! linux_chkconfig_present USB_PRINTER; then
+ ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
+ ewarn "support in your kernel."
+ ewarn "Please enable it:"
+ ewarn " CONFIG_USB_PRINTER=y"
+ ewarn "in /usr/src/linux/.config or"
+ ewarn " Device Drivers --->"
+ ewarn " USB support --->"
+ ewarn " [*] USB Printer support"
+ ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
+ fi
+ fi
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Remove ".SILENT" rule for verbose output (bug 524338).
+ sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed"
+
+ # Fix install-sh, posix sh does not have 'function'.
+ sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh"
+
+ AT_M4DIR=config-scripts eaclocal
+ eautoconf
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ export DSOFLAGS="${LDFLAGS}"
+
+ einfo LANGS=\"${LANGS}\"
+ einfo LINGUAS=\"${LINGUAS}\"
+
+ local myeconfargs=()
+
+ # explicitly specify compiler wrt bug 524340
+ #
+ # need to override KRB5CONFIG for proper flags
+ # https://github.com/apple/cups/issues/4423
+ myeconfargs+=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config
+ --libdir="${EPREFIX}"/usr/$(get_libdir)
+ --localstatedir="${EPREFIX}"/var
+ --with-exe-file-perm=755
+ --with-rundir="${EPREFIX}"/run/cups
+ --with-cups-user=lp
+ --with-cups-group=lp
+ --with-docdir="${EPREFIX}"/usr/share/cups/html
+ --with-languages="${LINGUAS}"
+ --with-system-groups=lpadmin
+ --with-xinetd="${EPREFIX}"/etc/xinetd.d
+ $(multilib_native_use_enable acl)
+ $(use_enable dbus)
+ $(use_enable debug)
+ $(use_enable debug debug-guards)
+ $(use_enable debug debug-printfs)
+ $(multilib_native_use_with java)
+ $(use_enable kerberos gssapi)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_with python python "${PYTHON}")
+ $(use_enable static-libs static)
+ $(use_enable threads)
+ $(use_enable ssl gnutls)
+ $(use_enable systemd)
+ $(multilib_native_use_enable usb libusb)
+ $(use_enable zeroconf avahi)
+ --disable-dnssd
+ --without-perl
+ --without-php
+ $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper)
+ )
+
+ if tc-is-static-only; then
+ myeconfargs+=(
+ --disable-shared
+ )
+ fi
+
+ econf "${myeconfargs[@]}"
+
+ # install in /usr/libexec always, instead of using /usr/lib/cups, as that
+ # makes more sense when facing multilib support.
+ sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
+ sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
+ sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
+
+ # additional path corrections needed for prefix, see bug 597728
+ sed -i -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" Makedefs || die
+ sed -i -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" Makedefs || die
+ sed -i -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" Makedefs || die
+ sed -i -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" Makedefs || die
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake libs
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake BUILDROOT="${D}" install
+ else
+ emake BUILDROOT="${D}" install-libs install-headers
+ dobin cups-config
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc {CHANGES,CREDITS,README}.md
+
+ # move the default config file to docs
+ dodoc "${ED}"/etc/cups/cupsd.conf.default
+ rm -f "${ED}"/etc/cups/cupsd.conf.default
+
+ # clean out cups init scripts
+ rm -rf "${ED}"/etc/{init.d/cups,rc*,pam.d/cups}
+
+ # install our init script
+ local neededservices
+ use zeroconf && neededservices+=" avahi-daemon"
+ use dbus && neededservices+=" dbus"
+ [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
+ cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
+ sed -i \
+ -e "s/@neededservices@/$neededservices/" \
+ "${T}"/cupsd || die
+ doinitd "${T}"/cupsd
+
+ # install our pam script
+ pamd_mimic_system cups auth account
+
+ if use xinetd ; then
+ # correct path
+ sed -i \
+ -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
+ "${ED}"/etc/xinetd.d/cups-lpd || die
+ # it is safer to disable this by default, bug #137130
+ grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
+ { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
+ # write permission for file owner (root), bug #296221
+ fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed"
+ else
+ # always configure with --with-xinetd= and clean up later,
+ # bug #525604
+ rm -rf "${ED}"/etc/xinetd.d
+ fi
+
+ keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \
+ /var/log/cups /var/spool/cups/tmp
+
+ keepdir /etc/cups/{interfaces,ppd,ssl}
+
+ use X || rm -r "${ED}"/usr/share/applications
+
+ # create /etc/cups/client.conf, bug #196967 and #266678
+ echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
+
+ # the following file is now provided by cups-filters:
+ rm -r "${ED}"/usr/share/cups/banners || die
+
+ # the following are created by the init script
+ rm -r "${ED}"/var/cache/cups || die
+ rm -r "${ED}"/run || die
+
+ # for the special case of running lprng and cups together, bug 467226
+ if use lprng-compat ; then
+ rm -fv "${ED}"/usr/bin/{lp*,cancel}
+ rm -fv "${ED}"/usr/sbin/lp*
+ rm -fv "${ED}"/usr/share/man/man1/{lp*,cancel*}
+ rm -fv "${ED}"/usr/share/man/man8/lp*
+ ewarn "Not installing lp... binaries, since the lprng-compat useflag is set."
+ ewarn "Unless you plan to install an exotic server setup, you most likely"
+ ewarn "do not want this. Disable the useflag then and all will be fine."
+ fi
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ local v
+
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 2.2.2-r2 ${v}; then
+ echo
+ ewarn "The cupsd init script switched to using pidfiles. Shutting down"
+ ewarn "cupsd will fail the next time. To fix this, please run once as root"
+ ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
+ echo
+ break
+ fi
+ done
+
+ for v in ${REPLACING_VERSIONS}; do
+ echo
+ elog "For information about installing a printer and general cups setup"
+ elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
+ echo
+ break
+ done
+}
+
+pkg_postrm() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/net-print/cups/cups-9999.ebuild b/net-print/cups/cups-9999.ebuild
new file mode 100644
index 000000000000..f32e1a41dda6
--- /dev/null
+++ b/net-print/cups/cups-9999.ebuild
@@ -0,0 +1,346 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools fdo-mime gnome2-utils flag-o-matic linux-info \
+ multilib multilib-minimal pam python-single-r1 user versionator \
+ java-pkg-opt-2 systemd toolchain-funcs
+
+MY_P=${P/_rc/rc}
+MY_P=${MY_P/_beta/b}
+MY_PV=${PV/_rc/rc}
+MY_PV=${MY_PV/_beta/b}
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/apple/cups.git"
+ if [[ ${PV} != 9999 ]]; then
+ EGIT_BRANCH=branch-${PV/.9999}
+ fi
+else
+ SRC_URI="https://github.com/apple/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint"
+fi
+
+DESCRIPTION="The Common Unix Printing System"
+HOMEPAGE="https://www.cups.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="acl dbus debug java kerberos lprng-compat pam
+ python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf"
+
+LANGS="ca cs de es fr it ja ru"
+for X in ${LANGS} ; do
+ IUSE="${IUSE} +linguas_${X}"
+done
+
+CDEPEND="
+ app-text/libpaper
+ sys-libs/zlib
+ acl? (
+ kernel_linux? (
+ sys-apps/acl
+ sys-apps/attr
+ )
+ )
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.6:* )
+ kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
+ !lprng-compat? ( !net-print/lprng )
+ pam? ( virtual/pam )
+ python? ( ${PYTHON_DEPS} )
+ ssl? (
+ >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+ )
+ systemd? ( sys-apps/systemd )
+ usb? ( virtual/libusb:1 )
+ X? ( x11-misc/xdg-utils )
+ xinetd? ( sys-apps/xinetd )
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+
+DEPEND="${CDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-cups )
+"
+
+PDEPEND=">=net-print/cups-filters-1.0.43"
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ usb? ( threads )
+"
+
+# upstream includes an interactive test which is a nono for gentoo
+RESTRICT="test"
+
+# systemd-socket.patch from Fedora
+PATCHES=(
+ "${FILESDIR}/${PN}-2.2.0-dont-compress-manpages.patch"
+ "${FILESDIR}/${PN}-2.2.4-fix-install-perms.patch"
+ "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
+ "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
+ "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
+)
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/cups-config
+)
+
+pkg_setup() {
+ enewgroup lp
+ enewuser lp -1 -1 -1 lp
+ enewgroup lpadmin 106
+
+ use python && python-single-r1_pkg_setup
+
+ if use kernel_linux; then
+ linux-info_pkg_setup
+ if ! linux_config_exists; then
+ ewarn "Can't check the linux kernel configuration."
+ ewarn "You might have some incompatible options enabled."
+ else
+ # recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug 501122)
+ if use usb; then
+ if linux_chkconfig_present USB_PRINTER; then
+ elog "Your USB printers will be managed via libusb. In case you run into problems, "
+ elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
+ elog "usblp kernel module."
+ elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
+ fi
+ else
+ #here we should warn user that he should enable it so he can print
+ if ! linux_chkconfig_present USB_PRINTER; then
+ ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
+ ewarn "support in your kernel."
+ ewarn "Please enable it:"
+ ewarn " CONFIG_USB_PRINTER=y"
+ ewarn "in /usr/src/linux/.config or"
+ ewarn " Device Drivers --->"
+ ewarn " USB support --->"
+ ewarn " [*] USB Printer support"
+ ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
+ fi
+ fi
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Remove ".SILENT" rule for verbose output (bug 524338).
+ sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed"
+
+ # Fix install-sh, posix sh does not have 'function'.
+ sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh"
+
+ AT_M4DIR=config-scripts eaclocal
+ eautoconf
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ export DSOFLAGS="${LDFLAGS}"
+
+ einfo LANGS=\"${LANGS}\"
+ einfo LINGUAS=\"${LINGUAS}\"
+
+ local myconf=()
+
+ if tc-is-static-only; then
+ myconf+=(
+ --disable-shared
+ )
+ fi
+
+ # explicitly specify compiler wrt bug 524340
+ #
+ # need to override KRB5CONFIG for proper flags
+ # https://github.com/apple/cups/issues/4423
+ econf \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --localstatedir="${EPREFIX}"/var \
+ --with-rundir="${EPREFIX}"/run/cups \
+ --with-cups-user=lp \
+ --with-cups-group=lp \
+ --with-docdir="${EPREFIX}"/usr/share/cups/html \
+ --with-languages="${LINGUAS}" \
+ --with-system-groups=lpadmin \
+ --with-xinetd="${EPREFIX}"/etc/xinetd.d \
+ $(multilib_native_use_enable acl) \
+ $(use_enable dbus) \
+ $(use_enable debug) \
+ $(use_enable debug debug-guards) \
+ $(use_enable debug debug-printfs) \
+ $(multilib_native_use_with java) \
+ $(use_enable kerberos gssapi) \
+ $(multilib_native_use_enable pam) \
+ $(multilib_native_use_with python python "${PYTHON}") \
+ $(use_enable static-libs static) \
+ $(use_enable threads) \
+ $(use_enable ssl gnutls) \
+ $(use_enable systemd) \
+ $(multilib_native_use_enable usb libusb) \
+ $(use_enable zeroconf avahi) \
+ --disable-dnssd \
+ --without-perl \
+ --without-php \
+ $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper) \
+ "${myconf[@]}"
+
+ # install in /usr/libexec always, instead of using /usr/lib/cups, as that
+ # makes more sense when facing multilib support.
+ sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
+ sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
+ sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
+
+ # additional path corrections needed for prefix, see bug 597728
+ sed -i -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" Makedefs || die
+ sed -i -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" Makedefs || die
+ sed -i -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" Makedefs || die
+ sed -i -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" Makedefs || die
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake libs
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake BUILDROOT="${D}" install
+ else
+ emake BUILDROOT="${D}" install-libs install-headers
+ dobin cups-config
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc {CHANGES,CREDITS,README}.txt
+
+ # move the default config file to docs
+ dodoc "${ED}"/etc/cups/cupsd.conf.default
+ rm -f "${ED}"/etc/cups/cupsd.conf.default
+
+ # clean out cups init scripts
+ rm -rf "${ED}"/etc/{init.d/cups,rc*,pam.d/cups}
+
+ # install our init script
+ local neededservices
+ use zeroconf && neededservices+=" avahi-daemon"
+ use dbus && neededservices+=" dbus"
+ [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
+ cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
+ sed -i \
+ -e "s/@neededservices@/$neededservices/" \
+ "${T}"/cupsd || die
+ doinitd "${T}"/cupsd
+
+ # install our pam script
+ pamd_mimic_system cups auth account
+
+ if use xinetd ; then
+ # correct path
+ sed -i \
+ -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
+ "${ED}"/etc/xinetd.d/cups-lpd || die
+ # it is safer to disable this by default, bug #137130
+ grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
+ { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
+ # write permission for file owner (root), bug #296221
+ fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed"
+ else
+ # always configure with --with-xinetd= and clean up later,
+ # bug #525604
+ rm -rf "${ED}"/etc/xinetd.d
+ fi
+
+ keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \
+ /var/log/cups /var/spool/cups/tmp
+
+ keepdir /etc/cups/{interfaces,ppd,ssl}
+
+ use X || rm -r "${ED}"/usr/share/applications
+
+ # create /etc/cups/client.conf, bug #196967 and #266678
+ echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
+
+ # the following file is now provided by cups-filters:
+ rm -r "${ED}"/usr/share/cups/banners || die
+
+ # the following are created by the init script
+ rm -r "${ED}"/var/cache/cups || die
+ rm -r "${ED}"/run || die
+
+ # for the special case of running lprng and cups together, bug 467226
+ if use lprng-compat ; then
+ rm -fv "${ED}"/usr/bin/{lp*,cancel}
+ rm -fv "${ED}"/usr/sbin/lp*
+ rm -fv "${ED}"/usr/share/man/man1/{lp*,cancel*}
+ rm -fv "${ED}"/usr/share/man/man8/lp*
+ ewarn "Not installing lp... binaries, since the lprng-compat useflag is set."
+ ewarn "Unless you plan to install an exotic server setup, you most likely"
+ ewarn "do not want this. Disable the useflag then and all will be fine."
+ fi
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ local v
+
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 2.2.2-r2 ${v}; then
+ echo
+ ewarn "The cupsd init script switched to using pidfiles. Shutting down"
+ ewarn "cupsd will fail the next time. To fix this, please run once as root"
+ ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
+ echo
+ break
+ fi
+ done
+
+ for v in ${REPLACING_VERSIONS}; do
+ echo
+ elog "For information about installing a printer and general cups setup"
+ elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
+ echo
+ break
+ done
+}
+
+pkg_postrm() {
+ # Update desktop file database and gtk icon cache (bug 370059)
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/net-print/cups/files/cups-1.4.4-nostrip.patch b/net-print/cups/files/cups-1.4.4-nostrip.patch
new file mode 100644
index 000000000000..cd2b07042cec
--- /dev/null
+++ b/net-print/cups/files/cups-1.4.4-nostrip.patch
@@ -0,0 +1,14 @@
+# Source: Gentoo
+
+diff -urN cups-1.4.4/config-scripts/cups-compiler.m4 cups-1.4.4.new/config-scripts/cups-compiler.m4
+--- cups-1.4.4/config-scripts/cups-compiler.m4 2009-05-17 02:13:47.000000000 +0200
++++ cups-1.4.4.new/config-scripts/cups-compiler.m4 2010-08-12 19:19:45.937020635 +0200
+@@ -30,7 +30,7 @@
+ if test x$enable_debug = xyes; then
+ OPTIM="-g"
+ else
+- INSTALL_STRIP="-s"
++ INSTALL_STRIP=""
+ fi
+
+ dnl Debug printfs can slow things down, so provide a separate option for that
diff --git a/net-print/cups/files/cups-1.6.0-dont-compress-manpages.patch b/net-print/cups/files/cups-1.6.0-dont-compress-manpages.patch
new file mode 100644
index 000000000000..a388b4d5e021
--- /dev/null
+++ b/net-print/cups/files/cups-1.6.0-dont-compress-manpages.patch
@@ -0,0 +1,17 @@
+--- a/config-scripts/cups-manpages.m4
++++ b/config-scripts/cups-manpages.m4
+@@ -69,10 +69,10 @@
+ ;;
+ Linux* | GNU* | Darwin*)
+ # Linux, GNU Hurd, and OS X
+- MAN1EXT=1.gz
+- MAN5EXT=5.gz
+- MAN7EXT=7.gz
+- MAN8EXT=8.gz
++ MAN1EXT=1
++ MAN5EXT=5
++ MAN7EXT=7
++ MAN8EXT=8
+ MAN8DIR=8
+ ;;
+ *)
diff --git a/net-print/cups/files/cups-1.6.0-fix-install-perms.patch b/net-print/cups/files/cups-1.6.0-fix-install-perms.patch
new file mode 100644
index 000000000000..e71934b7d49f
--- /dev/null
+++ b/net-print/cups/files/cups-1.6.0-fix-install-perms.patch
@@ -0,0 +1,23 @@
+--- a/Makedefs.in
++++ b/Makedefs.in
+@@ -40,14 +40,14 @@
+ # Installation programs...
+ #
+
+-INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
+-INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
++INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
++INSTALL_COMPDATA = $(INSTALL) -c -m 644 @INSTALL_GZIP@
+ INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
+-INSTALL_DATA = $(INSTALL) -c -m 444
++INSTALL_DATA = $(INSTALL) -c -m 644
+ INSTALL_DIR = $(INSTALL) -d
+-INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
+-INSTALL_MAN = $(INSTALL) -c -m 444
+-INSTALL_SCRIPT = $(INSTALL) -c -m 555
++INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
++INSTALL_MAN = $(INSTALL) -c -m 644
++INSTALL_SCRIPT = $(INSTALL) -c -m 755
+
+ #
+ # Default user, group, and system groups for the scheduler...
diff --git a/net-print/cups/files/cups-2.0.1-xinetd-installation-fix.patch b/net-print/cups/files/cups-2.0.1-xinetd-installation-fix.patch
new file mode 100644
index 000000000000..2e8419e7675a
--- /dev/null
+++ b/net-print/cups/files/cups-2.0.1-xinetd-installation-fix.patch
@@ -0,0 +1,9 @@
+--- a/scheduler/Makefile
++++ a/scheduler/Makefile
+@@ -211,4 +211,5 @@
+- elif test "x$(XINETD)" != x; then \
++ fi
++ if test "x$(XINETD)" != x; then \
+ echo Installing xinetd configuration file for cups-lpd...; \
+ $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
+ $(INSTALL_DATA) cups-lpd.xinetd $(BUILDROOT)$(XINETD)/cups-lpd; \
diff --git a/net-print/cups/files/cups-2.0.2-rename-systemd-service-files.patch b/net-print/cups/files/cups-2.0.2-rename-systemd-service-files.patch
new file mode 100644
index 000000000000..16f677ba7a37
--- /dev/null
+++ b/net-print/cups/files/cups-2.0.2-rename-systemd-service-files.patch
@@ -0,0 +1,46 @@
+From 33e0d4c8e450fe69b195422c0880aaa96ca9478d Mon Sep 17 00:00:00 2001
+From: Matthias Maier <tamiko@kyomu.43-1.org>
+Date: Wed, 19 Nov 2014 18:00:06 +0100
+Subject: [PATCH] change systemd service files to gentoo naming scheme
+
+---
+ scheduler/Makefile | 10 +++++-----
+ scheduler/org.cups.cupsd.path.in | 2 +-
+ scheduler/org.cups.cupsd.service.in | 2 +-
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/scheduler/Makefile b/scheduler/Makefile
+index 3e0884a..b354420 100644
+--- a/scheduler/Makefile
++++ b/scheduler/Makefile
+@@ -203,11 +203,11 @@ install-data:
+ if test "x$(SYSTEMD_DIR)" != x; then \
+ echo Installing systemd configuration files...; \
+ $(INSTALL_DIR) $(BUILDROOT)$(SYSTEMD_DIR); \
+- $(INSTALL_DATA) org.cups.cupsd.path $(BUILDROOT)$(SYSTEMD_DIR); \
+- $(INSTALL_DATA) org.cups.cupsd.service $(BUILDROOT)$(SYSTEMD_DIR); \
+- $(INSTALL_DATA) org.cups.cupsd.socket $(BUILDROOT)$(SYSTEMD_DIR); \
+- $(INSTALL_DATA) org.cups.cups-lpdAT.service $(BUILDROOT)$(SYSTEMD_DIR)/org.cups.cups-lpd@.service; \
+- $(INSTALL_DATA) org.cups.cups-lpd.socket $(BUILDROOT)$(SYSTEMD_DIR); \
++ $(INSTALL_DATA) org.cups.cupsd.path $(BUILDROOT)$(SYSTEMD_DIR)/cups.path; \
++ $(INSTALL_DATA) org.cups.cupsd.service $(BUILDROOT)$(SYSTEMD_DIR)/cups.service; \
++ $(INSTALL_DATA) org.cups.cupsd.socket $(BUILDROOT)$(SYSTEMD_DIR)/cups.socket; \
++ $(INSTALL_DATA) org.cups.cups-lpdAT.service $(BUILDROOT)$(SYSTEMD_DIR)/cups-lpd@.service; \
++ $(INSTALL_DATA) org.cups.cups-lpd.socket $(BUILDROOT)$(SYSTEMD_DIR)/cups-lpd.socket; \
+ elif test "x$(XINETD)" != x; then \
+ echo Installing xinetd configuration file for cups-lpd...; \
+ $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
+diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in
+index 0a27c76..7a04248 100644
+--- a/scheduler/org.cups.cupsd.service.in
++++ b/scheduler/org.cups.cupsd.service.in
+@@ -7,5 +7,5 @@ ExecStart=@sbindir@/cupsd -l
+ Type=simple
+
+ [Install]
+-Also=org.cups.cupsd.socket org.cups.cupsd.path
++Also=cups.socket cups.path
+ WantedBy=printer.target
+--
+2.0.4
+
diff --git a/net-print/cups/files/cups-2.0.3-cross-compile.patch b/net-print/cups/files/cups-2.0.3-cross-compile.patch
new file mode 100644
index 000000000000..d0893c31fa7b
--- /dev/null
+++ b/net-print/cups/files/cups-2.0.3-cross-compile.patch
@@ -0,0 +1,30 @@
+we don't actually install the generated html output, so no point in building
+them. this also helps cross-compiling because the tool to create the html
+uses $CC and has no logic for $BUILD_CC. simpler to disable than fix.
+
+--- a/man/Makefile
++++ b/man/Makefile
+@@ -73,7 +73,7 @@ MAN8 = cupsaccept.$(MAN8EXT) \
+ # Make everything...
+ #
+
+-all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) html
++all: $(MAN1) $(MAN5) $(MAN7) $(MAN8)
+
+
+ #
+
+similarly, the genstrings tool is used to gather all the translatable strings
+in the code base for passing to gettext. in our builds, those strings already
+exist, so no point in running this tool.
+
+--- a/ppdc/Makefile
++++ b/ppdc/Makefile
+@@ -70,7 +70,6 @@ EXECTARGETS = \
+ TARGETS = \
+ $(LIBTARGETS) \
+ $(EXECTARGETS) \
+- genstrings
+
+
+ #
diff --git a/net-print/cups/files/cups-2.1.2-systemd-socket.patch b/net-print/cups/files/cups-2.1.2-systemd-socket.patch
new file mode 100644
index 000000000000..2f88924ee2d5
--- /dev/null
+++ b/net-print/cups/files/cups-2.1.2-systemd-socket.patch
@@ -0,0 +1,51 @@
+diff --git a/scheduler/main.c b/scheduler/main.c
+index b1aa503..2f0f5fe 100644
+--- a/scheduler/main.c
++++ b/scheduler/main.c
+@@ -656,8 +656,15 @@ main(int argc, /* I - Number of command-line args */
+
+ #if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD)
+ if (OnDemand)
++ {
+ cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started on demand.");
+- else
++# ifdef HAVE_SYSTEMD
++ sd_notifyf(0, "READY=1\n"
++ "STATUS=Scheduler is running...\n"
++ "MAINPID=%lu",
++ (unsigned long) getpid());
++# endif /* HAVE_SYSTEMD */
++ } else
+ #endif /* HAVE_LAUNCHD || HAVE_SYSTEMD */
+ if (fg)
+ cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started in foreground.");
+diff --git a/scheduler/org.cups.cupsd.path.in b/scheduler/org.cups.cupsd.path.in
+index 1bccc6f..4564164 100644
+--- a/scheduler/org.cups.cupsd.path.in
++++ b/scheduler/org.cups.cupsd.path.in
+@@ -2,7 +2,7 @@
+ Description=CUPS Scheduler
+
+ [Path]
+-PathExists=@CUPS_CACHEDIR@/org.cups.cupsd
++PathExistsGlob=@CUPS_REQUESTS@/d*
+
+ [Install]
+ WantedBy=multi-user.target
+diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in
+index 0a27c76..0a841a2 100644
+--- a/scheduler/org.cups.cupsd.service.in
++++ b/scheduler/org.cups.cupsd.service.in
+@@ -1,10 +1,11 @@
+ [Unit]
+ Description=CUPS Scheduler
+ Documentation=man:cupsd(8)
++After=network.target
+
+ [Service]
+ ExecStart=@sbindir@/cupsd -l
+-Type=simple
++Type=notify
+
+ [Install]
+ Also=org.cups.cupsd.socket org.cups.cupsd.path
diff --git a/net-print/cups/files/cups-2.2.0-dont-compress-manpages.patch b/net-print/cups/files/cups-2.2.0-dont-compress-manpages.patch
new file mode 100644
index 000000000000..7b61b39f16ad
--- /dev/null
+++ b/net-print/cups/files/cups-2.2.0-dont-compress-manpages.patch
@@ -0,0 +1,17 @@
+--- cups-2.2.0/config-scripts/cups-manpages.m4
++++ cups-2.2.0/config-scripts/cups-manpages.m4
+@@ -53,10 +53,10 @@
+ ;;
+ Linux* | GNU* | Darwin*)
+ # Linux, GNU Hurd, and macOS
+- MAN1EXT=1.gz
+- MAN5EXT=5.gz
+- MAN7EXT=7.gz
+- MAN8EXT=8.gz
++ MAN1EXT=1
++ MAN5EXT=5
++ MAN7EXT=7
++ MAN8EXT=8
+ MAN8DIR=8
+ ;;
+ *)
diff --git a/net-print/cups/files/cups-2.2.4-fix-install-perms.patch b/net-print/cups/files/cups-2.2.4-fix-install-perms.patch
new file mode 100644
index 000000000000..b9fda922d2c6
--- /dev/null
+++ b/net-print/cups/files/cups-2.2.4-fix-install-perms.patch
@@ -0,0 +1,18 @@
+--- cups-2.2.4/Makedefs.in
++++ cups-2.2.4/Makedefs.in
+@@ -39,12 +39,12 @@
+ #
+
+ INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
+-INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
++INSTALL_COMPDATA = $(INSTALL) -c -m 644 @INSTALL_GZIP@
+ INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
+-INSTALL_DATA = $(INSTALL) -c -m 444
++INSTALL_DATA = $(INSTALL) -c -m 644
+ INSTALL_DIR = $(INSTALL) -d
+ INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
+-INSTALL_MAN = $(INSTALL) -c -m 444
++INSTALL_MAN = $(INSTALL) -c -m 644
+ INSTALL_SCRIPT = $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
+
+ #
diff --git a/net-print/cups/files/cupsd.init.d-r2 b/net-print/cups/files/cupsd.init.d-r2
new file mode 100644
index 000000000000..f89263077593
--- /dev/null
+++ b/net-print/cups/files/cupsd.init.d-r2
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+
+description="The Common Unix Printing System daemon"
+command="/usr/sbin/cupsd"
+
+depend() {
+ use net
+ @neededservices@
+ before nfs
+ after logger
+}
+
+start_pre() {
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
+ checkpath -q -d -m 0755 -o root:lp /run/cups
+ checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
+}
diff --git a/net-print/cups/files/cupsd.init.d-r3 b/net-print/cups/files/cupsd.init.d-r3
new file mode 100644
index 000000000000..2f563e4c7698
--- /dev/null
+++ b/net-print/cups/files/cupsd.init.d-r3
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+
+description="The Common Unix Printing System daemon"
+command="/usr/sbin/cupsd"
+command_args="-f -c /etc/cups/cupsd.conf -s /etc/cups/cups-files.conf"
+pidfile="/var/run/cupsd.pid"
+start_stop_daemon_args="-b -m --pidfile ${pidfile}"
+
+depend() {
+ use net
+ @neededservices@
+ before nfs
+ after logger
+}
+
+start_pre() {
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
+ checkpath -q -d -m 0755 -o root:lp /run/cups
+ checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
+}
diff --git a/net-print/cups/metadata.xml b/net-print/cups/metadata.xml
new file mode 100644
index 000000000000..50dcb809dbb0
--- /dev/null
+++ b/net-print/cups/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>printing@gentoo.org</email>
+ <name>Gentoo Printing Project</name>
+ </maintainer>
+ <use>
+ <flag name="lprng-compat">
+ Do not install lp... binaries so cups and lprng can coexist.
+ </flag>
+ <flag name="python">
+ Add support for the Python interpeter in the web server CGIs.
+ </flag>
+ <flag name="java">
+ Add support for the Java interpeter in the web server CGIs.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="github">apple/cups</remote-id>
+ </upstream>
+</pkgmetadata>