summaryrefslogtreecommitdiffstats
path: root/source/ap/cups/cups.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/cups/cups.SlackBuild')
-rwxr-xr-xsource/ap/cups/cups.SlackBuild19
1 files changed, 18 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