]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd.spec
- reverted last change
[packages/proftpd.git] / proftpd.spec
1
2 # Conditional builds:
3 # bcond_off_pam - disable PAM support
4 # bcond_on_ldap - enable LDAP suppoer
5 # bcond_on_mysql - enable MySQL suppoer
6 # bcond_on_quota - enable quota support
7 # bcond_on_linuxprivs - enable libcap support
8 # bcond_off_ipv6 - disable IPv6 and TCPD support
9 # bcond_off_ssl - disbale TLS/SSL support
10 # --without pam --with ldap --with mysql --with quota --with linuxprivs
11 Summary:        PROfessional FTP Daemon with apache-like configuration syntax
12 Summary(pl):    PROfesionalny serwer FTP  
13 Name:           proftpd
14 Version:        1.2.0rc3
15 Release:        1
16 License:        GPL
17 Group:          Daemons
18 Group(de):      Server
19 Group(pl):      Serwery
20 Source0:        ftp://ftp.proftpd.net/pub/proftpd/%{name}-%{version}.tar.gz
21 Source1:        %{name}.conf
22 Source2:        %{name}.logrotate
23 Source3:        ftp.pamd
24 Source4:        %{name}.inetd
25 Source5:        %{name}.sysconfig
26 Source6:        %{name}.init
27 Source7:        %{name}-mod_tcpd.c
28 Patch0:         %{name}-1.2.0rc3-v6-20010206.patch.gz
29 # ftp://ftp.runestig.com/pub/proftpd-tls/
30 Patch1:         %{name}-1.2.0rc3+v6-tls.20010206.patch.gz
31 Patch2:         %{name}-umode_t.patch
32 Patch3:         %{name}-glibc.patch
33 Patch4:         %{name}-paths.patch
34 Patch5:         %{name}-release.patch
35 Patch6:         %{name}-noautopriv.patch
36 Patch7:         %{name}-betterlog.patch
37 Patch8:         %{name}-DESTDIR.patch
38 Patch9:         %{name}-wtmp.patch
39 URL:            http://www.proftpd.net/
40 %{?!bcond_off_pam:BuildRequires:        pam-devel}
41 %{?bcond_on_ldap:BuildRequires:         openldap-devel}
42 %{?bcond_on_mysql:BuildRequires:        mysql-devel}
43 %{?!bcond_off_ssl:BuildRequires:        openssl-devel}
44 Prereq:         awk
45 Prereq:         rc-inetd
46 Prereq:         fileutils
47 Requires:       logrotate
48 %{?!bcond_off_pam:Requires:     pam >= 0.67}
49 Requires:       %{name}-setup = %{version}
50 Requires:       inetdaemon
51 Provides:       ftpserver
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 Obsoletes:      ftpserver
54 Obsoletes:      anonftp
55 Obsoletes:      bftpd
56 Obsoletes:      ftpd-BSD
57 Obsoletes:      heimdal-ftpd
58 Obsoletes:      linux-ftpd
59 Obsoletes:      pure-ftpd
60 Obsoletes:      wu-ftpd
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 %description -l pl
73 ProFTPD jest wysoce konfigurowalnym serwerem ftp dla systemów Unix.
74 ProFTPD jest robiony jako bezpo¶redni zamiennik wu-ftpd. Pe³na
75 dokunentacja jest dostêpna on-line pod http://www.proftpd.org/
76 w³±cznie z dokumentacj± dotycz±c± konfigurowania.
77
78 %package inetd
79 Summary:        inetd configs for proftpd
80 Group:          Daemons
81 Group(de):      Server
82 Group(pl):      Serwery
83 Prereq:         %{name} = %{version}
84 Provides:       %{name}-setup
85 Obsoletes:      proftpd-standalone
86
87 %description inetd
88 ProFTPD configs for running from inetd.
89
90 %package standalone
91 Summary:        standalone daemon configs for proftpd
92 Group:          Daemons
93 Group(de):      Server
94 Group(pl):      Serwery
95 Prereq:         %{name} = %{version}
96 Provides:       %{name}-setup
97 Obsoletes:      proftpd-inetd
98
99 %description standalone
100 ProFTPD configs for running as a standalone daemon.
101
102 %prep
103 %setup  -q 
104 %patch0 -p1
105 %patch1 -p1
106 %patch2 -p1
107 %patch3 -p1
108 %patch4 -p1
109 %patch5 -p1
110 %patch6 -p1
111 %patch7 -p1
112 %patch8 -p1
113 %patch9 -p1
114 install -m644 %{SOURCE7} contrib/mod_tcpd.c
115
116 %build
117 autoconf
118 RUN_DIR=%{_localstatedir} ; export RUN_DIR
119 %configure \
120         --enable-autoshadow \
121         --with-modules=mod_ratio:mod_readme%{?!bcond_off_ipv6::mod_tcpd}%{?!bcond_off_pam::mod_pam}%{?bcond_on_ldap::mod_ldap}%{?bcond_on_quota::mod_quota}%{?bcond_on_linuxprivs::mod_linuxprivs}%{?bcond_on_mysql::mod_sqlpw:mod_mysql} \
122         %{?!bcond_off_ipv6:--enable-ipv6} \
123         %{?bcond_off_ssl:--disable-tls} \
124         --enable-sendfile
125
126 %{__make}
127
128 %install
129 rm -rf $RPM_BUILD_ROOT
130
131 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,sysconfig/rc-inetd,rc.d/init.d} \
132         $RPM_BUILD_ROOT/{home/ftp/pub/Incoming,var/log}
133
134 %{__make} install DESTDIR=$RPM_BUILD_ROOT \
135         INSTALL_USER=`id -u` \
136         INSTALL_GROUP=`id -g`
137
138 rm -f $RPM_BUILD_ROOT%{_sbindir}/in.proftpd
139
140 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
141 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/ftpd
142 %{?!bcond_off_pam:install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/ftp}
143 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/ftpd
144 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/proftpd
145 install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/proftpd
146 install contrib/xferstats.* $RPM_BUILD_ROOT%{_bindir}/xferstat
147
148 mv -f contrib/README contrib/README.modules
149
150 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers.default
151 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers
152 :> $RPM_BUILD_ROOT/var/log/xferlog
153
154 ln -s proftpd $RPM_BUILD_ROOT%{_sbindir}/ftpd
155
156 gzip -9nf sample-configurations/{virtual,anonymous}.conf ChangeLog README \
157         README.linux-* contrib/README.modules README.IPv6 README.PAM \
158         README.TLS
159
160 %post 
161 touch /var/log/xferlog
162 awk 'BEGIN { FS = ":" }; { if(($3 < 1000)&&($1 != "ftp")) print $1; }' < /etc/passwd >> %{_sysconfdir}/ftpusers.default
163 if [ ! -f %{_sysconfdir}/ftpusers ]; then
164         ( cd %{_sysconfdir}; mv -f ftpusers.default ftpusers )
165 fi
166
167 %post inetd
168 if grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf ; then
169         cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
170         sed -e "s/^ServerType[[:space:]]\+standalone/ServerType                 inetd/g" \
171                 %{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
172 fi
173 if [ -f /var/lock/subsys/rc-inetd ]; then
174         /etc/rc.d/init.d/rc-inetd restart 1>&2
175 else
176         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet sever" 1>&2
177 fi
178
179 %postun inetd
180 if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
181         /etc/rc.d/init.d/rc-inetd reload 1>&2
182 fi
183
184 %post standalone
185 /sbin/chkconfig --add proftpd
186 if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf ; then
187         cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
188         sed -e "s/^ServerType[[:space:]]\+inetd/ServerType                      standalone/g" \
189                 %{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
190 fi
191 if [ -f /var/lock/subsys/proftpd ]; then
192         /etc/rc.d/init.d/proftpd restart 1>&2
193 else
194         echo "Run \"/etc/rc.d/init.d/proftpd start\" to start ProFTPD daemon."
195 fi
196
197 %preun standalone
198 if [ "$1" = "0" -a -f /var/lock/subsys/proftpd ]; then
199         /etc/rc.d/init.d/proftpd stop 1>&2
200 fi
201 /sbin/chkconfig --del proftpd
202
203 %clean
204 rm -rf $RPM_BUILD_ROOT
205
206 %files
207 %defattr(644,root,root,755)
208 %doc {ChangeLog,README*}.gz contrib/README.modules.gz
209 %doc sample-configurations/{virtual,anonymous}.conf.gz 
210 %doc doc/*html
211
212 %attr(750,root,root) %dir %{_sysconfdir}
213 %attr(640,root,root) /etc/logrotate.d/*
214 %attr(640,root,root) %ghost /var/log/*
215 %{?!bcond_off_pam:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*}
216
217 %attr(640,root,root) %{_sysconfdir}/ftpusers.default
218 %attr(640,root,root) %ghost %{_sysconfdir}/ftpusers
219
220 %attr(755,root,root) %{_bindir}/*
221 %attr(755,root,root) %{_sbindir}/*
222
223 %{_mandir}/man[158]/*
224
225 %dir /home/ftp/pub
226 %attr(711,root,root) %dir /home/ftp/pub/Incoming
227
228 %files inetd
229 %defattr(644,root,root,755)
230 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
231 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/ftpd
232
233 %files standalone
234 %defattr(644,root,root,755)
235 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
236 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/proftpd
237 %attr(754,root,root) /etc/rc.d/init.d/proftpd
This page took 0.042709 seconds and 4 git commands to generate.