From f783ca4d6b1f545cff1a27ee952026844ccbd36c Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Thu, 27 Aug 2009 20:14:26 +0000 Subject: [PATCH 01/12] Initial import 3proxy into Fedora --- .cvsignore | 1 + 3proxy.cfg | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3proxy.init | 87 +++++++++++++++++++++++++ 3proxy.spec | 142 +++++++++++++++++++++++++++++++++++++++++ import.log | 1 + sources | 1 + 6 files changed, 410 insertions(+) create mode 100644 3proxy.cfg create mode 100644 3proxy.init create mode 100644 3proxy.spec create mode 100644 import.log diff --git a/.cvsignore b/.cvsignore index e69de29..e7857b0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +3proxy-0.6.tgz diff --git a/3proxy.cfg b/3proxy.cfg new file mode 100644 index 0000000..8212546 --- /dev/null +++ b/3proxy.cfg @@ -0,0 +1,178 @@ +# Yes, 3proxy.cfg can be executable, in this case you should place +# something like +#config /usr/local/3proxy/3proxy.cfg +# to show which configuration 3proxy should re-read on realod. + +#system "echo Hello world!" +# you may use system to execute some external command if proxy starts + +# We can configure nservers to avoid unsafe gethostbyname() usage +#nserver 10.1.2.1 +#nserver 10.2.2.2 +# nscache is good to save speed, traffic and bandwidth +nscache 65536 + +#nsrecord porno.security.nnov.ru 0.0.0.0 +# nobody will be able to access porno.security.nnov.ru by the name. +#nsrecord wpad.security.nnov.ru www.security.nnov.ru +# wpad.security.nnov.ru will resolve to www.security.nnov.ru for +# clients + + +timeouts 1 5 30 60 180 1800 15 60 +# Here we can change timeout values + +users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1" +# note that "" required, overvise $... is treated as include file name. +# $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format. +#users $/usr/local/etc/3proxy/passwd +# this example shows you how to include passwd file. For included files +# and are treated as field separators. + +daemon +# now we will not depend on any console (daemonize). daemon must be given +# before any significant command on *nix. + +#service +# service is required under NT if you want 3proxy to start as service + +#log /usr/local/etc/3proxy/logs/3proxy.log D +log /var/log/3proxy/3proxy.log +# log allows to specify log file location and rotation, D means logfile +# is created daily + +# in log file we want to have underscores instead of spaces +logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T" +#logformat "L%d-%m-%Y %H:%M:%S %z %N.%p %E %U %C:%c %R:%r %O %I %h %T" +#logformat "Linsert into log (l_date, l_user, l_service, l_in, l_out, l_descr) values ('%d-%m-%Y %H:%M:%S', '%U', '%N', %I, %O, '%T')" + +archiver gz /bin/gzip %F +#archiver zip zip -m -qq %A %F +#archiver zip pkzipc -add -silent -move %A %F +#archiver rar rar a -df -inul %A %F +# if archiver specified log file will be compressed after closing. +# you should specify extension, path to archiver and command line, %A will be +# substituted with archive file name, %f - with original file name. +# Original file will not be removed, so archiver should care about it. + +rotate 30 +# We will keep last 30 log files + +auth iponly +#auth nbname +#auth strong +# auth specifies type of user authentication. If you specify none proxy +# will not do anything to check name of the user. If you specify +# nbname proxy will send NetBIOS name request packet to UDP/137 of +# client and parse request for NetBIOS name of messanger service. +# Strong means that proxy will check password. For strong authentication +# unknown user will not be allowed to use proxy regardless of ACL. +# If you do not want username to be checked but wanna ACL to work you should +# specify auth iponly. + + +#allow ADMINISTRATOR,root +#allow * 127.0.0.1,192.168.1.1 * * +#redirect 192.168.1.2 80 * * * 80 +#allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535 +# we will allow everything if username matches ADMINISTRATOR or root or +# client ip is 127.0.0.1 or 192.168.1.1. Overwise we will redirect any request +# to port 80 to our Web-server 192.168.0.2. +# We will allow any outgoing connections from network 192.168.1.0/24 to +# SMTP, POP3, FTP, DNS and unprivileged ports. +# Note, that redirect may also be used with proxy or portmapper. It will +# allow you to redirect requests to different ports or different server +# for different clients. + +# sharing access to internet + +#external 10.1.1.1 +external 0.0.0.0 +# external is address 3proxy uses for outgoing connections. 0.0.0.0 means any +# interface. Using 0.0.0.0 is not good because it allows to connect to 127.0.0.1 + +#internal 192.168.1.1 +internal 127.0.0.1 +# internal is address of interface proxy will listen for incoming requests +# 127.0.0.1 means only localhost will be able to use this proxy. This is +# address you should specify for clients as proxy IP. +# You MAY use 0.0.0.0 but you shouldn't, because it's a chance for you to +# have open proxy in your network in this case. + +auth none +# no authentication is requires + +dnspr + +# dnsproxy listens on UDP/53 to answer client's DNS requests. It requires +# nserver/nscache configuration. + + +#external $./external.ip +#internal $./internal.ip +# this is just an alternative form fo giving external and internal address +# allows you to read this addresses from files + +auth strong +# We want to protect internal interface +deny * * 127.0.0.1,192.168.1.1 +# and llow HTTP and HTTPS traffic. +allow * * * 80-88,8080-8088 HTTP +allow * * * 443,8443 HTTPS +proxy -n + +auth none +# pop3p will be used without any authentication. It's bad choice +# because it's possible to use pop3p to access any port +pop3p + +tcppm 25 mail.my.provider 25 +#udppm -s 53 ns.my.provider 53 +# we can portmap port TCP/25 to provider's SMTP server and UDP/53 +# to provider's DNS. +# Now we can use our proxy as SMTP and DNS server. +# -s switch for UDP means "single packet" service - instead of setting +# association for period of time association will only be set for 1 packet. +# It's very userfull for services like DNS but not for some massive services +# like multimedia streams or online games. + +auth strong +flush +allow 3APA3A,test +maxconn 20 +socks +# for socks we will use password authentication and different access control - +# we flush previously configured ACL list and create new one to allow users +# test and 3APA3A to connect from any location + + +auth strong +flush +internal 127.0.0.1 +allow 3APA3A 127.0.0.1 +maxconn 3 +admin +#only allow acces to admin interface for user 3APA3A from 127.0.0.1 address +#via 127.0.0.1 address. + +# map external 80 and 443 ports to internal Web server +# examples below show how to use 3proxy to publish Web server in internal +# network to Internet. We must switch internal and external addresses and +# flush any ACLs + +#auth none +#flush +#external $./internal.ip +#internal $./external.ip +#maxconn 300 +#tcppm 80 websrv 80 +#tcppm 443 websrv 443 + + +#chroot /usr/local/jail +#setgid 65535 +#setuid 65535 +# now we needn't any root rights. We can chroot and setgid/setuid. + + +###$Id: 3proxy.cfg,v 1.1 2009/08/27 20:14:25 hubbitus Exp $####### diff --git a/3proxy.init b/3proxy.init new file mode 100644 index 0000000..47948da --- /dev/null +++ b/3proxy.init @@ -0,0 +1,87 @@ +#!/bin/sh +# +# Init file for Software Watchdog daemon. +# +# Written by Dag Wieers . +# Rewrote for ALT Linux by Pavlov Konstantin +# Modifyed for Fedora by Pavel Alexeev aka Pahan-Hubbitus +# +# chkconfig: - 02 98 +# description: 3proxy Proxy Server +# +# processname: 3proxy +# config: /etc/3proxy.cfg +# pidfile: /var/run/3proxy.pid + +WITHOUT_RC_COMPAT=1 + +. /etc/init.d/functions + +### Default variables +prog=3proxy +CONFIG=/etc/3proxy.cfg +PROXY=/usr/bin/3proxy +RETVAL=0 +PIDFILE=/var/run/3proxy.pid +LOCKFILE=/var/lock/subsys/3proxy +#LOGFILE=/var/log/3proxy.log + +start() { + echo -n $"Starting $prog: " + # daemon --pidfile "${PIDFILE}" sh -c "exec \"$PROXY\" \"$CONFIG\" 2>&1 > \"$LOGFILE\" &" + daemon --pidfile "${PIDFILE}" "$PROXY" "$CONFIG" + RETVAL=$? + echo + [ $RETVAL = 0 ] && touch ${LOCKFILE} + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p "${PIDFILE}" -d 1 "$PROXY" + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} + return $RETVAL +} + +restart() { + stop + start +} + +reload(){ + echo -n $"Reloading $prog: " + killproc -p ${pidfile} $httpd -USR1 + RETVAL=$? + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + condrestart) + [ -e $LOCKFILE ] && restart + RETVAL=$? + ;; + status) + status -p "$PIDFILE" "$PROXY" + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + RETVAL=1 + ;; +esac + +exit $RETVAL diff --git a/3proxy.spec b/3proxy.spec new file mode 100644 index 0000000..a902b18 --- /dev/null +++ b/3proxy.spec @@ -0,0 +1,142 @@ +Name: 3proxy +Version: 0.6 +Release: 3%{?dist} + +Summary: Tiny but very powerful proxy +Summary(ru): Маленький, но крайне мощный прокси-сервер + +License: BSD or ASL 2.0 or GPLv2+ or LGPLv2+ +Group: System Environment/Daemons +Url: http://3proxy.ru/?l=EN + +Source0: http://3proxy.ru/%{version}/%{name}-%{version}.tgz +Source1: 3proxy.init +Source2: 3proxy.cfg +# EPEL still require it +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: dos2unix + +%description +3proxy -- light proxy server. +Universal proxy server with HTTP, HTTPS, SOCKS v4, SOCKS v4a, SOCKS v5, FTP, +POP3, UDP and TCP portmapping, access control, bandwith control, traffic +limitation and accounting based on username, client IP, target IP, day time, +day of week, etc. + +%description -l ru +3proxy -- маленький прокси сервер. +Это универсальное решение поддерживающее HTTP, HTTPS, SOCKS v4, SOCKS v4a, +SOCKS v5, FTP, POP3, UDP и TCP проброс портов (portmapping), списки доступа +управление скоростью доступа, ограничением трафика и статистикоу, базирующейся +на имени пользователя, слиентском IP адресе, IP цели, времени дня, дня недели +и т.д. + +%prep +%setup -q + +# To use "fedora" CFLAGS (exported) +sed -i -e "s/CFLAGS =/CFLAGS +=/" Makefile.Linux + +dos2unix Changelog + +%build +%{__make} -f Makefile.Linux + +%install +rm -rf %{buildroot} + +mkdir -p %{buildroot}%{_sysconfdir} +mkdir -p %{buildroot}%{_sysconfdir} +mkdir -p %{buildroot}%{_man3dir} +mkdir -p %{buildroot}%{_man8dir} +mkdir -p %{buildroot}%{_localstatedir}/log/%{name} +install -m755 -D src/3proxy %{buildroot}%{_bindir}/3proxy +install -m755 -D src/dighosts %{buildroot}%{_bindir}/dighosts +install -m755 -D src/ftppr %{buildroot}%{_bindir}/ftppr +install -m755 -D src/mycrypt %{buildroot}%{_bindir}/mycrypt +install -m755 -D src/pop3p %{buildroot}%{_bindir}/pop3p +install -m755 -D src/3proxy %{buildroot}%{_bindir}/3proxy +install -m755 -D src/proxy %{buildroot}%{_bindir}/htproxy +install -m755 -D src/socks %{buildroot}%{_bindir}/socks +install -m755 -D src/tcppm %{buildroot}%{_bindir}/tcppm +install -m755 -D src/udppm %{buildroot}%{_bindir}/udppm + +install -pD -m755 %{SOURCE1} %{buildroot}/%{_initrddir}/%{name} +install -pD -m644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}.cfg + +%clean +rm -rf %{buildroot} + +%post +# Register service +/sbin/chkconfig --add %{name} + +%preun +if [ $1 = 0 ]; then + /sbin/service %{name} stop > /dev/null 2>&1 + /sbin/chkconfig --del %{name} +fi + +%files +%defattr(-,root,root,-) +%{_bindir}/* +%config(noreplace) %{_sysconfdir}/%{name}.cfg +%{_initrddir}/%{name} +%{_localstatedir}/log/%{name} +%doc Readme Changelog authors copying news + +%changelog +* Thu Aug 20 2009 Pavel Alexeev - 0.6-3 +- Fedora Review started - thank you Peter Lemenkov. +- Change rights (0755->0644) of config. +- Disable service by default. +- Add BR dos2unix. + +* Mon Aug 17 2009 Pavel Alexeev - 0.6-2 +- /usr/bin/proxy renamed to htproxy to avoid name bump with libproxy-bin. +- Add Source2: 3proxy.cfg from Alt Linux (slightly modified) - http://sisyphus.ru/ru/srpm/Sisyphus/3proxy/sources/1 (thanks to Afanasov Dmitry). +- Add log-dir %%{_localstatedir}/log/%%{name} + +* Mon Aug 17 2009 Pavel Alexeev - 0.6-1 +- Ressurect old spec. New version 0.6. +- Rename spec to classic %%{name}.spec. +- Remove Hu part from release and add %%{?dist}. +- Change summary, description, URL. Add Russian localisation of sumamry and description. +- Strip some old comments. +- Add to %%doc Readme Changelog authors copying news. +- Turn macros usage from %%name to %%{name} for consistence. +- Change group from System/Servers to standard System Environment/Daemons. +- Add %%defattr(-,root,root,-) in %%files section. +- Add cleanup in %%install section. +- Add %%clean section with cleanup buildroot. +- License changed from just GPL to "BSD or ASL 2.0 or GPLv2+ or LGPLv2+" (according to Makefile.Linux) +- Add %%config(noreplace) mark to all configs. +- Add file %%{_initdir}/%%{name} +- Old %%{_initdir} macros replaced by %%{_initrddir} +- Hack makefile to use system CFLAGS. +- Add %%post/%%postun sections. + +* Fri Jan 25 2008 Pavel Alexeev - 0.5.3k +- 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 + Combine with ftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/t/th/three-proxy/3proxy-0.5.3g-1.src.rpm +- Steep to version 0.5.3k +- Comment out packager +- Reformat header of spec with tabs +- Add desc from second src.rpm of import +- Correct source0 +- Add -c key fo %%setup macro +- Add BuildRoot definition (this is not ALT) +- Change + Release: alt1 + to + Release: 0.Hu.0 + +* Fri Apr 13 2007 Lunar Child 0.5.3h-alt1 +- new version + +* Wed Mar 21 2007 Lunar Child 0.5.3g-alt2 +- Added init script. +- Added new trivial config file. + +* Tue Mar 20 2007 Lunar Child 0.5.3g-alt1 +- First build for ALT Linux Sisyphus diff --git a/import.log b/import.log new file mode 100644 index 0000000..6fff697 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +proxy-0_6-3_fc11:HEAD:3proxy-0.6-3.fc11.src.rpm:1251404030 diff --git a/sources b/sources index e69de29..dd62cf4 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +2ebd9c06939021f6c2aca31d67782f71 3proxy-0.6.tgz From 0ae3d34fc0a58cb249ba3177048128000356c68e Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Mon, 9 Nov 2009 11:03:44 +0000 Subject: [PATCH 02/12] - Fix BZ#533144: - Add reload section to service file, fix stop. - Add %%{_sysconfdir}/NetworkManager/dispatcher.d/40-%%{name} (Thanks to Pankaj Pandey) - Include man-files. - Add Requires: initscripts as owner directory %%{_sysconfdir}/NetworkManager/dispatcher.d/ --- .cvsignore | 2 +- 3proxy.init | 16 +++++++--------- 3proxy.spec | 30 ++++++++++++++++++++++++++---- sources | 2 +- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.cvsignore b/.cvsignore index e7857b0..b306019 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -3proxy-0.6.tgz +3proxy.init diff --git a/3proxy.init b/3proxy.init index 47948da..556ee54 100644 --- a/3proxy.init +++ b/3proxy.init @@ -11,7 +11,6 @@ # # processname: 3proxy # config: /etc/3proxy.cfg -# pidfile: /var/run/3proxy.pid WITHOUT_RC_COMPAT=1 @@ -22,26 +21,25 @@ prog=3proxy CONFIG=/etc/3proxy.cfg PROXY=/usr/bin/3proxy RETVAL=0 -PIDFILE=/var/run/3proxy.pid LOCKFILE=/var/lock/subsys/3proxy #LOGFILE=/var/log/3proxy.log start() { echo -n $"Starting $prog: " # daemon --pidfile "${PIDFILE}" sh -c "exec \"$PROXY\" \"$CONFIG\" 2>&1 > \"$LOGFILE\" &" - daemon --pidfile "${PIDFILE}" "$PROXY" "$CONFIG" + daemon "$PROXY" "$CONFIG" RETVAL=$? echo - [ $RETVAL = 0 ] && touch ${LOCKFILE} + [ 0 -eq $RETVAL ] && touch ${LOCKFILE} return $RETVAL } stop() { echo -n $"Stopping $prog: " - killproc -p "${PIDFILE}" -d 1 "$PROXY" + killproc -d 3 "$prog" RETVAL=$? echo - [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} + [ 0 -eq $RETVAL ] && rm -f ${LOCKFILE} return $RETVAL } @@ -52,7 +50,7 @@ restart() { reload(){ echo -n $"Reloading $prog: " - killproc -p ${pidfile} $httpd -USR1 + killproc $prog -USR1 RETVAL=$? echo } @@ -75,11 +73,11 @@ case "$1" in RETVAL=$? ;; status) - status -p "$PIDFILE" "$PROXY" + status "$PROXY" RETVAL=$? ;; *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" + echo $"Usage: $0 {start|stop|restart|condrestart|status|reload}" RETVAL=1 ;; esac diff --git a/3proxy.spec b/3proxy.spec index a902b18..763ad40 100644 --- a/3proxy.spec +++ b/3proxy.spec @@ -1,6 +1,6 @@ Name: 3proxy Version: 0.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Tiny but very powerful proxy Summary(ru): Маленький, но крайне мощный прокси-сервер @@ -15,6 +15,7 @@ Source2: 3proxy.cfg # EPEL still require it BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: dos2unix +Requires: initscripts %description 3proxy -- light proxy server. @@ -46,9 +47,8 @@ dos2unix Changelog rm -rf %{buildroot} mkdir -p %{buildroot}%{_sysconfdir} -mkdir -p %{buildroot}%{_sysconfdir} -mkdir -p %{buildroot}%{_man3dir} -mkdir -p %{buildroot}%{_man8dir} +mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/ +mkdir -p %{buildroot}%{_mandir}/man8 mkdir -p %{buildroot}%{_localstatedir}/log/%{name} install -m755 -D src/3proxy %{buildroot}%{_bindir}/3proxy install -m755 -D src/dighosts %{buildroot}%{_bindir}/dighosts @@ -64,6 +64,19 @@ install -m755 -D src/udppm %{buildroot}%{_bindir}/udppm install -pD -m755 %{SOURCE1} %{buildroot}/%{_initrddir}/%{name} install -pD -m644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}.cfg + for man in man/*.8 ; do + gzip -9c "$man" > "%{buildroot}%{_mandir}/man8/$( basename $man ).gz" + touch --reference "$man" "%{buildroot}%{_mandir}/man8/$( basename $man ).gz" + done + +cat > %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/40-%{name} < - 0.6-4 +- Fix BZ#533144: +- Add reload section to service file, fix stop. +- Add %%{_sysconfdir}/NetworkManager/dispatcher.d/40-%%{name} (Thanks to Pankaj Pandey) +- Include man-files. +- Add Requires: initscripts as owner directory %%{_sysconfdir}/NetworkManager/dispatcher.d/ + * Thu Aug 20 2009 Pavel Alexeev - 0.6-3 - Fedora Review started - thank you Peter Lemenkov. - Change rights (0755->0644) of config. diff --git a/sources b/sources index dd62cf4..a7f80ff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2ebd9c06939021f6c2aca31d67782f71 3proxy-0.6.tgz +5b15eaeb993ca0b048a5bc0f2b53465b 3proxy.init From 99db3b8451b707d9f2c211d5871d019bb0484a65 Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Mon, 9 Nov 2009 11:16:39 +0000 Subject: [PATCH 03/12] All souces, but not one by mistake. --- .cvsignore | 2 ++ sources | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.cvsignore b/.cvsignore index b306019..d0cd666 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,3 @@ 3proxy.init +3proxy.cfg +3proxy-0.6.tgz diff --git a/sources b/sources index a7f80ff..335c409 100644 --- a/sources +++ b/sources @@ -1 +1,3 @@ 5b15eaeb993ca0b048a5bc0f2b53465b 3proxy.init +d9a0d2959ed2d5511ea59c563d34b692 3proxy.cfg +2ebd9c06939021f6c2aca31d67782f71 3proxy-0.6.tgz From 8407b3ad61ba1ed6d8a9ef44b73234194137b163 Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Mon, 9 Nov 2009 12:10:27 +0000 Subject: [PATCH 04/12] - Fix BZ#533144: - Add reload section to service file, fix stop. - Add %%{_sysconfdir}/NetworkManager/dispatcher.d/40-%%{name} (Thanks to Pankaj Pandey) - Include man-files. - Add Requires: initscripts as owner directory %%{_sysconfdir}/NetworkManager/dispatcher.d/ --- 3proxy.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3proxy.spec b/3proxy.spec index 763ad40..5c41b07 100644 --- a/3proxy.spec +++ b/3proxy.spec @@ -1,6 +1,6 @@ Name: 3proxy Version: 0.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tiny but very powerful proxy Summary(ru): Маленький, но крайне мощный прокси-сервер @@ -101,7 +101,7 @@ fi %{_mandir}/man8/*.8.gz %changelog -* Sun Nov 8 2009 Pavel Alexeev - 0.6-4 +* Sun Nov 8 2009 Pavel Alexeev - 0.6-5 - Fix BZ#533144: - Add reload section to service file, fix stop. - Add %%{_sysconfdir}/NetworkManager/dispatcher.d/40-%%{name} (Thanks to Pankaj Pandey) From b163d3d2922f15c7ca08ecd1e14d38c4f81510ee Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Tue, 24 Nov 2009 23:24:56 +0000 Subject: [PATCH 05/12] - Forgot commit new init-script for Fix BZ#533144. --- .cvsignore | 4 ++-- 3proxy.init | 19 ++++++++++--------- 3proxy.spec | 5 ++++- sources | 4 ++-- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.cvsignore b/.cvsignore index d0cd666..6e2ffc7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,3 @@ -3proxy.init -3proxy.cfg 3proxy-0.6.tgz +3proxy.cfg +3proxy.init diff --git a/3proxy.init b/3proxy.init index 556ee54..869dde5 100644 --- a/3proxy.init +++ b/3proxy.init @@ -4,13 +4,14 @@ # # Written by Dag Wieers . # Rewrote for ALT Linux by Pavlov Konstantin -# Modifyed for Fedora by Pavel Alexeev aka Pahan-Hubbitus +# Modified for Fedora by Pavel Alexeev aka Pahan-Hubbitus # # chkconfig: - 02 98 # description: 3proxy Proxy Server # # processname: 3proxy # config: /etc/3proxy.cfg +# pidfile: /var/run/3proxy.pid WITHOUT_RC_COMPAT=1 @@ -21,25 +22,25 @@ prog=3proxy CONFIG=/etc/3proxy.cfg PROXY=/usr/bin/3proxy RETVAL=0 +PIDFILE=/var/run/3proxy.pid LOCKFILE=/var/lock/subsys/3proxy #LOGFILE=/var/log/3proxy.log start() { echo -n $"Starting $prog: " - # daemon --pidfile "${PIDFILE}" sh -c "exec \"$PROXY\" \"$CONFIG\" 2>&1 > \"$LOGFILE\" &" - daemon "$PROXY" "$CONFIG" + daemon --pidfile "${PIDFILE}" "$PROXY" "$CONFIG" RETVAL=$? echo - [ 0 -eq $RETVAL ] && touch ${LOCKFILE} + [ $RETVAL = 0 ] && touch ${LOCKFILE} return $RETVAL } stop() { echo -n $"Stopping $prog: " - killproc -d 3 "$prog" + killproc -p "${PIDFILE}" -d 1 "$PROXY" RETVAL=$? echo - [ 0 -eq $RETVAL ] && rm -f ${LOCKFILE} + [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} return $RETVAL } @@ -50,7 +51,7 @@ restart() { reload(){ echo -n $"Reloading $prog: " - killproc $prog -USR1 + killproc -p ${pidfile} $httpd -USR1 RETVAL=$? echo } @@ -73,11 +74,11 @@ case "$1" in RETVAL=$? ;; status) - status "$PROXY" + status -p "$PIDFILE" "$PROXY" RETVAL=$? ;; *) - echo $"Usage: $0 {start|stop|restart|condrestart|status|reload}" + echo $"Usage: $0 {start|stop|restart|condrestart|status}" RETVAL=1 ;; esac diff --git a/3proxy.spec b/3proxy.spec index 5c41b07..993c896 100644 --- a/3proxy.spec +++ b/3proxy.spec @@ -1,6 +1,6 @@ Name: 3proxy Version: 0.6 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Tiny but very powerful proxy Summary(ru): Маленький, но крайне мощный прокси-сервер @@ -101,6 +101,9 @@ fi %{_mandir}/man8/*.8.gz %changelog +* Wed Nov 25 2009 Pavel Alexeev - 0.6-6 +- Forgot commit new init-script for Fix BZ#533144. + * Sun Nov 8 2009 Pavel Alexeev - 0.6-5 - Fix BZ#533144: - Add reload section to service file, fix stop. diff --git a/sources b/sources index 335c409..db96c92 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -5b15eaeb993ca0b048a5bc0f2b53465b 3proxy.init -d9a0d2959ed2d5511ea59c563d34b692 3proxy.cfg 2ebd9c06939021f6c2aca31d67782f71 3proxy-0.6.tgz +d9a0d2959ed2d5511ea59c563d34b692 3proxy.cfg +9aff12ce0d7dfc69ac7b4794a7747ae0 3proxy.init From 14ac9890d282462e233e5fd7a5c4692df39d1181 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 22:37:55 +0000 Subject: [PATCH 06/12] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d1e1256..543adab 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: 3proxy -# $Id$ +# $Id: Makefile,v 1.1 2009/08/26 22:17:25 kevin Exp $ NAME := 3proxy SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 40f31a65f9b4540ec4353da4c0de8b03f69f4d64 Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Sat, 28 Nov 2009 14:07:53 +0000 Subject: [PATCH 07/12] - Again new init-script for Fix BZ#533144 :). --- 3proxy.init | 19 +++++++++---------- 3proxy.spec | 5 ++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/3proxy.init b/3proxy.init index 869dde5..556ee54 100644 --- a/3proxy.init +++ b/3proxy.init @@ -4,14 +4,13 @@ # # Written by Dag Wieers . # Rewrote for ALT Linux by Pavlov Konstantin -# Modified for Fedora by Pavel Alexeev aka Pahan-Hubbitus +# Modifyed for Fedora by Pavel Alexeev aka Pahan-Hubbitus # # chkconfig: - 02 98 # description: 3proxy Proxy Server # # processname: 3proxy # config: /etc/3proxy.cfg -# pidfile: /var/run/3proxy.pid WITHOUT_RC_COMPAT=1 @@ -22,25 +21,25 @@ prog=3proxy CONFIG=/etc/3proxy.cfg PROXY=/usr/bin/3proxy RETVAL=0 -PIDFILE=/var/run/3proxy.pid LOCKFILE=/var/lock/subsys/3proxy #LOGFILE=/var/log/3proxy.log start() { echo -n $"Starting $prog: " - daemon --pidfile "${PIDFILE}" "$PROXY" "$CONFIG" + # daemon --pidfile "${PIDFILE}" sh -c "exec \"$PROXY\" \"$CONFIG\" 2>&1 > \"$LOGFILE\" &" + daemon "$PROXY" "$CONFIG" RETVAL=$? echo - [ $RETVAL = 0 ] && touch ${LOCKFILE} + [ 0 -eq $RETVAL ] && touch ${LOCKFILE} return $RETVAL } stop() { echo -n $"Stopping $prog: " - killproc -p "${PIDFILE}" -d 1 "$PROXY" + killproc -d 3 "$prog" RETVAL=$? echo - [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} + [ 0 -eq $RETVAL ] && rm -f ${LOCKFILE} return $RETVAL } @@ -51,7 +50,7 @@ restart() { reload(){ echo -n $"Reloading $prog: " - killproc -p ${pidfile} $httpd -USR1 + killproc $prog -USR1 RETVAL=$? echo } @@ -74,11 +73,11 @@ case "$1" in RETVAL=$? ;; status) - status -p "$PIDFILE" "$PROXY" + status "$PROXY" RETVAL=$? ;; *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" + echo $"Usage: $0 {start|stop|restart|condrestart|status|reload}" RETVAL=1 ;; esac diff --git a/3proxy.spec b/3proxy.spec index 993c896..6fee4ad 100644 --- a/3proxy.spec +++ b/3proxy.spec @@ -1,6 +1,6 @@ Name: 3proxy Version: 0.6 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Tiny but very powerful proxy Summary(ru): Маленький, но крайне мощный прокси-сервер @@ -101,6 +101,9 @@ fi %{_mandir}/man8/*.8.gz %changelog +* Wed Nov 25 2009 Pavel Alexeev - 0.6-7 +- Again new init-script for Fix BZ#533144 :). + * Wed Nov 25 2009 Pavel Alexeev - 0.6-6 - Forgot commit new init-script for Fix BZ#533144. From c7b25b8d05ec8202a2dc60803d81b0bd185b1c4f Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Mon, 15 Mar 2010 11:38:55 +0000 Subject: [PATCH 08/12] - Update to version 0.6.1 - In NM event processing replace service restart to condrestart - BZ#572662 --- .cvsignore | 2 +- 3proxy.spec | 10 +++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.cvsignore b/.cvsignore index 6e2ffc7..fa2cc0c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,3 @@ -3proxy-0.6.tgz 3proxy.cfg 3proxy.init +3proxy-0.6.1.tgz diff --git a/3proxy.spec b/3proxy.spec index 6fee4ad..d7fd40d 100644 --- a/3proxy.spec +++ b/3proxy.spec @@ -1,6 +1,6 @@ Name: 3proxy -Version: 0.6 -Release: 7%{?dist} +Version: 0.6.1 +Release: 8%{?dist} Summary: Tiny but very powerful proxy Summary(ru): Маленький, но крайне мощный прокси-сервер @@ -73,7 +73,7 @@ cat > %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/40-%{name} < - 0.6.1-8 +- Update to version 0.6.1 +- In NM event processing replace service restart to condrestart - BZ#572662 + * Wed Nov 25 2009 Pavel Alexeev - 0.6-7 - Again new init-script for Fix BZ#533144 :). diff --git a/sources b/sources index db96c92..b2477f8 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -2ebd9c06939021f6c2aca31d67782f71 3proxy-0.6.tgz d9a0d2959ed2d5511ea59c563d34b692 3proxy.cfg -9aff12ce0d7dfc69ac7b4794a7747ae0 3proxy.init +5b15eaeb993ca0b048a5bc0f2b53465b 3proxy.init +03790467a12e16ed8785ae688ecf9b68 3proxy-0.6.1.tgz From 4460b1f8d0121c3c27be9d1c1cec418f7ae24e49 Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Sun, 30 May 2010 17:58:04 +0000 Subject: [PATCH 09/12] Correct path to config file in man (BUG#596087) add Patch0: 3proxy-0.6.1-config-path.patch --- .cvsignore | 4 +--- sources | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.cvsignore b/.cvsignore index fa2cc0c..ef3c88b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1 @@ -3proxy.cfg -3proxy.init -3proxy-0.6.1.tgz +3proxy-0.6.1-config-path.patch diff --git a/sources b/sources index b2477f8..887f550 100644 --- a/sources +++ b/sources @@ -1,3 +1 @@ -d9a0d2959ed2d5511ea59c563d34b692 3proxy.cfg -5b15eaeb993ca0b048a5bc0f2b53465b 3proxy.init -03790467a12e16ed8785ae688ecf9b68 3proxy-0.6.1.tgz +b20790ea04b8cd8b366df9323416f604 3proxy-0.6.1-config-path.patch From cd8f98ab6c305205bdbbe4c4a9950c85071b2d4d Mon Sep 17 00:00:00 2001 From: Pavel Alexeev Date: Sun, 30 May 2010 18:18:12 +0000 Subject: [PATCH 10/12] Correct path to config file in man (BUG#596087) add Patch0: 3proxy-0.6.1-config-path.patch --- .cvsignore | 3 +++ 3proxy.spec | 10 +++++++++- sources | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.cvsignore b/.cvsignore index ef3c88b..08ff98a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,4 @@ +3proxy.init +3proxy.cfg +3proxy-0.6.1.tgz 3proxy-0.6.1-config-path.patch diff --git a/3proxy.spec b/3proxy.spec index d7fd40d..971b34c 100644 --- a/3proxy.spec +++ b/3proxy.spec @@ -1,6 +1,6 @@ Name: 3proxy Version: 0.6.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Tiny but very powerful proxy Summary(ru): Маленький, но крайне мощный прокси-сервер @@ -17,6 +17,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: dos2unix Requires: initscripts +# I correct config path in man only. It is fully Fedora related. +Patch0: 3proxy-0.6.1-config-path.patch + %description 3proxy -- light proxy server. Universal proxy server with HTTP, HTTPS, SOCKS v4, SOCKS v4a, SOCKS v5, FTP, @@ -35,6 +38,8 @@ SOCKS v5, FTP, POP3, UDP и TCP проброс портов (portmapping), сп %prep %setup -q +%patch0 -p0 -b .man-cfg + # To use "fedora" CFLAGS (exported) sed -i -e "s/CFLAGS =/CFLAGS +=/" Makefile.Linux @@ -101,6 +106,9 @@ fi %{_mandir}/man8/*.8.gz %changelog +* Sun May 30 2010 Pavel Alexeev - 0.6.1-9 +- Correct path to config file in man (BUG#596087) add Patch0: 3proxy-0.6.1-config-path.patch + * Mon Mar 15 2010 Pavel Alexeev - 0.6.1-8 - Update to version 0.6.1 - In NM event processing replace service restart to condrestart - BZ#572662 diff --git a/sources b/sources index 887f550..5cf5eeb 100644 --- a/sources +++ b/sources @@ -1 +1,4 @@ +5b15eaeb993ca0b048a5bc0f2b53465b 3proxy.init +d9a0d2959ed2d5511ea59c563d34b692 3proxy.cfg +03790467a12e16ed8785ae688ecf9b68 3proxy-0.6.1.tgz b20790ea04b8cd8b366df9323416f604 3proxy-0.6.1-config-path.patch From 5970885433b1ab7ffc77e5cf906042670e8112d1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 08:45:04 +0000 Subject: [PATCH 11/12] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- import.log | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 543adab..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: 3proxy -# $Id: Makefile,v 1.1 2009/08/26 22:17:25 kevin Exp $ -NAME := 3proxy -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/import.log b/import.log deleted file mode 100644 index 6fff697..0000000 --- a/import.log +++ /dev/null @@ -1 +0,0 @@ -proxy-0_6-3_fc11:HEAD:3proxy-0.6-3.fc11.src.rpm:1251404030 From c5cc3de94b466824f302497981a84ec15b9db8af Mon Sep 17 00:00:00 2001 From: "Pavel Alexeev (aka Pahan-Hubbitus)" Date: Thu, 4 Nov 2010 18:07:18 +0300 Subject: [PATCH 12/12] - Add man3/3proxy.cfg.3 man (BZ#648204). - Gone explicit man gzip - leave it for rpm. --- 3proxy.cfg | 2 +- 3proxy.spec | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/3proxy.cfg b/3proxy.cfg index 8212546..1c038ac 100644 --- a/3proxy.cfg +++ b/3proxy.cfg @@ -175,4 +175,4 @@ admin # now we needn't any root rights. We can chroot and setgid/setuid. -###$Id: 3proxy.cfg,v 1.1 2009/08/27 20:14:25 hubbitus Exp $####### +###$Id: 3proxy.cfg.sample,v 1.5 2004/07/16 12:37:20 vlad Exp $####### diff --git a/3proxy.spec b/3proxy.spec index 971b34c..5849319 100644 --- a/3proxy.spec +++ b/3proxy.spec @@ -1,6 +1,6 @@ Name: 3proxy Version: 0.6.1 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Tiny but very powerful proxy Summary(ru): Маленький, но крайне мощный прокси-сервер @@ -53,7 +53,7 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{_sysconfdir} mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/ -mkdir -p %{buildroot}%{_mandir}/man8 +mkdir -p %{buildroot}%{_mandir}/man{3,8} mkdir -p %{buildroot}%{_localstatedir}/log/%{name} install -m755 -D src/3proxy %{buildroot}%{_bindir}/3proxy install -m755 -D src/dighosts %{buildroot}%{_bindir}/dighosts @@ -69,9 +69,8 @@ install -m755 -D src/udppm %{buildroot}%{_bindir}/udppm install -pD -m755 %{SOURCE1} %{buildroot}/%{_initrddir}/%{name} install -pD -m644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}.cfg - for man in man/*.8 ; do - gzip -9c "$man" > "%{buildroot}%{_mandir}/man8/$( basename $man ).gz" - touch --reference "$man" "%{buildroot}%{_mandir}/man8/$( basename $man ).gz" + for man in man/*.{3,8} ; do + install "$man" "%{buildroot}%{_mandir}/man${man:(-1)}/" done cat > %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/40-%{name} < - 0.6.1-10 +- Add man3/3proxy.cfg.3 man (BZ#648204). +- Gone explicit man gzip - leave it for rpm. + * Sun May 30 2010 Pavel Alexeev - 0.6.1-9 - Correct path to config file in man (BUG#596087) add Patch0: 3proxy-0.6.1-config-path.patch