summaryrefslogtreecommitdiffstats
path: root/source/ap/cups
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/cups')
-rwxr-xr-xsource/ap/cups/cups.SlackBuild19
-rw-r--r--source/ap/cups/doinst.sh3
2 files changed, 21 insertions, 1 deletions
diff --git a/source/ap/cups/cups.SlackBuild b/source/ap/cups/cups.SlackBuild
index de09891b0..60ff31fce 100755
--- a/source/ap/cups/cups.SlackBuild
+++ b/source/ap/cups/cups.SlackBuild
@@ -81,6 +81,15 @@ cd cups-$VERSION || exit 1
sed -i.orig -e 's#$exec_prefix/lib/cups#$libdir/cups#g' configure
+# Choose correct options depending on whether PAM is installed:
+if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
+ PAM_OPTIONS="--enable-pam"
+ unset SHADOW_OPTIONS
+else
+ unset PAM_OPTIONS
+ SHADOW_OPTIONS="--disable-pam"
+fi
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@@ -89,7 +98,8 @@ CXXFLAGS="$SLKCFLAGS" \
--enable-gnutls=yes \
--enable-cdsassl=no \
--docdir=/usr/doc \
- --disable-pam \
+ $PAM_OPTIONS \
+ $SHADOW_OPTIONS \
--disable-avahi \
--disable-dnssd \
--build=$ARCH-slackware-linux || exit 1
@@ -97,6 +107,13 @@ CXXFLAGS="$SLKCFLAGS" \
make $NUMJOBS || exit 1
make BUILDROOT=$PKG install || exit 1
+if [ ! -z "$PAM_OPTIONS" ]; then
+ # Allow pam config files to be edited by root:
+ chmod 644 $PKG/etc/pam.d/*
+ # Make PAM file .new:
+ mv $PKG/etc/pam.d/cups $PKG/etc/pam.d/cups.new
+fi
+
# Blacklist the usblp module just to make sure that it doesn't cause
# any problems:
mkdir -p $PKG/lib/modprobe.d
diff --git a/source/ap/cups/doinst.sh b/source/ap/cups/doinst.sh
index 6807cc3ac..d0349bca7 100644
--- a/source/ap/cups/doinst.sh
+++ b/source/ap/cups/doinst.sh
@@ -13,6 +13,9 @@ for file in etc/cups/*.new ; do
config $file
done
config etc/dbus-1/system.d/cups.conf.new
+if [ -r etc/pam.d/cups.new ]; then
+ config etc/pam.d/cups.new
+fi
# This file will just have to go. It appeared for a while during a -current
# devel period and has never been part of a stable release.