michael@182: ## michael@182: ## proftpd.spec -- OpenPKG RPM Package Specification michael@182: ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. michael@182: ## michael@182: ## Permission to use, copy, modify, and distribute this software for michael@182: ## any purpose with or without fee is hereby granted, provided that michael@182: ## the above copyright notice and this permission notice appear in all michael@182: ## copies. michael@182: ## michael@182: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@182: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@182: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@182: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@182: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@182: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@182: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@182: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@182: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@182: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@182: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@182: ## SUCH DAMAGE. michael@182: ## michael@182: michael@182: # package version michael@182: %define V_proftpd 1.3.2 michael@182: %define V_mod_exec 0.9.6 michael@182: %define V_mod_otp 0.9.1 michael@182: %define V_mod_shaper 0.6.5 michael@182: %define V_mod_sql_sqlite 0.2 michael@182: %define V_mod_sql_odbc 0.3.2 michael@182: %define V_mod_time 2.2.1 michael@182: %define V_mod_vroot 0.8.5 michael@182: %define V_mod_gss 1.3.2 michael@182: %define V_mod_sftp 0.9.6 michael@182: %define V_mod_sftp_sql 0.1 michael@182: %define V_mod_md5 0.3.3 michael@182: michael@182: # package information michael@182: Name: proftpd michael@182: Summary: Professional FTP Daemon michael@182: URL: http://www.proftpd.org/ michael@182: Vendor: The ProFTPD Project michael@182: Packager: OpenPKG Foundation e.V. michael@182: Distribution: OpenPKG Community michael@182: Class: BASE michael@182: Group: FTP michael@182: License: GPL michael@182: Version: %{V_proftpd} michael@182: Release: 20090327 michael@182: michael@182: # package options michael@182: %option with_ifsession no michael@182: %option with_ctrls no michael@182: %option with_radius no michael@182: %option with_pam no michael@182: %option with_mysql no michael@182: %option with_pgsql no michael@182: %option with_sqlite no michael@182: %option with_odbc no michael@182: %option with_ldap no michael@182: %option with_skey no michael@182: %option with_opie no michael@182: %option with_kerberos no michael@182: %option with_ssl no michael@182: %option with_sftp no michael@182: %option with_md5 no michael@182: michael@182: # checking option conflicts michael@182: %if "%{with_mysql}" == "yes" && "%{with_pgsql}" == "yes" michael@182: %{error:build-time options 'with_mysql' and 'with_pgsql' conflict} michael@182: %endif michael@182: michael@182: # list of sources michael@182: Source0: ftp://ftp.proftpd.org/distrib/source/proftpd-%{V_proftpd}.tar.bz2 michael@182: Source1: http://www.castaglia.net/proftpd/modules/proftpd-mod-exec-%{V_mod_exec}.tar.gz michael@182: Source2: http://www.castaglia.net/proftpd/modules/proftpd-mod-otp-%{V_mod_otp}.tar.gz michael@182: Source3: http://www.castaglia.net/proftpd/modules/proftpd-mod-shaper-%{V_mod_shaper}.tar.gz michael@182: Source4: http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-sqlite-%{V_mod_sql_sqlite}.tar.gz michael@182: Source5: http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-odbc-%{V_mod_sql_odbc}.tar.gz michael@182: Source6: http://www.castaglia.net/proftpd/modules/proftpd-mod-time-%{V_mod_time}.tar.gz michael@182: Source7: http://www.castaglia.net/proftpd/modules/proftpd-mod-vroot-%{V_mod_vroot}.tar.gz michael@182: Source8: http://switch.dl.sourceforge.net/gssmod/mod_gss-%{V_mod_gss}.tar.gz michael@182: Source9: http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-%{V_mod_sftp}.tar.gz michael@182: Source10: http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-sql-%{V_mod_sftp_sql}.tar.gz michael@182: Source11: http://www.castaglia.net/proftpd/modules/proftpd-mod-md5-%{V_mod_md5}.tar.gz michael@182: Source12: proftpd.conf michael@182: Source13: proftpd.msg.goaway michael@182: Source14: proftpd.msg.login michael@182: Source15: rc.proftpd michael@182: Patch0: proftpd.patch michael@182: michael@182: # build information michael@182: Prefix: %{l_prefix} michael@182: BuildRoot: %{l_buildroot} michael@182: BuildPreReq: OpenPKG, openpkg >= 20060823, make michael@182: PreReq: OpenPKG, openpkg >= 20060823 michael@182: BuildPreReq: ncurses, getopt michael@182: PreReq: ncurses, getopt michael@182: %if "%{with_mysql}" == "yes" michael@182: BuildPreReq: mysql michael@182: PreReq: mysql michael@182: %endif michael@182: %if "%{with_pam}" == "yes" michael@182: BuildPreReq: PAM michael@182: PreReq: PAM michael@182: %endif michael@182: %if "%{with_pgsql}" == "yes" michael@182: BuildPreReq: postgresql, openssl michael@182: PreReq: postgresql, openssl michael@182: %endif michael@182: %if "%{with_sqlite}" == "yes" michael@182: BuildPreReq: sqlite michael@182: PreReq: sqlite michael@182: %endif michael@182: %if "%{with_odbc}" == "yes" michael@182: BuildPreReq: ODBC michael@182: PreReq: ODBC michael@182: %endif michael@182: %if "%{with_ldap}" == "yes" michael@182: BuildPreReq: openldap, openssl michael@182: PreReq: openldap, openssl michael@182: %endif michael@182: %if "%{with_skey}" == "yes" michael@182: BuildPreReq: skey michael@182: PreReq: skey michael@182: %endif michael@182: %if "%{with_opie}" == "yes" michael@182: BuildPreReq: opie michael@182: PreReq: opie michael@182: %endif michael@182: %if "%{with_kerberos}" == "yes" michael@182: BuildPreReq: KERBEROS michael@182: PreReq: KERBEROS michael@182: %endif michael@182: %if "%{with_ssl}" == "yes" || "%{with_sftp}" == "yes" michael@182: BuildPreReq: openssl michael@182: PreReq: openssl michael@182: %endif michael@182: AutoReq: no michael@182: AutoReqProv: no michael@182: michael@182: %description michael@182: ProFTPD grew out of the desire to have a secure and configurable michael@182: FTP server, and out of a significant admiration of the Apache web michael@182: server. There are currently a very limited number of FTP servers michael@182: running on unix (or unix-like) hosts. The most commonly used server michael@182: is probably wu-ftpd. While wu-ftpd provides excellent performance michael@182: and is generally a good product, it lacks numerous features found michael@182: in newer Win32 FTP servers, and has a poor security history. Many michael@182: people, including the developers who work on ProFTPD have spent a michael@182: great deal of time fixing bugs and hacking features into wu-ftpd. michael@182: Unfortunately, it quickly became clear that a complete redesign was michael@182: necessary in order to implement the configurability and features michael@182: desired. ProFTPD is not a hack based on any other server, it's an michael@182: independent source tree from the ground up. Click here for a small michael@182: list of some of the sites ProFTPD powers -- many of them handling michael@182: large volumes of traffic on a daily basis. michael@182: michael@182: %track michael@182: prog proftpd = { michael@182: version = %{V_proftpd} michael@182: url = ftp://ftp.proftpd.org/distrib/source/ michael@182: regex = proftpd-(\d+\.\d+\.\d+(?:rc\d+|[a-z]?))\.tar\.bz2 michael@182: } michael@182: prog proftpd:mod_exec = { michael@182: version = %{V_mod_exec} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-exec-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_shaper = { michael@182: version = %{V_mod_shaper} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-shaper-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_sql_sqlite = { michael@182: version = %{V_mod_sql_sqlite} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-sql-sqlite-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_sql_odbc = { michael@182: version = %{V_mod_sql_odbc} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-sql-odbc-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_time = { michael@182: version = %{V_mod_time} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-time-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_vroot = { michael@182: version = %{V_mod_vroot} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-vroot-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_gss = { michael@182: version = %{V_mod_gss} michael@182: url = http://prdownloads.sourceforge.net/gssmod/ michael@182: regex = mod_gss-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_sftp = { michael@182: version = %{V_mod_sftp} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-sftp-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_sftp_sql = { michael@182: version = %{V_mod_sftp_sql} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-sftp-sql-(__VER__)\.tar\.gz michael@182: } michael@182: prog proftpd:mod_md5 = { michael@182: version = %{V_mod_md5} michael@182: url = http://www.castaglia.net/proftpd/ michael@182: regex = proftpd-mod-md5-(__VER__)\.tar\.gz michael@182: } michael@182: michael@182: %prep michael@182: %setup -q michael@182: %setup -q -D -T -a 1 michael@182: %setup -q -D -T -a 2 michael@182: %setup -q -D -T -a 3 michael@182: %setup -q -D -T -a 4 michael@182: %setup -q -D -T -a 5 michael@182: %setup -q -D -T -a 6 michael@182: %setup -q -D -T -a 7 michael@182: %setup -q -D -T -a 8 michael@182: %setup -q -D -T -a 9 michael@182: %setup -q -D -T -a 10 michael@182: %setup -q -D -T -a 11 michael@182: %patch -p0 michael@182: michael@182: %{l_shtool} subst \ michael@182: -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \ michael@182: configure michael@182: michael@182: # utils require to link with getopt michael@182: %{l_shtool} subst \ michael@182: -e 's;\(\$(BUILD_FTPCOUNT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ michael@182: -e 's;\(\$(BUILD_FTPSHUT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ michael@182: -e 's;\(\$(BUILD_FTPTOP_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ michael@182: -e 's;\(\$(BUILD_FTPWHO_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ michael@182: Makefile.in michael@182: %if "%{with_mysql}" == "yes" michael@182: libs=`mysql_config --libs` michael@182: # libmysqlclient may require more libraries michael@182: %{l_shtool} subst \ michael@182: -e "s;\(-lmysqlclient\);$libs;g" \ michael@182: contrib/mod_sql_mysql.c michael@182: %endif michael@182: michael@182: # libpq also requires openssl michael@182: # postgresql also doesn't provide its own include subdirectory michael@182: %{l_shtool} subst \ michael@182: -e 's;\(-lpq\);\1 -lssl -lcrypto;g' \ michael@182: -e 's;^\(#include <\)pgsql/\(libpq-fe.h>.*\)$;\1postgresql/\2;' \ michael@182: contrib/mod_sql_postgres.c michael@182: michael@182: # libldap also requires openssl michael@182: %{l_shtool} subst \ michael@182: -e 's;\(-llber\);\1 -lssl -lcrypto;g' \ michael@182: contrib/mod_ldap.c michael@182: michael@182: # prepare mod_otp module michael@182: %if "%{with_skey}" == "yes" || "%{with_opie}" == "yes" michael@182: ( cd mod_otp michael@182: CC="%{l_cc}" \ michael@182: CFLAGS="%{l_cflags -O}" \ michael@182: CPPFLAGS="%{l_cppflags}" \ michael@182: LDFLAGS="%{l_ldflags}" \ michael@182: ./configure \ michael@182: %if "%{with_skey}" == "yes" michael@182: --with-skey \ michael@182: %endif michael@182: %if "%{with_opie}" == "yes" michael@182: --with-opie \ michael@182: %endif michael@182: %{l_nil} michael@182: cp mod_otp.[ch] ../contrib/ michael@182: ) || exit $? michael@182: %endif michael@182: michael@182: # prepare mod_sql_odbc module michael@182: %if "%{with_odbc}" == "yes" michael@182: ( cd mod_sql_odbc michael@182: if [ -f %{l_prefix}/etc/unixodbc/odbc.ini ]; then michael@182: ./configure --enable-unixodbc michael@182: else michael@182: ./configure --enable-iodbc michael@182: fi michael@182: ) || exit $? michael@182: %endif michael@182: michael@182: # prepare optional add-on modules michael@182: cp mod_exec/mod_exec.c contrib/ michael@182: cp mod_sql_sqlite/mod_sql_sqlite.c contrib/ michael@182: cp mod_sql_odbc/mod_sql_odbc.[ch] contrib/ michael@182: cp mod_time/mod_time.c contrib/ michael@182: cp mod_vroot/mod_vroot.c contrib/ michael@182: %if "%{with_ctrls}" == "yes" michael@182: cp mod_shaper/mod_shaper.c contrib/ michael@182: %endif michael@182: %if "%{with_sftp}" == "yes" michael@182: cp -r mod_sftp contrib/ michael@182: %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes" michael@182: cp mod_sftp_sql/mod_sftp_sql.c contrib/ michael@182: %endif michael@182: %endif michael@182: %if "%{with_md5}" == "yes" michael@182: cp mod_md5/mod_md5.c contrib/ michael@182: %endif michael@182: michael@182: # prepare mod_gss module michael@182: %if "%{with_kerberos}" == "yes" michael@182: ( cd mod_gss-* michael@182: CC="%{l_cc}" \ michael@182: CFLAGS="%{l_cflags -O}" \ michael@182: CPPFLAGS="%{l_cppflags}" \ michael@182: LDFLAGS="%{l_ldflags}" \ michael@182: ./configure \ michael@182: --prefix=%{l_prefix} \ michael@182: `if [ -d %{l_prefix}/include/heimdal ]; then \ michael@182: echo "--enable-heimdal"; \ michael@182: else \ michael@182: echo "--enable-mit"; \ michael@182: fi` michael@182: cp mod_gss.h ../include/ michael@182: cp mod_gss.c ../contrib/ michael@182: ) || exit $? michael@182: %endif michael@182: michael@182: %build michael@182: # make non-standard "rundir" the same as standard "sysconfdir" michael@182: %{l_shtool} subst \ michael@182: -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \ michael@182: Make.rules.in michael@182: %{l_shtool} subst \ michael@182: -e 's;^\(#define PR_RUN_DIR "`eval echo "${localstatedir}\)/proftpd;\1;' \ michael@182: configure michael@182: michael@182: # write shutdown message file to OpenPKG instance, not outside michael@182: %{l_shtool} subst \ michael@182: -e 's;\(#define PR_SHUTMSG_PATH.*"\)\(/etc/\)\(shutmsg\)";\1%{l_prefix}\2proftpd/\3";' \ michael@182: include/default_paths.h michael@182: michael@182: # configure the ProFTPd source tree michael@182: MOD="mod_ratio:mod_readme:mod_exec:mod_time:mod_vroot" michael@182: MOD_INC="%{l_prefix}/include" michael@182: MOD_LIB="%{l_prefix}/lib" michael@182: %if "%{with_ifsession}" == "yes" michael@182: MOD="$MOD:mod_ifsession" michael@182: %endif michael@182: %if "%{with_ctrls}" == "yes" michael@182: MOD="$MOD:mod_shaper" michael@182: MOD="$MOD:mod_ctrls_admin" michael@182: %endif michael@182: %if "%{with_radius}" == "yes" michael@182: MOD="$MOD:mod_radius" michael@182: %endif michael@182: %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes" michael@182: MOD="$MOD:mod_sql" michael@182: %if "%{with_mysql}" == "yes" michael@182: MOD="$MOD:mod_sql_mysql" michael@182: MOD_INC=":%{l_prefix}/include/mysql" michael@182: %endif michael@182: %if "%{with_pgsql}" == "yes" michael@182: MOD="$MOD:mod_sql_postgres" michael@182: MOD_INC=":%{l_prefix}/include/postgresql" michael@182: %endif michael@182: %if "%{with_sqlite}" == "yes" michael@182: MOD="$MOD:mod_sql_sqlite" michael@182: %endif michael@182: %if "%{with_odbc}" == "yes" michael@182: MOD="$MOD:mod_sql_odbc" michael@182: %endif michael@182: %endif michael@182: %if "%{with_ldap}" == "yes" michael@182: MOD="$MOD:mod_ldap" michael@182: %endif michael@182: %if "%{with_skey}" == "yes" || "%{with_opie}" == "yes" michael@182: MOD="$MOD:mod_otp" michael@182: %endif michael@182: %if "%{with_kerberos}" == "yes" michael@182: MOD="$MOD:mod_gss" michael@182: %endif michael@182: %if "%{with_ssl}" == "yes" michael@182: MOD="$MOD:mod_tls" michael@182: %endif michael@182: %if "%{with_sftp}" == "yes" michael@182: MOD="$MOD:mod_sftp" michael@182: %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes" michael@182: MOD="$MOD:mod_sftp_sql" michael@182: %endif michael@182: %endif michael@182: %if "%{with_md5}" == "yes" michael@182: MOD="$MOD:mod_md5" michael@182: %endif michael@182: export CC="%{l_cc}" michael@182: export CFLAGS="%{l_cflags -O}" michael@182: export CPPFLAGS="%{l_cppflags ncurses}" michael@182: export LDFLAGS="%{l_ldflags}" michael@182: export LIBS="-lgetopt" michael@182: %if "%{with_pam}" == "yes" michael@182: CPPFLAGS="$CPPFLAGS -I`%{l_rc} --query pam_incdir`" michael@182: LDFLAGS="$LDFLAGS -L`%{l_rc} --query pam_libdir`" michael@182: %endif michael@182: %if "%{with_kerberos}" == "yes" michael@182: CPPFLAGS="$CPPFLAGS `krb5-config --cflags gssapi`" michael@182: LIBS="$LIBS `krb5-config --libs gssapi`" michael@182: %endif michael@182: ./configure \ michael@182: --prefix=%{l_prefix} \ michael@182: --sysconfdir=%{l_prefix}/etc/proftpd \ michael@182: --localstatedir=%{l_prefix}/var/proftpd \ michael@182: --with-modules="$MOD" \ michael@182: --with-includes="$MOD_INC" \ michael@182: --with-libraries="$MOD_LIB" \ michael@182: --enable-buffer-size=1024 \ michael@182: %if "%{with_ctrls}" == "yes" michael@182: --enable-ctrls \ michael@182: %endif michael@182: %if "%{with_pam}" == "yes" michael@182: --enable-auth-pam michael@182: %else michael@182: --disable-auth-pam michael@182: %endif michael@182: michael@182: # build ProFTPd programs michael@182: %{l_make} %{l_mflags} michael@182: michael@182: %install michael@182: rm -rf $RPM_BUILD_ROOT michael@182: michael@182: # make sure the "install" procedure does not try michael@182: # to perform explicit ownership assignments michael@182: %{l_shtool} subst -v \ michael@182: -e 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \ michael@182: -e 's;chown;true;g' \ michael@182: Makefile Make.rules michael@182: michael@182: # perform the "install" procedure while redirecting michael@182: # it to the temporarily install area michael@182: %{l_make} %{l_mflags} \ michael@182: install-proftpd install-utils install-man \ michael@182: prefix=$RPM_BUILD_ROOT%{l_prefix} \ michael@182: bindir=$RPM_BUILD_ROOT%{l_prefix}/bin \ michael@182: sbindir=$RPM_BUILD_ROOT%{l_prefix}/sbin \ michael@182: sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \ michael@182: localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \ michael@182: rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd michael@182: michael@182: # strip installation michael@182: rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd michael@182: michael@182: # install more stuff manually michael@182: %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd michael@182: %{l_shtool} install -c -m 644 doc/faq.html \ michael@182: $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html michael@182: %{l_shtool} install -c -m 644 doc/Configuration.html \ michael@182: $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html michael@182: michael@182: # extended installation with own stuff michael@182: l_pam="#" michael@182: %if "%{with_pam}" == "yes" michael@182: l_pam="" michael@182: %endif michael@182: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@182: -e "s;@l_pam@;${l_pam};g" \ michael@182: %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/ michael@182: %{l_shtool} install -c -m 644 \ michael@182: %{SOURCE proftpd.msg.goaway} \ michael@182: %{SOURCE proftpd.msg.login} \ michael@182: $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/ michael@182: %{l_shtool} install -c -m 644 \ michael@182: %{SOURCE proftpd.msg.login} \ michael@182: $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login michael@182: %{l_shtool} install -c -m 644 \ michael@182: %{SOURCE proftpd.msg.goaway} \ michael@182: $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway michael@182: %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d michael@182: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@182: %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@182: michael@182: # determine the package ingredients michael@182: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@182: %{l_files_std} \ michael@182: '%config %attr(0600,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/proftpd/proftpd.conf' \ michael@182: '%config %{l_prefix}/etc/proftpd/proftpd.msg.*' michael@182: michael@182: %files -f files michael@182: michael@182: %clean michael@182: rm -rf $RPM_BUILD_ROOT michael@182: michael@182: %post michael@182: %if "%{with_pam}" == "yes" michael@182: # add PAM configuration entry michael@182: if [ $1 -eq 1 ]; then michael@182: $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=proftpd michael@182: fi michael@182: %endif michael@182: michael@182: # after upgrade, restart service michael@182: [ $1 -eq 2 ] || exit 0 michael@182: eval `%{l_rc} proftpd status 2>/dev/null` michael@182: [ ".$proftpd_active" = .yes ] && %{l_rc} proftpd restart michael@182: exit 0 michael@182: michael@182: %preun michael@182: # before erase, stop service and remove log files michael@182: [ $1 -eq 0 ] || exit 0 michael@182: %{l_rc} proftpd stop 2>/dev/null michael@182: rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log* >/dev/null 2>&1 || true michael@182: rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid >/dev/null 2>&1 || true michael@182: %if "%{with_pam}" == "yes" michael@182: # remove PAM configuration entry michael@182: $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=proftpd michael@182: %endif michael@182: exit 0 michael@182: