Tue, 21 Apr 2009 11:54:34 +0200
Import package vendor original specs for necessary manipulations.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/proftpd/proftpd.conf Tue Apr 21 11:54:34 2009 +0200 1.3 @@ -0,0 +1,105 @@ 1.4 +## 1.5 +## proftpd.conf -- ProFTPD Configuration 1.6 +## 1.7 + 1.8 +ServerType standalone 1.9 +DefaultServer off 1.10 +SocketBindTight on 1.11 +Port none 1.12 + 1.13 +MaxInstances 40 1.14 +User @l_nusr@ 1.15 +Group @l_ngrp@ 1.16 +Umask 022 022 1.17 + 1.18 +UseReverseDNS off 1.19 +MultilineRFC2228 on 1.20 +ShowSymlinks on 1.21 +AllowOverwrite on 1.22 +MaxLoginAttempts 2 1.23 +RequireValidShell yes 1.24 +ListOptions "-l" 1.25 + 1.26 +@l_pam@AuthPAM on 1.27 +@l_pam@AuthPAMConfig proftpd 1.28 +@l_pam@AuthPAMAuthoritative off 1.29 +#PersistentPasswd off 1.30 + 1.31 +CommandBufferSize 1023 1.32 +TimeoutLogin 120 1.33 +TimeoutNoTransfer 600 1.34 +TimeoutStalled 600 1.35 +TimeoutIdle 1200 1.36 + 1.37 +LogFormat default "%h %l %u %t \"%r\" %s %b" 1.38 +LogFormat auth "%v [%P] %h %t \"%r\" %s" 1.39 +LogFormat write "%h %l %u %t \"%r\" %s %b" 1.40 +SystemLog @l_prefix@/var/proftpd/proftpd.system.log 1.41 +ScoreboardFile @l_prefix@/var/proftpd/proftpd.scoreboard 1.42 + 1.43 +<Global> 1.44 + ExtendedLog @l_prefix@/var/proftpd/proftpd.access.log WRITE,READ write 1.45 + ExtendedLog @l_prefix@/var/proftpd/proftpd.auth.log AUTH auth 1.46 + TransferLog @l_prefix@/var/proftpd/proftpd.xfer.log 1.47 + IdentLookups off 1.48 + DeferWelcome off 1.49 + DisplayGoAway @l_prefix@/etc/proftpd/proftpd.msg.goaway 1.50 + DisplayLogin @l_prefix@/etc/proftpd/proftpd.msg.login 1.51 + DisplayChdir .message true 1.52 + DisplayReadme README* 1.53 + WTmpLog off 1.54 +</Global> 1.55 + 1.56 +<Directory /*> 1.57 + AllowOverwrite on 1.58 +</Directory> 1.59 + 1.60 +# sample virtual Anonymous-FTP only server 1.61 +<VirtualHost 127.0.0.1> 1.62 + Port 21 1.63 + PassivePorts 49152 65535 1.64 + ServerIdent on "localhost FTP Server (ProFTPD) ready." 1.65 + ServerAdmin root@localhost 1.66 + MaxClients 20 1.67 + 1.68 + # allow anonymous logins only 1.69 + <Limit LOGIN> 1.70 + DenyAll 1.71 + </Limit> 1.72 + 1.73 + # Anonymous-FTP 1.74 + <Anonymous @l_prefix@/share/proftpd> 1.75 + User @l_nusr@ 1.76 + Group @l_ngrp@ 1.77 + UserAlias anonymous @l_nusr@ 1.78 + UserAlias ftp @l_nusr@ 1.79 + RootLogin off 1.80 + UseFtpUsers off 1.81 + MaxClients 10 "Sorry, max %m users allowed -- try again later, please." 1.82 + RequireValidShell off 1.83 + DisplayGoAway /.msg.goaway 1.84 + DisplayLogin /.msg.login 1.85 + <Limit LOGIN> 1.86 + AllowAll 1.87 + </Limit> 1.88 + <Limit WRITE> 1.89 + DenyAll 1.90 + </Limit> 1.91 + <Limit READ DIRS> 1.92 + IgnoreHidden on 1.93 + </Limit> 1.94 + # optionally allow uploads to a particular directory 1.95 + #<Directory incoming/*> 1.96 + # <Limit STOR> 1.97 + # AllowAll 1.98 + # </Limit> 1.99 + # <Limit WRITE DIRS READ> 1.100 + # DenyAll 1.101 + # </Limit> 1.102 + # <Limit CWD XCWD CDUP> 1.103 + # AllowAll 1.104 + # </Limit> 1.105 + #</Directory> 1.106 + </Anonymous> 1.107 +</VirtualHost> 1.108 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/proftpd/proftpd.msg.goaway Tue Apr 21 11:54:34 2009 +0200 2.3 @@ -0,0 +1,2 @@ 2.4 +Sorry, access is denied because there are already the maximum 2.5 +number of connections (%z) established in your access class.
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/proftpd/proftpd.msg.login Tue Apr 21 11:54:34 2009 +0200 3.3 @@ -0,0 +1,3 @@ 3.4 +You are number %N of maximal %M users in your access class. 3.5 +Our localtime is %T. 3.6 +Contact <%E> in case of problems.
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/proftpd/proftpd.patch Tue Apr 21 11:54:34 2009 +0200 4.3 @@ -0,0 +1,117 @@ 4.4 +Index: mod_otp/mod_otp.c 4.5 +--- mod_otp/mod_otp.c.orig 2006-12-06 17:13:06 +0100 4.6 ++++ mod_otp/mod_otp.c 2009-01-27 08:33:56 +0100 4.7 +@@ -79,7 +79,7 @@ 4.8 + CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL); 4.9 + 4.10 + bool = get_boolean(cmd, 1); 4.11 +- if ((bool == -1) 4.12 ++ if (bool == -1) 4.13 + CONF_ERROR(cmd, "expecting Boolean parameter"); 4.14 + 4.15 + c = add_config_param(cmd->argv[0], 1, NULL); 4.16 +@@ -128,7 +128,7 @@ 4.17 + ": error generating challenge for user '%s': %s", cmd->argv[1], str); 4.18 + 4.19 + } else 4.20 +- pr_add_response_dup(R_DUP, "Challenge: [ %s ]", challenge); 4.21 ++ pr_response_add(R_DUP, "Challenge: [ %s ]", challenge); 4.22 + 4.23 + return DECLINED(cmd); 4.24 + } 4.25 +Index: mod_sql_odbc/mod_sql_odbc.c 4.26 +--- mod_sql_odbc/mod_sql_odbc.c.orig 2007-04-17 17:05:18 +0200 4.27 ++++ mod_sql_odbc/mod_sql_odbc.c 2009-01-27 19:16:56 +0100 4.28 +@@ -890,8 +890,8 @@ 4.29 + 4.30 + /* Set up our timer, if necessary. */ 4.31 + if (entry->ttl > 0) { 4.32 +- entry->timer = add_timer(entry->ttl, -1, &sql_odbc_module, 4.33 +- sqlodbc_timer_cb); 4.34 ++ entry->timer = pr_timer_add(entry->ttl, -1, &sql_odbc_module, 4.35 ++ sqlodbc_timer_cb, "mod_sql_odbc TTL"); 4.36 + 4.37 + sql_log(DEBUG_INFO, "'%s' connection: %d second timer started", 4.38 + entry->name, entry->ttl); 4.39 +Index: mod_sql_sqlite/mod_sql_sqlite.c 4.40 +--- mod_sql_sqlite/mod_sql_sqlite.c.orig 2007-05-21 17:37:11 +0200 4.41 ++++ mod_sql_sqlite/mod_sql_sqlite.c 2009-01-27 19:15:57 +0100 4.42 +@@ -236,8 +236,8 @@ 4.43 + 4.44 + /* Set up our timer, if necessary. */ 4.45 + if (entry->ttl > 0) { 4.46 +- entry->timer = add_timer(entry->ttl, -1, &sql_sqlite_module, 4.47 +- sql_sqlite_timer_cb); 4.48 ++ entry->timer = pr_timer_add(entry->ttl, -1, &sql_sqlite_module, 4.49 ++ sql_sqlite_timer_cb, "mod_sql_sqlite TTL"); 4.50 + 4.51 + sql_log(DEBUG_INFO, "'%s' connection: %d second timer started", 4.52 + entry->name, entry->ttl); 4.53 +Index: mod_time/mod_time.c 4.54 +--- mod_time/mod_time.c.orig 2004-05-12 20:57:06 +0200 4.55 ++++ mod_time/mod_time.c 2009-01-27 08:33:56 +0100 4.56 +@@ -146,7 +146,7 @@ 4.57 + /* If we don't have a password file, we create an empty array and punt. 4.58 + */ 4.59 + if (!pw) { 4.60 +- if (!name || !(pw = (struct passwd *) auth_getpwnam(p, name))) { 4.61 ++ if (!name || !(pw = (struct passwd *) pr_auth_getpwnam(p, name))) { 4.62 + *gids = make_array(p, 2, sizeof(gid_t)); 4.63 + *groups = make_array(p, 2, sizeof(char *)); 4.64 + return; 4.65 +@@ -172,7 +172,7 @@ 4.66 + /* Now populate the names of the groups. 4.67 + */ 4.68 + for (i = 0; i < total; i++) { 4.69 +- if ((gr = (struct group *) auth_getgrgid(p, ((gid_t *) xgids->elts)[i]))) 4.70 ++ if ((gr = (struct group *) pr_auth_getgrgid(p, ((gid_t *) xgids->elts)[i]))) 4.71 + *((char **) push_array(xgroups)) = pstrdup(p, gr->gr_name); 4.72 + } 4.73 + 4.74 +@@ -188,7 +188,7 @@ 4.75 + /* Nothing there...punt. 4.76 + */ 4.77 + if (!pw) { 4.78 +- if (!name || !(pw = (struct passwd *) auth_getpwnam(p, name))) { 4.79 ++ if (!name || !(pw = (struct passwd *) pr_auth_getpwnam(p, name))) { 4.80 + *gids = xgids; 4.81 + *groups = xgroups; 4.82 + return; 4.83 +@@ -197,16 +197,16 @@ 4.84 + 4.85 + /* Populate the first group name. 4.86 + */ 4.87 +- if ((gr = auth_getgrgid(p, pw->pw_gid)) != NULL) 4.88 ++ if ((gr = pr_auth_getgrgid(p, pw->pw_gid)) != NULL) 4.89 + *((char **) push_array(xgroups)) = pstrdup(p, gr->gr_name); 4.90 + 4.91 +- auth_setgrent(p); 4.92 ++ pr_auth_setgrent(p); 4.93 + 4.94 + /* This is where things get slow, expensive, and ugly. 4.95 + * Loop through everything, checking to make sure we haven't already added 4.96 + * it. This is why we have getgroups() and company. 4.97 + */ 4.98 +- while ((gr = auth_getgrent(p)) != NULL && gr->gr_mem) 4.99 ++ while ((gr = pr_auth_getgrent(p)) != NULL && gr->gr_mem) 4.100 + for (gr_mem = gr->gr_mem; *gr_mem; gr_mem++) { 4.101 + if (strcmp(*gr_mem, pw->pw_name) == 0) { 4.102 + *((int *) push_array(xgids)) = (int) gr->gr_gid; 4.103 +@@ -634,7 +634,7 @@ 4.104 + if (!session.user) { 4.105 + /* Populate the pw struct, check for a NULL return value. */ 4.106 + 4.107 +- if ((pw = auth_getpwnam(cmd->tmp_pool, user)) == NULL) 4.108 ++ if ((pw = pr_auth_getpwnam(cmd->tmp_pool, user)) == NULL) 4.109 + return NULL; 4.110 + 4.111 + time_user = pstrdup(session.pool, pw->pw_name); 4.112 +@@ -1603,7 +1603,7 @@ 4.113 + "%R", (session.c && session.c->remote_name ? session.c->remote_name : "(unknown)"), 4.114 + "%L", main_server->ServerFQDN, 4.115 + "%U", user, 4.116 +- "%u", session.ident_user, 4.117 ++ "%u", session.user, 4.118 + "%M", mesg_max, 4.119 + "%N", mesg_cur, 4.120 + "%E", main_server->ServerAdmin,
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/proftpd/proftpd.spec Tue Apr 21 11:54:34 2009 +0200 5.3 @@ -0,0 +1,518 @@ 5.4 +## 5.5 +## proftpd.spec -- OpenPKG RPM Package Specification 5.6 +## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> 5.7 +## 5.8 +## Permission to use, copy, modify, and distribute this software for 5.9 +## any purpose with or without fee is hereby granted, provided that 5.10 +## the above copyright notice and this permission notice appear in all 5.11 +## copies. 5.12 +## 5.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 5.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 5.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 5.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 5.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 5.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 5.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 5.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 5.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 5.24 +## SUCH DAMAGE. 5.25 +## 5.26 + 5.27 +# package version 5.28 +%define V_proftpd 1.3.2 5.29 +%define V_mod_exec 0.9.6 5.30 +%define V_mod_otp 0.9.1 5.31 +%define V_mod_shaper 0.6.5 5.32 +%define V_mod_sql_sqlite 0.2 5.33 +%define V_mod_sql_odbc 0.3.2 5.34 +%define V_mod_time 2.2.1 5.35 +%define V_mod_vroot 0.8.5 5.36 +%define V_mod_gss 1.3.2 5.37 +%define V_mod_sftp 0.9.6 5.38 +%define V_mod_sftp_sql 0.1 5.39 +%define V_mod_md5 0.3.3 5.40 + 5.41 +# package information 5.42 +Name: proftpd 5.43 +Summary: Professional FTP Daemon 5.44 +URL: http://www.proftpd.org/ 5.45 +Vendor: The ProFTPD Project 5.46 +Packager: OpenPKG Foundation e.V. 5.47 +Distribution: OpenPKG Community 5.48 +Class: BASE 5.49 +Group: FTP 5.50 +License: GPL 5.51 +Version: %{V_proftpd} 5.52 +Release: 20090327 5.53 + 5.54 +# package options 5.55 +%option with_ifsession no 5.56 +%option with_ctrls no 5.57 +%option with_radius no 5.58 +%option with_pam no 5.59 +%option with_mysql no 5.60 +%option with_pgsql no 5.61 +%option with_sqlite no 5.62 +%option with_odbc no 5.63 +%option with_ldap no 5.64 +%option with_skey no 5.65 +%option with_opie no 5.66 +%option with_kerberos no 5.67 +%option with_ssl no 5.68 +%option with_sftp no 5.69 +%option with_md5 no 5.70 + 5.71 +# checking option conflicts 5.72 +%if "%{with_mysql}" == "yes" && "%{with_pgsql}" == "yes" 5.73 + %{error:build-time options 'with_mysql' and 'with_pgsql' conflict} 5.74 +%endif 5.75 + 5.76 +# list of sources 5.77 +Source0: ftp://ftp.proftpd.org/distrib/source/proftpd-%{V_proftpd}.tar.bz2 5.78 +Source1: http://www.castaglia.net/proftpd/modules/proftpd-mod-exec-%{V_mod_exec}.tar.gz 5.79 +Source2: http://www.castaglia.net/proftpd/modules/proftpd-mod-otp-%{V_mod_otp}.tar.gz 5.80 +Source3: http://www.castaglia.net/proftpd/modules/proftpd-mod-shaper-%{V_mod_shaper}.tar.gz 5.81 +Source4: http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-sqlite-%{V_mod_sql_sqlite}.tar.gz 5.82 +Source5: http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-odbc-%{V_mod_sql_odbc}.tar.gz 5.83 +Source6: http://www.castaglia.net/proftpd/modules/proftpd-mod-time-%{V_mod_time}.tar.gz 5.84 +Source7: http://www.castaglia.net/proftpd/modules/proftpd-mod-vroot-%{V_mod_vroot}.tar.gz 5.85 +Source8: http://switch.dl.sourceforge.net/gssmod/mod_gss-%{V_mod_gss}.tar.gz 5.86 +Source9: http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-%{V_mod_sftp}.tar.gz 5.87 +Source10: http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-sql-%{V_mod_sftp_sql}.tar.gz 5.88 +Source11: http://www.castaglia.net/proftpd/modules/proftpd-mod-md5-%{V_mod_md5}.tar.gz 5.89 +Source12: proftpd.conf 5.90 +Source13: proftpd.msg.goaway 5.91 +Source14: proftpd.msg.login 5.92 +Source15: rc.proftpd 5.93 +Patch0: proftpd.patch 5.94 + 5.95 +# build information 5.96 +Prefix: %{l_prefix} 5.97 +BuildRoot: %{l_buildroot} 5.98 +BuildPreReq: OpenPKG, openpkg >= 20060823, make 5.99 +PreReq: OpenPKG, openpkg >= 20060823 5.100 +BuildPreReq: ncurses, getopt 5.101 +PreReq: ncurses, getopt 5.102 +%if "%{with_mysql}" == "yes" 5.103 +BuildPreReq: mysql 5.104 +PreReq: mysql 5.105 +%endif 5.106 +%if "%{with_pam}" == "yes" 5.107 +BuildPreReq: PAM 5.108 +PreReq: PAM 5.109 +%endif 5.110 +%if "%{with_pgsql}" == "yes" 5.111 +BuildPreReq: postgresql, openssl 5.112 +PreReq: postgresql, openssl 5.113 +%endif 5.114 +%if "%{with_sqlite}" == "yes" 5.115 +BuildPreReq: sqlite 5.116 +PreReq: sqlite 5.117 +%endif 5.118 +%if "%{with_odbc}" == "yes" 5.119 +BuildPreReq: ODBC 5.120 +PreReq: ODBC 5.121 +%endif 5.122 +%if "%{with_ldap}" == "yes" 5.123 +BuildPreReq: openldap, openssl 5.124 +PreReq: openldap, openssl 5.125 +%endif 5.126 +%if "%{with_skey}" == "yes" 5.127 +BuildPreReq: skey 5.128 +PreReq: skey 5.129 +%endif 5.130 +%if "%{with_opie}" == "yes" 5.131 +BuildPreReq: opie 5.132 +PreReq: opie 5.133 +%endif 5.134 +%if "%{with_kerberos}" == "yes" 5.135 +BuildPreReq: KERBEROS 5.136 +PreReq: KERBEROS 5.137 +%endif 5.138 +%if "%{with_ssl}" == "yes" || "%{with_sftp}" == "yes" 5.139 +BuildPreReq: openssl 5.140 +PreReq: openssl 5.141 +%endif 5.142 +AutoReq: no 5.143 +AutoReqProv: no 5.144 + 5.145 +%description 5.146 + ProFTPD grew out of the desire to have a secure and configurable 5.147 + FTP server, and out of a significant admiration of the Apache web 5.148 + server. There are currently a very limited number of FTP servers 5.149 + running on unix (or unix-like) hosts. The most commonly used server 5.150 + is probably wu-ftpd. While wu-ftpd provides excellent performance 5.151 + and is generally a good product, it lacks numerous features found 5.152 + in newer Win32 FTP servers, and has a poor security history. Many 5.153 + people, including the developers who work on ProFTPD have spent a 5.154 + great deal of time fixing bugs and hacking features into wu-ftpd. 5.155 + Unfortunately, it quickly became clear that a complete redesign was 5.156 + necessary in order to implement the configurability and features 5.157 + desired. ProFTPD is not a hack based on any other server, it's an 5.158 + independent source tree from the ground up. Click here for a small 5.159 + list of some of the sites ProFTPD powers -- many of them handling 5.160 + large volumes of traffic on a daily basis. 5.161 + 5.162 +%track 5.163 + prog proftpd = { 5.164 + version = %{V_proftpd} 5.165 + url = ftp://ftp.proftpd.org/distrib/source/ 5.166 + regex = proftpd-(\d+\.\d+\.\d+(?:rc\d+|[a-z]?))\.tar\.bz2 5.167 + } 5.168 + prog proftpd:mod_exec = { 5.169 + version = %{V_mod_exec} 5.170 + url = http://www.castaglia.net/proftpd/ 5.171 + regex = proftpd-mod-exec-(__VER__)\.tar\.gz 5.172 + } 5.173 + prog proftpd:mod_shaper = { 5.174 + version = %{V_mod_shaper} 5.175 + url = http://www.castaglia.net/proftpd/ 5.176 + regex = proftpd-mod-shaper-(__VER__)\.tar\.gz 5.177 + } 5.178 + prog proftpd:mod_sql_sqlite = { 5.179 + version = %{V_mod_sql_sqlite} 5.180 + url = http://www.castaglia.net/proftpd/ 5.181 + regex = proftpd-mod-sql-sqlite-(__VER__)\.tar\.gz 5.182 + } 5.183 + prog proftpd:mod_sql_odbc = { 5.184 + version = %{V_mod_sql_odbc} 5.185 + url = http://www.castaglia.net/proftpd/ 5.186 + regex = proftpd-mod-sql-odbc-(__VER__)\.tar\.gz 5.187 + } 5.188 + prog proftpd:mod_time = { 5.189 + version = %{V_mod_time} 5.190 + url = http://www.castaglia.net/proftpd/ 5.191 + regex = proftpd-mod-time-(__VER__)\.tar\.gz 5.192 + } 5.193 + prog proftpd:mod_vroot = { 5.194 + version = %{V_mod_vroot} 5.195 + url = http://www.castaglia.net/proftpd/ 5.196 + regex = proftpd-mod-vroot-(__VER__)\.tar\.gz 5.197 + } 5.198 + prog proftpd:mod_gss = { 5.199 + version = %{V_mod_gss} 5.200 + url = http://prdownloads.sourceforge.net/gssmod/ 5.201 + regex = mod_gss-(__VER__)\.tar\.gz 5.202 + } 5.203 + prog proftpd:mod_sftp = { 5.204 + version = %{V_mod_sftp} 5.205 + url = http://www.castaglia.net/proftpd/ 5.206 + regex = proftpd-mod-sftp-(__VER__)\.tar\.gz 5.207 + } 5.208 + prog proftpd:mod_sftp_sql = { 5.209 + version = %{V_mod_sftp_sql} 5.210 + url = http://www.castaglia.net/proftpd/ 5.211 + regex = proftpd-mod-sftp-sql-(__VER__)\.tar\.gz 5.212 + } 5.213 + prog proftpd:mod_md5 = { 5.214 + version = %{V_mod_md5} 5.215 + url = http://www.castaglia.net/proftpd/ 5.216 + regex = proftpd-mod-md5-(__VER__)\.tar\.gz 5.217 + } 5.218 + 5.219 +%prep 5.220 + %setup -q 5.221 + %setup -q -D -T -a 1 5.222 + %setup -q -D -T -a 2 5.223 + %setup -q -D -T -a 3 5.224 + %setup -q -D -T -a 4 5.225 + %setup -q -D -T -a 5 5.226 + %setup -q -D -T -a 6 5.227 + %setup -q -D -T -a 7 5.228 + %setup -q -D -T -a 8 5.229 + %setup -q -D -T -a 9 5.230 + %setup -q -D -T -a 10 5.231 + %setup -q -D -T -a 11 5.232 + %patch -p0 5.233 + 5.234 + %{l_shtool} subst \ 5.235 + -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \ 5.236 + configure 5.237 + 5.238 + # utils require to link with getopt 5.239 + %{l_shtool} subst \ 5.240 + -e 's;\(\$(BUILD_FTPCOUNT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ 5.241 + -e 's;\(\$(BUILD_FTPSHUT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ 5.242 + -e 's;\(\$(BUILD_FTPTOP_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ 5.243 + -e 's;\(\$(BUILD_FTPWHO_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \ 5.244 + Makefile.in 5.245 +%if "%{with_mysql}" == "yes" 5.246 + libs=`mysql_config --libs` 5.247 + # libmysqlclient may require more libraries 5.248 + %{l_shtool} subst \ 5.249 + -e "s;\(-lmysqlclient\);$libs;g" \ 5.250 + contrib/mod_sql_mysql.c 5.251 +%endif 5.252 + 5.253 + # libpq also requires openssl 5.254 + # postgresql also doesn't provide its own include subdirectory 5.255 + %{l_shtool} subst \ 5.256 + -e 's;\(-lpq\);\1 -lssl -lcrypto;g' \ 5.257 + -e 's;^\(#include <\)pgsql/\(libpq-fe.h>.*\)$;\1postgresql/\2;' \ 5.258 + contrib/mod_sql_postgres.c 5.259 + 5.260 + # libldap also requires openssl 5.261 + %{l_shtool} subst \ 5.262 + -e 's;\(-llber\);\1 -lssl -lcrypto;g' \ 5.263 + contrib/mod_ldap.c 5.264 + 5.265 + # prepare mod_otp module 5.266 +%if "%{with_skey}" == "yes" || "%{with_opie}" == "yes" 5.267 + ( cd mod_otp 5.268 + CC="%{l_cc}" \ 5.269 + CFLAGS="%{l_cflags -O}" \ 5.270 + CPPFLAGS="%{l_cppflags}" \ 5.271 + LDFLAGS="%{l_ldflags}" \ 5.272 + ./configure \ 5.273 +%if "%{with_skey}" == "yes" 5.274 + --with-skey \ 5.275 +%endif 5.276 +%if "%{with_opie}" == "yes" 5.277 + --with-opie \ 5.278 +%endif 5.279 + %{l_nil} 5.280 + cp mod_otp.[ch] ../contrib/ 5.281 + ) || exit $? 5.282 +%endif 5.283 + 5.284 + # prepare mod_sql_odbc module 5.285 +%if "%{with_odbc}" == "yes" 5.286 + ( cd mod_sql_odbc 5.287 + if [ -f %{l_prefix}/etc/unixodbc/odbc.ini ]; then 5.288 + ./configure --enable-unixodbc 5.289 + else 5.290 + ./configure --enable-iodbc 5.291 + fi 5.292 + ) || exit $? 5.293 +%endif 5.294 + 5.295 + # prepare optional add-on modules 5.296 + cp mod_exec/mod_exec.c contrib/ 5.297 + cp mod_sql_sqlite/mod_sql_sqlite.c contrib/ 5.298 + cp mod_sql_odbc/mod_sql_odbc.[ch] contrib/ 5.299 + cp mod_time/mod_time.c contrib/ 5.300 + cp mod_vroot/mod_vroot.c contrib/ 5.301 +%if "%{with_ctrls}" == "yes" 5.302 + cp mod_shaper/mod_shaper.c contrib/ 5.303 +%endif 5.304 +%if "%{with_sftp}" == "yes" 5.305 + cp -r mod_sftp contrib/ 5.306 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes" 5.307 + cp mod_sftp_sql/mod_sftp_sql.c contrib/ 5.308 +%endif 5.309 +%endif 5.310 +%if "%{with_md5}" == "yes" 5.311 + cp mod_md5/mod_md5.c contrib/ 5.312 +%endif 5.313 + 5.314 + # prepare mod_gss module 5.315 +%if "%{with_kerberos}" == "yes" 5.316 + ( cd mod_gss-* 5.317 + CC="%{l_cc}" \ 5.318 + CFLAGS="%{l_cflags -O}" \ 5.319 + CPPFLAGS="%{l_cppflags}" \ 5.320 + LDFLAGS="%{l_ldflags}" \ 5.321 + ./configure \ 5.322 + --prefix=%{l_prefix} \ 5.323 + `if [ -d %{l_prefix}/include/heimdal ]; then \ 5.324 + echo "--enable-heimdal"; \ 5.325 + else \ 5.326 + echo "--enable-mit"; \ 5.327 + fi` 5.328 + cp mod_gss.h ../include/ 5.329 + cp mod_gss.c ../contrib/ 5.330 + ) || exit $? 5.331 +%endif 5.332 + 5.333 +%build 5.334 + # make non-standard "rundir" the same as standard "sysconfdir" 5.335 + %{l_shtool} subst \ 5.336 + -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \ 5.337 + Make.rules.in 5.338 + %{l_shtool} subst \ 5.339 + -e 's;^\(#define PR_RUN_DIR "`eval echo "${localstatedir}\)/proftpd;\1;' \ 5.340 + configure 5.341 + 5.342 + # write shutdown message file to OpenPKG instance, not outside 5.343 + %{l_shtool} subst \ 5.344 + -e 's;\(#define PR_SHUTMSG_PATH.*"\)\(/etc/\)\(shutmsg\)";\1%{l_prefix}\2proftpd/\3";' \ 5.345 + include/default_paths.h 5.346 + 5.347 + # configure the ProFTPd source tree 5.348 + MOD="mod_ratio:mod_readme:mod_exec:mod_time:mod_vroot" 5.349 + MOD_INC="%{l_prefix}/include" 5.350 + MOD_LIB="%{l_prefix}/lib" 5.351 +%if "%{with_ifsession}" == "yes" 5.352 + MOD="$MOD:mod_ifsession" 5.353 +%endif 5.354 +%if "%{with_ctrls}" == "yes" 5.355 + MOD="$MOD:mod_shaper" 5.356 + MOD="$MOD:mod_ctrls_admin" 5.357 +%endif 5.358 +%if "%{with_radius}" == "yes" 5.359 + MOD="$MOD:mod_radius" 5.360 +%endif 5.361 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes" 5.362 + MOD="$MOD:mod_sql" 5.363 +%if "%{with_mysql}" == "yes" 5.364 + MOD="$MOD:mod_sql_mysql" 5.365 + MOD_INC=":%{l_prefix}/include/mysql" 5.366 +%endif 5.367 +%if "%{with_pgsql}" == "yes" 5.368 + MOD="$MOD:mod_sql_postgres" 5.369 + MOD_INC=":%{l_prefix}/include/postgresql" 5.370 +%endif 5.371 +%if "%{with_sqlite}" == "yes" 5.372 + MOD="$MOD:mod_sql_sqlite" 5.373 +%endif 5.374 +%if "%{with_odbc}" == "yes" 5.375 + MOD="$MOD:mod_sql_odbc" 5.376 +%endif 5.377 +%endif 5.378 +%if "%{with_ldap}" == "yes" 5.379 + MOD="$MOD:mod_ldap" 5.380 +%endif 5.381 +%if "%{with_skey}" == "yes" || "%{with_opie}" == "yes" 5.382 + MOD="$MOD:mod_otp" 5.383 +%endif 5.384 +%if "%{with_kerberos}" == "yes" 5.385 + MOD="$MOD:mod_gss" 5.386 +%endif 5.387 +%if "%{with_ssl}" == "yes" 5.388 + MOD="$MOD:mod_tls" 5.389 +%endif 5.390 +%if "%{with_sftp}" == "yes" 5.391 + MOD="$MOD:mod_sftp" 5.392 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes" 5.393 + MOD="$MOD:mod_sftp_sql" 5.394 +%endif 5.395 +%endif 5.396 +%if "%{with_md5}" == "yes" 5.397 + MOD="$MOD:mod_md5" 5.398 +%endif 5.399 + export CC="%{l_cc}" 5.400 + export CFLAGS="%{l_cflags -O}" 5.401 + export CPPFLAGS="%{l_cppflags ncurses}" 5.402 + export LDFLAGS="%{l_ldflags}" 5.403 + export LIBS="-lgetopt" 5.404 +%if "%{with_pam}" == "yes" 5.405 + CPPFLAGS="$CPPFLAGS -I`%{l_rc} --query pam_incdir`" 5.406 + LDFLAGS="$LDFLAGS -L`%{l_rc} --query pam_libdir`" 5.407 +%endif 5.408 +%if "%{with_kerberos}" == "yes" 5.409 + CPPFLAGS="$CPPFLAGS `krb5-config --cflags gssapi`" 5.410 + LIBS="$LIBS `krb5-config --libs gssapi`" 5.411 +%endif 5.412 + ./configure \ 5.413 + --prefix=%{l_prefix} \ 5.414 + --sysconfdir=%{l_prefix}/etc/proftpd \ 5.415 + --localstatedir=%{l_prefix}/var/proftpd \ 5.416 + --with-modules="$MOD" \ 5.417 + --with-includes="$MOD_INC" \ 5.418 + --with-libraries="$MOD_LIB" \ 5.419 + --enable-buffer-size=1024 \ 5.420 +%if "%{with_ctrls}" == "yes" 5.421 + --enable-ctrls \ 5.422 +%endif 5.423 +%if "%{with_pam}" == "yes" 5.424 + --enable-auth-pam 5.425 +%else 5.426 + --disable-auth-pam 5.427 +%endif 5.428 + 5.429 + # build ProFTPd programs 5.430 + %{l_make} %{l_mflags} 5.431 + 5.432 +%install 5.433 + rm -rf $RPM_BUILD_ROOT 5.434 + 5.435 + # make sure the "install" procedure does not try 5.436 + # to perform explicit ownership assignments 5.437 + %{l_shtool} subst -v \ 5.438 + -e 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \ 5.439 + -e 's;chown;true;g' \ 5.440 + Makefile Make.rules 5.441 + 5.442 + # perform the "install" procedure while redirecting 5.443 + # it to the temporarily install area 5.444 + %{l_make} %{l_mflags} \ 5.445 + install-proftpd install-utils install-man \ 5.446 + prefix=$RPM_BUILD_ROOT%{l_prefix} \ 5.447 + bindir=$RPM_BUILD_ROOT%{l_prefix}/bin \ 5.448 + sbindir=$RPM_BUILD_ROOT%{l_prefix}/sbin \ 5.449 + sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \ 5.450 + localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \ 5.451 + rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd 5.452 + 5.453 + # strip installation 5.454 + rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd 5.455 + 5.456 + # install more stuff manually 5.457 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd 5.458 + %{l_shtool} install -c -m 644 doc/faq.html \ 5.459 + $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html 5.460 + %{l_shtool} install -c -m 644 doc/Configuration.html \ 5.461 + $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html 5.462 + 5.463 + # extended installation with own stuff 5.464 + l_pam="#" 5.465 +%if "%{with_pam}" == "yes" 5.466 + l_pam="" 5.467 +%endif 5.468 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 5.469 + -e "s;@l_pam@;${l_pam};g" \ 5.470 + %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/ 5.471 + %{l_shtool} install -c -m 644 \ 5.472 + %{SOURCE proftpd.msg.goaway} \ 5.473 + %{SOURCE proftpd.msg.login} \ 5.474 + $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/ 5.475 + %{l_shtool} install -c -m 644 \ 5.476 + %{SOURCE proftpd.msg.login} \ 5.477 + $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login 5.478 + %{l_shtool} install -c -m 644 \ 5.479 + %{SOURCE proftpd.msg.goaway} \ 5.480 + $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway 5.481 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 5.482 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 5.483 + %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 5.484 + 5.485 + # determine the package ingredients 5.486 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 5.487 + %{l_files_std} \ 5.488 + '%config %attr(0600,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/proftpd/proftpd.conf' \ 5.489 + '%config %{l_prefix}/etc/proftpd/proftpd.msg.*' 5.490 + 5.491 +%files -f files 5.492 + 5.493 +%clean 5.494 + rm -rf $RPM_BUILD_ROOT 5.495 + 5.496 +%post 5.497 +%if "%{with_pam}" == "yes" 5.498 + # add PAM configuration entry 5.499 + if [ $1 -eq 1 ]; then 5.500 + $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=proftpd 5.501 + fi 5.502 +%endif 5.503 + 5.504 + # after upgrade, restart service 5.505 + [ $1 -eq 2 ] || exit 0 5.506 + eval `%{l_rc} proftpd status 2>/dev/null` 5.507 + [ ".$proftpd_active" = .yes ] && %{l_rc} proftpd restart 5.508 + exit 0 5.509 + 5.510 +%preun 5.511 + # before erase, stop service and remove log files 5.512 + [ $1 -eq 0 ] || exit 0 5.513 + %{l_rc} proftpd stop 2>/dev/null 5.514 + rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log* >/dev/null 2>&1 || true 5.515 + rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid >/dev/null 2>&1 || true 5.516 +%if "%{with_pam}" == "yes" 5.517 + # remove PAM configuration entry 5.518 + $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=proftpd 5.519 +%endif 5.520 + exit 0 5.521 +
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/proftpd/rc.proftpd Tue Apr 21 11:54:34 2009 +0200 6.3 @@ -0,0 +1,101 @@ 6.4 +#!@l_prefix@/bin/openpkg rc 6.5 +## 6.6 +## rc.proftpd -- Run-Commands 6.7 +## 6.8 + 6.9 +%config 6.10 + proftpd_enable="$openpkg_rc_def" 6.11 + proftpd_nice="0" 6.12 + proftpd_acc_file="@l_prefix@/var/proftpd/proftpd.access.log" 6.13 + proftpd_acc_prolog="true" 6.14 + proftpd_acc_epilog="true" 6.15 + proftpd_acc_numfiles="10" 6.16 + proftpd_acc_minsize="1M" 6.17 + proftpd_acc_complevel="9" 6.18 + proftpd_auth_file="@l_prefix@/var/proftpd/proftpd.auth.log" 6.19 + proftpd_auth_prolog="true" 6.20 + proftpd_auth_epilog="true" 6.21 + proftpd_auth_numfiles="10" 6.22 + proftpd_auth_minsize="1M" 6.23 + proftpd_auth_complevel="9" 6.24 + proftpd_sys_file="@l_prefix@/var/proftpd/proftpd.system.log" 6.25 + proftpd_sys_prolog="true" 6.26 + proftpd_sys_epilog="true" 6.27 + proftpd_sys_numfiles="10" 6.28 + proftpd_sys_minsize="1M" 6.29 + proftpd_sys_complevel="9" 6.30 + proftpd_xfer_file="@l_prefix@/var/proftpd/proftpd.xfer.log" 6.31 + proftpd_xfer_prolog="true" 6.32 + proftpd_xfer_epilog="true" 6.33 + proftpd_xfer_numfiles="10" 6.34 + proftpd_xfer_minsize="1M" 6.35 + proftpd_xfer_complevel="9" 6.36 + 6.37 +%common 6.38 + proftpd_pidfile="@l_prefix@/var/proftpd/proftpd.pid" 6.39 + proftpd_signal () { 6.40 + [ -f $proftpd_pidfile ] && kill -$1 `cat $proftpd_pidfile` 6.41 + } 6.42 + 6.43 +%status -u @l_susr@ -o 6.44 + proftpd_usable="unknown" 6.45 + proftpd_active="no" 6.46 + rcService proftpd enable yes && \ 6.47 + proftpd_signal 0 && proftpd_active="yes" 6.48 + echo "proftpd_enable=\"$proftpd_enable\"" 6.49 + echo "proftpd_usable=\"$proftpd_usable\"" 6.50 + echo "proftpd_active=\"$proftpd_active\"" 6.51 + 6.52 +%start -u @l_susr@ 6.53 + rcService proftpd enable yes || exit 0 6.54 + rcService proftpd active yes && exit 0 6.55 + nice -n $proftpd_nice @l_prefix@/sbin/proftpd 6.56 + 6.57 +%stop -u @l_susr@ 6.58 + rcService proftpd enable yes || exit 0 6.59 + rcService proftpd active no && exit 0 6.60 + proftpd_signal TERM 6.61 + sleep 2 6.62 + 6.63 +%restart -u @l_susr@ 6.64 + rcService proftpd enable yes || exit 0 6.65 + rcService proftpd active no && exit 0 6.66 + rc proftpd stop start 6.67 + 6.68 +%reload -u @l_susr@ 6.69 + rcService proftpd enable yes || exit 0 6.70 + proftpd_signal HUP 6.71 + 6.72 +%daily -u @l_susr@ 6.73 + rcService proftpd enable yes || exit 0 6.74 + rcTmp -i 6.75 + hintfile=`rcTmp -f -n hint` 6.76 + shtool rotate -f \ 6.77 + -n ${proftpd_acc_numfiles} -s ${proftpd_acc_minsize} -d \ 6.78 + -z ${proftpd_acc_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ 6.79 + -P "${proftpd_acc_prolog}" \ 6.80 + -E "${proftpd_acc_epilog}; echo 1 >$hintfile" \ 6.81 + ${proftpd_acc_file} 6.82 + shtool rotate -f \ 6.83 + -n ${proftpd_auth_numfiles} -s ${proftpd_auth_minsize} -d \ 6.84 + -z ${proftpd_auth_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ 6.85 + -P "${proftpd_auth_prolog}" \ 6.86 + -E "${proftpd_auth_epilog}; echo 1 >$hintfile" \ 6.87 + ${proftpd_auth_file} 6.88 + shtool rotate -f \ 6.89 + -n ${proftpd_sys_numfiles} -s ${proftpd_sys_minsize} -d \ 6.90 + -z ${proftpd_sys_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ 6.91 + -P "${proftpd_sys_prolog}" \ 6.92 + -E "${proftpd_sys_epilog}; echo 1 >$hintfile" \ 6.93 + ${proftpd_sys_file} 6.94 + shtool rotate -f \ 6.95 + -n ${proftpd_xfer_numfiles} -s ${proftpd_xfer_minsize} -d \ 6.96 + -z ${proftpd_xfer_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ 6.97 + -P "${proftpd_xfer_prolog}" \ 6.98 + -E "${proftpd_xfer_epilog}; echo 1 >$hintfile" \ 6.99 + ${proftpd_xfer_file} 6.100 + if [ -s $hintfile ]; then 6.101 + rc proftpd restart 6.102 + fi 6.103 + rcTmp -k 6.104 +