Files
BMLFS/build-scripts/cups.build
2023-09-12 13:33:25 -05:00

90 lines
3.7 KiB
Bash

#! /bin/bash
# CUPS
# Source: https://github.com/OpenPrinting/cups/releases/download/v2.4.6/cups-2.4.6-source.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: GnuTLS, cups-filters(post-install)
# Recommended: Colord, dbus, libusb, Linux-PAM, xdg-utils
# Optional: Avahi, libpaper, MIIT Kerberos, OpenJDK, PHP, Python2
# Optional: Gutenprint(post-install)
patch -Np1 -i ../patches/cups-chimera/cups-tlslibs-no-export.patch
sudo -S useradd -c "Print Service User" -d /var/spool/cups -g lp -s /bin/false -u 9 lp &&
sudo -S groupadd -g 19 lpadmin &&
#sed -i '/stat.h/a #include <asm-generic/ioctls.h>' tools/ipptool.c &&
CC=gcc CXX=g++ \
./configure --libdir=/usr/lib \
--without-systemd \
--with-rcdir=/tmp/cupsinit \
--with-system-groups=lpadmin \
--with-rundir=/run/cups \
--with-docdir=/usr/share/cups/doc-2.4.6 $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S rm -rf /tmp/cupsinit &&
sudo -S mkdir -pv ${BUILD}/usr/share/doc &&
sudo -S ln -svnf ../cups/doc-2.4.6 ${BUILD}/usr/share/doc/cups-2.4.6 &&
echo "ServerName /run/cups/cups.sock" > /tmp/client.conf &&
sudo -S mkdir -pv ${BUILD}/etc/cups &&
sudo -S mv -v /tmp/client.conf ${BUILD}/etc/cups/client.conf &&
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr/share
sudo -S mv $BUILD/usr/share/doc /BMAN/usr/share/
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
cups: CUPS (Common UNIX Printing System)
cups:
cups: The Common UNIX Printing System provides a portable printing layer for
cups: UNIX(R)-like operating systems. It has been developed by Easy Software
cups: Products to promote a standard printing solution for all UNIX vendors
cups: and users. CUPS uses the Internet Printing Protocol ("IPP") as the
cups: basis for managing print jobs and queues. The CUPS package includes
cups: System V and Berkeley command-line interfaces, a PostScript RIP
cups: package for supporting non-PostScript printer drivers, and tools for
cups: creating additional printer drivers and other CUPS services.
cups:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S rm -rvf usr/share/cups/banners/* \
usr/share/cups/data/testprint &&
sudo -S makepkg -l y -c n $PKGS/cups-2.4.6-$PSUFFIX &&
cp -v install/doinst.sh /tmp/ &&
cat >> /tmp/doinst.sh << "EOF"
useradd -c "Print Service User" -d /var/spool/cups -g lp -s /bin/false -u 9 lp
groupadd -g 19 lpadmin
EOF
sudo -S mv -v /tmp/doinst.sh install/ &&
sudo -S makepkg -l y -c n $PKGS/cups-2.4.2-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
cups-doc: Manuals for CUPS (Common UNIX Printing System)
cups-doc:
cups-doc: The Common Unix Printing System (CUPS) is a print spooler
cups-doc: and associated utilities. It is based on the "Internet
cups-doc: Printing Protocol" and provides printing services to most
cups-doc: PostScript and raster printers
cups-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/cups-doc-2.4.6-$NOPUSFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*