diff --git a/net/print/cups/cups.groups b/net/print/cups/cups.groups new file mode 100644 index 00000000..22f6a509 --- /dev/null +++ b/net/print/cups/cups.groups @@ -0,0 +1,3 @@ +lp:x:7:lp +lpadmin:x:118:lp + diff --git a/net/print/cups/cups.initd b/net/print/cups/cups.initd new file mode 100644 index 00000000..ff099878 --- /dev/null +++ b/net/print/cups/cups.initd @@ -0,0 +1,44 @@ +#!/sbin/openrc-run + +name="CUPS" + +extra_commands="checkconfig" +extra_started_commands="reload" + +description_checkconfig="Test the configuration file" +description_reload="Reload" + +: ${cfgfile:="/etc/cups/cupsd.conf"} + +command="/usr/sbin/cupsd" +command_args="-f -c $cfgfile" +command_background="yes" + +pidfile="/run/cups/$RC_SVCNAME.pid" + +depend() { + use net + before nfs + need dbus + after logger +} + +checkconfig() { + $command $command_args -t >/dev/null 2>&1 \ + || $command $command_args -t +} + +start_pre() { + checkconfig || return 1 + + checkpath -q -d -m 0775 -o root:lp /var/cache/cups + checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss + checkpath -q -d -m 0755 -o root:lp /run/cups + checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs +} + +reload() { + ebegin "Reloading $name" + start-stop-daemon --signal HUP --pidfile "$pidfile" + eend $? +} diff --git a/net/print/cups/cups.users b/net/print/cups/cups.users new file mode 100644 index 00000000..06ef3c17 --- /dev/null +++ b/net/print/cups/cups.users @@ -0,0 +1,2 @@ +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin + diff --git a/net/print/cups/ympbuild b/net/print/cups/ympbuild index 170564d5..0122e9a7 100644 --- a/net/print/cups/ympbuild +++ b/net/print/cups/ympbuild @@ -7,10 +7,16 @@ description='The Common Unix Printing System ' email='bk@gmail.com' maintainer='bk' license=('GPLv3') -source=("https://github.com/OpenPrinting/cups/archive/refs/tags/v$version.tar.gz") -depends=() +source=("https://github.com/OpenPrinting/cups/archive/refs/tags/v$version.tar.gz" + 'cups.groups' + 'cups.users' + 'cups.initd') +depends=(openssl) makedepends=() -md5sums=('2dc62207ba89ef43ba376e0066cad138') +md5sums=('2dc62207ba89ef43ba376e0066cad138' + 'SKIP' + 'SKIP' + 'SKIP') group=(net.print) uses=() arch=('x86_64') @@ -28,5 +34,9 @@ build(){ package(){ make install $jobs + mkdir -p "$DESTDIR"/etc/{passwd,group,init}.d + install ../cups.initd "$DESTDIR"/etc/init.d/cupsd + install ../cups.groups "$DESTDIR"/etc/group.d/cups + install ../cups.users "$DESTDIR"/etc/passwd.d/cups }