]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - mod_caps uses uname -r for detection | |
3 | # - don't use internal libltdl | |
4 | # - package contrib/ftp* perl scripts. | |
5 | # | |
6 | # Conditional build: | |
7 | %bcond_without pam # disable PAM support | |
8 | %bcond_without ipv6 # disable IPv6 and TCPD support | |
9 | %bcond_without ssl # disbale TLS/SSL support | |
10 | %bcond_without ldap # disable LDAP support | |
11 | %bcond_without mysql # disable MySQL support | |
12 | %bcond_without pgsql # disable PostgreSQL support | |
13 | %bcond_without quotafile # disable quota file support | |
14 | %bcond_without quotaldap # disable quota ldap support | |
15 | %bcond_without quotamysql # disable quota mysql support | |
16 | %bcond_without quotapgsql # disable quota pgsql support | |
17 | # | |
18 | %define mod_clamav_version 0.11rc | |
19 | ||
20 | Summary: PROfessional FTP Daemon with apache-like configuration syntax | |
21 | Summary(es.UTF-8): Servidor FTP profesional, con sintaxis de configuración semejante a la del apache | |
22 | Summary(pl.UTF-8): PROfesionalny serwer FTP | |
23 | Summary(pt_BR.UTF-8): Servidor FTP profissional, com sintaxe de configuração semelhante à do apache | |
24 | Summary(zh_CN.UTF-8): 易于管理的,安全的 FTP 服务器 | |
25 | Name: proftpd | |
26 | Version: 1.3.4a | |
27 | Release: 1 | |
28 | Epoch: 2 | |
29 | License: GPL v2+ | |
30 | Group: Networking/Daemons | |
31 | Source0: ftp://ftp.proftpd.org/distrib/source/%{name}-%{version}.tar.bz2 | |
32 | # Source0-md5: 4e3235dc1ef95d36e59721d70c5c489c | |
33 | Source1: https://secure.thrallingpenguin.com/redmine/attachments/download/1/mod_clamav-%{mod_clamav_version}.tar.gz | |
34 | # Source1-md5: 42e560ec0bd5964e13fad1b2bb7afe21 | |
35 | Source2: %{name}.conf | |
36 | Source3: ftp.pamd | |
37 | Source4: %{name}.inetd | |
38 | Source5: %{name}.sysconfig | |
39 | Source6: %{name}.init | |
40 | Source7: ftpusers.tar.bz2 | |
41 | # Source7-md5: 76c80b6ec9f4d079a1e27316edddbe16 | |
42 | Source9: %{name}-mod_pam.conf | |
43 | Source10: %{name}-mod_tls.conf | |
44 | Source11: %{name}-anonftp.conf | |
45 | Source12: %{name}-mod_clamav.conf | |
46 | Patch0: %{name}-paths.patch | |
47 | Patch1: %{name}-noautopriv.patch | |
48 | Patch2: %{name}-wtmp.patch | |
49 | Patch3: %{name}-pool.patch | |
50 | Patch4: %{name}-link.patch | |
51 | URL: http://www.proftpd.org/ | |
52 | BuildRequires: acl-devel | |
53 | BuildRequires: autoconf | |
54 | BuildRequires: automake | |
55 | BuildRequires: libcap-devel | |
56 | BuildRequires: libstdc++-devel | |
57 | BuildRequires: libwrap-devel | |
58 | %if %{with mysql} || %{with quotamysql} | |
59 | BuildRequires: mysql-devel | |
60 | %endif | |
61 | BuildRequires: ncurses-devel | |
62 | %if %{with ldap} || %{with quotaldap} | |
63 | BuildRequires: openldap-devel | |
64 | %endif | |
65 | %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d} | |
66 | %{?with_pam:BuildRequires: pam-devel} | |
67 | %if %{with pgsql} || %{with quotapgsql} | |
68 | BuildRequires: postgresql-devel | |
69 | %endif | |
70 | BuildRequires: rpmbuild(macros) >= 1.268 | |
71 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
72 | ||
73 | %define _sysconfdir /etc/ftpd | |
74 | %define _localstatedir /var/run | |
75 | %define _libexecdir %{_prefix}/%{_lib}/%{name} | |
76 | ||
77 | %description | |
78 | ProFTPD is a highly configurable FTP daemon for Unix and Unix-like | |
79 | operating systems. ProFTPD is designed to be somewhat of a "drop-in" | |
80 | replacement for wu-ftpd. Full online documentation is available at | |
81 | <http://www.proftpd.org/>, including a server configuration directive | |
82 | reference manual. | |
83 | ||
84 | %description -l es.UTF-8 | |
85 | ProFTPD es un servidor FTP altamente configurable para sistemas | |
86 | operativos Unix. Está proyectado para ser un substituto directo al | |
87 | wu-ftpd. La documentación completa está disponible en | |
88 | <http://www.proftpd.org/>, incluido el manual de referencia para las | |
89 | directivas de configuración del servidor. | |
90 | ||
91 | %description -l pl.UTF-8 | |
92 | ProFTPD jest wysoce konfigurowalnym serwerem FTP dla systemów Unix. | |
93 | ProFTPD jest robiony jako bezpośredni zamiennik wu-ftpd. Pełna | |
94 | dokumentacja jest dostępna on-line pod <http://www.proftpd.org/> | |
95 | włącznie z dokumentacją dotyczącą konfigurowania. | |
96 | ||
97 | %description -l pt_BR.UTF-8 | |
98 | O ProFTPD é um servidor FTP altamente configurável para sistemas | |
99 | operacionais Unix. | |
100 | ||
101 | É projetado para ser um substituto direto para o wu-ftpd. A | |
102 | documentação completa está disponível em <http://www.proftpd.org/>, | |
103 | incluindo o manual de referência para as diretivas de configuração do | |
104 | servidor. | |
105 | ||
106 | %package common | |
107 | Summary: PROfessional FTP Daemon with apache-like configuration syntax - common files | |
108 | Summary(pl.UTF-8): PROfesionalny serwer FTP - wspólne pliki | |
109 | Group: Networking/Daemons | |
110 | Requires(post): awk | |
111 | Requires(post): fileutils | |
112 | Obsoletes: proftpd < 0:1.2.2rc1-3 | |
113 | ||
114 | %description common | |
115 | ProFTPD is a highly configurable FTP daemon for Unix and Unix-like | |
116 | operating systems. ProFTPD is designed to be somewhat of a "drop-in" | |
117 | replacement for wu-ftpd. Full online documentation is available at | |
118 | <http://www.proftpd.org/>, including a server configuration directive | |
119 | reference manual. | |
120 | ||
121 | %description common -l es.UTF-8 | |
122 | ProFTPD es un servidor FTP altamente configurable para sistemas | |
123 | operativos Unix. Está proyectado para ser un substituto directo al | |
124 | wu-ftpd. La documentación completa está disponible en | |
125 | <http://www.proftpd.org/>, incluido el manual de referencia para las | |
126 | directivas de configuración del servidor. | |
127 | ||
128 | %description common -l pl.UTF-8 | |
129 | ProFTPD jest wysoce konfigurowalnym serwerem FTP dla systemów Unix. | |
130 | ProFTPD jest robiony jako bezpośredni zamiennik wu-ftpd. Pełna | |
131 | dokumentacja jest dostępna on-line pod <http://www.proftpd.org/> | |
132 | włącznie z dokumentacją dotyczącą konfigurowania. | |
133 | ||
134 | %description common -l pt_BR.UTF-8 | |
135 | O ProFTPD é um servidor FTP altamente configurável para sistemas | |
136 | operacionais Unix. | |
137 | ||
138 | É projetado para ser um substituto direto para o wu-ftpd. A | |
139 | documentação completa está disponível em <http://www.proftpd.org/>, | |
140 | incluindo o manual de referência para as diretivas de configuração do | |
141 | servidor. | |
142 | ||
143 | %package inetd | |
144 | Summary: inetd configs for proftpd | |
145 | Summary(pl.UTF-8): Pliki konfiguracyjne do użycia proftpd poprzez inetd | |
146 | Group: Networking/Daemons | |
147 | Requires(post): fileutils | |
148 | Requires(post): grep | |
149 | Requires(post): sed >= 4.0 | |
150 | Requires(triggerpostun): sed >= 4.0 | |
151 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
152 | Requires: rc-inetd | |
153 | Provides: ftpserver | |
154 | Provides: proftpd = %{epoch}:%{version}-%{release} | |
155 | Obsoletes: anonftp | |
156 | Obsoletes: bftpd | |
157 | Obsoletes: ftpd-BSD | |
158 | Obsoletes: ftpserver | |
159 | Obsoletes: glftpd | |
160 | Obsoletes: heimdal-ftpd | |
161 | Obsoletes: krb5-ftpd | |
162 | Obsoletes: linux-ftpd | |
163 | Obsoletes: muddleftpd | |
164 | Obsoletes: proftpd-standalone | |
165 | Obsoletes: pure-ftpd | |
166 | Obsoletes: troll-ftpd | |
167 | Obsoletes: vsftpd | |
168 | Obsoletes: wu-ftpd | |
169 | Conflicts: man-pages < 1.51 | |
170 | Conflicts: rpm < 4.4.2-0.2 | |
171 | ||
172 | %description inetd | |
173 | ProFTPD configs for running from inetd. | |
174 | ||
175 | %description inetd -l pl.UTF-8 | |
176 | Pliki konfiguracyjna ProFTPD do startowania demona poprzez inetd. | |
177 | ||
178 | %package standalone | |
179 | Summary: Standalone daemon configs for proftpd | |
180 | Summary(pl.UTF-8): Pliki konfiguracyjne do startowania proftpd w trybie standalone | |
181 | Group: Networking/Daemons | |
182 | Requires(post): fileutils | |
183 | Requires(post): grep | |
184 | Requires(post): sed >= 4.0 | |
185 | Requires(post,preun): /sbin/chkconfig | |
186 | Requires(triggerpostun): sed >= 4.0 | |
187 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
188 | Requires: rc-scripts | |
189 | Provides: ftpserver | |
190 | Provides: proftpd = %{epoch}:%{version}-%{release} | |
191 | Obsoletes: anonftp | |
192 | Obsoletes: bftpd | |
193 | Obsoletes: ftpd-BSD | |
194 | Obsoletes: ftpserver | |
195 | Obsoletes: glftpd | |
196 | Obsoletes: heimdal-ftpd | |
197 | Obsoletes: krb5-ftpd | |
198 | Obsoletes: linux-ftpd | |
199 | Obsoletes: muddleftpd | |
200 | Obsoletes: proftpd-inetd | |
201 | Obsoletes: pure-ftpd | |
202 | Obsoletes: troll-ftpd | |
203 | Obsoletes: vsftpd | |
204 | Obsoletes: wu-ftpd | |
205 | Conflicts: man-pages < 1.51 | |
206 | Conflicts: rpm < 4.4.2-0.2 | |
207 | ||
208 | %description standalone | |
209 | ProFTPD configs for running as a standalone daemon. | |
210 | ||
211 | %description standalone -l pl.UTF-8 | |
212 | Pliki konfiguracyjne ProFTPD do startowania demona w trybie | |
213 | standalone. | |
214 | ||
215 | %package devel | |
216 | Summary: Header files ProFTPD | |
217 | Summary(pl.UTF-8): Pliki nagłówkowe ProFTPD | |
218 | Group: Development/Libraries | |
219 | Requires: acl-devel | |
220 | ||
221 | %description devel | |
222 | This is the package containing the header files for ProFTPD. | |
223 | ||
224 | %description devel -l pl.UTF-8 | |
225 | Ten pakiet zawiera pliki nagłówkowe ProFTPD | |
226 | ||
227 | %package anonftp | |
228 | Summary: Anonymous FTP config for ProFTPD | |
229 | Summary(pl.UTF-8): Konfiguracja anonimowego FTP dla ProFTPD | |
230 | Group: Networking/Daemons | |
231 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
232 | ||
233 | %description anonftp | |
234 | Anonymous FTP config for ProFTPD. | |
235 | ||
236 | %description anonftp -l pl.UTF-8 | |
237 | Konfiguracja anonimowego FTP dla ProFTPD. | |
238 | ||
239 | %package mod_auth_pam | |
240 | Summary: ProFTPD PAM auth module | |
241 | Summary(pl.UTF-8): Moduł uwierzytelnienia PAM dla ProFTPD | |
242 | Group: Networking/Daemons | |
243 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
244 | Requires: pam >= 0.79.0 | |
245 | ||
246 | %description mod_auth_pam | |
247 | PAM authentication method for ProFTPD. | |
248 | ||
249 | %description mod_auth_pam -l pl.UTF-8 | |
250 | Metoda uwierzytelnienia PAM dla ProFTPD. | |
251 | ||
252 | %package mod_ldap | |
253 | Summary: ProFTPD OpenLDAP module | |
254 | Summary(pl.UTF-8): Moduł OpenLDAP dla ProFTPD | |
255 | Group: Networking/Daemons | |
256 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
257 | ||
258 | %description mod_ldap | |
259 | mod_ldap provides LDAP authentication support for ProFTPD. It supports | |
260 | many features useful in "toaster" environments such as default UID/GID | |
261 | and autocreation/autogeneration of home directories. | |
262 | ||
263 | %description mod_ldap -l pl.UTF-8 | |
264 | mod_ldap dodaje obsługę uwierzytelnienia LDAP do ProFTPD. Obsługuje | |
265 | wiele cech przydatnych w środowiskach "tosterowych", takich jak | |
266 | domyślny UID/GID i automatyczne tworzenie/generowanie katalogów | |
267 | domowych. | |
268 | ||
269 | %package mod_quotatab | |
270 | Summary: ProFTPD quotatab module | |
271 | Summary(pl.UTF-8): Moduł quotatab dla ProFTPD | |
272 | Group: Networking/Daemons | |
273 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
274 | ||
275 | %description mod_quotatab | |
276 | A module for managing FTP byte/file quotas via centralized tables. | |
277 | ||
278 | %description mod_quotatab -l pl.UTF-8 | |
279 | Moduł do zarządzania ograniczeniami bajtów/plików FTP poprzez | |
280 | scentralizowane tabele. | |
281 | ||
282 | %package mod_quotatab_file | |
283 | Summary: ProFTPD quotatab file module | |
284 | Summary(pl.UTF-8): Moduł quotatab_file dla ProFTPD | |
285 | Group: Networking/Daemons | |
286 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
287 | Requires: %{name}-mod_quotatab = %{epoch}:%{version}-%{release} | |
288 | ||
289 | %description mod_quotatab_file | |
290 | A mod_quotatab sub-module for managing quota data via file-based | |
291 | tables. | |
292 | ||
293 | %description mod_quotatab_file -l pl.UTF-8 | |
294 | Podmoduł mod_quotatab do zarządzania danymi o ograniczeniach poprzez | |
295 | tabele zapisane w pliku. | |
296 | ||
297 | %package mod_quotatab_ldap | |
298 | Summary: ProFTPD quotatab ldap module | |
299 | Summary(pl.UTF-8): Moduł quotatab_ldap dla ProFTPD | |
300 | Group: Networking/Daemons | |
301 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
302 | Requires: %{name}-mod_ldap = %{epoch}:%{version}-%{release} | |
303 | Requires: %{name}-mod_quotatab = %{epoch}:%{version}-%{release} | |
304 | ||
305 | %description mod_quotatab_ldap | |
306 | A mod_quotatab sub-module for obtaining quota information from an LDAP | |
307 | directory. | |
308 | ||
309 | %description mod_quotatab_ldap -l pl.UTF-8 | |
310 | Podmoduł mod_quotatab do pobierania informacji o ograniczeniach z | |
311 | katalogu LDAP. | |
312 | ||
313 | %package mod_quotatab_sql | |
314 | Summary: ProFTPD quotatab sql module | |
315 | Summary(pl.UTF-8): Moduł quotatab_sql dla ProFTPD | |
316 | Group: Networking/Daemons | |
317 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
318 | Requires: %{name}-mod_quotatab = %{epoch}:%{version}-%{release} | |
319 | Requires: %{name}-mod_sql = %{epoch}:%{version}-%{release} | |
320 | ||
321 | %description mod_quotatab_sql | |
322 | A mod_quotatab sub-module for managing quota data via SQL-based | |
323 | tables. | |
324 | ||
325 | %description mod_quotatab_sql -l pl.UTF-8 | |
326 | Podmoduł mod_quotatab do zarządzania danymi o ograniczeniach poprzez | |
327 | tabele SQL. | |
328 | ||
329 | %package mod_ratio | |
330 | Summary: ProFTPD ratio module | |
331 | Summary(pl.UTF-8): Moduł ratio dla ProFTPD | |
332 | Group: Networking/Daemons | |
333 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
334 | ||
335 | %description mod_ratio | |
336 | Support upload/download ratios. | |
337 | ||
338 | %description mod_ratio -l pl.UTF-8 | |
339 | Obsługa współczynników upload/download. | |
340 | ||
341 | %package mod_readme | |
342 | Summary: ProFTPD readme module | |
343 | Summary(pl.UTF-8): Moduł readme dla ProFTPD | |
344 | Group: Networking/Daemons | |
345 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
346 | ||
347 | %description mod_readme | |
348 | "README" file support. | |
349 | ||
350 | %description mod_readme -l pl.UTF-8 | |
351 | Obsługa pliku "README". | |
352 | ||
353 | %package mod_rewrite | |
354 | Summary: ProFTPD rewrite module | |
355 | Summary(pl.UTF-8): Moduł rewrite dla ProFTPD | |
356 | Group: Networking/Daemons | |
357 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
358 | ||
359 | %description mod_rewrite | |
360 | Runtime rewrite engine. | |
361 | ||
362 | %description mod_rewrite -l pl.UTF-8 | |
363 | Silnik przepisujący adresy w locie. | |
364 | ||
365 | %package mod_sql | |
366 | Summary: ProFTPD SQL support module | |
367 | Summary(pl.UTF-8): Moduł obsługi SQL dla ProFTPD | |
368 | Group: Networking/Daemons | |
369 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
370 | ||
371 | %description mod_sql | |
372 | This module provides the necessary support for SQL based | |
373 | authentication, logging and other features as required. | |
374 | ||
375 | %description mod_sql -l pl.UTF-8 | |
376 | Ten moduł dodaje obsługę SQL potrzebną do uwierzytelniania, logowania | |
377 | i innych możliwości opartych o SQL. | |
378 | ||
379 | %package mod_sql_mysql | |
380 | Summary: ProFTPD sql mysql module | |
381 | Summary(pl.UTF-8): Moduł sql_mysql dla ProFTPD | |
382 | Group: Networking/Daemons | |
383 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
384 | Requires: %{name}-mod_sql = %{epoch}:%{version}-%{release} | |
385 | ||
386 | %description mod_sql_mysql | |
387 | Support for connecting to MySQL databases. | |
388 | ||
389 | %description mod_sql_mysql -l pl.UTF-8 | |
390 | Obsługa łączenia się z bazami danych MySQL. | |
391 | ||
392 | %package mod_sql_postgres | |
393 | Summary: ProFTPD sql postgres module | |
394 | Summary(pl.UTF-8): Moduł sql_postgres dla ProFTPD | |
395 | Group: Networking/Daemons | |
396 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
397 | Requires: %{name}-mod_sql = %{epoch}:%{version}-%{release} | |
398 | ||
399 | %description mod_sql_postgres | |
400 | Support for connecting to PostgreSQL databases. | |
401 | ||
402 | %description mod_sql_postgres -l pl.UTF-8 | |
403 | Obsługa łączenia się z bazami danych PostgreSQL. | |
404 | ||
405 | %package mod_tls | |
406 | Summary: ProFTPD TLS support | |
407 | Summary(pl.UTF-8): Obsługa TLS dla ProFTPD | |
408 | Group: Networking/Daemons | |
409 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
410 | ||
411 | %description mod_tls | |
412 | An RFC2228 SSL/TLS module for ProFTPD. | |
413 | ||
414 | %description mod_tls -l pl.UTF-8 | |
415 | Moduł SSL/TLS zgodny z RFC2228 dla ProFTPD. | |
416 | ||
417 | %package mod_wrap | |
418 | Summary: ProFTPD interface to libwrap | |
419 | Summary(pl.UTF-8): Interfejs ProFTPD do libwrap | |
420 | Group: Networking/Daemons | |
421 | Requires: %{name}-common = %{epoch}:%{version}-%{release} | |
422 | Requires: libwrap | |
423 | ||
424 | %description mod_wrap | |
425 | It enables the daemon to use the common tcpwrappers access control | |
426 | library while in standalone mode, and in a very configurable manner. | |
427 | ||
428 | Many programs will automatically add entries in the common allow/deny | |
429 | files, and use of this module will allow a ProFTPD daemon running in | |
430 | standalone mode to adapt as these entries are added. The portsentry | |
431 | program does this, for example: when illegal access is attempted, it | |
432 | will add hosts to the /etc/hosts.deny file. | |
433 | ||
434 | %description mod_wrap -l pl.UTF-8 | |
435 | Ten pakiet pozwala demonowi używać wspólnej biblioteki kontroli | |
436 | dostępu tcpwrappers w trybie samodzielnym w bardzo wygodny sposób. | |
437 | ||
438 | Wiele programów automatycznie dodaje wpisy we wspólnych plikach | |
439 | allow/deny, a użycie tego modułu pozwala demonowi ProFTPD działającemu | |
440 | w trybie samodzielnym adaptować te wpisy w miarę dodawania. Robi tak | |
441 | na przykład program portsentry: przy próbie niedozwolonego dostępu | |
442 | dodaje hosty do pliku /etc/hosts.deny. | |
443 | ||
444 | %prep | |
445 | %setup -q -n %{name}-%{version}%{?_rc} -a1 | |
446 | %patch0 -p1 | |
447 | %patch1 -p1 | |
448 | %patch2 -p1 | |
449 | %patch3 -p1 | |
450 | %patch4 -p1 | |
451 | ||
452 | # mod_clamav | |
453 | patch -p0 < mod_clamav-%{mod_clamav_version}/proftpd.patch | |
454 | cp -a mod_clamav-%{mod_clamav_version}/*.{c,h} contrib/ | |
455 | ||
456 | cp -f /usr/share/automake/config.sub . | |
457 | ||
458 | # cleanup backups after patching | |
459 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
460 | ||
461 | %build | |
462 | %{__autoconf} | |
463 | ||
464 | MODULES=" | |
465 | mod_auth_file | |
466 | mod_ident | |
467 | mod_ratio | |
468 | mod_readme | |
469 | mod_rewrite | |
470 | mod_wrap | |
471 | mod_facl | |
472 | mod_ifsession | |
473 | mod_lang | |
474 | %{?with_ssl:mod_tls} | |
475 | %{?with_pam:mod_auth_pam} | |
476 | %{?with_ldap:mod_ldap} | |
477 | %{?with_quotafile:mod_quotatab mod_quotatab_file} | |
478 | %{?with_quotaldap:mod_quotatab mod_quotatab_ldap} | |
479 | %{?with_quotamysql:mod_quotatab mod_quotatab_sql} | |
480 | %{?with_quotapgsql:mod_quotatab mod_quotatab_sql} | |
481 | %{?with_mysql:mod_sql mod_sql_mysql} | |
482 | %{?with_pgsql:mod_sql mod_sql_postgres} | |
483 | " | |
484 | ||
485 | MODARG=$(echo $MODULES | tr ' ' '\n' | sort -u | xargs | tr ' ' ':') | |
486 | %configure \ | |
487 | --with-includes=/usr/include/ncurses%{?with_mysql::%{_includedir}/mysql} \ | |
488 | --disable-strip \ | |
489 | --enable-buffer-size=4096 \ | |
490 | --disable-auth-file \ | |
491 | --enable-autoshadow \ | |
492 | --enable-ctrls \ | |
493 | --enable-dso \ | |
494 | %{?with_ipv6:--enable-ipv6} \ | |
495 | --enable-sendfile \ | |
496 | %{!?with_ssl:--disable-tls} \ | |
497 | --with-shared=$MODARG \ | |
498 | --with-modules=mod_clamav | |
499 | ||
500 | %{__make} -j1 | |
501 | ||
502 | %install | |
503 | rm -rf $RPM_BUILD_ROOT | |
504 | install -d $RPM_BUILD_ROOT/etc/{pam.d,security,sysconfig/rc-inetd,rc.d/init.d} \ | |
505 | $RPM_BUILD_ROOT/var/{lib/ftp/pub/Incoming,log,run/proftpd} \ | |
506 | $RPM_BUILD_ROOT%{_sysconfdir}/conf.d \ | |
507 | $RPM_BUILD_ROOT%{_includedir}/%{name} | |
508 | ||
509 | %{__make} install \ | |
510 | DESTDIR=$RPM_BUILD_ROOT \ | |
511 | INSTALL_USER=%(id -u) \ | |
512 | INSTALL_GROUP=%(id -g) | |
513 | ||
514 | rm $RPM_BUILD_ROOT%{_sbindir}/in.proftpd | |
515 | ||
516 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir} | |
517 | install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_auth_pam.conf | |
518 | MODULES=" | |
519 | mod_auth_file | |
520 | mod_ident | |
521 | mod_ratio | |
522 | mod_readme | |
523 | mod_rewrite | |
524 | mod_wrap | |
525 | %{?with_ldap:mod_ldap} | |
526 | %{?with_quotafile:mod_quotatab mod_quotatab_file} | |
527 | %{?with_quotaldap:mod_quotatab mod_quotatab_ldap} | |
528 | %{?with_quotamysql:mod_quotatab mod_quotatab_sql} | |
529 | %{?with_quotapgsql:mod_quotatab mod_quotatab_sql} | |
530 | %{?with_mysql:mod_sql mod_sql_mysql} | |
531 | %{?with_pgsql:mod_sql mod_sql_postgres} | |
532 | " | |
533 | for module in $MODULES; do | |
534 | echo "LoadModule $module.c" > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/$module.conf | |
535 | done | |
536 | install %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_tls.conf | |
537 | install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/anonftp.conf | |
538 | install %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_clamav.conf | |
539 | ||
540 | %{?with_pam:install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/ftp} | |
541 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/ftpd | |
542 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/proftpd | |
543 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/proftpd | |
544 | install contrib/xferstats.holger-preiss $RPM_BUILD_ROOT%{_bindir}/xferstat | |
545 | ||
546 | bzip2 -dc %{SOURCE7} | tar xf - -C $RPM_BUILD_ROOT%{_mandir} | |
547 | ||
548 | :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers.default | |
549 | :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers | |
550 | ||
551 | # only for -inetd package? | |
552 | ln -sf proftpd $RPM_BUILD_ROOT%{_sbindir}/ftpd | |
553 | ||
554 | :> $RPM_BUILD_ROOT/etc/security/blacklist.ftp | |
555 | ||
556 | rm $RPM_BUILD_ROOT%{_libexecdir}/*.a | |
557 | rm $RPM_BUILD_ROOT%{_libexecdir}/*.la | |
558 | ||
559 | rm -f $RPM_BUILD_ROOT%{_mandir}/ftpusers-path.diff* | |
560 | cp -aL include/* config.h $RPM_BUILD_ROOT%{_includedir}/%{name} | |
561 | ||
562 | %clean | |
563 | rm -rf $RPM_BUILD_ROOT | |
564 | ||
565 | %post common | |
566 | umask 027 | |
567 | awk -F: '{ if (($3 < 500) && ($1 != "ftp")) print $1; }' < /etc/passwd >> %{_sysconfdir}/ftpusers.default | |
568 | if [ ! -f %{_sysconfdir}/ftpusers ]; then | |
569 | cp -f %{_sysconfdir}/ftpusers.default %{_sysconfdir}/ftpusers | |
570 | fi | |
571 | ||
572 | %posttrans inetd | |
573 | if grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf ; then | |
574 | cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig} | |
575 | sed -i -e 's/^ServerType[[:space:]]\+standalone/ServerType inetd/g' %{_sysconfdir}/proftpd.conf | |
576 | fi | |
577 | %service -q rc-inetd reload | |
578 | ||
579 | %postun inetd | |
580 | if [ "$1" = "0" ]; then | |
581 | %service -q rc-inetd reload | |
582 | fi | |
583 | ||
584 | %posttrans standalone | |
585 | if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf ; then | |
586 | cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig} | |
587 | sed -i -e 's/^ServerType[[:space:]]\+inetd/ServerType standalone/g' %{_sysconfdir}/proftpd.conf | |
588 | fi | |
589 | /sbin/chkconfig --add proftpd | |
590 | %service proftpd restart "ProFTPD daemon" | |
591 | ||
592 | %preun standalone | |
593 | if [ "$1" = "0" ]; then | |
594 | %service proftpd stop | |
595 | /sbin/chkconfig --del proftpd | |
596 | fi | |
597 | ||
598 | %triggerin standalone -- pam | |
599 | # restart proftpd if pam is upgraded | |
600 | # (proftpd is linked with old libpam but tries to open modules linked with new libpam) | |
601 | if [ "$2" != 1 ]; then | |
602 | %service -q proftpd restart | |
603 | fi | |
604 | ||
605 | # macro called at module post scriptlet | |
606 | %define module_post \ | |
607 | if [ "$1" = "1" ]; then \ | |
608 | if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then \ | |
609 | %service -q rc-inetd reload \ | |
610 | elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then \ | |
611 | %service -q proftpd restart \ | |
612 | fi \ | |
613 | fi | |
614 | ||
615 | # macro called at module postun scriptlet | |
616 | %define module_postun \ | |
617 | if [ "$1" = "0" ]; then \ | |
618 | if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then \ | |
619 | %service -q rc-inetd reload \ | |
620 | elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then \ | |
621 | %service -q proftpd restart \ | |
622 | fi \ | |
623 | fi | |
624 | ||
625 | # it's sooo annoying to write them | |
626 | %define module_scripts() \ | |
627 | %post %1 \ | |
628 | %module_post \ | |
629 | \ | |
630 | %postun %1 \ | |
631 | %module_postun | |
632 | ||
633 | %module_scripts mod_auth_pam | |
634 | %module_scripts mod_ldap | |
635 | %module_scripts mod_quotatab | |
636 | %module_scripts mod_quotatab_file | |
637 | %module_scripts mod_quotatab_ldap | |
638 | %module_scripts mod_quotatab_sql | |
639 | %module_scripts mod_ratio | |
640 | %module_scripts mod_readme | |
641 | %module_scripts mod_rewrite | |
642 | %module_scripts mod_sql | |
643 | %module_scripts mod_sql_mysql | |
644 | %module_scripts mod_sql_postgres | |
645 | %module_scripts mod_tls | |
646 | %module_scripts mod_wrap | |
647 | ||
648 | %files common | |
649 | %defattr(644,root,root,755) | |
650 | %doc sample-configurations/*.conf CREDITS ChangeLog NEWS RELEASE_NOTES | |
651 | %doc README README.capabilities README.classes README.controls README.IPv6 | |
652 | %doc README.modules | |
653 | %doc doc/*.html doc/contrib doc/howto doc/modules | |
654 | %dir %attr(750,root,ftp) %dir %{_sysconfdir} | |
655 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf | |
656 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %ghost %{_sysconfdir}/ftpusers | |
657 | %attr(640,root,root) %{_sysconfdir}/ftpusers.default | |
658 | %dir %attr(750,root,root) %{_sysconfdir}/conf.d | |
659 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_auth_file.conf | |
660 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_ident.conf | |
661 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_clamav.conf | |
662 | #%attr(640,root,root) %ghost /var/log/* | |
663 | %attr(755,root,root) %{_bindir}/* | |
664 | %attr(755,root,root) %{_sbindir}/* | |
665 | %dir %{_libexecdir} | |
666 | %attr(755,root,root) %{_libexecdir}/mod_auth_file.so | |
667 | %attr(755,root,root) %{_libexecdir}/mod_facl.so | |
668 | %attr(755,root,root) %{_libexecdir}/mod_ident.so | |
669 | %attr(755,root,root) %{_libexecdir}/mod_ifsession.so | |
670 | %attr(755,root,root) %{_libexecdir}/mod_lang.so | |
671 | %dir %{_localstatedir}/proftpd | |
672 | %{_mandir}/man[18]/* | |
673 | %dir /var/lib/ftp | |
674 | %dir /var/lib/ftp/pub | |
675 | %attr(711,ftp,ftp) %dir /var/lib/ftp/pub/Incoming | |
676 | ||
677 | %files inetd | |
678 | %defattr(644,root,root,755) | |
679 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/ftpd | |
680 | %{_mandir}/man5/* | |
681 | %lang(ja) %{_mandir}/ja/man5/ftpusers* | |
682 | %lang(pl) %{_mandir}/pl/man5/ftpusers* | |
683 | %lang(pt_BR) %{_mandir}/pt_BR/man5/ftpusers* | |
684 | %lang(ru) %{_mandir}/ru/man5/ftpusers* | |
685 | ||
686 | %files standalone | |
687 | %defattr(644,root,root,755) | |
688 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/proftpd | |
689 | %attr(754,root,root) /etc/rc.d/init.d/proftpd | |
690 | %{_mandir}/man5/* | |
691 | %lang(ja) %{_mandir}/ja/man5/ftpusers* | |
692 | %lang(pl) %{_mandir}/pl/man5/ftpusers* | |
693 | %lang(pt_BR) %{_mandir}/pt_BR/man5/ftpusers* | |
694 | %lang(ru) %{_mandir}/ru/man5/ftpusers* | |
695 | ||
696 | %files devel | |
697 | %defattr(644,root,root,755) | |
698 | %{_includedir}/%{name} | |
699 | %{_pkgconfigdir}/%{name}.pc | |
700 | ||
701 | %files anonftp | |
702 | %defattr(644,root,root,755) | |
703 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/anonftp.conf | |
704 | ||
705 | %if %{with pam} | |
706 | %files mod_auth_pam | |
707 | %defattr(644,root,root,755) | |
708 | %doc README.PAM | |
709 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/* | |
710 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.ftp | |
711 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_auth_pam.conf | |
712 | %attr(755,root,root) %{_libexecdir}/mod_auth_pam.so | |
713 | %endif | |
714 | ||
715 | %if %{with ldap} | |
716 | %files mod_ldap | |
717 | %defattr(644,root,root,755) | |
718 | %doc README.LDAP | |
719 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_ldap.conf | |
720 | %attr(755,root,root) %{_libexecdir}/mod_ldap.so | |
721 | %endif | |
722 | ||
723 | %files mod_quotatab | |
724 | %defattr(644,root,root,755) | |
725 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_quotatab.conf | |
726 | %attr(755,root,root) %{_libexecdir}/mod_quotatab.so | |
727 | ||
728 | %if %{with quotafile} | |
729 | %files mod_quotatab_file | |
730 | %defattr(644,root,root,755) | |
731 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_quotatab_file.conf | |
732 | %attr(755,root,root) %{_libexecdir}/mod_quotatab_file.so | |
733 | %endif | |
734 | ||
735 | %if %{with quotaldap} | |
736 | %files mod_quotatab_ldap | |
737 | %defattr(644,root,root,755) | |
738 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_quotatab_ldap.conf | |
739 | %attr(755,root,root) %{_libexecdir}/mod_quotatab_ldap.so | |
740 | %endif | |
741 | ||
742 | %if %{with quotamysql} || %{with quotapgsql} | |
743 | %files mod_quotatab_sql | |
744 | %defattr(644,root,root,755) | |
745 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_quotatab_sql.conf | |
746 | %attr(755,root,root) %{_libexecdir}/mod_quotatab_sql.so | |
747 | %endif | |
748 | ||
749 | %files mod_ratio | |
750 | %defattr(644,root,root,755) | |
751 | %doc contrib/README.ratio | |
752 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_ratio.conf | |
753 | %attr(755,root,root) %{_libexecdir}/mod_ratio.so | |
754 | ||
755 | %files mod_readme | |
756 | %defattr(644,root,root,755) | |
757 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_readme.conf | |
758 | %attr(755,root,root) %{_libexecdir}/mod_readme.so | |
759 | ||
760 | %files mod_rewrite | |
761 | %defattr(644,root,root,755) | |
762 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_rewrite.conf | |
763 | %attr(755,root,root) %{_libexecdir}/mod_rewrite.so | |
764 | ||
765 | %if %{with mysql} || %{with pgsql} | |
766 | %files mod_sql | |
767 | %defattr(644,root,root,755) | |
768 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_sql.conf | |
769 | %attr(755,root,root) %{_libexecdir}/mod_sql.so | |
770 | %endif | |
771 | ||
772 | %if %{with mysql} | |
773 | %files mod_sql_mysql | |
774 | %defattr(644,root,root,755) | |
775 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_sql_mysql.conf | |
776 | %attr(755,root,root) %{_libexecdir}/mod_sql_mysql.so | |
777 | %endif | |
778 | ||
779 | %if %{with pgsql} | |
780 | %files mod_sql_postgres | |
781 | %defattr(644,root,root,755) | |
782 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_sql_postgres.conf | |
783 | %attr(755,root,root) %{_libexecdir}/mod_sql_postgres.so | |
784 | %endif | |
785 | ||
786 | %files mod_tls | |
787 | %defattr(644,root,root,755) | |
788 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_tls.conf | |
789 | %attr(755,root,root) %{_libexecdir}/mod_tls.so | |
790 | ||
791 | %files mod_wrap | |
792 | %defattr(644,root,root,755) | |
793 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_wrap.conf | |
794 | %attr(755,root,root) %{_libexecdir}/mod_wrap.so |