archrelease: copy trunk to extra-x86_64
[arch-packages.git] / cups-filters / repos / extra-x86_64 / PKGBUILD
bloba8141fa709ccff59ebf24645eaebc5fa8a44a654
1 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
3 pkgname=cups-filters
4 pkgver=1.28.17
5 pkgrel=3
6 pkgdesc="OpenPrinting CUPS Filters"
7 arch=('x86_64')
8 url="https://wiki.linuxfoundation.org/openprinting/cups-filters"
9 license=('custom')
10 depends=('lcms2' 'poppler' 'qpdf' 'ijs' 'libcups>=2.2.6-2' 'systemd' 'libexif')
11 makedepends=('ghostscript' 'python' 'mupdf-tools' 'liblouis')
12 checkdepends=('ttf-dejavu') # ttf-dejavu for make check
13 optdepends=('ghostscript: for non-PostScript printers to print with CUPS to convert PostScript to raster images'
14             'foomatic-db: drivers use Ghostscript to convert PostScript to a printable form directly'
15             'foomatic-db-engine: drivers use Ghostscript to convert PostScript to a printable form directly'
16             'foomatic-db-nonfree: drivers use Ghostscript to convert PostScript to a printable form directly'
17             'imagemagick: for Braille embosser support'
18             'liblouis: for Braille embosser support'
19             'antiword: to convert MS Word documents for Braille embosser support'
20             'docx2txt: to convert Microsoft OOXML text from DOCX files for Braille embosser support')
21 backup=(etc/cups/cups-browsed.conf)
22 source=(#https://www.openprinting.org/download/cups-filters/$pkgname-$pkgver.tar.xz
23         https://github.com/OpenPrinting/cups-filters/releases/download/$pkgver/$pkgname-$pkgver.tar.xz
24         cups-filters-CVE-2023-24805.patch::https://github.com/OpenPrinting/cups-filters/commit/93e60d3df358c0ae6f3dba79e1c9684657683d89.patch)
25 sha256sums=('270a3752a960368aa99d431fb5d34f4039b2ac943c576d840612d1d8185c9bb9'
26             'c79f9bb558ce02117c09c461d760844d5de79e7f753a48971bb5f9aed1a9f913')
28 prepare() {
29   cd "$pkgname"-$pkgver
30   patch -Np1 < ../cups-filters-CVE-2023-24805.patch
33 build() {
34   # qpdf 11.3.0 buildfix - https://github.com/OpenPrinting/cups-filters/issues/512
35   CXXFLAGS+=" -std=c++17"
37   cd "$pkgname"-$pkgver
38   ./configure --prefix=/usr  \
39     --sysconfdir=/etc \
40     --sbindir=/usr/bin \
41     --localstatedir=/var \
42     --with-rcdir=no \
43     --enable-avahi \
44     --with-browseremoteprotocols=DNSSD,CUPS \
45     --with-test-font-path=/usr/share/fonts/TTF/DejaVuSans.ttf
46   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
47   make
50 check() {
51   cd "$pkgname"-$pkgver
52   make check
55 package() {
56   cd "$pkgname"-$pkgver
57   make DESTDIR="$pkgdir/" install
58   
59   # add upstream systemd support file
60   install -Dm644 utils/cups-browsed.service "${pkgdir}"/usr/lib/systemd/system/cups-browsed.service
61   sed -i "s|/usr/sbin/cups-browsed|/usr/bin/cups-browsed|" "${pkgdir}"/usr/lib/systemd/system/cups-browsed.service
62   #sed -i "s|cups.service|org.cups.cupsd.service|g" "${pkgdir}"/usr/lib/systemd/system/cups-browsed.service
63   
64   # use cups group from cups pkg FS#56818
65   chgrp -R 209 "${pkgdir}"/etc/cups
67   # license
68   mkdir -p "${pkgdir}"/usr/share/licenses/${pkgname}
69   install -m644 "${srcdir}"/${pkgname}-${pkgver}/COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/