proftpd/proftpd.spec

Fri, 10 Aug 2012 14:12:46 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 10 Aug 2012 14:12:46 +0200
changeset 505
0838649dd325
parent 182
42a8c8d745e6
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

     1 ##
     2 ##  proftpd.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   package version
    25 %define       V_proftpd         1.3.2
    26 %define       V_mod_exec        0.9.6
    27 %define       V_mod_otp         0.9.1
    28 %define       V_mod_shaper      0.6.5
    29 %define       V_mod_sql_sqlite  0.2
    30 %define       V_mod_sql_odbc    0.3.2
    31 %define       V_mod_time        2.2.1
    32 %define       V_mod_vroot       0.8.5
    33 %define       V_mod_gss         1.3.2
    34 %define       V_mod_sftp        0.9.6
    35 %define       V_mod_sftp_sql    0.1
    36 %define       V_mod_md5         0.3.3
    38 #   package information
    39 Name:         proftpd
    40 Summary:      Professional FTP Daemon
    41 URL:          http://www.proftpd.org/
    42 Vendor:       The ProFTPD Project
    43 Packager:     OpenPKG Foundation e.V.
    44 Distribution: OpenPKG Community
    45 Class:        BASE
    46 Group:        FTP
    47 License:      GPL
    48 Version:      %{V_proftpd}
    49 Release:      20090418
    51 #   package options
    52 %option       with_ifsession  no
    53 %option       with_ctrls      no
    54 %option       with_radius     no
    55 %option       with_pam        no
    56 %option       with_mysql      no
    57 %option       with_pgsql      no
    58 %option       with_sqlite     no
    59 %option       with_odbc       no
    60 %option       with_ldap       no
    61 %option       with_skey       no
    62 %option       with_opie       no
    63 %option       with_kerberos   no
    64 %option       with_ssl        no
    65 %option       with_sftp       no
    66 %option       with_md5        no
    68 #   checking option conflicts
    69 %if "%{with_mysql}" == "yes" && "%{with_pgsql}" == "yes"
    70     %{error:build-time options 'with_mysql' and 'with_pgsql' conflict}
    71 %endif
    73 #   list of sources
    74 Source0:      ftp://ftp.proftpd.org/distrib/source/proftpd-%{V_proftpd}.tar.bz2
    75 Source1:      http://www.castaglia.net/proftpd/modules/proftpd-mod-exec-%{V_mod_exec}.tar.gz
    76 Source2:      http://www.castaglia.net/proftpd/modules/proftpd-mod-otp-%{V_mod_otp}.tar.gz
    77 Source3:      http://www.castaglia.net/proftpd/modules/proftpd-mod-shaper-%{V_mod_shaper}.tar.gz
    78 Source4:      http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-sqlite-%{V_mod_sql_sqlite}.tar.gz
    79 Source5:      http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-odbc-%{V_mod_sql_odbc}.tar.gz
    80 Source6:      http://www.castaglia.net/proftpd/modules/proftpd-mod-time-%{V_mod_time}.tar.gz
    81 Source7:      http://www.castaglia.net/proftpd/modules/proftpd-mod-vroot-%{V_mod_vroot}.tar.gz
    82 Source8:      http://switch.dl.sourceforge.net/gssmod/mod_gss-%{V_mod_gss}.tar.gz
    83 Source9:      http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-%{V_mod_sftp}.tar.gz
    84 Source10:     http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-sql-%{V_mod_sftp_sql}.tar.gz
    85 Source11:     http://www.castaglia.net/proftpd/modules/proftpd-mod-md5-%{V_mod_md5}.tar.gz
    86 Source12:     proftpd.conf
    87 Source13:     proftpd.msg.goaway
    88 Source14:     proftpd.msg.login
    89 Source15:     rc.proftpd
    90 Patch0:       proftpd.patch
    92 #   build information
    93 Prefix:       %{l_prefix}
    94 BuildRoot:    %{l_buildroot}
    95 BuildPreReq:  OpenPKG, openpkg >= 20060823, make
    96 PreReq:       OpenPKG, openpkg >= 20060823
    97 BuildPreReq:  ncurses, getopt
    98 PreReq:       ncurses, getopt
    99 %if "%{with_mysql}" == "yes"
   100 BuildPreReq:  mysql
   101 PreReq:       mysql
   102 %endif
   103 %if "%{with_pam}" == "yes"
   104 BuildPreReq:  PAM
   105 PreReq:       PAM
   106 %endif
   107 %if "%{with_pgsql}" == "yes"
   108 BuildPreReq:  postgresql, openssl
   109 PreReq:       postgresql, openssl
   110 %endif
   111 %if "%{with_sqlite}" == "yes"
   112 BuildPreReq:  sqlite
   113 PreReq:       sqlite
   114 %endif
   115 %if "%{with_odbc}" == "yes"
   116 BuildPreReq:  ODBC
   117 PreReq:       ODBC
   118 %endif
   119 %if "%{with_ldap}" == "yes"
   120 BuildPreReq:  openldap, openssl
   121 PreReq:       openldap, openssl
   122 %endif
   123 %if "%{with_skey}" == "yes"
   124 BuildPreReq:  skey
   125 PreReq:       skey
   126 %endif
   127 %if "%{with_opie}" == "yes"
   128 BuildPreReq:  opie
   129 PreReq:       opie
   130 %endif
   131 %if "%{with_kerberos}" == "yes"
   132 BuildPreReq:  KERBEROS
   133 PreReq:       KERBEROS
   134 %endif
   135 %if "%{with_ssl}" == "yes" || "%{with_sftp}" == "yes"
   136 BuildPreReq:  openssl
   137 PreReq:       openssl
   138 %endif
   139 AutoReq:      no
   140 AutoReqProv:  no
   142 %description
   143     ProFTPD grew out of the desire to have a secure and configurable
   144     FTP server, and out of a significant admiration of the Apache web
   145     server. There are currently a very limited number of FTP servers
   146     running on unix (or unix-like) hosts. The most commonly used server
   147     is probably wu-ftpd. While wu-ftpd provides excellent performance
   148     and is generally a good product, it lacks numerous features found
   149     in newer Win32 FTP servers, and has a poor security history. Many
   150     people, including the developers who work on ProFTPD have spent a
   151     great deal of time fixing bugs and hacking features into wu-ftpd.
   152     Unfortunately, it quickly became clear that a complete redesign was
   153     necessary in order to implement the configurability and features
   154     desired. ProFTPD is not a hack based on any other server, it's an
   155     independent source tree from the ground up. Click here for a small
   156     list of some of the sites ProFTPD powers -- many of them handling
   157     large volumes of traffic on a daily basis.
   159 %track
   160     prog proftpd = {
   161         version   = %{V_proftpd}
   162         url       = ftp://ftp.proftpd.org/distrib/source/
   163         regex     = proftpd-(\d+\.\d+\.\d+(?:rc\d+|[a-z]?))\.tar\.bz2
   164     }
   165     prog proftpd:mod_exec = {
   166         version   = %{V_mod_exec}
   167         url       = http://www.castaglia.net/proftpd/
   168         regex     = proftpd-mod-exec-(__VER__)\.tar\.gz
   169     }
   170     prog proftpd:mod_shaper = {
   171         version   = %{V_mod_shaper}
   172         url       = http://www.castaglia.net/proftpd/
   173         regex     = proftpd-mod-shaper-(__VER__)\.tar\.gz
   174     }
   175     prog proftpd:mod_sql_sqlite = {
   176         version   = %{V_mod_sql_sqlite}
   177         url       = http://www.castaglia.net/proftpd/
   178         regex     = proftpd-mod-sql-sqlite-(__VER__)\.tar\.gz
   179     }
   180     prog proftpd:mod_sql_odbc = {
   181         version   = %{V_mod_sql_odbc}
   182         url       = http://www.castaglia.net/proftpd/
   183         regex     = proftpd-mod-sql-odbc-(__VER__)\.tar\.gz
   184     }
   185     prog proftpd:mod_time = {
   186         version   = %{V_mod_time}
   187         url       = http://www.castaglia.net/proftpd/
   188         regex     = proftpd-mod-time-(__VER__)\.tar\.gz
   189     }
   190     prog proftpd:mod_vroot = {
   191         version   = %{V_mod_vroot}
   192         url       = http://www.castaglia.net/proftpd/
   193         regex     = proftpd-mod-vroot-(__VER__)\.tar\.gz
   194     }
   195     prog proftpd:mod_gss = {
   196         version   = %{V_mod_gss}
   197         url       = http://prdownloads.sourceforge.net/gssmod/
   198         regex     = mod_gss-(__VER__)\.tar\.gz
   199     }
   200     prog proftpd:mod_sftp = {
   201         version   = %{V_mod_sftp}
   202         url       = http://www.castaglia.net/proftpd/
   203         regex     = proftpd-mod-sftp-(__VER__)\.tar\.gz
   204     }
   205     prog proftpd:mod_sftp_sql = {
   206         version   = %{V_mod_sftp_sql}
   207         url       = http://www.castaglia.net/proftpd/
   208         regex     = proftpd-mod-sftp-sql-(__VER__)\.tar\.gz
   209     }
   210     prog proftpd:mod_md5 = {
   211         version   = %{V_mod_md5}
   212         url       = http://www.castaglia.net/proftpd/
   213         regex     = proftpd-mod-md5-(__VER__)\.tar\.gz
   214     }
   216 %prep
   217     %setup -q
   218     %setup -q -D -T -a 1
   219     %setup -q -D -T -a 2
   220     %setup -q -D -T -a 3
   221     %setup -q -D -T -a 4
   222     %setup -q -D -T -a 5
   223     %setup -q -D -T -a 6
   224     %setup -q -D -T -a 7
   225     %setup -q -D -T -a 8
   226     %setup -q -D -T -a 9
   227     %setup -q -D -T -a 10
   228     %setup -q -D -T -a 11
   229     %patch -p0
   231     %{l_shtool} subst \
   232         -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
   233         configure
   235     #   utils require to link with getopt
   236     %{l_shtool} subst \
   237         -e 's;\(\$(BUILD_FTPCOUNT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   238         -e 's;\(\$(BUILD_FTPSHUT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   239         -e 's;\(\$(BUILD_FTPTOP_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   240         -e 's;\(\$(BUILD_FTPWHO_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   241         Makefile.in
   242 %if "%{with_mysql}" == "yes"
   243     libs=`mysql_config --libs`
   244     #   libmysqlclient may require more libraries
   245     %{l_shtool} subst \
   246         -e "s;\(-lmysqlclient\);$libs;g" \
   247         contrib/mod_sql_mysql.c
   248 %endif
   250     #   libpq also requires openssl
   251     #   postgresql also doesn't provide its own include subdirectory
   252     %{l_shtool} subst \
   253         -e 's;\(-lpq\);\1 -lssl -lcrypto;g' \
   254         -e 's;^\(#include <\)pgsql/\(libpq-fe.h>.*\)$;\1postgresql/\2;' \
   255         contrib/mod_sql_postgres.c
   257     #   libldap also requires openssl
   258     %{l_shtool} subst \
   259         -e 's;\(-llber\);\1 -lssl -lcrypto;g' \
   260         contrib/mod_ldap.c
   262     #   prepare mod_otp module
   263 %if "%{with_skey}" == "yes" || "%{with_opie}" == "yes"
   264     ( cd mod_otp
   265       CC="%{l_cc}" \
   266       CFLAGS="%{l_cflags -O}" \
   267       CPPFLAGS="%{l_cppflags}" \
   268       LDFLAGS="%{l_ldflags}" \
   269       ./configure \
   270 %if "%{with_skey}" == "yes"
   271           --with-skey \
   272 %endif
   273 %if "%{with_opie}" == "yes"
   274           --with-opie \
   275 %endif
   276           %{l_nil}
   277       cp mod_otp.[ch] ../contrib/
   278     ) || exit $?
   279 %endif
   281     #   prepare mod_sql_odbc module
   282 %if "%{with_odbc}" == "yes"
   283     ( cd mod_sql_odbc
   284       if [ -f %{l_prefix}/etc/unixodbc/odbc.ini ]; then
   285           ./configure --enable-unixodbc
   286       else
   287           ./configure --enable-iodbc
   288       fi
   289     ) || exit $?
   290 %endif
   292     #   prepare optional add-on modules
   293     cp mod_exec/mod_exec.c contrib/
   294     cp mod_sql_sqlite/mod_sql_sqlite.c contrib/
   295     cp mod_sql_odbc/mod_sql_odbc.[ch] contrib/
   296     cp mod_time/mod_time.c contrib/
   297     cp mod_vroot/mod_vroot.c contrib/
   298 %if "%{with_ctrls}" == "yes"
   299     cp mod_shaper/mod_shaper.c contrib/
   300 %endif
   301 %if "%{with_sftp}" == "yes"
   302     cp -r mod_sftp contrib/
   303 %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
   304     cp mod_sftp_sql/mod_sftp_sql.c contrib/
   305 %endif
   306 %endif
   307 %if "%{with_md5}" == "yes"
   308     cp mod_md5/mod_md5.c contrib/
   309 %endif
   311     #   prepare mod_gss module
   312 %if "%{with_kerberos}" == "yes"
   313     ( cd mod_gss-*
   314       CC="%{l_cc}" \
   315       CFLAGS="%{l_cflags -O}" \
   316       CPPFLAGS="%{l_cppflags}" \
   317       LDFLAGS="%{l_ldflags}" \
   318       ./configure \
   319           --prefix=%{l_prefix} \
   320           `if [ -d %{l_prefix}/include/heimdal ]; then \
   321               echo "--enable-heimdal"; \
   322            else \
   323               echo "--enable-mit"; \
   324           fi`
   325       cp mod_gss.h ../include/
   326       cp mod_gss.c ../contrib/
   327     ) || exit $?
   328 %endif
   330 %build
   331     #   make non-standard "rundir" the same as standard "sysconfdir"
   332     %{l_shtool} subst \
   333         -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \
   334         Make.rules.in
   335     %{l_shtool} subst \
   336         -e 's;^\(#define PR_RUN_DIR "`eval echo "${localstatedir}\)/proftpd;\1;' \
   337         configure
   339     #   write shutdown message file to OpenPKG instance, not outside
   340     %{l_shtool} subst \
   341         -e 's;\(#define PR_SHUTMSG_PATH.*"\)\(/etc/\)\(shutmsg\)";\1%{l_prefix}\2proftpd/\3";' \
   342         include/default_paths.h
   344     #   configure the ProFTPd source tree
   345     MOD="mod_ratio:mod_readme:mod_exec:mod_time:mod_vroot"
   346     MOD_INC="%{l_prefix}/include"
   347     MOD_LIB="%{l_prefix}/lib"
   348 %if "%{with_ifsession}" == "yes"
   349     MOD="$MOD:mod_ifsession"
   350 %endif
   351 %if "%{with_ctrls}" == "yes"
   352     MOD="$MOD:mod_shaper"
   353     MOD="$MOD:mod_ctrls_admin"
   354 %endif
   355 %if "%{with_radius}" == "yes"
   356     MOD="$MOD:mod_radius"
   357 %endif
   358 %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
   359     MOD="$MOD:mod_sql"
   360 %if "%{with_mysql}" == "yes"
   361     MOD="$MOD:mod_sql_mysql"
   362     MOD_INC=":%{l_prefix}/include/mysql"
   363 %endif
   364 %if "%{with_pgsql}" == "yes"
   365     MOD="$MOD:mod_sql_postgres"
   366     MOD_INC=":%{l_prefix}/include/postgresql"
   367 %endif
   368 %if "%{with_sqlite}" == "yes"
   369     MOD="$MOD:mod_sql_sqlite"
   370 %endif
   371 %if "%{with_odbc}" == "yes"
   372     MOD="$MOD:mod_sql_odbc"
   373 %endif
   374 %endif
   375 %if "%{with_ldap}" == "yes"
   376     MOD="$MOD:mod_ldap"
   377 %endif
   378 %if "%{with_skey}" == "yes" || "%{with_opie}" == "yes"
   379     MOD="$MOD:mod_otp"
   380 %endif
   381 %if "%{with_kerberos}" == "yes"
   382     MOD="$MOD:mod_gss"
   383 %endif
   384 %if "%{with_ssl}" == "yes"
   385     MOD="$MOD:mod_tls"
   386 %endif
   387 %if "%{with_sftp}" == "yes"
   388     MOD="$MOD:mod_sftp"
   389 %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
   390     MOD="$MOD:mod_sftp_sql"
   391 %endif
   392 %endif
   393 %if "%{with_md5}" == "yes"
   394     MOD="$MOD:mod_md5"
   395 %endif
   396     export CC="%{l_cc}"
   397     export CFLAGS="%{l_cflags -O}"
   398     export CPPFLAGS="%{l_cppflags ncurses}"
   399     export LDFLAGS="%{l_ldflags}"
   400     export LIBS="-lgetopt"
   401 %if "%{with_pam}" == "yes"
   402     CPPFLAGS="$CPPFLAGS -I`%{l_rc} --query pam_incdir`"
   403     LDFLAGS="$LDFLAGS -L`%{l_rc} --query pam_libdir`"
   404 %endif
   405 %if "%{with_kerberos}" == "yes"
   406     CPPFLAGS="$CPPFLAGS `krb5-config --cflags gssapi`"
   407     LIBS="$LIBS `krb5-config --libs gssapi`"
   408 %endif
   409     ./configure \
   410         --prefix=%{l_prefix} \
   411         --sysconfdir=%{l_prefix}/etc/proftpd \
   412         --localstatedir=%{l_prefix}/var/proftpd \
   413         --mandir=%{l_prefix}/man \
   414         --with-modules="$MOD" \
   415         --with-includes="$MOD_INC" \
   416         --with-libraries="$MOD_LIB" \
   417         --enable-buffer-size=1024 \
   418 %if "%{with_ctrls}" == "yes"
   419         --enable-ctrls \
   420 %endif
   421 %if "%{with_pam}" == "yes"
   422         --enable-auth-pam
   423 %else
   424         --disable-auth-pam
   425 %endif
   427     #   build ProFTPd programs
   428     %{l_make} %{l_mflags}
   430 %install
   431     rm -rf $RPM_BUILD_ROOT
   433     #   make sure the "install" procedure does not try
   434     #   to perform explicit ownership assignments
   435     %{l_shtool} subst -v \
   436         -e 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \
   437         -e 's;chown;true;g' \
   438         Makefile Make.rules
   440     #   perform the "install" procedure while redirecting
   441     #   it to the temporarily install area
   442     %{l_make} %{l_mflags} \
   443         install-proftpd install-utils install-man \
   444         prefix=$RPM_BUILD_ROOT%{l_prefix} \
   445         bindir=$RPM_BUILD_ROOT%{l_prefix}/bin \
   446         sbindir=$RPM_BUILD_ROOT%{l_prefix}/sbin \
   447         sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \
   448         localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \
   449         mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
   450         rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd
   452     #   strip installation
   453     rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd
   455     #   install more stuff manually
   456     %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd
   457     %{l_shtool} install -c -m 644 doc/faq.html \
   458         $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html
   459     %{l_shtool} install -c -m 644 doc/Configuration.html \
   460         $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html
   462     #   extended installation with own stuff
   463     l_pam="#"
   464 %if "%{with_pam}" == "yes"
   465     l_pam=""
   466 %endif
   467     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   468         -e "s;@l_pam@;${l_pam};g" \
   469         %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
   470     %{l_shtool} install -c -m 644 \
   471         %{SOURCE proftpd.msg.goaway} \
   472         %{SOURCE proftpd.msg.login} \
   473         $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
   474     %{l_shtool} install -c -m 644 \
   475         %{SOURCE proftpd.msg.login} \
   476         $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login
   477     %{l_shtool} install -c -m 644 \
   478         %{SOURCE proftpd.msg.goaway} \
   479         $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway
   480     %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   481     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   482         %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   484     #   determine the package ingredients
   485     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   486         %{l_files_std} \
   487         '%config %attr(0600,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/proftpd/proftpd.conf' \
   488         '%config %{l_prefix}/etc/proftpd/proftpd.msg.*'
   490 %files -f files
   492 %clean
   493     rm -rf $RPM_BUILD_ROOT
   495 %post
   496 %if "%{with_pam}" == "yes"
   497     #   add PAM configuration entry
   498     if [ $1 -eq 1 ]; then
   499         $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=proftpd
   500     fi
   501 %endif
   503     #   after upgrade, restart service
   504     [ $1 -eq 2 ] || exit 0
   505     eval `%{l_rc} proftpd status 2>/dev/null`
   506     [ ".$proftpd_active" = .yes ] && %{l_rc} proftpd restart
   507     exit 0
   509 %preun
   510     #   before erase, stop service and remove log files
   511     [ $1 -eq 0 ] || exit 0
   512     %{l_rc} proftpd stop 2>/dev/null
   513     rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log* >/dev/null 2>&1 || true
   514     rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid  >/dev/null 2>&1 || true
   515 %if "%{with_pam}" == "yes"
   516     #   remove PAM configuration entry
   517     $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=proftpd
   518 %endif
   519     exit 0

mercurial