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