]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd.spec
6e1d63d7e0aaf920c3a800b609e7d0c4bbf0acda
[packages/proftpd.git] / proftpd.spec
1 # TODO
2 # - why main and -common package descriptions are same?
3 #
4 # Conditional build:
5 %bcond_without  pam             # disable PAM support
6 %bcond_without  ipv6            # disable IPv6 and TCPD support
7 %bcond_without  ssl             # disbale TLS/SSL support
8 %bcond_with     ldap            # enable LDAP support
9 %bcond_with     mysql           # enable MySQL support
10 %bcond_with     pgsql           # enable PostgreSQL support
11 %bcond_with     quotafile       # enable quota file support
12 %bcond_with     quotaldap       # enable quota ldap support
13 %bcond_with     quotamysql      # enable quota mysql support
14 %bcond_with     quotapgsql      # enable quota pgsql support
15 %bcond_with     linuxprivs      # enable libcap support
16 #
17 Summary:        PROfessional FTP Daemon with apache-like configuration syntax
18 Summary(es):    Servidor FTP profesional, con sintaxis de configuración semejante a la del apache
19 Summary(pl):    PROfesionalny serwer FTP
20 Summary(pt_BR): Servidor FTP profissional, com sintaxe de configuração semelhante à do apache
21 Summary(zh_CN): Ò×ÓÚ¹ÜÀíµÄ,°²È«µÄ FTP ·þÎñÆ÷
22 Name:           proftpd
23 Version:        1.2.10
24 Release:        7
25 Epoch:          1
26 License:        GPL v2+
27 Group:          Daemons
28 Source0:        ftp://ftp.proftpd.org/distrib/source/%{name}-%{version}.tar.bz2
29 # Source0-md5:  5feb4a7348e12faefc25e34fd92efdd6
30 Source1:        %{name}.conf
31 Source3:        ftp.pamd
32 Source4:        %{name}.inetd
33 Source5:        %{name}.sysconfig
34 Source6:        %{name}.init
35 Source7:        ftpusers.tar.bz2
36 # Source7-md5:  76c80b6ec9f4d079a1e27316edddbe16
37 Source8:        http://www.castaglia.org/proftpd/modules/%{name}-mod-shaper-0.5.5.tar.gz
38 # Source8-md5:  ca3d63ffbc6ad5b6a9063f79b36d1b55
39 Patch0:         %{name}-umode_t.patch
40 Patch1:         %{name}-glibc.patch
41 Patch2:         %{name}-paths.patch
42 Patch3:         %{name}-noautopriv.patch
43 Patch4:         %{name}-wtmp.patch
44 Patch5:         %{name}-sendfile64.patch
45 Patch6:         %{name}-CAN-2005-2390.patch
46 URL:            http://www.proftpd.org/
47 BuildRequires:  autoconf
48 BuildRequires:  automake
49 BuildRequires:  libwrap-devel
50 %{?with_mysql:BuildRequires:            mysql-devel}
51 %{?with_quotamysql:BuildRequires:       mysql-devel}
52 BuildRequires:  ncurses-devel
53 %{?with_ldap:BuildRequires:             openldap-devel}
54 %{?with_quotaldap:BuildRequires:        openldap-devel}
55 %{?with_ssl:BuildRequires:              openssl-devel >= 0.9.7d}
56 %{?with_pam:BuildRequires:              pam-devel}
57 %{?with_pgsql:BuildRequires:            postgresql-devel}
58 %{?with_quotapgsql:BuildRequires:       postgresql-devel}
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %define         _sysconfdir             /etc/ftpd
62 %define         _localstatedir  /var/run
63
64 # There is no main package.
65 %description
66
67 %package common
68 Summary:        PROfessional FTP Daemon with apache-like configuration syntax - common files
69 Summary(pl):    PROfesionalny serwer FTP  - wspólne pliki
70 Group:          Daemons
71 Requires(post): awk
72 Requires(post): fileutils
73 %{?with_pam:Requires:   pam >= 0.79.0}
74 Obsoletes:      proftpd < 0:1.2.2rc1-3
75
76 %description common
77 ProFTPD is a highly configurable FTP daemon for unix and unix-like
78 operating systems. ProFTPD is designed to be somewhat of a "drop-in"
79 replacement for wu-ftpd. Full online documentation is available at
80 <http://www.proftpd.org/>, including a server configuration directive
81 reference manual.
82
83 This package also includes mod_shaper module from
84 <http://www.castaglia.org/proftpd/>
85
86 %description common -l pl
87 ProFTPD jest wysoce konfigurowalnym serwerem FTP dla systemów Unix.
88 ProFTPD jest robiony jako bezpo¶redni zamiennik wu-ftpd. Pe³na
89 dokunentacja jest dostêpna on-line pod <http://www.proftpd.org/>
90 w³±cznie z dokumentacj± dotycz±c± konfigurowania.
91
92 %description common -l es
93 ProFTPD es un servidor FTP altamente configurable para sistemas
94 operativos unix. Está proyectado para ser un substituto directo al
95 wu-ftpd. La documentación completa está disponible en
96 <http://www.proftpd.org/>, incluido el manual de referencia para las
97 directivas de configuración del servidor.
98
99 %description common -l pl
100 ProFTPD jest wysoce konfigurowalnym serwerem FTP dla systemów Unix.
101 ProFTPD jest robiony jako bezpo¶redni zamiennik wu-ftpd. Pe³na
102 dokumentacja jest dostêpna on-line pod <http://www.proftpd.org/>
103 w³±cznie z dokumentacj± dotycz±c± konfigurowania.
104
105 %description common -l pt_BR
106 O ProFTPD é um servidor FTP altamente configurável para sistemas
107 operacionais unix.
108
109 É projetado para ser um substituto direto para o wu-ftpd. A
110 documentação completa está disponível em <http://www.proftpd.org/>,
111 incluindo o manual de referência para as diretivas de configuração do
112 servidor.
113
114 %package inetd
115 Summary:        inetd configs for proftpd
116 Summary(pl):    Pliki konfiguracyjne do u¿ycia proftpd poprzez inetd
117 Group:          Daemons
118 PreReq:         %{name}-common = %{epoch}:%{version}-%{release}
119 PreReq:         rc-inetd
120 Requires(post): fileutils
121 Requires(post): grep
122 Requires(post): sed >= 4.0
123 Requires(triggerpostun):        sed >= 4.0
124 Provides:       proftpd = %{epoch}:%{version}-%{release}
125 Provides:       ftpserver
126 Obsoletes:      proftpd-standalone
127 Obsoletes:      ftpserver
128 Obsoletes:      anonftp
129 Obsoletes:      bftpd
130 Obsoletes:      ftpd-BSD
131 Obsoletes:      glftpd
132 Obsoletes:      heimdal-ftpd
133 Obsoletes:      linux-ftpd
134 Obsoletes:      muddleftpd
135 Obsoletes:      pure-ftpd
136 Obsoletes:      troll-ftpd
137 Obsoletes:      vsftpd
138 Obsoletes:      wu-ftpd
139 Conflicts:      man-pages < 1.51
140
141 %description inetd
142 ProFTPD configs for running from inetd.
143
144 %description inetd -l pl
145 Pliki konfiguracyjna ProFTPD do startowania demona poprzez inetd.
146
147 %package standalone
148 Summary:        Standalone daemon configs for proftpd
149 Summary(pl):    Pliki konfiguracyjne do startowania proftpd w trybie standalone
150 Group:          Daemons
151 PreReq:         %{name}-common = %{epoch}:%{version}-%{release}
152 PreReq:         rc-scripts
153 Requires(post,preun):   /sbin/chkconfig
154 Requires(post): fileutils
155 Requires(post): grep
156 Requires(post): sed >= 4.0
157 Requires(triggerpostun):        sed >= 4.0
158 Provides:       proftpd = %{epoch}:%{version}-%{release}
159 Provides:       ftpserver
160 Obsoletes:      proftpd-inetd
161 Obsoletes:      ftpserver
162 Obsoletes:      anonftp
163 Obsoletes:      bftpd
164 Obsoletes:      ftpd-BSD
165 Obsoletes:      glftpd
166 Obsoletes:      heimdal-ftpd
167 Obsoletes:      linux-ftpd
168 Obsoletes:      muddleftpd
169 Obsoletes:      pure-ftpd
170 Obsoletes:      troll-ftpd
171 Obsoletes:      vsftpd
172 Obsoletes:      wu-ftpd
173 Conflicts:      man-pages < 1.51
174
175 %description standalone
176 ProFTPD configs for running as a standalone daemon.
177
178 %description standalone -l pl
179 Pliki konfiguracyjne ProFTPD do startowania demona w trybie
180 standalone.
181
182 %prep
183 %if %{with mysql} && %{with pgsql}
184 echo "Error: You can't build at once --with mysql and --with pgsql"
185 exit 1
186 %endif
187
188 %setup -q -a 8
189 %patch0 -p1
190 %patch1 -p1
191 %patch2 -p1
192 %patch3 -p1
193 %patch4 -p1
194 %patch5 -p1
195 %patch6 -p1
196 # move mod_shaper code on to the source tree
197 mv mod_shaper/mod_shaper.c contrib/
198
199 %build
200 cp -f /usr/share/automake/config.sub .
201 %{__autoconf}
202 RUN_DIR=%{_localstatedir} ; export RUN_DIR
203 CFLAGS="%{rpmcflags} -I%{_includedir}/ncurses %{?with_mysql:-I%{_includedir}/mysql}"
204 CPPFLAGS="%{rpmcflags} -I%{_includedir}/ncurses %{?with_mysql:-I%{_includedir}/mysql}"
205
206 MODULES="
207 mod_ratio
208 mod_readme
209 mod_shaper
210 %{?with_ssl:mod_tls}
211 %{?with_ipv6:mod_wrap}
212 %{?with_pam:mod_auth_pam}
213 %{?with_ldap:mod_ldap}
214 %{?with_quotafile:mod_quotatab mod_quotatab_file}
215 %{?with_quotaldap:mod_quotatab mod_quotatab_ldap}
216 %{?with_quotamysql:mod_quotatab mod_quotatab_sql}
217 %{?with_quotapgsql:mod_quotatab mod_quotatab_sql}
218 %{?with_linuxprivs:mod_linuxprivs}
219 %{?with_mysql:mod_sql mod_sql_mysql}
220 %{?with_pgsql:mod_sql mod_sql_postgres}
221 "
222
223 %configure \
224         --enable-autoshadow \
225         --with-modules=$(echo $MODULES | tr ' ' ':') \
226         %{?with_ipv6:--enable-ipv6} \
227         %{!?with_ssl:--disable-tls} \
228         --enable-ctrls \
229         --enable-sendfile
230
231 %{__make}
232
233 %install
234 rm -rf $RPM_BUILD_ROOT
235 install -d $RPM_BUILD_ROOT/etc/{pam.d,security,sysconfig/rc-inetd,rc.d/init.d} \
236         $RPM_BUILD_ROOT/var/{lib/ftp/pub/Incoming,log}
237
238 %{__make} install \
239         DESTDIR=$RPM_BUILD_ROOT \
240         INSTALL_USER=%(id -u) \
241         INSTALL_GROUP=%(id -g)
242
243 rm -f $RPM_BUILD_ROOT%{_sbindir}/in.proftpd
244
245 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
246 %{?with_pam:install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/ftp}
247 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/ftpd
248 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/proftpd
249 install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/proftpd
250 install contrib/xferstats.holger-preiss $RPM_BUILD_ROOT%{_bindir}/xferstat
251
252 bzip2 -dc %{SOURCE7} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
253
254 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers.default
255 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers
256 :> $RPM_BUILD_ROOT/var/log/xferlog
257
258 ln -sf proftpd $RPM_BUILD_ROOT%{_sbindir}/ftpd
259
260 :> $RPM_BUILD_ROOT/etc/security/blacklist.ftp
261
262 rm -f $RPM_BUILD_ROOT%{_mandir}/ftpusers-path.diff*
263
264 %clean
265 rm -rf $RPM_BUILD_ROOT
266
267 %post common
268 umask 027
269 touch /var/log/xferlog
270 awk -F: '{ if (($3 < 500) && ($1 != "ftp")) print $1; }' < /etc/passwd >> %{_sysconfdir}/ftpusers.default
271 if [ ! -f %{_sysconfdir}/ftpusers ]; then
272         cp -f %{_sysconfdir}/ftpusers.default %{_sysconfdir}/ftpusers
273 fi
274
275 %post inetd
276 if grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf ; then
277         cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig}
278         sed -i -e 's/^ServerType[[:space:]]\+standalone/ServerType                      inetd/g' %{_sysconfdir}/proftpd.conf
279 fi
280 if [ -f /var/lock/subsys/rc-inetd ]; then
281         /etc/rc.d/init.d/rc-inetd reload 1>&2
282 else
283         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
284 fi
285
286 %postun inetd
287 if [ "$1" = "0" ] && [ -f /var/lock/subsys/rc-inetd ]; then
288         /etc/rc.d/init.d/rc-inetd reload 1>&2
289 fi
290
291 %post standalone
292 /sbin/chkconfig --add proftpd
293 if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf ; then
294         cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig}
295         sed -i -e 's/^ServerType[[:space:]]\+inetd/ServerType                   standalone/g' %{_sysconfdir}/proftpd.conf
296 fi
297 if [ -f /var/lock/subsys/proftpd ]; then
298         /etc/rc.d/init.d/proftpd restart 1>&2
299 else
300         echo "Run \"/etc/rc.d/init.d/proftpd start\" to start ProFTPD daemon."
301 fi
302
303 %preun standalone
304 if [ "$1" = "0" ]; then
305         if [ -f /var/lock/subsys/proftpd ]; then
306                 /etc/rc.d/init.d/proftpd stop 1>&2
307         fi
308         /sbin/chkconfig --del proftpd
309 fi
310
311 %triggerpostun inetd -- %{name}-inetd <= 1:1.2.10
312 echo "Changing deprecated config options"
313 cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig}
314 sed -i -e '
315         s/AuthPAMAuthoritative\b/AuthPAM/
316         s/TCPDServiceName/TCPServiceName/
317         s/TlsRsaCertFile/TLSRSACertificateFile/
318         s/TlsRsaKeyFile/TLSRSACertificateKeyFile/
319         s/TlsDsaCertFile/TLSDSACertificateFile/
320         s/TlsDsaKeyFile/TLSDSACertificateKeyFile/
321         s/TlsCrlFile/TLSCARevocationFile/
322         s/TlsDhParamFile/TLSDHParamFile/
323         s/TlsCipherList/TLSCipherSuite/
324         s/TlsCertsOk/TLSVerifyClient/
325         /UseTCPD/d
326 ' %{_sysconfdir}/proftpd.conf
327
328 %triggerpostun standalone -- %{name}-standalone <= 1:1.2.10
329 echo "Changing deprecated config options"
330 cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig}
331 sed -i -e '
332         s/AuthPAMAuthoritative\b/AuthPAM/
333         s/TCPDServiceName/TCPServiceName/
334         s/TlsRsaCertFile/TLSRSACertificateFile/
335         s/TlsRsaKeyFile/TLSRSACertificateKeyFile/
336         s/TlsDsaCertFile/TLSDSACertificateFile/
337         s/TlsDsaKeyFile/TLSDSACertificateKeyFile/
338         s/TlsCrlFile/TLSCARevocationFile/
339         s/TlsDhParamFile/TLSDHParamFile/
340         s/TlsCipherList/TLSCipherSuite/
341         s/TlsCertsOk/TLSVerifyClient/
342         /UseTCPD/d
343 ' %{_sysconfdir}/proftpd.conf
344
345 %files common
346 %defattr(644,root,root,755)
347 %doc sample-configurations/*.conf CREDITS ChangeLog NEWS RELEASE_NOTES
348 %doc README README.LDAP README.PAM README.capabilities README.classes README.controls README.IPv6
349 %doc README.modules
350 %doc doc/*html contrib/*.html
351
352 %attr(750,root,ftp) %dir %{_sysconfdir}
353 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
354 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %ghost %{_sysconfdir}/ftpusers
355 %attr(640,root,root) %{_sysconfdir}/ftpusers.default
356 %attr(640,root,root) %ghost /var/log/*
357 %{?with_pam:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*}
358
359 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.ftp
360
361 %attr(755,root,root) %{_bindir}/*
362 %attr(755,root,root) %{_sbindir}/*
363
364 %{_mandir}/man[18]/*
365
366 %dir /var/lib/ftp
367 %dir /var/lib/ftp/pub
368 %attr(711,ftp,ftp) %dir /var/lib/ftp/pub/Incoming
369
370 %files inetd
371 %defattr(644,root,root,755)
372 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/ftpd
373 %{_mandir}/man5/*
374 %lang(ja) %{_mandir}/ja/man5/ftpusers*
375 %lang(pl) %{_mandir}/pl/man5/ftpusers*
376 %lang(pt_BR) %{_mandir}/pt_BR/man5/ftpusers*
377 %lang(ru) %{_mandir}/ru/man5/ftpusers*
378
379 %files standalone
380 %defattr(644,root,root,755)
381 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/proftpd
382 %attr(754,root,root) /etc/rc.d/init.d/proftpd
383 %{_mandir}/man5/*
384 %lang(ja) %{_mandir}/ja/man5/ftpusers*
385 %lang(pl) %{_mandir}/pl/man5/ftpusers*
386 %lang(pt_BR) %{_mandir}/pt_BR/man5/ftpusers*
387 %lang(ru) %{_mandir}/ru/man5/ftpusers*
This page took 0.223534 seconds and 3 git commands to generate.