LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dba-proftpd-134e.spec of Package dba-proftpd-134e (Project home:csbuild:DBA)

%define real_name 	proftpd
%define version         1.3.4e
%define vers            134e
%define prefix		/DBA/ftp/PRO/%{version}
%define with_dbassl 1
%define with_exec 1
%define with_geoip 1
%define with_shaper 1
%define with_pg 1
%define with_memcache 0

Name:           	dba-%{real_name}-%{vers}
Summary:        	Highly configurable GPL-licensed FTP server software 1.3.4e
License:        	GPL
Group:          	Productivity/Networking/Ftp/Servers
Version:        	%{version}
Release:        	1
Source0:        	ftp://ftp.proftpd.org/distrib/source/%{real_name}-%{version}.tar.gz
Url:            	http://www.proftpd.org/
Source1:        	dba-proftpd-rpmlintrc
Source2:        	%{real_name}.init
Source3:        	%{real_name}.logrotate
Source4:        	%{real_name}.init.centos
Source5:                https://github.com/Castaglia/proftpd-mod_vroot/archive/mod_vroot-0.9.3.tar.gz
Source6:                http://www.thrallingpenguin.com/resources/mod_clamav-0.10.tar.gz
Source7:                http://www.castaglia.org/proftpd/modules/proftpd-mod-case-0.7.tar.gz
Source8:                http://www.castaglia.org/proftpd/modules/proftpd-mod-log-forensic-0.2.tar.gz
Source9:		filter-requires-proftpd.sh
Source10:               set_proftpd_1.3.latest.sh
AutoReqProv:    	on
BuildRoot:      	%{_tmppath}/%{name}-%{version}-build

%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE9}

%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks
%endif

#!BuildIgnore:  dba-postgresql-839 dba-postgresql-842 dba-postgresql-845 dba-postgresql-846
#!BuildIgnore:  dba-postgresql-901 dba-postgresql-902 dba-postgresql-904 dba-postgresql-910
#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c

BuildRequires:  libacl-devel libattr-devel pam-devel unixODBC-devel
%if %{with_dbassl}
BuildRequires:  dba-openssl-101h-static
%define ssldir /DBA/openssl/1.0.1h
%else
BuildRequires:  openssl-devel
%endif

%if %{with_geoip}
BuildRequires:  dba-geoip-148-static
%endif

%if 0%{?suse_version}
BuildRequires:  openldap2-devel tcpd-devel

%if 0%{?sles_version} == 9
BuildRequires:  mysql-devel mysql-shared sqlite-devel
%else
BuildRequires:  mysql-devel krb5-devel libcap-devel sqlite-devel
%endif

%else
# CentOS, RHEL
%if 0%{?rhel_version} == 406
%define with_sqlite 0
%else
BuildRequires:  sqlite-devel
%endif

BuildRequires:  mysql-devel krb5-devel libcap-devel
BuildRequires:  tcp_wrappers openldap-devel openldap mysql glibc-devel libgcc gcc gcc-c++

%if 0%{?fedora_version} >= 10 || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
BuildRequires:  tcp_wrappers-devel
%endif

%endif


%description
Highly configurable GPL-licensed FTP server software

%if %{with_pg}
%package postgresql
Summary:        Postgresql plugin for proftpd
Group:          Productivity/Networking/Ftp/Servers
Requires:       %{name} = %{version}
Requires:	postgresql-libs
BuildRequires:  postgresql-devel

%description postgresql
Postgresql plugin for proftpd

%endif


%prep
%setup -q -n %{real_name}-%{version} -a 5 -a 6 -a 7 -a 8

# Copy mod_vroot source and documentation into place
%{__cp} -p */mod_vroot.c contrib/
%{__cp} -p */mod_vroot.html doc/contrib/

%{__cp} -p mod_clamav-0.10/mod_clamav.* contrib/

%{__cp} -p mod_case/mod_case.* contrib/

%{__cp} -p mod_log_forensic/mod_log_forensic.* contrib/

%{__chmod} +x %{SOURCE9}


%build
%if %{with_geoip}
export CFLAGS='-I/DBA/geoip/1.4.8/include'
export LDFLAGS='-L/DBA/geoip/1.4.8/lib'
%else
find contrib/ -name "mod_geoip.c" |xargs -i rm -f {}
%endif
%if %{with_dbassl}
export CFLAGS="$CFLAGS -I%{ssldir}/include"
export LDFLAGS="$LDFLAGS -L/%{ssldir}/lib"
%endif

