]> git.pld-linux.org Git - packages/vsftpd.git/blob - vsftpd.spec
- release 5 (by relup.sh)
[packages/vsftpd.git] / vsftpd.spec
1 # TODO:
2 # - default config does not work with inetd configuration
3 #
4 # Conditional build:
5 %bcond_with     clamav  # ClamAV scanning support
6
7 %define         _ftpdir /home/services/ftp
8 Summary:        vsftpd - Very Secure FTP Daemon
9 Summary(pl.UTF-8):      Bardzo Bezpieczny Demon FTP
10 Summary(pt_BR.UTF-8):   vsftpd - Daemon FTP Muito Seguro
11 Name:           vsftpd
12 Version:        3.0.2
13 Release:        5
14 License:        GPL v2
15 Group:          Daemons
16 Source0:        https://security.appspot.com/downloads/%{name}-%{version}.tar.gz
17 # Source0-md5:  8b00c749719089401315bd3c44dddbb2
18 Source1:        %{name}.inetd
19 Source2:        %{name}.pamd
20 Source3:        %{name}-ftpusers
21 Source4:        ftpusers.tar.bz2
22 # Source4-md5:  76c80b6ec9f4d079a1e27316edddbe16
23 Source5:        %{name}.init
24 Patch0:         %{name}-builddefs.patch
25 Patch1:         %{name}-amd64-findlibs.patch
26 Patch2:         %{name}-clamav.patch
27 Patch3:         %{name}-switch_sha256_to_sha1.patch
28 Patch4:         %{name}-findlibs-egrep.patch
29 URL:            https://security.appspot.com/vsftpd.html
30 BuildRequires:  libcap-devel
31 BuildRequires:  libwrap-devel
32 %if "%{pld_release}" == "ac"
33 BuildRequires:  openssl-devel >= 0.9.7d
34 %else
35 BuildRequires:  openssl-devel >= 0.9.8
36 %endif
37 BuildRequires:  rpmbuild(macros) >= 1.268
38 Requires:       %{name}-init = %{version}-%{release}
39 Requires:       filesystem >= 3.0-11
40 Requires:       pam >= 0.77.3
41 Provides:       ftpserver
42 Conflicts:      man-pages < 1.51
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define specflags       -fpie -pipe -Wextra -Werror
46
47 %description
48 A Very Secure FTP Daemon - written from scratch - by Chris "One Man
49 Security Audit Team" Evans.
50
51 %description -l pl.UTF-8
52 Bardzo Bezpieczny Demon FTP - napisany od zera przez Chrisa "One Man
53 Security Audit Team" Evansa.
54
55 %description -l pt_BR.UTF-8
56 A Very Secure FTP Daemon (vsftpd) - escrito do zero - por Chris "One
57 Man Security Audit Team" Evans.
58
59 %package inetd
60 Summary:        vsftpd - Very Secure FTP Daemon
61 Summary(pl.UTF-8):      Bardzo Bezpieczny Demon FTP
62 Summary(pt_BR.UTF-8):   vsftpd - Daemon FTP Muito Seguro
63 Group:          Networking/Daemons
64 Requires:       %{name} = %{version}-%{release}
65 Requires:       rc-inetd
66 Provides:       %{name}-init = %{version}-%{release}
67 Obsoletes:      vsftpd-standalone
68 Conflicts:      %{name} <= 2.0.3-1
69
70 %description inetd
71 This package allows to start vsftpd as inetd service.
72
73 %description inetd -l pl.UTF-8
74 Ten pakiet pozwala na wystartowanie vsftpd jako usÅ‚ugi inetd.
75
76 %package standalone
77 Summary:        vsftpd - Very Secure FTP Daemon
78 Summary(pl.UTF-8):      Bardzo Bezpieczny Demon FTP
79 Summary(pt_BR.UTF-8):   vsftpd - Daemon FTP Muito Seguro
80 Group:          Networking/Daemons
81 Requires(post,preun):   /sbin/chkconfig
82 Requires:       %{name} = %{version}-%{release}
83 Requires:       rc-scripts
84 Provides:       %{name}-init = %{version}-%{release}
85 Obsoletes:      vsftpd-inetd
86 Conflicts:      %{name} <= 2.0.3-1
87
88 %description standalone
89 This package allows to start vsftpd as standalone daemon.
90
91 %description standalone -l pl.UTF-8
92 Ten pakiet pozwala na wystartowanie vsftpd jako samodzielnego demona.
93
94 %prep
95 %setup -q
96 %patch0 -p1
97 %patch1 -p1
98 %if %{with clamav}
99 %patch2 -p1
100 %endif
101 %if "%{pld_release}" == "ac"
102 %patch3 -p1
103 %endif
104 %patch4 -p1
105
106 %build
107 %{__make} \
108         CC="%{__cc}" \
109         CFLAGS="%{rpmcflags}" \
110         LIBS="-lwrap -lpam -lcap -lssl -lcrypto" \
111         LINK="%{rpmldflags}"
112
113 %install
114 rm -rf $RPM_BUILD_ROOT
115 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8}} \
116         $RPM_BUILD_ROOT/etc/{pam.d,sysconfig/rc-inetd,logrotate.d,ftpd,rc.d/init.d} \
117         $RPM_BUILD_ROOT{%{_ftpdir}/pub/incoming,/var/log}
118
119 install -p vsftpd $RPM_BUILD_ROOT%{_sbindir}/vsftpd
120 cp -p vsftpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd.conf
121 cp -p vsftpd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/vsftpd.conf.5
122 cp -p vsftpd.8 $RPM_BUILD_ROOT%{_mandir}/man8/vsftpd.8
123 cp -p RedHat/vsftpd.log $RPM_BUILD_ROOT/etc/logrotate.d/vsftpd
124
125 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/vsftpd
126 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/ftp
127 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ftpd/ftpusers
128 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/vsftpd
129
130 > $RPM_BUILD_ROOT/var/log/vsftpd.log
131
132 bzip2 -dc %{SOURCE4} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
133 %{__rm} $RPM_BUILD_ROOT%{_mandir}/ftpusers-path.diff
134
135 %clean
136 rm -rf $RPM_BUILD_ROOT
137
138 %post
139 touch /var/log/vsftpd.log
140 chmod 640 /var/log/vsftpd.log
141
142 %post inetd
143 %service -q rc-inetd reload
144
145 %postun inetd
146 if [ "$1" = "0" ]; then
147         %service -q rc-inetd reload
148 fi
149
150 %post standalone
151 /sbin/chkconfig --add %{name}
152 %service vsftpd restart "vsftpd server"
153
154 %preun standalone
155 if [ "$1" = "0" ]; then
156         %service vsftpd stop
157         /sbin/chkconfig --del %{name}
158 fi
159
160 %triggerin standalone -- glibc
161 # restart vsftpd if glibc is upgraded or downgraded
162 if [ "$2" != 1 ]; then
163         %service -q vsftpd restart
164 fi
165
166 %files
167 %defattr(644,root,root,755)
168 %doc AUDIT BENCHMARKS BUGS Changelog FAQ README README.ssl REWARD SIZE SPEED TODO TUNING EXAMPLE SECURITY
169 %attr(755,root,root) %{_sbindir}/vsftpd
170 %dir %attr(750,root,ftp) %dir %{_sysconfdir}/ftpd
171 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vsftpd.conf
172 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ftpd/ftpusers
173 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/ftp
174 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/vsftpd
175 %attr(640,root,root) %ghost /var/log/vsftpd.log
176 %{_mandir}/man5/vsftpd.conf.5*
177 %{_mandir}/man8/vsftpd.8*
178 %{_mandir}/man5/ftpusers.5*
179 %lang(ja) %{_mandir}/ja/man5/ftpusers*
180 %lang(pl) %{_mandir}/pl/man5/ftpusers*
181 %lang(pt_BR) %{_mandir}/pt_BR/man5/ftpusers*
182 %lang(ru) %{_mandir}/ru/man5/ftpusers*
183 %dir %{_ftpdir}
184 %dir %{_ftpdir}/pub
185 # it's safe - by default anon_upload_enable=NO, anon_world_readable_only=YES
186 %attr(775,root,ftp) %dir %{_ftpdir}/pub/incoming
187
188 %files inetd
189 %defattr(644,root,root,755)
190 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/vsftpd
191
192 %files standalone
193 %defattr(644,root,root,755)
194 %attr(754,root,root) /etc/rc.d/init.d/vsftpd
This page took 0.060975 seconds and 4 git commands to generate.