Files
packages/extra/cups/build.sh
T
SFG545 2bb4d5187c Add TOML configuration files for various packages
- Introduced build configurations for graphene, gst-plugins-bad, gst-plugins-base, gstreamer, gtk4, iso-codes, jbig2dec, libepoxy, libsoup3, libtheora, libxpm, lynx, md4c, openjpeg2, poppler-data, python-attrs, python-automat, python-constantly, python-hyperlink, python-incremental, python-twisted, python-versioneer, python-zope-interface, qpdf, sdl12-compat, tinysparql, unixodbc, vmaf, xcb-util-cursor, xcb-util-image, xcb-util-renderutil, xcb-util-wm, xcb-util, xdg-utils.
- Each package includes build type, dependencies, runtime requirements, and source URLs.
- Added necessary post-install scripts and configurations where applicable.
2026-03-29 02:51:06 -05:00

122 lines
4.0 KiB
Bash
Executable File

#!/bin/sh
set -eu
makei() {
echo "==> Running: make DESTDIR=\"$pkgdir\" install $*"
make DESTDIR="$pkgdir" install "$@"
}
mesoni() {
echo "==> Running: meson install --destdir \"$pkgdir\" $*"
meson install --destdir "$pkgdir" "$@"
}
cmakei() {
echo "==> Running: cmake --install $*"
DESTDIR="$pkgdir" cmake --install "$@"
}
starmove() {
[ "$#" -ge 1 ] || {
echo "starmove: requires at least one path pattern" >&2
return 1
}
[ "${DEPOT_OUTPUT_NAME:-}" != "" ] || {
echo "starmove: DEPOT_OUTPUT_NAME is not set" >&2
return 1
}
haul "$DEPOT_OUTPUT_NAME" "$@"
}
depot_starbuild_sync_srcdir() {
workdir=${DEPOT_STARBUILD_WORKDIR:?}
compat_root="$workdir/.depot-starbuild"
mkdir -p "$compat_root/packages"
for entry in "$workdir"/* "$workdir"/.[!.]* "$workdir"/..?*; do
[ -e "$entry" ] || [ -L "$entry" ] || continue
base=$(basename "$entry")
[ "$base" = ".depot-starbuild" ] && continue
[ "$base" = "packages" ] && continue
ln -snf "$entry" "$compat_root/$base"
done
mkdir -p "$compat_root/packages/cups/"
ln -snf "${DEPOT_PRIMARY_DESTDIR:-$DESTDIR}" "$compat_root/packages/cups/files"
mkdir -p "$compat_root/packages/libcups/"
ln -snf "$(subdestdir 'libcups')" "$compat_root/packages/libcups/files"
srcdir="$compat_root"
export srcdir
}
depot_starbuild_setup_env() {
package_name=$1
package_version='2.4.14'
pkgdir=${DESTDIR:?}
export package_name package_version pkgdir
LANG=C
LC_ALL=C
export LANG LC_ALL
depot_starbuild_sync_srcdir
}
depot_build() {
depot_starbuild_setup_env 'cups'
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/bin \
--libdir=/usr/lib \
--with-logdir=/var/log/cups \
--with-docdir=/usr/share/cups/doc \
--with-exe-file-perm=0755 \
--with-cups-user=209 \
--with-cups-group=209 \
--with-max-log-size=0 \
--enable-pam=yes \
--enable-raw-printing \
--enable-dbus=yes \
--with-tls=gnutls \
--with-dbusdir=/usr/share/dbus-1 \
--enable-relro \
--enable-libpaper
make
}
depot_install() {
depot_starbuild_setup_env 'cups'
make BUILDROOT="${pkgdir}" install-data install-exec
rm -f "${pkgdir}"/usr/bin/cups-config
install -D -m644 ../cups.logrotate "${pkgdir}"/etc/logrotate.d/cups
install -D -m644 ../cups.pam "${pkgdir}"/etc/pam.d/cups
# fix perms on /var/spool and /etc
chmod 755 "${pkgdir}"/var/spool
chmod 755 "${pkgdir}"/etc
# remove directory from package, it will be recreated at each server start
rm -rf "${pkgdir}"/var/run
# install some more configuration files that will get filled by cupsd
touch "${pkgdir}"/etc/cups/printers.conf
touch "${pkgdir}"/etc/cups/classes.conf
touch "${pkgdir}"/etc/cups/subscriptions.conf
chgrp -R 209 "${pkgdir}"/etc/cups
# fix .desktop file
sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' "${pkgdir}"/usr/share/applications/cups.desktop
# compress some driver files, adopted from Fedora
find "${pkgdir}"/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f
# remove client.conf man page
rm -f "${pkgdir}"/usr/share/man/man5/client.conf.5
# comment out removed filters that are now part of cups-filters
perl -p -i -e 's:^(.*\s+bannertops\s*)$:#\1:' "$pkgdir"/usr/share/cups/mime/mime.convs
# comment out unnecessary PageLogFormat entry
sed -i -e 's:PageLogFormat:#PageLogFormat:' "$pkgdir"/etc/cups/cupsd.conf*
# no more xinetd support
rm -rf "${pkgdir}"/etc/xinetd.d
install -D -m 755 "$srcdir"/cupsd.initd $pkgdir/etc/init.d/cupsd
}
depot_install_libcups() {
depot_starbuild_setup_env 'libcups'
make BUILDROOT="${pkgdir}" install-headers install-libs
mkdir -p "${pkgdir}"/usr/bin
install -m755 "${srcdir}"/cups/cups-config "${pkgdir}"/usr/bin/cups-config
}