f783ca4
Name:		3proxy
d9f0f0a
Version:		0.6.1
2048bbd
Release:		9%{?dist}
f783ca4
f783ca4
Summary:		Tiny but very powerful proxy
f783ca4
Summary(ru):	Маленький, но крайне мощный прокси-сервер
f783ca4
f783ca4
License:		BSD or ASL 2.0 or GPLv2+ or LGPLv2+
f783ca4
Group:		System Environment/Daemons
f783ca4
Url:			http://3proxy.ru/?l=EN
f783ca4
f783ca4
Source0:		http://3proxy.ru/%{version}/%{name}-%{version}.tgz
f783ca4
Source1:		3proxy.init
f783ca4
Source2:		3proxy.cfg
f783ca4
# EPEL still require it
f783ca4
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
f783ca4
BuildRequires:	dos2unix
e2fff6d
Requires:		initscripts
f783ca4
2048bbd
# I correct config path in man only. It is fully Fedora related.
2048bbd
Patch0:		3proxy-0.6.1-config-path.patch
2048bbd
f783ca4
%description
f783ca4
3proxy -- light proxy server.
f783ca4
Universal proxy server with HTTP, HTTPS, SOCKS v4, SOCKS v4a, SOCKS v5, FTP,
f783ca4
POP3, UDP and TCP portmapping, access control, bandwith control, traffic
f783ca4
limitation and accounting based on username, client IP, target IP, day time,
f783ca4
day of week, etc.
f783ca4
f783ca4
%description -l ru
f783ca4
3proxy -- маленький прокси сервер.
f783ca4
Это универсальное решение поддерживающее HTTP, HTTPS, SOCKS v4, SOCKS v4a,
f783ca4
SOCKS v5, FTP, POP3, UDP и TCP проброс портов (portmapping), списки доступа
f783ca4
управление скоростью доступа, ограничением трафика и статистикоу, базирующейся
f783ca4
на имени пользователя, слиентском IP адресе, IP цели, времени дня, дня недели
f783ca4
и т.д.
f783ca4
f783ca4
%prep
f783ca4
%setup -q
f783ca4
2048bbd
%patch0 -p0 -b .man-cfg
2048bbd
f783ca4
# To use "fedora" CFLAGS (exported)
f783ca4
sed -i -e "s/CFLAGS =/CFLAGS +=/" Makefile.Linux
f783ca4
f783ca4
dos2unix Changelog
f783ca4
f783ca4
%build
f783ca4
%{__make} -f Makefile.Linux
f783ca4
f783ca4
%install
f783ca4
rm -rf %{buildroot}
f783ca4
f783ca4
mkdir -p %{buildroot}%{_sysconfdir}
e2fff6d
mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/
e2fff6d
mkdir -p %{buildroot}%{_mandir}/man8
f783ca4
mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
f783ca4
install -m755 -D src/3proxy %{buildroot}%{_bindir}/3proxy
f783ca4
install -m755 -D src/dighosts %{buildroot}%{_bindir}/dighosts
f783ca4
install -m755 -D src/ftppr %{buildroot}%{_bindir}/ftppr
f783ca4
install -m755 -D src/mycrypt %{buildroot}%{_bindir}/mycrypt
f783ca4
install -m755 -D src/pop3p %{buildroot}%{_bindir}/pop3p
f783ca4
install -m755 -D src/3proxy %{buildroot}%{_bindir}/3proxy
f783ca4
install -m755 -D src/proxy %{buildroot}%{_bindir}/htproxy
f783ca4
install -m755 -D src/socks %{buildroot}%{_bindir}/socks
f783ca4
install -m755 -D src/tcppm %{buildroot}%{_bindir}/tcppm
f783ca4
install -m755 -D src/udppm %{buildroot}%{_bindir}/udppm
f783ca4
f783ca4
install -pD -m755 %{SOURCE1} %{buildroot}/%{_initrddir}/%{name}
f783ca4
install -pD -m644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}.cfg
f783ca4
e2fff6d
	for man in man/*.8 ; do
e2fff6d
	gzip -9c "$man" > "%{buildroot}%{_mandir}/man8/$( basename $man ).gz"
e2fff6d
	touch --reference "$man" "%{buildroot}%{_mandir}/man8/$( basename $man ).gz"
e2fff6d
	done
e2fff6d
e2fff6d
cat > %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/40-%{name} <
e2fff6d
#!/bin/sh
e2fff6d
e2fff6d
	if [ "\$2" = "up" ]; then
d9f0f0a
	/sbin/service 3proxy condrestart || : # reload doesn't work
e2fff6d
	fi
e2fff6d
EOF
e2fff6d
f783ca4
%clean
f783ca4
rm -rf %{buildroot}
f783ca4
f783ca4
%post
f783ca4
# Register service
f783ca4
/sbin/chkconfig --add %{name}
f783ca4
f783ca4
%preun
f783ca4
if [ $1 = 0 ]; then
f783ca4
	/sbin/service %{name} stop > /dev/null 2>&1
f783ca4
	/sbin/chkconfig --del %{name}
f783ca4
fi
f783ca4
f783ca4
%files
f783ca4
%defattr(-,root,root,-)
f783ca4
%{_bindir}/*
f783ca4
%config(noreplace) %{_sysconfdir}/%{name}.cfg
e2fff6d
%attr(0755,root,root) %config %{_sysconfdir}/NetworkManager/dispatcher.d/40-%{name}
f783ca4
%{_initrddir}/%{name}
f783ca4
%{_localstatedir}/log/%{name}
f783ca4
%doc Readme Changelog authors copying news
e2fff6d
%{_mandir}/man8/*.8.gz
f783ca4
f783ca4
%changelog
2048bbd
* Sun May 30 2010 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6.1-9
2048bbd
- Correct path to config file in man (BUG#596087) add Patch0: 3proxy-0.6.1-config-path.patch
2048bbd
d9f0f0a
* Mon Mar 15 2010 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6.1-8
d9f0f0a
- Update to version 0.6.1
d9f0f0a
- In NM event processing replace service restart to condrestart - BZ#572662
d9f0f0a
0d61de1
* Wed Nov 25 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6-7
0d61de1
- Again new init-script for Fix BZ#533144 :).
0d61de1
0d61de1
* Wed Nov 25 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6-6
0d61de1
- Forgot commit new init-script for Fix BZ#533144.
0d61de1
e2fff6d
* Sun Nov 8 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6-5
e2fff6d
- Fix BZ#533144:
e2fff6d
- Add reload section to service file, fix stop.
e2fff6d
- Add %%{_sysconfdir}/NetworkManager/dispatcher.d/40-%%{name} (Thanks to Pankaj Pandey)
e2fff6d
- Include man-files.
e2fff6d
- Add Requires: initscripts as owner directory %%{_sysconfdir}/NetworkManager/dispatcher.d/
e2fff6d
f783ca4
* Thu Aug 20 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6-3
f783ca4
- Fedora Review started - thank you Peter Lemenkov.
f783ca4
- Change rights (0755->0644) of config.
f783ca4
- Disable service by default.
f783ca4
- Add BR dos2unix.
f783ca4
f783ca4
* Mon Aug 17 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6-2
f783ca4
- /usr/bin/proxy renamed to htproxy to avoid name bump with libproxy-bin.
f783ca4
- Add Source2: 3proxy.cfg from Alt Linux (slightly modified) - http://sisyphus.ru/ru/srpm/Sisyphus/3proxy/sources/1 (thanks to Afanasov Dmitry).
f783ca4
- Add log-dir %%{_localstatedir}/log/%%{name}
f783ca4
f783ca4
* Mon Aug 17 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6-1
f783ca4
- Ressurect old spec. New version 0.6.
f783ca4
- Rename spec to classic %%{name}.spec.
f783ca4
- Remove Hu part from release and add %%{?dist}.
f783ca4
- Change summary, description, URL. Add Russian localisation of sumamry and description.
f783ca4
- Strip some old comments.
f783ca4
- Add to %%doc Readme Changelog authors copying news.
f783ca4
- Turn macros usage from %%name to %%{name} for consistence.
f783ca4
- Change group from System/Servers to standard System Environment/Daemons.
f783ca4
- Add %%defattr(-,root,root,-) in %%files section.
f783ca4
- Add cleanup in %%install section.
f783ca4
- Add %%clean section with cleanup buildroot.
f783ca4
- License changed from just GPL to "BSD or ASL 2.0 or GPLv2+ or LGPLv2+" (according to Makefile.Linux)
f783ca4
- Add %%config(noreplace) mark to all configs.
f783ca4
- Add file %%{_initdir}/%%{name}
f783ca4
- Old %%{_initdir} macros replaced by %%{_initrddir}
f783ca4
- Hack makefile to use system CFLAGS.
f783ca4
- Add %%post/%%postun sections.
f783ca4
f783ca4
* Fri Jan 25 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] info> - 0.5.3k
f783ca4
- Import from ftp://ftp.nluug.nl/pub/os/Linux/distr/altlinux/4.0/Server/4.0.1/files/SRPMS/3proxy-0.5.3h-alt1.src.rpm
f783ca4
	Combine with ftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/t/th/three-proxy/3proxy-0.5.3g-1.src.rpm
f783ca4
- Steep to version 0.5.3k
f783ca4
- Comment out packager
f783ca4
- Reformat header of spec with tabs
f783ca4
- Add desc from second src.rpm of import
f783ca4
- Correct source0
f783ca4
- Add -c key fo %%setup macro
f783ca4
- Add BuildRoot definition (this is not ALT)
f783ca4
- Change
f783ca4
	Release:	alt1
f783ca4
	to
f783ca4
	Release:	0.Hu.0
f783ca4
f783ca4
* Fri Apr 13 2007 Lunar Child <luch@altlinux.ru> 0.5.3h-alt1
f783ca4
- new version
f783ca4
f783ca4
* Wed Mar 21 2007 Lunar Child <luch@altlinux.ru> 0.5.3g-alt2
f783ca4
- Added init script.
f783ca4
- Added new trivial config file.
f783ca4
f783ca4
* Tue Mar 20 2007 Lunar Child <luch@altlinux.ru> 0.5.3g-alt1
f783ca4
- First build for ALT Linux Sisyphus