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