Squat
Joined: 15 Jan 2008 Posts: 4 Location: Trondheim, Norway
|
Posted: Wed May 30, 2012 9:40 am Post subject: Minor FreeBSD related patches |
|
|
I am maintaining the FreeBSD port of miniupnpd, and the port has implemented a two FreeBSD related patches.
Some of this should probably instead be moved upwards to the official version of miniupnpd?
The patches are the following:
Code: | --- Makefile.orig 2012-05-30 10:27:24.587226775 +0200
+++ Makefile 2012-05-30 10:28:12.497226510 +0200
@@ -15,7 +15,7 @@
# $ CONFIG_OPTIONS="--ipv6 --igd2" make
#
-CFLAGS ?= -pipe -Os
+CFLAGS ?= -pipe
#CFLAGS = -pipe -O -g -DDEBUG
CFLAGS += -ansi
CFLAGS += -Wall
@@ -43,10 +43,12 @@
# better way to find if we are using ipf or pf
.if $(OSNAME) == "FreeBSD"
+.if defined(/etc/rc.subr) && defined(/etc/rc.conf)
FWNAME != . /etc/rc.subr; . /etc/rc.conf; \
if checkyesno ipfilter_enable; then \
echo "ipf"; else echo "pf"; fi
.endif
+.endif
.if $(OSNAME) == "NetBSD"
FWNAME != . /etc/rc.subr; . /etc/rc.conf; \ |
The -Os should probably stay unchanged in the official version, while the FreeBSD-port removes it to replace it with what ports (FreeBSD) passes in by it self (for me it is -O2, I guess it comes from options in /etc/make.conf).
The other change is to check if /etc/rc.conf and /etc/rc.subr exist.
I mean that this just as well should be a part of the official version, instead of a local change in the FreeBSD port.
If one wants to use variables from those files it is a good idea to check if they exists first, as checkyesno dislike checking for variables if the source does not exist.
This is mostly relevant when trying to build the port in tinderbox or other "non fully environments".
The same is the point of the other patch:
Code: | --- genconfig.sh.orig 2012-05-30 10:37:23.936226718 +0200
+++ genconfig.sh 2012-05-30 10:36:53.849226834 +0200
@@ -112,21 +112,23 @@
# new way to see which one to use PF or IPF.
# see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=957
# source file with handy subroutines like checkyesno
- . /etc/rc.subr
- # source config file so we can probe vars
- . /etc/rc.conf
- if checkyesno ipfilter_enable; then
- echo "Using ipf"
- FW=ipf
- elif checkyesno pf_enable; then
- echo "Using pf"
- FW=pf
- elif checkyesno firewall_enable; then
- echo "Using ifpw"
- FW=ipfw
- else
- echo "Could not detect usage of ipf, pf, ipfw. Compiling for pf by default"
- FW=pf
+ if [ -f /etc/rc.subr ] && [ -f /etc/rc.conf ]; then
+ . /etc/rc.subr
+ # source config file so we can probe vars
+ . /etc/rc.conf
+ if checkyesno ipfilter_enable; then
+ echo "Using ipf"
+ FW=ipf
+ elif checkyesno pf_enable; then
+ echo "Using pf"
+ FW=pf
+ elif checkyesno firewall_enable; then
+ echo "Using ifpw"
+ FW=ipfw
+ else
+ echo "Could not detect usage of ipf, pf, ipfw. Compiling for pf by default"
+ FW=pf
+ fi
fi
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
OS_URL=http://www.freebsd.org/ |
|
|