浏览代码

add pam entry management

Ralf S. Engelschall 24 年之前
父节点
当前提交
6b5c8402e8
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      pureftpd/pureftpd.spec

+ 16 - 0
pureftpd/pureftpd.spec

@@ -107,3 +107,19 @@ AutoReqProv:  no
 %clean
     rm -rf $RPM_BUILD_ROOT
 
+%post
+%if "%{with_pam}" == "yes"
+    #   add PAM configuration entry
+    if [ $1 -eq 1 ]; then
+        $RPM_INSTALL_PREFIX/sbin/pamtool -a -s -n "pureftpd"
+    fi
+%endif
+
+%preun
+%if "%{with_pam}" == "yes"
+    #   remove PAM configuration entry
+    if [ $1 -eq 0 ]; then
+        $RPM_INSTALL_PREFIX/sbin/pamtool -r -s -n "pureftpd"
+    fi
+%endif
+