recipes: printing/cups-filters: Added daemon handling for cups-browsed(8)
[dragora.git] / recipes / printing / cups-filters / recipe
blobdfef92ab9f7ff99a06fe4d2d15644a94e6fe951d
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
18 set -e
20 program=cups-filters
21 version=1.28.16
22 release=2
24 # Define a category for the output of the package name
25 pkgcategory=printing
27 tarname=${program}-${version}.tar.bz2
29 # Remote source(s)
30 fetch=https://www.openprinting.org/download/cups-filters/$tarname
32 homepage=https://www.openprinting.org
34 description="
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.
46 license=Custom
48 # Source documentation
49 docs="AUTHORS COPYING ChangeLog NEWS README"
50 docsdir="${docdir}/${program}-${version}"
52 build()
54     unpack "${tardir}/$tarname"
56     cd "$srcdir"
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" \
63      $configure_args \
64      --libdir=/usr/lib${libSuffix} \
65      --mandir=$mandir \
66      --docdir=$docsdir \
67      --enable-static=no \
68      --enable-shared=yes \
69      --disable-avahi \
70      --disable-mutool \
71      --with-browseremoteprotocols=cups \
72      --with-test-font-path=/usr/share/fonts/X11/TTF/DejaVuSans.ttf \
73      --without-php \
74      --without-rcdir \
75      --build="$(gcc -dumpmachine)"
77     make -j${jobs} V=1
78     make -j${jobs} check
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"
101     then
102         (
103             cd "${destdir}/$mandir"
104             find . -type f -exec lzip -9 {} +
105             find . -type l | while read -r file
106             do
107                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
108                 rm -- "$file"
109             done
110         )
111     fi
113     # Copy documentation
114     mkdir -p "${destdir}/$docsdir"
115     cp -p $docs "${destdir}/$docsdir"