Browse Source

convert to the new PAM world order

Ralf S. Engelschall 24 years ago
parent
commit
4f2f121923
1 changed files with 28 additions and 15 deletions
  1. 28 15
      qpopper/qpopper.spec

+ 28 - 15
qpopper/qpopper.spec

@@ -23,6 +23,11 @@
 ##  SUCH DAMAGE. 
 ##  
 
+#   package options
+%ifndef       with_pam
+%define       with_pam  no
+%endif
+
 #   package information
 Name:         qpopper
 Summary:      POP3 Daemon
@@ -33,7 +38,7 @@ Distribution: OpenPKG [REL]
 Group:        Mail
 License:      GPL
 Version:      4.0.4
-Release:      20020413
+Release:      20020425
 
 #   list of sources
 Source0:      ftp://ftp.qualcomm.com/eudora/servers/unix/popper/qpopper%{version}.tar.gz
@@ -46,15 +51,21 @@ Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20020206, MTA, openssl
 PreReq:       OpenPKG, openpkg >= 20020206, MTA, openssl
+%if "%{with_pam}" == "yes"
+BuildPreReq:  PAM
+PreReq:       PAM
+%endif
 AutoReq:      no
 AutoReqProv:  no
 Provides:     POP
 
 %description
-    Qualcom Popper is a POP3 Daemon.
+    Qualcom Popper is a full-featured POP3 daemon.
+
+    Options: with_pam=%{with_pam}
 
 %prep
-    %setup0 -q -c -a 0
+    %setup0 -q -c 
     %setup1 -q -T -D -a 1
     cd qpopper%{version}
     %patch0 -p0
@@ -74,6 +85,10 @@ Provides:     POP
     ( cd qpopper%{version}
       CC="%{l_cc}" \
       CFLAGS="%{l_cflags -O}" \
+%if "%{with_pam}" == "yes"
+      CPPFLAGS="-I`%{l_prefix}/etc/rc --query pam_incdir`" \
+      LDFLAGS="-L`%{l_prefix}/etc/rc --query pam_libdir`" \
+%endif
       OS_DEFS="-DPIDFILE=\\\"%{l_prefix}/var/qpopper/qpopper.pid\\\"" \
       LIBS="-L$fakesyslogdir -lfakesyslog" \
       ./configure \
@@ -83,7 +98,9 @@ Provides:     POP
           --enable-servermode \
           --enable-standalone \
           --enable-log-login \
+%if "%{with_pam}" == "yes"
           --with-pam=qpopper \
+%endif
           --enable-home-dir-mail=.mail/inbox \
           --with-log-facility=LOG_MAIL \
           --enable-nonauth-file=%{l_prefix}/etc/qpopper/users.deny \
@@ -134,22 +151,18 @@ Provides:     POP
     rm -rf $RPM_BUILD_ROOT
 
 %post
+%if "%{with_pam}" == "yes"
     #   add PAM configuration entry
-    if [ -f /etc/pam.conf ]; then
-        ( case "%{l_target}" in
-              *-freebsd* ) echo "qpopper auth required pam_unix.so try_first_pass"                   ;;
-              *-linux*   ) echo "qpopper auth required /lib/security/pam_unix.so shadow nodelay"     ;;
-              *-solaris* ) echo "qpopper auth required /usr/lib/security/pam_unix.so try_first_pass" ;;
-          esac
-        ) |\
-        $RPM_INSTALL_PREFIX/sbin/rpmtool config \
-            -a -s -i "$RPM_INSTALL_PREFIX:qpopper" /etc/pam.conf
+    if [ $1 -eq 1 ]; then
+        $RPM_INSTALL_PREFIX/sbin/pamtool -a -s -n "qpopper"
     fi
+%endif
 
 %preun
+%if "%{with_pam}" == "yes"
     #   remove PAM configuration entry
-    if [ -f /etc/pam.conf ]; then
-        $RPM_INSTALL_PREFIX/sbin/rpmtool config \
-            -r -s -i "$RPM_INSTALL_PREFIX:qpopper" /etc/pam.conf
+    if [ $1 -eq 0 ]; then
+        $RPM_INSTALL_PREFIX/sbin/pamtool -r -s -n "qpopper"
     fi
+%endif