[arch-commits] Commit in cups/trunk (PKGBUILD cups.install cups.sysusers)

Andreas Radke andyrtr at archlinux.org
Thu Jan 18 16:21:45 UTC 2018


    Date: Thursday, January 18, 2018 @ 16:21:44
  Author: andyrtr
Revision: 315085

upgpkg: cups 2.2.6-2

use cups user/group - FS#36769

Added:
  cups/trunk/cups.sysusers
Modified:
  cups/trunk/PKGBUILD
  cups/trunk/cups.install

---------------+
 PKGBUILD      |   18 +++++++++++++-----
 cups.install  |    8 ++++++++
 cups.sysusers |    2 ++
 3 files changed, 23 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-01-18 16:04:55 UTC (rev 315084)
+++ PKGBUILD	2018-01-18 16:21:44 UTC (rev 315085)
@@ -4,7 +4,7 @@
 pkgbase="cups"
 pkgname=('libcups' 'cups')
 pkgver=2.2.6
-pkgrel=1
+pkgrel=2
 arch=('x86_64')
 license=('GPL')
 url="https://www.cups.org/"
@@ -13,6 +13,7 @@
              'avahi'  'hicolor-icon-theme' 'systemd' 'inetutils' 'libpaper' 'valgrind')
 source=(https://github.com/apple/cups/releases/download/v${pkgver}/cups-${pkgver}-source.tar.gz{,.sig}
         cups.logrotate cups.pam
+        cups.sysusers
         # improve build and linking
         cups-no-export-ssllibs.patch
         cups-no-gzip-man.patch
@@ -23,6 +24,7 @@
             'SKIP'
             'd87fa0f0b5ec677aae34668f260333db17ce303aa1a752cba5f8e72623d9acf9'
             '57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5'
+            '06173dfaea37bdd9b39b3e09aba98c34ae7112a2f521db45a688907d8848caa2'
             'ff3eb0782af0405f5dafe89e04b1b4ea7a49afc5496860d724343bd04f375832'
             'b8fc2e3bc603495f0278410350ea8f0161d9d83719feb64f573b63430cb4800b'
             '23349c96f2f7aeb7d48e3bcd35a969f5d5ac8f55a032b0cfaa0a03d7e37ea9af'
@@ -57,6 +59,8 @@
 
 build() {
   cd ${pkgbase}-${pkgver}
+
+  # use fixed cups user (id 209) since systemd adds "lp" group without a fixed id
   ./configure --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var \
@@ -65,8 +69,8 @@
      --with-logdir=/var/log/cups \
      --with-docdir=/usr/share/cups/doc \
      --with-exe-file-perm=0755 \
-     --with-cups-user=daemon \
-     --with-cups-group=lp \
+     --with-cups-user=209 \
+     --with-cups-group=209 \
      --enable-pam=yes \
      --enable-raw-printing \
      --enable-dbus --with-dbusdir=/etc/dbus-1 \
@@ -128,8 +132,12 @@
   chmod 755 ${pkgdir}/var/spool
   chmod 755 ${pkgdir}/etc
 
+   # use cups group FS#36769
+   install -Dm644 "$srcdir"/cups.sysusers "${pkgdir}/usr/lib/sysusers.d/$pkgname.conf"
+ 
+
   # install ssl directory where to store the certs, solves some samba issues
-  install -dm700 -g lp ${pkgdir}/etc/cups/ssl
+  install -dm700 -g 209 ${pkgdir}/etc/cups/ssl
   # remove directory from package, it will be recreated at each server start
   rm -rf ${pkgdir}/run
 
@@ -137,7 +145,7 @@
   touch ${pkgdir}/etc/cups/printers.conf
   touch ${pkgdir}/etc/cups/classes.conf
   touch ${pkgdir}/etc/cups/subscriptions.conf 
-  chgrp -R lp ${pkgdir}/etc/cups
+  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

Modified: cups.install
===================================================================
--- cups.install	2018-01-18 16:04:55 UTC (rev 315084)
+++ cups.install	2018-01-18 16:21:44 UTC (rev 315085)
@@ -4,3 +4,11 @@
  echo ">> This is because the first request triggers the generation of the CUPS"
  echo ">> SSL certificates which can be a very time-consuming job."
 }
+
+post_upgrade() {
+  # FS#56818 - make sure we change the ownership to the new cups group
+  if [[ $(vercmp 2.2.6-2 $2) = 1 ]]; then
+    chgrp -R 209 /etc/cups
+  fi
+}
+

Added: cups.sysusers
===================================================================
--- cups.sysusers	                        (rev 0)
+++ cups.sysusers	2018-01-18 16:21:44 UTC (rev 315085)
@@ -0,0 +1,2 @@
+u cups 209 "cups helper user"
+m cups lp



More information about the arch-commits mailing list