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