vsftpd/vsftpd.spec

246 lines
8.4 KiB
RPMSpec

%define nobodygroupid 65013
%define nobodyuserid 65013
%define ftpgroupid 65014
%define ftpuserid 65014
Name: vsftpd
Version: 3.0.2
Release: 3mamba
Summary: Very Secure File Transfer Protocol Daemon.
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://security.appspot.com/vsftpd.html
Source0: https://security.appspot.com/downloads/vsftpd-%{version}.tar.gz
Source1: vsftpd.pam
Source2: vsftpd.ftpusers
Source3: vsftpd.user_list
Source4: vsftpd.logrotate
Source5: vsftpd.conf
Source6: vsftpd.init
Source7: vsftpd.service
Source8: vsftpd@.service
Source9: vsftpd.socket
Source10: vsftpd-ssl.socket
Patch0: %{name}-2.2.0-paths.patch
Patch1: %{name}-2.0.5-builddefs_h.patch
Patch2: %{name}-2.0.5-disable_by_default.patch
Patch3: %{name}-2.0.5-vsftpd_path.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libcap-devel
BuildRequires: libopenssl-devel
BuildRequires: libwrap-devel
BuildRequires: pam-devel
## AUTOBUILDREQ-END
BuildRequires: tcp_wrappers-devel >= 7.6
Requires: pam >= 0.77
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
vsftpd is short for "Very Secure FTP Daemon".
vsftpd is very fast and supports a very high number of concurrent connections.
This package installs the FTP-daemon with a default configuration allowing non-anonymous chroot-logins.
%prep
%setup -q
%patch0 -p1 -b .paths
%patch1 -p1 -b .builddefs_h
%patch2 -p1 -b .disable_by_default
%patch3 -p1 -b .vsftpd_path
%ifarch x86_64
sed -i "s|/lib/|/lib64/|g" vsf_findlibs.sh
%endif
%build
%make CC=%{_host}-gcc \
%if "%{_host}" != "%{_build}"
LIBS="-lwrap -lnsl -lpam -ldl -lnsl -lresolv -lssl -lcrypt -lcap -lcrypto -lattr"
%endif
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d %{buildroot}%{_datadir}/empty
install -d %{buildroot}/var/ftp/pub
install -d %{buildroot}/var/log/vsftpd
install -d %{buildroot}%{_sysconfdir}/vsftpd
touch %{buildroot}%{_sysconfdir}/vsftpd/banned-emails
touch %{buildroot}%{_sysconfdir}/vsftpd/chroot-list
install -D -m 755 vsftpd \
%{buildroot}%{_sbindir}/vsftpd
install -D -m 600 vsftpd.conf \
%{buildroot}%{_sysconfdir}/vsftpd.conf
#install -D -m 644 xinetd.d/vsftpd \
# %{buildroot}%{_sysconfdir}/xinetd.d/vsftpd
install -D -m 644 vsftpd.conf.5 \
%{buildroot}%{_mandir}/man5/vsftpd.conf.5
install -D -m 644 vsftpd.8 \
%{buildroot}%{_mandir}/man8/vsftpd.8
install -D -m 644 %{S:1} %{buildroot}%{_sysconfdir}/pam.d/ftp
install -D -m 600 %{S:2} %{buildroot}%{_sysconfdir}/vsftpd/ftpusers
install -D -m 600 %{S:3} %{buildroot}%{_sysconfdir}/vsftpd/user_list
install -D -m 644 %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/vsftpd
install -D -m 644 %{S:5} %{buildroot}%{_sysconfdir}/vsftpd.conf
#install -D -m 755 %{S:6} %{buildroot}%{_initrddir}/vsftpd
install -D -m0644 %{S:7} %{buildroot}/lib/systemd/system/vsftpd.service
install -D -m0644 %{S:8} %{buildroot}/lib/systemd/system/vsftpd@.service
install -D -m0644 %{S:9} %{buildroot}/lib/systemd/system/vsftpd.socket
install -D -m0644 %{S:10} %{buildroot}/lib/systemd/system/vsftpd-ssl.socket
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
groupadd nobody -g %{nobodygroupid} &>/dev/null
useradd -c nobody -u %{nobodyuserid} -d /dev/null \
-g nobody -s /bin/false nobody &>/dev/null
groupadd ftp -g %{ftpgroupid} &>/dev/null || true
useradd -c "Ftp user" -d /var/ftp -u %{ftpuserid} \
-g ftp -s /bin/false ftp &>/dev/null
exit 0
%preun
if [ $1 -eq 0 ]; then
# erase
userdel ftp &>/dev/null
fi
exit 0
%posttrans
systemctl -q daemon-reload
exit 0
%files
%defattr(-, root, root)
%config(noreplace) %{_sysconfdir}/pam.d/ftp
%config %{_sysconfdir}/logrotate.d/vsftpd
%{_sbindir}/vsftpd
/lib/systemd/system/vsftpd.service
/lib/systemd/system/vsftpd@.service
/lib/systemd/system/vsftpd.socket
/lib/systemd/system/vsftpd-ssl.socket
%attr(0555,ftp,ftp) %dir /var/ftp
%attr(2555,ftp,ftp) %dir /var/ftp/pub
%attr(700,root,root) %dir %{_sysconfdir}/vsftpd
%attr(600,root,root) %config(noreplace) %{_sysconfdir}/vsftpd/*
%attr(600,root,root) %config(noreplace) %{_sysconfdir}/vsftpd.conf
%{_mandir}/*/*
%{_datadir}/empty
%dir %attr(600,root,root) /var/log/vsftpd
%changelog
* Sun Sep 29 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.2-3mamba
- switch from xinetd to systemd
* Sun Nov 11 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.2-2mamba
- added initscript for stand-alone execution
* Thu Nov 08 2012 Automatic Build System <autodist@mambasoft.it> 3.0.2-1mamba
- automatic version update by autodist
* Sun Sep 16 2012 Automatic Build System <autodist@mambasoft.it> 3.0.1-1mamba
- automatic version update by autodist
* Tue Apr 10 2012 Automatic Build System <autodist@mambasoft.it> 3.0.0-1mamba
- automatic version update by autodist
* Sun Feb 12 2012 Automatic Build System <autodist@mambasoft.it> 2.3.5-1mamba
- update to 2.3.5
* Wed Feb 16 2011 Automatic Build System <autodist@mambasoft.it> 2.3.4-1mamba
- automatic update by autodist
* Fri Aug 20 2010 Automatic Build System <autodist@mambasoft.it> 2.3.2-1mamba
- automatic update to 2.3.2 by autodist
* Thu Aug 19 2010 Automatic Build System <autodist@mambasoft.it> 2.3.1-1mamba
- automatic update to 2.3.1 by autodist
* Fri Aug 06 2010 Automatic Build System <autodist@mambasoft.it> 2.3.0-1mamba
- automatic update to 2.3.0 by autodist
* Wed Nov 18 2009 Automatic Build System <autodist@mambasoft.it> 2.2.2-1mamba
- automatic update to 2.2.2 by autodist
* Mon Oct 19 2009 Automatic Build System <autodist@mambasoft.it> 2.2.1-1mamba
- automatic update to 2.2.1 by autodist
* Mon Oct 12 2009 Automatic Build System <autodist@mambasoft.it> 2.2.0-1mamba
- automatic update to 2.2.0 by autodist
* Tue Jun 02 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.2-2mamba
- set LISTEN=NO in default configuration to prevent it from working in xinet mode
* Sat May 30 2009 Automatic Build System <autodist@mambasoft.it> 2.1.2-1mamba
- automatic update to 2.1.2 by autodist
* Fri Feb 20 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-1mamba
- automatic update to 2.1.0 by autodist
* Sat Aug 30 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.7-1mamba
- update to 2.0.7
* Wed Feb 13 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.6-1mamba
- update to 2.0.6
- updated pam file and commented pam_ldap auth line
* Wed Jul 05 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.0.5-1qilnx
- update to version 2.0.5 by autospec
- updated specfile
* Thu Apr 13 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.0.4-1qilnx
- update to version 2.0.4 by autospec
* Thu Mar 03 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.2-1qilnx
- update to version 2.0.2 by autospec
* Wed Dec 01 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.1-6qilnx
- enabled use_localtime option by default
* Wed Dec 01 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.1-5qilnx
- fix of prevoius fix
* Wed Dec 01 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.1-4qilnx
- rename pam service from vsftpd to ftp
- added some (commented) option in vsftpd.conf
* Mon Nov 08 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.1-3qilnx
- rebuild with tcp wrapper and ssl support
* Sun Nov 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.1-2qilnx
- fixed logrotate script
* Mon Jul 12 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.1-1qilnx
- new version build
* Fri May 28 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.2-1qilnx
- new version build
- modified vsftpd pam file to allow login of users without shell
* Wed Dec 17 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.1-1qilnx
- new version build
- added user and group ids > 65000
- fixed logfile configuration and moved to /var/log/vsftpd dir
* Wed Oct 15 2003 Davide Madrisan <davide.madrisan@qilinux.it> 1.2.0-2qilnx
- xinetd.d/vsftpd modified to make the ftp server disabled by default
- added pam dependences; hardcoded system directories moved to rpm variables
* Wed Sep 03 2003 Silvan Calarco <silvan.calarco@qinet.it> 1.2.0-1qilnx
- added creation of ftp and nobody user
- removed paths from pam.d file
* Mon May 26 2003 Silvan Calarco <silvan.calarco@qinet.it> 1.1.3-2qilnx
- added creation of ftp and nobody user
- removed paths from pam.d file
* Wed Apr 23 2003 Mirko Cortillaro <mirko.cortillaro@qinet.it> 1.1.3-1qilnx
- wrote a spec file for vsftpd