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