f783ca4
Name:		3proxy
f783ca4
Version:		0.6
36135d8
Release:		5%{?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
36135d8
Requires:		initscripts
f783ca4
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
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}
36135d8
mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/
36135d8
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
36135d8
	for man in man/*.8 ; do
36135d8
	gzip -9c "$man" > "%{buildroot}%{_mandir}/man8/$( basename $man ).gz"
36135d8
	touch --reference "$man" "%{buildroot}%{_mandir}/man8/$( basename $man ).gz"
36135d8
	done
36135d8
36135d8
cat > %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/40-%{name} <
36135d8
#!/bin/sh
36135d8
36135d8
	if [ "\$2" = "up" ]; then
36135d8
	/sbin/service 3proxy restart || : # reload doesn't work
36135d8
	fi
36135d8
EOF
36135d8
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
36135d8
%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
36135d8
%{_mandir}/man8/*.8.gz
f783ca4
f783ca4
%changelog
36135d8
* Sun Nov 8 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.6-5
36135d8
- Fix BZ#533144:
36135d8
- Add reload section to service file, fix stop.
36135d8
- Add %%{_sysconfdir}/NetworkManager/dispatcher.d/40-%%{name} (Thanks to Pankaj Pandey)
36135d8
- Include man-files.
36135d8
- Add Requires: initscripts as owner directory %%{_sysconfdir}/NetworkManager/dispatcher.d/
36135d8
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