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