View | Details | Raw Unified | Return to bug 204946
Collapse All | Expand All

(-)Makefile (-13 / +29 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	tinyproxy
4
PORTNAME=	tinyproxy
5
PORTVERSION=	1.8.3
5
PORTVERSION=	1.8.3
6
PORTREVISION=	1
6
PORTREVISION=	2
7
PORTEPOCH=	1
7
PORTEPOCH=	1
8
CATEGORIES=	www
8
CATEGORIES=	www
9
MASTER_SITES=	https://banu.com/pub/tinyproxy/${PORTVERSION:R}/ \
9
MASTER_SITES=	https://banu.com/pub/tinyproxy/${PORTVERSION:R}/ \
Lines 15-25 Link Here
15
LICENSE=	GPLv2 GPLv3
15
LICENSE=	GPLv2 GPLv3
16
LICENSE_COMB=	dual
16
LICENSE_COMB=	dual
17
17
18
OPTIONS_DEFINE=	REVERSE TRANSPARENT XHEADER
19
REVERSE_DESC=		Reverse proxy support
20
TRANSPARENT_DESC=	Transparent proxy support
21
XHEADER_DESC=		X-Tinyproxy header
22
23
CONFIGURE_ARGS=	--bindir=${PREFIX}/sbin \
18
CONFIGURE_ARGS=	--bindir=${PREFIX}/sbin \
24
		--disable-silent-rules \
19
		--disable-silent-rules \
25
		--program-transform-name=""
20
		--program-transform-name=""
Lines 27-47 Link Here
27
USE_RC_SUBR=	${PORTNAME}
22
USE_RC_SUBR=	${PORTNAME}
28
USES=		gmake
23
USES=		gmake
29
24
25
TINYPROXY_USER=	tinyproxy
26
TINYPROXY_GROUP=	tinyproxy
27
USERS=		${TINYPROXY_USER}
28
GROUPS=		${TINYPROXY_GROUP}
29
30
SUB_LIST+=	TINYPROXY_USER=${TINYPROXY_USER} TINYPROXY_GROUP=${TINYPROXY_GROUP}
31
SUB_FILES+=	tinyproxy.newsyslog
32
33
PLIST_SUB+=	TINYPROXY_USER=${TINYPROXY_USER} TINYPROXY_GROUP=${TINYPROXY_GROUP}
34
35
OPTIONS_DEFINE=	REVERSE TRANSPARENT XHEADER
36
REVERSE_DESC=		Reverse proxy support
37
TRANSPARENT_DESC=	Transparent proxy support
38
XHEADER_DESC=		X-Tinyproxy header
39
30
REVERSE_CONFIGURE_ENABLE=	reverse
40
REVERSE_CONFIGURE_ENABLE=	reverse
31
TRANSPARENT_CONFIGURE_ENABLE=	transparent
41
TRANSPARENT_CONFIGURE_ENABLE=	transparent
32
XHEADER_CONFIGURE_ENABLE=	xtinyproxy
42
XHEADER_CONFIGURE_ENABLE=	xtinyproxy
33
43
44
pre-patch:
45
	@${MV} ${WRKSRC}/etc/tinyproxy.conf.in \
46
		${WRKSRC}/etc/tinyproxy.conf.sample.in
47
34
post-patch:
48
post-patch:
35
	@${REINPLACE_CMD} -e 's|-O2||' ${WRKSRC}/configure
49
	@${REINPLACE_CMD} -e '/\/usr\/share\/tinyproxy/d' \
36
	@${REINPLACE_CMD} -e 's|tinyproxy/tinyproxy|tinyproxy|g; s|/etc/tinyproxy|${PREFIX}&|' \
50
		-e 's|/etc/tinyproxy|${PREFIX}&|' \
37
		${WRKSRC}/docs/man5/tinyproxy.conf.txt.in \
51
		-e 's|User nobody|User ${TINYPROXY_USER}|' \
38
		${WRKSRC}/docs/man8/tinyproxy.txt.in \
52
		-e 's|Group nobody|Group ${TINYPROXY_GROUP}|' \
39
		${WRKSRC}/etc/tinyproxy.conf.in
53
		${WRKSRC}/etc/tinyproxy.conf.sample.in
40
	@${REINPLACE_CMD} -e '/\/usr\/share\/tinyproxy/d' ${WRKSRC}/etc/tinyproxy.conf.in
41
54
42
post-install:
55
post-install:
43
	${INSTALL_DATA} ${WRKSRC}/etc/tinyproxy.conf ${STAGEDIR}${PREFIX}/etc/tinyproxy.conf.sample
44
	${INSTALL_MAN} ${FILESDIR}/tinyproxy.conf.5 ${STAGEDIR}${PREFIX}/man/man5/
56
	${INSTALL_MAN} ${FILESDIR}/tinyproxy.conf.5 ${STAGEDIR}${PREFIX}/man/man5/
45
	${INSTALL_MAN} ${FILESDIR}/tinyproxy.8 ${STAGEDIR}${PREFIX}/man/man8/
57
	${INSTALL_MAN} ${FILESDIR}/tinyproxy.8 ${STAGEDIR}${PREFIX}/man/man8/
58
	${INSTALL_DATA} ${WRKDIR}/tinyproxy.newsyslog \
59
		${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/tinyproxy.conf
60
	${MKDIR} ${STAGEDIR}/var/log/tinyproxy
61
	${MKDIR} ${STAGEDIR}/var/run/tinyproxy
46
62
47
.include <bsd.port.mk>
63
.include <bsd.port.mk>
(-)files/patch-etc-Makefile.in (-13 / +31 lines)
Lines 1-15 Link Here
1
--- etc/Makefile.in.orig	2011-08-16 12:27:58 UTC
1
--- etc/Makefile.in.orig	2015-11-19 19:45:17 UTC
2
+++ etc/Makefile.in
2
+++ etc/Makefile.in
3
@@ -248,8 +248,10 @@ install-sysconfDATA: $(sysconf_DATA)
3
@@ -188,10 +188,10 @@ top_build_prefix = @top_build_prefix@
4
 	  echo "$$d$$p"; \
4
 top_builddir = @top_builddir@
5
 	done | $(am__base_list) | \
5
 top_srcdir = @top_srcdir@
6
 	while read files; do \
6
 sysconf_DATA = \
7
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \
7
-	tinyproxy.conf
8
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \
8
+	tinyproxy.conf.sample
9
+	  nfile="$$files.sample"; \
10
+	  cp $$files $$nfile; \
11
+	  echo " $(INSTALL_DATA) $$nfile '$(DESTDIR)$(sysconfdir)'"; \
12
+	  $(INSTALL_DATA) $$nfile "$(DESTDIR)$(sysconfdir)" || exit $$?; \
13
 	done
14
 
9
 
15
 uninstall-sysconfDATA:
10
 EXTRA_DIST = \
11
-	tinyproxy.conf.in
12
+	tinyproxy.conf.sample.in
13
 
14
 edit = sed \
15
 	-e 's|@bindir[@]|$(bindir)|g' \
16
@@ -204,7 +204,7 @@ edit = sed \
17
 	-e 's|@TINYPROXY_STATHOST[@]|$(TINYPROXY_STATHOST)|g'
18
 
19
 CLEANFILES = \
20
-	tinyproxy.conf
21
+	tinyproxy.conf.sample
22
 
23
 all: all-am
24
 
25
@@ -409,7 +409,7 @@ uninstall-am: uninstall-sysconfDATA
26
 	uninstall-am uninstall-sysconfDATA
27
 
28
 
29
-tinyproxy.conf: $(top_srcdir)/etc/tinyproxy.conf.in Makefile
30
+tinyproxy.conf.sample: $(top_srcdir)/etc/tinyproxy.conf.sample.in Makefile
31
 	@rm -f $@ $@.tmp
32
 	$(AM_V_GEN) $(edit) $(top_srcdir)/etc/$@.in > $@.tmp
33
 	@mv $@.tmp $@
(-)files/patch-src-main.c (-32 lines)
Lines 1-32 Link Here
1
--- src/main.c.orig	2011-08-16 12:14:34 UTC
2
+++ src/main.c
3
@@ -407,12 +407,9 @@ main (int argc, char **argv)
4
                 exit (EX_OSERR);
5
         }
6
 
7
-        /* Switch to a different user if we're running as root */
8
-        if (geteuid () == 0)
9
-                change_user (argv[0]);
10
-        else
11
-                log_message (LOG_WARNING,
12
-                             "Not running as root, so not changing UID/GID.");
13
+	/*To get this to run correctly on FreeBSD, we must
14
+	  ceate the PID and log files before we drop privileges. 
15
+	  Other ideas are welcome */
16
 
17
         /* Create log file after we drop privileges */
18
         if (setup_logging ()) {
19
@@ -427,6 +424,13 @@ main (int argc, char **argv)
20
                         exit (EX_OSERR);
21
                 }
22
         }
