void-packages/srcpkgs/cups/template
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

102 lines
3.3 KiB
Bash

# Template file for 'cups'
pkgname=cups
version=2.3.3op2
revision=1
build_style=gnu-configure
make_install_args="BUILDROOT=${DESTDIR}"
hostmakedepends="automake $(vopt_if avahi avahi-libs-devel)
gnutls-devel perl pkg-config poppler-utils"
makedepends="acl-devel gnutls-devel libpaper-devel libpng-devel
libusb-devel pam-devel poppler-devel tiff-devel
$(vopt_if avahi avahi-libs-devel)
$(vopt_if gssapi 'mit-krb5-devel')"
depends="xdg-utils"
short_desc="Common Unix Printing System"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="https://github.com/OpenPrinting/cups"
distfiles="https://github.com/OpenPrinting/cups/releases/download/v${version}/cups-${version}-source.tar.gz"
checksum=deb3575bbe79c0ae963402787f265bfcf8d804a71fc2c94318a74efec86f96df
conf_files="/etc/pam.d/cups /etc/cups/*.conf /etc/xinetd.d/cups-lpd"
make_dirs="
/usr/lib/cups/driver 0755 root root
/var/log/cups 0750 root root
/var/cache/cups/rss 0750 cups lp
/var/spool/cups 0755 cups lp
/etc/cups/ssl 0700 cups lp"
build_options="avahi gssapi"
build_options_default="avahi"
system_accounts="cups"
system_groups=lpadmin
cups_pgroup=lp
cups_homedir=/var/spool/cups
pre_configure() {
aclocal -I config-scripts
autoconf -I config-scripts
}
do_configure() {
./configure ${configure_args} --sbindir=/usr/bin --libdir=/usr/lib \
--enable-acl --enable-dbus --enable-raw-printing \
--enable-threads --with-logdir=/var/log/cups \
--with-docdir=/usr/share/cups/doc --with-rundir=/run/cups \
--with-cups-user=cups --with-cups-group=lp --with-system-groups="lpadmin sys root" --enable-relro \
--enable-libpaper --enable-pam --enable-ssl \
--with-menudir=/usr/share/applications --with-xinetd=/etc/xinetd.d \
--with-optim="${CFLAGS}" --disable-systemd --disable-launchd \
--without-rcdir --without-java --without-perl --without-php \
--without-python \
$(vopt_enable avahi) $(vopt_enable gssapi)
}
post_install() {
# compress some driver files, adopted from Fedora
find ${DESTDIR}/usr/share/cups/model -name "*.ppd"|xargs gzip -n9f
# install some more configuration files that will get filled by cupsd
for f in printers classes client subscriptions; do
touch ${DESTDIR}/etc/cups/${f}.conf
done
# Remove files provided by cups-filters.
rm -f ${DESTDIR}/usr/share/cups/banners/*
rm -f ${DESTDIR}/usr/share/cups/data/testprint
# comment out all conversion rules which use any of the removed filters
perl -p -i -e 's:^(.*\s+bannertops\s*)$:#\1:' \
${DESTDIR}/usr/share/cups/mime/mime.convs
# remove unnecessary PageLogFormat entry
vsed -i -e 's:PageLogFormat:#PageLogFormat:' ${DESTDIR}/etc/cups/cupsd.conf*
# fix .desktop file
vsed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' \
${DESTDIR}/usr/share/applications/cups.desktop
vinstall ${FILESDIR}/cups.pam 644 etc/pam.d cups
vinstall ${FILESDIR}/client.conf 644 etc/cups client.conf
vsv cupsd
}
libcups_package() {
short_desc+=" - client runtime shared libraries"
conf_files="/etc/cups/client.conf"
pkg_install() {
vmove "usr/lib/*.so.*"
vmove etc/cups/client.conf
vmove usr/share/man/man5/client.conf.5
}
}
cups-devel_package() {
depends="zlib-devel libcups>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/bin/cups-config
vmove "usr/lib/*.so"
}
}