1 # Build recipe for cups-filters.
3 # Copyright (c) 2022 Matias Fonzo, <selk@dragora.rog>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.bz2
30 fetch=https://www.openprinting.org/download/cups-filters/$tarname
32 homepage=https://www.openprinting.org
35 Backends, filters, and other software for CUPS.
37 This package contains backends, filters, and other software that
38 was once part of the core CUPS distribution but is no longer
39 maintained by Apple Inc. In addition it contains additional
40 filters and software developed independently of Apple, especially
41 filters for the PDF-centric printing workflow introduced by
42 OpenPrinting and a daemon to browse broadcasts of remote CUPS
43 printers and IPP printers to make them available locally.
48 # Source documentation
49 docs="AUTHORS COPYING ChangeLog NEWS README"
50 docsdir="${docdir}/${program}-${version}"
54 unpack "${tardir}/$tarname"
58 # Set sane permissions
59 chmod -R u+w,go-w,a+rX-s .
61 ./configure CPPFLAGS="$QICPPFLAGS" \
62 CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
64 --libdir=/usr/lib${libSuffix} \
71 --with-browseremoteprotocols=cups \
72 --with-test-font-path=/usr/share/fonts/X11/TTF/DejaVuSans.ttf \
75 --build="$(gcc -dumpmachine)"
79 make -j${jobs} DESTDIR="$destdir" install
81 # Install CUPS-BROWSED perp service
83 mkdir -p "${destdir}/etc/perp/cups-browsed"
85 cp -p "${worktree}/archive/cups-filters/rc.log" \
86 "${worktree}/archive/cups-filters/rc.main" \
87 "${destdir}/etc/perp/cups-browsed/"
89 chmod 755 "${destdir}"/etc/perp/cups-browsed/rc.*
91 # Do not enable cups-browsed by default
92 chmod -t "${destdir}/etc/perp/cups-browsed"
94 # To handle (dot) .new files via graft(1)
96 touch "${destdir}/etc/perp/cups-browsed/.graft-config" \
97 "${destdir}/etc/cups/.graft-config"
99 # Compress and link man pages (if needed)
100 if test -d "${destdir}/$mandir"
103 cd "${destdir}/$mandir"
104 find . -type f -exec lzip -9 {} +
105 find . -type l | while read -r file
107 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
114 mkdir -p "${destdir}/$docsdir"
115 cp -p $docs "${destdir}/$docsdir"