23
+        /* Switch to a different user if we're running as root */
24
+        if (geteuid () == 0)
25
+                change_user (argv[0]);
26
+        else
27
+                log_message (LOG_WARNING,
28
+                             "Not running as root, so not changing UID/GID.");
29
+
30
 
31
         if (child_pool_create () < 0) {
32
                 fprintf (stderr,
(-)files/tinyproxy.8 (-1 / +1 lines)
Lines 144-150 Link Here
144
The stat file template can be changed at runtime through the configuration variable StatFile\&.
144
The stat file template can be changed at runtime through the configuration variable StatFile\&.
145
.SH "FILES"
145
.SH "FILES"
146
.sp
146
.sp
147
/usr/local/etc/tinyproxy\&.conf, /var/run/tinyproxy\&.pid, /var/log/tinyproxy\&.log
147
/usr/local/etc/tinyproxy\&.conf, /var/run/tinyproxy/tinyproxy\&.pid, /var/log/tinyproxy/tinyproxy\&.log
148
.SH "BUGS"
148
.SH "BUGS"
149
.sp
149
.sp
150
To report bugs in Tinyproxy, please visit <https://www\&.banu\&.com/tinyproxy/>\&.
150
To report bugs in Tinyproxy, please visit <https://www\&.banu\&.com/tinyproxy/>\&.
(-)files/tinyproxy.in (-3 / +4 lines)
Lines 19-29 Link Here
19
19
20
# Make sure the pidfile matches what's in the config file.
20
# Make sure the pidfile matches what's in the config file.
21
: ${tinyproxy_enable="NO"}
21
: ${tinyproxy_enable="NO"}
22
: ${tinyproxy_pidfile="/var/run/tinyproxy.pid"}
22
: ${tinyproxy_pidfile="/var/run/tinyproxy/tinyproxy.pid"}
23
: ${tinyproxy_config="%%PREFIX%%/etc/tinyproxy.conf"}
23
: ${tinyproxy_config="%%PREFIX%%/etc/tinyproxy.conf"}
24
24
25
pidfile=${tinyproxy_pidfile}
25
required_files="${tinyproxy_config}"
26
pidfile="${tinyproxy_pidfile}"
26
command=%%PREFIX%%/sbin/tinyproxy
27
command=%%PREFIX%%/sbin/tinyproxy
27
command_args="-c $tinyproxy_config 2> /dev/null"
28
command_args="-c ${tinyproxy_config} 2> /dev/null"
28
29
29
run_rc_command "$1"
30
run_rc_command "$1"
(-)files/tinyproxy.newsyslog.in (+2 lines)
Line 0 Link Here
1
# logfilename          			[owner:group]    	mode count size when  flags [/pid_file] [sig_num]
2
/var/log/tinyproxy/tinyproxy.log	%%TINYPROXY_USER%%:%%TINYPROXY_GROUP%%	600  7	   *	@T00  J    /var/run/tinyproxy/tinyproxy.pid
(-)pkg-plist (+3 lines)
Lines 1-4 Link Here
1
@sample etc/tinyproxy.conf.sample
1
@sample etc/tinyproxy.conf.sample
2
etc/newsyslog.conf.d/tinyproxy.conf
2
man/man5/tinyproxy.conf.5.gz
3
man/man5/tinyproxy.conf.5.gz
3
man/man8/tinyproxy.8.gz
4
man/man8/tinyproxy.8.gz
4
sbin/tinyproxy
5
sbin/tinyproxy
Lines 5-7 Link Here
5
%%DATADIR%%/debug.html
6
%%DATADIR%%/debug.html
6
%%DATADIR%%/default.html
7
%%DATADIR%%/default.html
7
%%DATADIR%%/stats.html
8
%%DATADIR%%/stats.html
9
@dir(%%TINYPROXY_USER%%,%%TINYPROXY_GROUP%%,) /var/log/tinyproxy
10
@dir(%%TINYPROXY_USER%%,%%TINYPROXY_GROUP%%,) /var/run/tinyproxy

Return to bug 204946