%if 0%{?sles_version} != 9
%if 0%{?with_sqlite}
PROFTPD_SHARED_MODS="$(for spec_mod in $(find contrib -name mod_\*.c); do echo "$(basename ${spec_mod%%.c})"; done | tr '\n' ':' | sed -e 's|:$||')"
%else
PROFTPD_SHARED_MODS="$(for spec_mod in $(find contrib -name mod_\*.c|grep -v sqlite); do echo "$(basename ${spec_mod%%.c})"; done | tr '\n' ':' | sed -e 's|:$||')"
%endif
%else
PROFTPD_SHARED_MODS="$(for spec_mod in $(find contrib -name mod_\*.c|grep -v sqlite); do echo "$(basename ${spec_mod%%.c})"; done | tr '\n' ':' | sed -e 's|:$||')"
%endif

./configure \
    --prefix=%{prefix} \
    --enable-sendfile \
    --enable-ipv6 \
    --enable-ctrls \
    --enable-facl \
    --enable-dso \
    --enable-nls \
%if %{with_dbassl}
    --enable-openssl \
%endif
%if %{with_memcache}
    --enable-memcache \
%endif
    --with-includes="%{_includedir}/mysql:%{_includedir}/pgsql" \
%if 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora_version}
    --with-libraries="%{_libdir}/mysql" \
%endif
    --with-shared="${PROFTPD_SHARED_MODS}" \
    LIBS=-lcrypto

%{__make}

%install
%if 0%{?suse_version}
%makeinstall INSTALL_USER=`id -un` INSTALL_GROUP=`id -gn`
%else
make DESTDIR=%{buildroot} install INSTALL_USER=`id -un` INSTALL_GROUP=`id -gn`
%endif
%{__mkdir_p} %{buildroot}%{prefix}
%{__mkdir_p} %{buildroot}%{prefix}/conf
%{__mkdir_p} %{buildroot}%{prefix}/samples
%{__mkdir_p} %{buildroot}%{prefix}/var
# %{__rm} -fv %{buildroot}%{_libdir}/%{real_name}/*.a
%{__cp} -v contrib/dist/rpm/xinetd %{buildroot}%{prefix}/samples
%{__cp} -v contrib/dist/rpm/proftpd.logrotate %{buildroot}%{prefix}/samples
%{__cp} -v sample-configurations/*conf %{buildroot}%{prefix}/samples
# %{__install} -D -m 0644 contrib/dist/rpm/xinetd   %{buildroot}%{prefix}/samples
# %{__install} -D -m 0644 contrib/dist/rpm/proftpd.logrotate %{buildroot}%{prefix}/samples
# %{__install} -D -m 0644 sample-configurations/*conf %{buildroot}%{prefix}/samples
# %{__install} -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/%{real_name}
%if 0%{?suse_version}
%{__cp} -v %{S:2} %{buildroot}%{prefix}/samples
# %{__install} -D -m 0755 %{S:2} %{buildroot}%{prefix}/samples
%else
%{__cp} -v %{S:4} %{buildroot}%{prefix}/samples
# %{__install} -D -m 0755 %{S:4} %{buildroot}%{prefix}/samples
%endif

%{__install} -m 0755 %{S:10} %{buildroot}%{prefix}/bin/set_proftpd_1.3.latest.sh

%{__rm} -rv %{buildroot}/%{prefix}/libexec/*.a
%{__rm} -rv %{buildroot}/%{prefix}/libexec/*.la


%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}


%post
cd %{prefix}/..
%{prefix}/bin/set_proftpd_1.3.latest.sh


%if %{with_pg}
%files postgresql
%defattr(-,root,root)
%{prefix}/libexec/mod_sql_postgres.so
%endif

%files
%defattr(-,root,root)
%dir %{prefix} 
%{prefix}/bin
%{prefix}/etc
%{prefix}/include
%{prefix}/lib
%{prefix}/libexec
%exclude %{prefix}/libexec/mod_sql_postgres.so
%{prefix}/samples
%{prefix}/sbin
%{prefix}/share
%{prefix}/var


%changelog
* Fri Jul 11 2014 Holger Manthey <holger.manthey@bertelsmann.de>
- initial package