File frox.spec of Package frox

#
# spec file for package frox
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%if ! %{defined _fillupdir}
 %define _fillupdir /var/adm/fillup-templates
%endif

Name:           frox
Version:        0.7.18
Release:        0
Summary:        A transparent FTP proxy for linux
License:        GPL-2.0
Group:          Productivity/Networking/Ftp/Servers
Url:            http://frox.sourceforge.net/
Source0:        http://frox.sourceforge.net/download/frox-%{version}.tar.bz2
Source1:        rc.frox
Source2:        sysconfig.syslog-frox
Source3:        frox.README
Patch0:         frox-0.7.9.configuration.dif
Patch1:         frox-0.7.18-sin.zero.dif
BuildRequires:  openssl-devel
Requires(pre):  %insserv_prereq %fillup_prereq /bin/cp
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
It will transparently proxy your ftp clients (duh). This means that any
clients you have that are behind the proxy will believe that they are
connecting to an ftp server as normal, but will actually be connecting
to frox. Frox will do the onward connection to the remote server.

It can also be set up to do non-transparent proxying. In this case the
ftp client can connect directly to frox, but instead of logging in with
``username'' should log in with ``username@ftp.wherever.org''.

On either of these sorts of connections it can do caching of files you
download, or converting of data connections from active-->passive which
can make firewalling rules a lot easier/safer. There is also basic
support for running a virus scanner on downloaded files.

See http://frox.sourceforge.net/ for more information.

%prep
%setup -q -n frox-%{version}
%patch0 -p1
%patch1 -p1

%build
%configure \
	--enable-warnings \
	--enable-http-cache \
	--enable-local-cache \
	--enable-virus-scan \
	--enable-ssl \
	--enable-configfile=%{_sysconfdir}/frox.conf
make %{?_smp_mflags}

%install
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d %{buildroot} ] && rm -rf $RPM_BUILD_ROOT;
make DESTDIR=%{buildroot} install %{?_smp_mflags}
mkdir -p %{buildroot}%{_initddir}/
mkdir -p %{buildroot}%{_localstatedir}/lib/frox/etc
mkdir -p %{buildroot}%{_localstatedir}/lib/frox/dev
mkdir -p %{buildroot}%{_localstatedir}/lib/frox/%{_lib}
mkdir -p %{buildroot}%{_localstatedir}/lib/frox%{_localstatedir}/run
mkdir -p %{buildroot}%{_fillupdir}
mkdir -p %{buildroot}/%{_mandir}/man8
pushd doc; for i in *.man; do mv $i %{buildroot}/%{_mandir}/man8/${i%.man}.8; done; popd
rm doc/*.sgml
install -m 744 $RPM_SOURCE_DIR/rc.frox %{buildroot}%{_initddir}/frox
ln -s ../..%{_initddir}/frox %{buildroot}%{_sbindir}/rcfrox
install -m 744 $RPM_SOURCE_DIR/sysconfig.syslog-frox %{buildroot}%{_fillupdir}
cp -p $RPM_SOURCE_DIR/frox.README README.%{VENDOR}

%post
%{fillup_and_insserv -f}
test -s etc/frox.conf || {
	cp -p usr/share/doc/packages/frox/frox.conf etc/ &&
	echo installing default %{_sysconfdir}/frox.conf from %{_docdir}/frox/frox.conf;
}
%{fillup_only -ans syslog frox}

%postun
%restart_on_update frox
%insserv_cleanup

%preun
%stop_on_removal frox

%files
%defattr(-,root,root)
%doc COPYING README BUGS doc/* src/frox.conf 
%{_mandir}/man8/*
%{_sbindir}/*
%{_initddir}/*
%dir %attr(700,root,root) %{_localstatedir}/lib/frox
%dir %{_localstatedir}/lib/frox/etc
%dir %{_localstatedir}/lib/frox/dev
%dir %{_localstatedir}/lib/frox/%{_lib}
%{_fillupdir}/sysconfig.syslog-frox

%changelog
openSUSE Build Service is sponsored by