PREIN
/bin/sh
# Make sure that on installs or updates if libdir/pkcs11/methods and
# libdir/pkcs11/stdll # are directories they are removed prior to installation
# as rpm can't handle the transition from directories to symlinks without
# problems.
[ -d '/usr/lib/pkcs11/methods' ] && rm -rf /usr/lib/pkcs11/methods
[ -d '/usr/lib/pkcs11/stdll' ] && rm -rf /usr/lib/pkcs11/stdll
/usr/sbin/groupadd -r pkcs11 2>/dev/null || true
/usr/sbin/usermod -G $(/usr/bin/id --groups --name root | /bin/sed -e '
# add the pkcs group if it is missing
/(^| )pkcs11( |$)/!s/$/ pkcs11/
# replace spaces by commas
y/ /,/
'),pkcs11 root