Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 814da7e76973aff3ca5dbf1320fb6af0 > scriptlet

cups-2.0.4-1.4.mga5.x86_64.rpm

PREIN

/bin/sh
# Fix /usr/lib/cups directory, so that updates can be done
if [ -d /usr/lib64/cups ] && ! [ -h /usr/lib64/cups ]; then
    if [ -h /usr/lib/cups ] || ! [ -e /usr/lib/cups ]; then
        rm -f /usr/lib/cups
        mv /usr/lib64/cups /usr/lib/cups
    else
        rm -rf /usr/lib64/cups.rpmsave
        mv /usr/lib64/cups /usr/lib64/cups.rpmsave
        #echo 'Moved /usr/lib64/cups to /usr/lib64/cups.rpmsave' 1>&2
    fi
fi
/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 

#_preun_service cups-lpd

POSTIN

/bin/sh
# (cg) Note: Not triggering the cups-lp.conf tmpfile here... should it be?
/usr/bin/systemd-tmpfiles --create cups.conf 

# Make sure group ownerships are correct
chgrp -R sys /etc/cups /var/*/cups

# ensure read permissions are present for others for PPDs
# seems they are removed sometimes on updates for some HP printers (mga#16971)
chmod -R o+r /etc/cups/ppd

# 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

# Previous migration script unnecessarily put PageLogFormat into cups-files.conf
# (see bug #1148995)
FILE=/etc/cups/cups-files.conf
for keyword in PageLogFormat; do
    /bin/sed -i -e "s,^$keyword,#$keyword,i" "$FILE" || :
done

# Let CUPS daemon be automatically started at boot time
/usr/share/rpm-helper/add-service cups $1 cups 

#_post_service cups-lpd

POSTUN

/bin/sh
/usr/share/rpm-helper/del-group cups $1 lpadmin 

#_postun_service cups-lpd