PREIN
/bin/sh
/usr/share/rpm-helper/add-group cups $1 lpadmin
PREUN
/bin/sh
# Let CUPS daemon not be automatically started at boot time any more
/usr/share/rpm-helper/del-service cups $1 cups
POSTIN
/bin/sh
# Make sure group ownerships are correct
chgrp -R sys /etc/cups /var/*/cups
# We can't enforce this. Bug #35993
for d in /opt/share/ppd /opt/lib/printdriver /usr/local/share/ppd /usr/local/lib/printdriver
do
[ ! -e $d ] && mkdir -p $d || :
done
# End of 28383
# Apply our udev rules:
/sbin/udevadm trigger --sysname-match="lp[0-9]*" --sysname-match="parport[0-9]*" --sysname-match="irlpt[0-9]*"
/sbin/udevadm trigger --subsystem-match="usb" --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01
# wait for the permissions need to be ready
/sbin/udevadm settle --timeout=15
# Deal with config migration due to CVE-2012-5519 (STR #4223)
IN=/etc/cups/cupsd.conf
OUT=/etc/cups/cups-files.conf
copiedany=no
for keyword in AccessLog CacheDir ConfigFilePerm \
DataDir DocumentRoot ErrorLog FatalErrors \
FileDevice FontPath Group LogFilePerm \
LPDConfigFile PageLog Printcap PrintcapFormat \
RemoteRoot RequestRoot ServerBin ServerCertificate \
ServerKey ServerRoot SMBConfigFile StateDir \
SystemGroup SystemGroupAuthKey TempDir User; do
if ! /bin/grep -iq ^$keyword "$IN"; then continue; fi
copy=yes
if /bin/grep -iq ^$keyword "$OUT"; then
if [ "`/bin/grep -i ^$keyword "$IN"`" == \
"`/bin/grep -i ^$keyword "$OUT"`" ]; then
copy=no
else
/bin/sed -i -e "s,^$keyword,#$keyword,i" "$OUT" || :
fi
fi
if [ "$copy" == "yes" ]; then
if [ "$copiedany" == "no" ]; then
(cat >> "$OUT" <<EOF
# Settings automatically moved from cupsd.conf by RPM package:
EOF
) || :
fi
(/bin/grep -i ^$keyword "$IN" >> "$OUT") || :
copiedany=yes
fi
/bin/sed -i -e "s,^$keyword,#$keyword,i" "$IN" || :
done
# Let CUPS daemon be automatically started at boot time
/usr/share/rpm-helper/add-service cups $1 cups
POSTUN
/bin/sh
/usr/share/rpm-helper/del-group cups $1 lpadmin