pkgname: cups pkgver: '2.4.19' pkgrel: '2' pkgdesc: 'The Common Unix Printing System (CUPS) is a print spooler and associated utilities' url: 'https://www.cups.org' arch: x86_64 depends: - 'xdg-utils' - 'gtk-update-icon-cache' makedepends: - pam - libusb - avahi - python - gnutls - libxcrypt source: - 'https://github.com/OpenPrinting/cups/releases/download/v${pkgver}/${pkgname}-${pkgver}-source.tar.gz' - '99-printer.rules' sha256sums: - SKIP - SKIP hooks: 'post-install': | name=cups version=2.4.19 release=2 INFO="\033[1;36m" NORMAL="\033[0;39m" systemctl enable cups if [ ! -f /etc/cups/client.conf ]; then echo "ServerName /run/cups/cups.sock" > /etc/cups/client.conf printf "${INFO} /etc/cups/client.conf created ${NORMAL}\n" printf "${INFO} Double check /etc/cups/client.conf and adapted to your needs ${NORMAL}\n" fi systemctl enable cups 'pre-install': | name=cups version=2.4.19 release=2 INFO="\033[1;36m" NORMAL="\033[0;39m" SN="lpadmin" IDN="19" if ! (getent group $SN > /dev/null); then printf "${INFO}Creating $SN group${NORMAL}\n" groupadd -g $IDN $SN fi UN="lp" IDN="9" if ! (getent group $UN > /dev/null); then printf "${INFO}Creating $UN group${NORMAL}\n" groupadd -g $IDN $UN fi if ! (getent passwd $UN > /dev/null); then printf "${INFO}Creating $UN user${NORMAL}\n" useradd -c "Print Service User" -d /var/spool/cups \ -u $IDN -g $UN -s /bin/false $UN fi build: | SN="lpadmin" IDN="19" UN="lp" if ! (getent group $SN > /dev/null); then groupadd -g $IDN $SN fi UN="lp" IDN="9" if ! (getent passwd $UN > /dev/null); then useradd -c "Printer Service User" -d /var/spool/cups \ -u $IDN -g $SN -s /bin/false $UN fi cd ${pkgname}-${pkgver} sed -i '/stat.h/a #include ' tools/ipptool.c CC=gcc CXX=g++ \ ./configure --libdir=/usr/lib \ --sbindir=/usr/bin \ --with-rundir=/run/cups \ --with-rcdir=/tmp/cupsinit \ --with-system-groups=lpadmin \ --with-docdir=/usr/share/cups/doc \ --disable-libusb make make BUILDROOT=${PKGDIR} install rm -rf ${PKGDIR}/tmp mkdir -p ${PKGDIR}/usr/share/doc ln -svnf ../cups/doc ${PKGDIR}/usr/share/doc/cups # Lanceur if [ ! -f ${PKGDIR}/usr/share/applications/cups.desktop ]; then mkdir -p ${PKGDIR}/usr/share/applications install -m644 desktop/cups.desktop \ ${PKGDIR}/usr/share/applications/cups.desktop fi # Supprimer les filtres faisant parti de cups-filters rm -rf ${PKGDIR}/usr/share/cups/banners rm -rf ${PKGDIR}/usr/share/cups/data/testprint chmod 755 ${PKGDIR}/etc # PAM cat > ${PKGDIR}/etc/pam.d/cups << "EOF" # Begin /etc/pam.d/cups auth include system-auth account include system-account session include system-session # End /etc/pam.d/cups EOF mkdir -p ${PKGDIR}/etc/udev/rules.d install -m644 ../99-printer.rules ${PKGDIR}/etc/udev/rules.d/99-printer.rules package: | true