Compare commits

...
15 Commits
8 changed files with 105 additions and 35 deletions
+3
View File
@@ -0,0 +1,3 @@
# Ignore BPM archives and signatures
*.bpm
*.bpm.sig
+1 -1
View File
@@ -4,7 +4,7 @@
REPO="OpenPrinting/cups"
# Get tag name using Github Rest API
TAG_NAME=$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name')
TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name')
# Trim 'v' character in TAG_NAME variable
VERSION=$(echo "$TAG_NAME" | tr -d 'v')
+60
View File
@@ -0,0 +1,60 @@
name: cups
description: An open-source printing system
version: 2.4.19
revision: 3
url: https://openprinting.github.io/cups/
license: Apache2 with LLVM-exception and BSD-3-Clause and Zlib and BSD-2-Clause
maintainers:
- [email protected]
architecture: any
type: source
make_depends:
- acl
- avahi
- cups-filters
- dbus
- gnutls
- libpaper
- libusb
- pam
- udev
downloads:
- url: https://github.com/OpenPrinting/cups/releases/download/v${BPM_PKG_VERSION}/cups-${BPM_PKG_VERSION}-source.tar.gz
extract_to: ${BPM_SOURCE}
extract_strip_components: 1
checksum: 820984b12a67f98705785aae2dd1347fe0ac097828001d4583ff64574aed6389
split_packages:
- name: cups
keep:
- etc/cups/client.conf
- etc/cups/cupsd.conf
- etc/cups/snmp.conf
- etc/cups/printers.conf
- etc/cups/classes.conf
- etc/cups/cups-files.conf
- etc/cups/subscriptions.conf
depends:
- acl
- avahi
- cups-filters
- dbus
- gcc-libs
- glibc
- gnutls
- hicolor-icon-theme
- libcups
- libpaper
- sysusers
- pam
- udev
optional_depends:
- cups-browsed
- libusb
- xdg-utils
- name: libcups
description: Library and header files for the CUPS printing system
depends:
- avahi
- glibc
- gnutls
- zlib
-16
View File
@@ -1,16 +0,0 @@
name: cups
description: An open-source printing system
version: 2.4.12
url: https://openprinting.github.io/cups/
license: Apache2 with LLVM-exception and BSD-3-Clause and Zlib and BSD-2-Clause
architecture: any
optional_depends: ["libusb","xdg-utils"]
make_depends: ["acl","dbus","gnutls","libusb","pam","udev"]
keep: ["etc/cups/client.conf"]
type: source
split_packages:
- name: cups
depends: ["acl", "dbus", "gcc-libs", "glibc", "gnutls", "hicolor-icon-theme", "libcups", "sysusers", "pam", "udev"]
- name: libcups
description: Library and header files for the CUPS printing system
depends: ["glibc","gnutls","zlib"]
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
# Exit if directory does not exist
[ -d /etc/cups ] || exit 0
# Fix ownership of files in /etc/cups
[ `stat -c '%g' /etc/cups` != 209 ] && chown -R 0:209 /etc/cups
# Ensure script exits cleanly
exit 0
+26 -17
View File
@@ -1,23 +1,23 @@
# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
DOWNLOAD="https://github.com/OpenPrinting/cups/releases/download/v${BPM_PKG_VERSION}/cups-${BPM_PKG_VERSION}-source.tar.gz"
FILENAME="${DOWNLOAD##*/}"
# The prepare function is executed in the root of the temp directory
# This function is used for downloading files and putting them into the correct location
prepare() {
wget "$DOWNLOAD"
tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE"
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
sed -i 's#@CUPS_HTMLVIEW@#xdg-open#' desktop/cups.desktop.in
./configure --libdir=/usr/lib --localstatedir=/var --disable-systemd --with-rundir=/run/cups
./configure --libdir=/usr/lib \
--localstatedir=/var \
--with-rundir=/run/cups \
--with-cups-user=209 \
--with-cups-group=209 \
--with-optim="$CFLAGS" \
--with-tls=gnutls \
--enable-pam \
--enable-raw-printing \
--enable-dbus=yes \
--enable-relro
make
}
@@ -26,19 +26,28 @@ build() {
package_cups() {
make DESTDIR="$BPM_OUTPUT" install-data install-exec
# Remove /run directory
rm -rf "$BPM_OUTPUT"/run
# Remove program that is installed by libcups
rm "$BPM_OUTPUT"/usr/bin/cups-config
# Remove SysV files
rm -rf "$BPM_OUTPUT"/etc/rd*.d
rm -rf "$BPM_OUTPUT"/etc/init.d
rm -r "$BPM_OUTPUT"/etc/rc.d
# Fix unknown directive error
sed -i 's/^IdleExitTimeout/#&/' "$BPM_OUTPUT"/etc/cups/cupsd.conf
# Create default cups client config
install -d "$BPM_OUTPUT"/etc/cups
echo "ServerName /run/cups/cups.sock" > "$BPM_OUTPUT"/etc/cups/client.conf
echo "ServerName /run/cups/cups.sock" | install -Dm644 -g 209 /dev/stdin "$BPM_OUTPUT"/etc/cups/client.conf
# Install sysusesrs
# Install sysusesrs and set user and group in config
install -Dm644 "$BPM_WORKDIR"/sysusers "$BPM_OUTPUT"/usr/lib/sysusers.d/cups.conf
sed -i "s/#User 209/User 209/" "$BPM_OUTPUT"/etc/cups/cups-files.conf{,.default}
sed -i "s/#Group 209/Group 209/" "$BPM_OUTPUT"/etc/cups/cups-files.conf{,.default}
# Install pam configuration file
install -Dm644 "$BPM_WORKDIR"/cups-pam "$BPM_OUTPUT"/etc/pam.d/cups
# Install ESVM service
install -Dm644 "$BPM_WORKDIR"/cupsd.esv "$BPM_OUTPUT"/etc/esvm/services/cupsd.esv
+3
View File
@@ -0,0 +1,3 @@
auth include system-auth
account include system-account
session include system-session
+2 -1
View File
@@ -1 +1,2 @@
u lp - "Print Service User" /var/spool/cups /bin/false
u cups 209 "Cups helper user" /var/spool/cups /bin/false
m cups lpadmin