proftpd/proftpd.spec

changeset 182
42a8c8d745e6
child 183
94771d2369b6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/proftpd/proftpd.spec	Tue Apr 21 11:54:34 2009 +0200
     1.3 @@ -0,0 +1,518 @@
     1.4 +##
     1.5 +##  proftpd.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_proftpd         1.3.2
    1.29 +%define       V_mod_exec        0.9.6
    1.30 +%define       V_mod_otp         0.9.1
    1.31 +%define       V_mod_shaper      0.6.5
    1.32 +%define       V_mod_sql_sqlite  0.2
    1.33 +%define       V_mod_sql_odbc    0.3.2
    1.34 +%define       V_mod_time        2.2.1
    1.35 +%define       V_mod_vroot       0.8.5
    1.36 +%define       V_mod_gss         1.3.2
    1.37 +%define       V_mod_sftp        0.9.6
    1.38 +%define       V_mod_sftp_sql    0.1
    1.39 +%define       V_mod_md5         0.3.3
    1.40 +
    1.41 +#   package information
    1.42 +Name:         proftpd
    1.43 +Summary:      Professional FTP Daemon
    1.44 +URL:          http://www.proftpd.org/
    1.45 +Vendor:       The ProFTPD Project
    1.46 +Packager:     OpenPKG Foundation e.V.
    1.47 +Distribution: OpenPKG Community
    1.48 +Class:        BASE
    1.49 +Group:        FTP
    1.50 +License:      GPL
    1.51 +Version:      %{V_proftpd}
    1.52 +Release:      20090327
    1.53 +
    1.54 +#   package options
    1.55 +%option       with_ifsession  no
    1.56 +%option       with_ctrls      no
    1.57 +%option       with_radius     no
    1.58 +%option       with_pam        no
    1.59 +%option       with_mysql      no
    1.60 +%option       with_pgsql      no
    1.61 +%option       with_sqlite     no
    1.62 +%option       with_odbc       no
    1.63 +%option       with_ldap       no
    1.64 +%option       with_skey       no
    1.65 +%option       with_opie       no
    1.66 +%option       with_kerberos   no
    1.67 +%option       with_ssl        no
    1.68 +%option       with_sftp       no
    1.69 +%option       with_md5        no
    1.70 +
    1.71 +#   checking option conflicts
    1.72 +%if "%{with_mysql}" == "yes" && "%{with_pgsql}" == "yes"
    1.73 +    %{error:build-time options 'with_mysql' and 'with_pgsql' conflict}
    1.74 +%endif
    1.75 +
    1.76 +#   list of sources
    1.77 +Source0:      ftp://ftp.proftpd.org/distrib/source/proftpd-%{V_proftpd}.tar.bz2
    1.78 +Source1:      http://www.castaglia.net/proftpd/modules/proftpd-mod-exec-%{V_mod_exec}.tar.gz
    1.79 +Source2:      http://www.castaglia.net/proftpd/modules/proftpd-mod-otp-%{V_mod_otp}.tar.gz
    1.80 +Source3:      http://www.castaglia.net/proftpd/modules/proftpd-mod-shaper-%{V_mod_shaper}.tar.gz
    1.81 +Source4:      http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-sqlite-%{V_mod_sql_sqlite}.tar.gz
    1.82 +Source5:      http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-odbc-%{V_mod_sql_odbc}.tar.gz
    1.83 +Source6:      http://www.castaglia.net/proftpd/modules/proftpd-mod-time-%{V_mod_time}.tar.gz
    1.84 +Source7:      http://www.castaglia.net/proftpd/modules/proftpd-mod-vroot-%{V_mod_vroot}.tar.gz
    1.85 +Source8:      http://switch.dl.sourceforge.net/gssmod/mod_gss-%{V_mod_gss}.tar.gz
    1.86 +Source9:      http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-%{V_mod_sftp}.tar.gz
    1.87 +Source10:     http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-sql-%{V_mod_sftp_sql}.tar.gz
    1.88 +Source11:     http://www.castaglia.net/proftpd/modules/proftpd-mod-md5-%{V_mod_md5}.tar.gz
    1.89 +Source12:     proftpd.conf
    1.90 +Source13:     proftpd.msg.goaway
    1.91 +Source14:     proftpd.msg.login
    1.92 +Source15:     rc.proftpd
    1.93 +Patch0:       proftpd.patch
    1.94 +
    1.95 +#   build information
    1.96 +Prefix:       %{l_prefix}
    1.97 +BuildRoot:    %{l_buildroot}
    1.98 +BuildPreReq:  OpenPKG, openpkg >= 20060823, make
    1.99 +PreReq:       OpenPKG, openpkg >= 20060823
   1.100 +BuildPreReq:  ncurses, getopt
   1.101 +PreReq:       ncurses, getopt
   1.102 +%if "%{with_mysql}" == "yes"
   1.103 +BuildPreReq:  mysql
   1.104 +PreReq:       mysql
   1.105 +%endif
   1.106 +%if "%{with_pam}" == "yes"
   1.107 +BuildPreReq:  PAM
   1.108 +PreReq:       PAM
   1.109 +%endif
   1.110 +%if "%{with_pgsql}" == "yes"
   1.111 +BuildPreReq:  postgresql, openssl
   1.112 +PreReq:       postgresql, openssl
   1.113 +%endif
   1.114 +%if "%{with_sqlite}" == "yes"
   1.115 +BuildPreReq:  sqlite
   1.116 +PreReq:       sqlite
   1.117 +%endif
   1.118 +%if "%{with_odbc}" == "yes"
   1.119 +BuildPreReq:  ODBC
   1.120 +PreReq:       ODBC
   1.121 +%endif
   1.122 +%if "%{with_ldap}" == "yes"
   1.123 +BuildPreReq:  openldap, openssl
   1.124 +PreReq:       openldap, openssl
   1.125 +%endif
   1.126 +%if "%{with_skey}" == "yes"
   1.127 +BuildPreReq:  skey
   1.128 +PreReq:       skey
   1.129 +%endif
   1.130 +%if "%{with_opie}" == "yes"
   1.131 +BuildPreReq:  opie
   1.132 +PreReq:       opie
   1.133 +%endif
   1.134 +%if "%{with_kerberos}" == "yes"
   1.135 +BuildPreReq:  KERBEROS
   1.136 +PreReq:       KERBEROS
   1.137 +%endif
   1.138 +%if "%{with_ssl}" == "yes" || "%{with_sftp}" == "yes"
   1.139 +BuildPreReq:  openssl
   1.140 +PreReq:       openssl
   1.141 +%endif
   1.142 +AutoReq:      no
   1.143 +AutoReqProv:  no
   1.144 +
   1.145 +%description
   1.146 +    ProFTPD grew out of the desire to have a secure and configurable
   1.147 +    FTP server, and out of a significant admiration of the Apache web
   1.148 +    server. There are currently a very limited number of FTP servers
   1.149 +    running on unix (or unix-like) hosts. The most commonly used server
   1.150 +    is probably wu-ftpd. While wu-ftpd provides excellent performance
   1.151 +    and is generally a good product, it lacks numerous features found
   1.152 +    in newer Win32 FTP servers, and has a poor security history. Many
   1.153 +    people, including the developers who work on ProFTPD have spent a
   1.154 +    great deal of time fixing bugs and hacking features into wu-ftpd.
   1.155 +    Unfortunately, it quickly became clear that a complete redesign was
   1.156 +    necessary in order to implement the configurability and features
   1.157 +    desired. ProFTPD is not a hack based on any other server, it's an
   1.158 +    independent source tree from the ground up. Click here for a small
   1.159 +    list of some of the sites ProFTPD powers -- many of them handling
   1.160 +    large volumes of traffic on a daily basis.
   1.161 +
   1.162 +%track
   1.163 +    prog proftpd = {
   1.164 +        version   = %{V_proftpd}
   1.165 +        url       = ftp://ftp.proftpd.org/distrib/source/
   1.166 +        regex     = proftpd-(\d+\.\d+\.\d+(?:rc\d+|[a-z]?))\.tar\.bz2
   1.167 +    }
   1.168 +    prog proftpd:mod_exec = {
   1.169 +        version   = %{V_mod_exec}
   1.170 +        url       = http://www.castaglia.net/proftpd/
   1.171 +        regex     = proftpd-mod-exec-(__VER__)\.tar\.gz
   1.172 +    }
   1.173 +    prog proftpd:mod_shaper = {
   1.174 +        version   = %{V_mod_shaper}
   1.175 +        url       = http://www.castaglia.net/proftpd/
   1.176 +        regex     = proftpd-mod-shaper-(__VER__)\.tar\.gz
   1.177 +    }
   1.178 +    prog proftpd:mod_sql_sqlite = {
   1.179 +        version   = %{V_mod_sql_sqlite}
   1.180 +        url       = http://www.castaglia.net/proftpd/
   1.181 +        regex     = proftpd-mod-sql-sqlite-(__VER__)\.tar\.gz
   1.182 +    }
   1.183 +    prog proftpd:mod_sql_odbc = {
   1.184 +        version   = %{V_mod_sql_odbc}
   1.185 +        url       = http://www.castaglia.net/proftpd/
   1.186 +        regex     = proftpd-mod-sql-odbc-(__VER__)\.tar\.gz
   1.187 +    }
   1.188 +    prog proftpd:mod_time = {
   1.189 +        version   = %{V_mod_time}
   1.190 +        url       = http://www.castaglia.net/proftpd/
   1.191 +        regex     = proftpd-mod-time-(__VER__)\.tar\.gz
   1.192 +    }
   1.193 +    prog proftpd:mod_vroot = {
   1.194 +        version   = %{V_mod_vroot}
   1.195 +        url       = http://www.castaglia.net/proftpd/
   1.196 +        regex     = proftpd-mod-vroot-(__VER__)\.tar\.gz
   1.197 +    }
   1.198 +    prog proftpd:mod_gss = {
   1.199 +        version   = %{V_mod_gss}
   1.200 +        url       = http://prdownloads.sourceforge.net/gssmod/
   1.201 +        regex     = mod_gss-(__VER__)\.tar\.gz
   1.202 +    }
   1.203 +    prog proftpd:mod_sftp = {
   1.204 +        version   = %{V_mod_sftp}
   1.205 +        url       = http://www.castaglia.net/proftpd/
   1.206 +        regex     = proftpd-mod-sftp-(__VER__)\.tar\.gz
   1.207 +    }
   1.208 +    prog proftpd:mod_sftp_sql = {
   1.209 +        version   = %{V_mod_sftp_sql}
   1.210 +        url       = http://www.castaglia.net/proftpd/
   1.211 +        regex     = proftpd-mod-sftp-sql-(__VER__)\.tar\.gz
   1.212 +    }
   1.213 +    prog proftpd:mod_md5 = {
   1.214 +        version   = %{V_mod_md5}
   1.215 +        url       = http://www.castaglia.net/proftpd/
   1.216 +        regex     = proftpd-mod-md5-(__VER__)\.tar\.gz
   1.217 +    }
   1.218 +
   1.219 +%prep
   1.220 +    %setup -q
   1.221 +    %setup -q -D -T -a 1
   1.222 +    %setup -q -D -T -a 2
   1.223 +    %setup -q -D -T -a 3
   1.224 +    %setup -q -D -T -a 4
   1.225 +    %setup -q -D -T -a 5
   1.226 +    %setup -q -D -T -a 6
   1.227 +    %setup -q -D -T -a 7
   1.228 +    %setup -q -D -T -a 8
   1.229 +    %setup -q -D -T -a 9
   1.230 +    %setup -q -D -T -a 10
   1.231 +    %setup -q -D -T -a 11
   1.232 +    %patch -p0
   1.233 +
   1.234 +    %{l_shtool} subst \
   1.235 +        -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
   1.236 +        configure
   1.237 +
   1.238 +    #   utils require to link with getopt
   1.239 +    %{l_shtool} subst \
   1.240 +        -e 's;\(\$(BUILD_FTPCOUNT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   1.241 +        -e 's;\(\$(BUILD_FTPSHUT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   1.242 +        -e 's;\(\$(BUILD_FTPTOP_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   1.243 +        -e 's;\(\$(BUILD_FTPWHO_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
   1.244 +        Makefile.in
   1.245 +%if "%{with_mysql}" == "yes"
   1.246 +    libs=`mysql_config --libs`
   1.247 +    #   libmysqlclient may require more libraries
   1.248 +    %{l_shtool} subst \
   1.249 +        -e "s;\(-lmysqlclient\);$libs;g" \
   1.250 +        contrib/mod_sql_mysql.c
   1.251 +%endif
   1.252 +
   1.253 +    #   libpq also requires openssl
   1.254 +    #   postgresql also doesn't provide its own include subdirectory
   1.255 +    %{l_shtool} subst \
   1.256 +        -e 's;\(-lpq\);\1 -lssl -lcrypto;g' \
   1.257 +        -e 's;^\(#include <\)pgsql/\(libpq-fe.h>.*\)$;\1postgresql/\2;' \
   1.258 +        contrib/mod_sql_postgres.c
   1.259 +
   1.260 +    #   libldap also requires openssl
   1.261 +    %{l_shtool} subst \
   1.262 +        -e 's;\(-llber\);\1 -lssl -lcrypto;g' \
   1.263 +        contrib/mod_ldap.c
   1.264 +
   1.265 +    #   prepare mod_otp module
   1.266 +%if "%{with_skey}" == "yes" || "%{with_opie}" == "yes"
   1.267 +    ( cd mod_otp
   1.268 +      CC="%{l_cc}" \
   1.269 +      CFLAGS="%{l_cflags -O}" \
   1.270 +      CPPFLAGS="%{l_cppflags}" \
   1.271 +      LDFLAGS="%{l_ldflags}" \
   1.272 +      ./configure \
   1.273 +%if "%{with_skey}" == "yes"
   1.274 +          --with-skey \
   1.275 +%endif
   1.276 +%if "%{with_opie}" == "yes"
   1.277 +          --with-opie \
   1.278 +%endif
   1.279 +          %{l_nil}
   1.280 +      cp mod_otp.[ch] ../contrib/
   1.281 +    ) || exit $?
   1.282 +%endif
   1.283 +
   1.284 +    #   prepare mod_sql_odbc module
   1.285 +%if "%{with_odbc}" == "yes"
   1.286 +    ( cd mod_sql_odbc
   1.287 +      if [ -f %{l_prefix}/etc/unixodbc/odbc.ini ]; then
   1.288 +          ./configure --enable-unixodbc
   1.289 +      else
   1.290 +          ./configure --enable-iodbc
   1.291 +      fi
   1.292 +    ) || exit $?
   1.293 +%endif
   1.294 +
   1.295 +    #   prepare optional add-on modules
   1.296 +    cp mod_exec/mod_exec.c contrib/
   1.297 +    cp mod_sql_sqlite/mod_sql_sqlite.c contrib/
   1.298 +    cp mod_sql_odbc/mod_sql_odbc.[ch] contrib/
   1.299 +    cp mod_time/mod_time.c contrib/
   1.300 +    cp mod_vroot/mod_vroot.c contrib/
   1.301 +%if "%{with_ctrls}" == "yes"
   1.302 +    cp mod_shaper/mod_shaper.c contrib/
   1.303 +%endif
   1.304 +%if "%{with_sftp}" == "yes"
   1.305 +    cp -r mod_sftp contrib/
   1.306 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
   1.307 +    cp mod_sftp_sql/mod_sftp_sql.c contrib/
   1.308 +%endif
   1.309 +%endif
   1.310 +%if "%{with_md5}" == "yes"
   1.311 +    cp mod_md5/mod_md5.c contrib/
   1.312 +%endif
   1.313 +
   1.314 +    #   prepare mod_gss module
   1.315 +%if "%{with_kerberos}" == "yes"
   1.316 +    ( cd mod_gss-*
   1.317 +      CC="%{l_cc}" \
   1.318 +      CFLAGS="%{l_cflags -O}" \
   1.319 +      CPPFLAGS="%{l_cppflags}" \
   1.320 +      LDFLAGS="%{l_ldflags}" \
   1.321 +      ./configure \
   1.322 +          --prefix=%{l_prefix} \
   1.323 +          `if [ -d %{l_prefix}/include/heimdal ]; then \
   1.324 +              echo "--enable-heimdal"; \
   1.325 +           else \
   1.326 +              echo "--enable-mit"; \
   1.327 +          fi`
   1.328 +      cp mod_gss.h ../include/
   1.329 +      cp mod_gss.c ../contrib/
   1.330 +    ) || exit $?
   1.331 +%endif
   1.332 +
   1.333 +%build
   1.334 +    #   make non-standard "rundir" the same as standard "sysconfdir"
   1.335 +    %{l_shtool} subst \
   1.336 +        -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \
   1.337 +        Make.rules.in
   1.338 +    %{l_shtool} subst \
   1.339 +        -e 's;^\(#define PR_RUN_DIR "`eval echo "${localstatedir}\)/proftpd;\1;' \
   1.340 +        configure
   1.341 +
   1.342 +    #   write shutdown message file to OpenPKG instance, not outside
   1.343 +    %{l_shtool} subst \
   1.344 +        -e 's;\(#define PR_SHUTMSG_PATH.*"\)\(/etc/\)\(shutmsg\)";\1%{l_prefix}\2proftpd/\3";' \
   1.345 +        include/default_paths.h
   1.346 +
   1.347 +    #   configure the ProFTPd source tree
   1.348 +    MOD="mod_ratio:mod_readme:mod_exec:mod_time:mod_vroot"
   1.349 +    MOD_INC="%{l_prefix}/include"
   1.350 +    MOD_LIB="%{l_prefix}/lib"
   1.351 +%if "%{with_ifsession}" == "yes"
   1.352 +    MOD="$MOD:mod_ifsession"
   1.353 +%endif
   1.354 +%if "%{with_ctrls}" == "yes"
   1.355 +    MOD="$MOD:mod_shaper"
   1.356 +    MOD="$MOD:mod_ctrls_admin"
   1.357 +%endif
   1.358 +%if "%{with_radius}" == "yes"
   1.359 +    MOD="$MOD:mod_radius"
   1.360 +%endif
   1.361 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
   1.362 +    MOD="$MOD:mod_sql"
   1.363 +%if "%{with_mysql}" == "yes"
   1.364 +    MOD="$MOD:mod_sql_mysql"
   1.365 +    MOD_INC=":%{l_prefix}/include/mysql"
   1.366 +%endif
   1.367 +%if "%{with_pgsql}" == "yes"
   1.368 +    MOD="$MOD:mod_sql_postgres"
   1.369 +    MOD_INC=":%{l_prefix}/include/postgresql"
   1.370 +%endif
   1.371 +%if "%{with_sqlite}" == "yes"
   1.372 +    MOD="$MOD:mod_sql_sqlite"
   1.373 +%endif
   1.374 +%if "%{with_odbc}" == "yes"
   1.375 +    MOD="$MOD:mod_sql_odbc"
   1.376 +%endif
   1.377 +%endif
   1.378 +%if "%{with_ldap}" == "yes"
   1.379 +    MOD="$MOD:mod_ldap"
   1.380 +%endif
   1.381 +%if "%{with_skey}" == "yes" || "%{with_opie}" == "yes"
   1.382 +    MOD="$MOD:mod_otp"
   1.383 +%endif
   1.384 +%if "%{with_kerberos}" == "yes"
   1.385 +    MOD="$MOD:mod_gss"
   1.386 +%endif
   1.387 +%if "%{with_ssl}" == "yes"
   1.388 +    MOD="$MOD:mod_tls"
   1.389 +%endif
   1.390 +%if "%{with_sftp}" == "yes"
   1.391 +    MOD="$MOD:mod_sftp"
   1.392 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
   1.393 +    MOD="$MOD:mod_sftp_sql"
   1.394 +%endif
   1.395 +%endif
   1.396 +%if "%{with_md5}" == "yes"
   1.397 +    MOD="$MOD:mod_md5"
   1.398 +%endif
   1.399 +    export CC="%{l_cc}"
   1.400 +    export CFLAGS="%{l_cflags -O}"
   1.401 +    export CPPFLAGS="%{l_cppflags ncurses}"
   1.402 +    export LDFLAGS="%{l_ldflags}"
   1.403 +    export LIBS="-lgetopt"
   1.404 +%if "%{with_pam}" == "yes"
   1.405 +    CPPFLAGS="$CPPFLAGS -I`%{l_rc} --query pam_incdir`"
   1.406 +    LDFLAGS="$LDFLAGS -L`%{l_rc} --query pam_libdir`"
   1.407 +%endif
   1.408 +%if "%{with_kerberos}" == "yes"
   1.409 +    CPPFLAGS="$CPPFLAGS `krb5-config --cflags gssapi`"
   1.410 +    LIBS="$LIBS `krb5-config --libs gssapi`"
   1.411 +%endif
   1.412 +    ./configure \
   1.413 +        --prefix=%{l_prefix} \
   1.414 +        --sysconfdir=%{l_prefix}/etc/proftpd \
   1.415 +        --localstatedir=%{l_prefix}/var/proftpd \
   1.416 +        --with-modules="$MOD" \
   1.417 +        --with-includes="$MOD_INC" \
   1.418 +        --with-libraries="$MOD_LIB" \
   1.419 +        --enable-buffer-size=1024 \
   1.420 +%if "%{with_ctrls}" == "yes"
   1.421 +        --enable-ctrls \
   1.422 +%endif
   1.423 +%if "%{with_pam}" == "yes"
   1.424 +        --enable-auth-pam
   1.425 +%else
   1.426 +        --disable-auth-pam
   1.427 +%endif
   1.428 +
   1.429 +    #   build ProFTPd programs
   1.430 +    %{l_make} %{l_mflags}
   1.431 +
   1.432 +%install
   1.433 +    rm -rf $RPM_BUILD_ROOT
   1.434 +
   1.435 +    #   make sure the "install" procedure does not try
   1.436 +    #   to perform explicit ownership assignments
   1.437 +    %{l_shtool} subst -v \
   1.438 +        -e 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \
   1.439 +        -e 's;chown;true;g' \
   1.440 +        Makefile Make.rules
   1.441 +
   1.442 +    #   perform the "install" procedure while redirecting
   1.443 +    #   it to the temporarily install area
   1.444 +    %{l_make} %{l_mflags} \
   1.445 +        install-proftpd install-utils install-man \
   1.446 +        prefix=$RPM_BUILD_ROOT%{l_prefix} \
   1.447 +        bindir=$RPM_BUILD_ROOT%{l_prefix}/bin \
   1.448 +        sbindir=$RPM_BUILD_ROOT%{l_prefix}/sbin \
   1.449 +        sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \
   1.450 +        localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \
   1.451 +        rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd
   1.452 +
   1.453 +    #   strip installation
   1.454 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd
   1.455 +
   1.456 +    #   install more stuff manually
   1.457 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd
   1.458 +    %{l_shtool} install -c -m 644 doc/faq.html \
   1.459 +        $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html
   1.460 +    %{l_shtool} install -c -m 644 doc/Configuration.html \
   1.461 +        $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html
   1.462 +
   1.463 +    #   extended installation with own stuff
   1.464 +    l_pam="#"
   1.465 +%if "%{with_pam}" == "yes"
   1.466 +    l_pam=""
   1.467 +%endif
   1.468 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.469 +        -e "s;@l_pam@;${l_pam};g" \
   1.470 +        %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
   1.471 +    %{l_shtool} install -c -m 644 \
   1.472 +        %{SOURCE proftpd.msg.goaway} \
   1.473 +        %{SOURCE proftpd.msg.login} \
   1.474 +        $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
   1.475 +    %{l_shtool} install -c -m 644 \
   1.476 +        %{SOURCE proftpd.msg.login} \
   1.477 +        $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login
   1.478 +    %{l_shtool} install -c -m 644 \
   1.479 +        %{SOURCE proftpd.msg.goaway} \
   1.480 +        $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway
   1.481 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.482 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.483 +        %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.484 +
   1.485 +    #   determine the package ingredients
   1.486 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.487 +        %{l_files_std} \
   1.488 +        '%config %attr(0600,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/proftpd/proftpd.conf' \
   1.489 +        '%config %{l_prefix}/etc/proftpd/proftpd.msg.*'
   1.490 +
   1.491 +%files -f files
   1.492 +
   1.493 +%clean
   1.494 +    rm -rf $RPM_BUILD_ROOT
   1.495 +
   1.496 +%post
   1.497 +%if "%{with_pam}" == "yes"
   1.498 +    #   add PAM configuration entry
   1.499 +    if [ $1 -eq 1 ]; then
   1.500 +        $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=proftpd
   1.501 +    fi
   1.502 +%endif
   1.503 +
   1.504 +    #   after upgrade, restart service
   1.505 +    [ $1 -eq 2 ] || exit 0
   1.506 +    eval `%{l_rc} proftpd status 2>/dev/null`
   1.507 +    [ ".$proftpd_active" = .yes ] && %{l_rc} proftpd restart
   1.508 +    exit 0
   1.509 +
   1.510 +%preun
   1.511 +    #   before erase, stop service and remove log files
   1.512 +    [ $1 -eq 0 ] || exit 0
   1.513 +    %{l_rc} proftpd stop 2>/dev/null
   1.514 +    rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log* >/dev/null 2>&1 || true
   1.515 +    rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid  >/dev/null 2>&1 || true
   1.516 +%if "%{with_pam}" == "yes"
   1.517 +    #   remove PAM configuration entry
   1.518 +    $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=proftpd
   1.519 +%endif
   1.520 +    exit 0
   1.521 +

mercurial