Hi all,
I've updated the previous diff to also remove patches for install-related
scripts that are never used, and hopefully to fix whatever else I did to
the diffs.
Thanks,
Ayaka
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/mininet/Makefile,v
retrieving revision 1.5
diff -u -p -u -r1.5 Makefile
--- Makefile 16 Sep 2017 06:03:05 -0000 1.5
+++ Makefile 19 Nov 2017 07:57:41 -0000
@@ -3,7 +3,7 @@
COMMENT = emulator for rapid prototyping of software defined networks
DISTNAME = mininet-0.0.20170813
-REVISION = 2
+REVISION = 3
GH_ACCOUNT = mininet
GH_PROJECT = mininet
GH_COMMIT = 87e26ef931ee6063332ceba77db472140f832d3a
@@ -24,10 +24,6 @@ BUILD_DEPENDS = devel/help2man
RUN_DEPENDS = net/socat \
net/iperf
-MAKE_ENV = BINDIR=${PREFIX}/bin \
- MANDIR=${PREFIX}/man/man1 \
- PKGDIR=${MODPY_SITEPKG} \
- PYTHON=${MODPY_BIN}
do-build:
$(CC) ${WRKSRC}/mnexec.c -o ${WRKBUILD}/mnexec
help2man -N -n "create a Mininet network." --no-discard-stderr \
Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- patches/patch-Makefile 21 Aug 2017 18:47:12 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,69 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.1.1.1 2017/08/21 18:47:12 akoshibe Exp $
-Refactoring to make things buildable with both GNU and BSD make
-and account for directory organization differences.
-Index: Makefile
---- Makefile.orig
-+++ Makefile
-@@ -2,23 +2,23 @@ MININET = mininet/*.py
- TEST = mininet/test/*.py
- EXAMPLES = mininet/examples/*.py
- MN = bin/mn
--PYMN = python -B bin/mn
-+PYMN = $(PYTHON) -B bin/mn
- BIN = $(MN)
- PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN)
- MNEXEC = mnexec
- MANPAGES = mn.1 mnexec.1
- P8IGN = E251,E201,E302,E202,E126,E127,E203,E226
--BINDIR = /usr/bin
--MANDIR = /usr/share/man/man1
- DOCDIRS = doc/html doc/latex
- PDF = doc/latex/refman.pdf
-
- CFLAGS += -Wall -Wextra
-
-+include config.mk
-+
- all: codecheck test
-
- clean:
-- rm -rf build dist *.egg-info *.pyc $(MNEXEC) $(MANPAGES) $(DOCDIRS)
-+ rm -rf config.mk util/install.sh build dist *.egg-info *.pyc $(MNEXEC)
$(MANPAGES) $(DOCDIRS)
-
- codecheck: $(PYSRC)
- -echo "Running code check"
-@@ -49,23 +49,27 @@ mnexec: mnexec.c $(MN) mininet/net.py
- install: $(MNEXEC) $(MANPAGES)
- install $(MNEXEC) $(BINDIR)
- install $(MANPAGES) $(MANDIR)
-- python setup.py install
-+ $(PYTHON) setup.py install
-
-+uninstall:
-+ rm -rf $(BINDIR)/$(MNEXEC) $(BINDIR)/mn $(PKGDIR)/mininet-*.egg
-+ printf $(MANDIR)'/%s\n' $(MANPAGES) | xargs rm
-+
- develop: $(MNEXEC) $(MANPAGES)
- # Perhaps we should link these as well
- install $(MNEXEC) $(BINDIR)
- install $(MANPAGES) $(MANDIR)
-- python setup.py develop
-+ $(PYTHON) setup.py develop
-
- man: $(MANPAGES)
-
--mn.1: $(MN)
-- PYTHONPATH=. help2man -N -n "create a Mininet network." \
-- --no-discard-stderr "$(PYMN)" -o $@
-+mn.1:
-+ help2man -N -n "create a Mininet network." \
-+ --no-discard-stderr "$(PYTHON) $(MN)" -o $@
-
--mnexec.1: mnexec
-+mnexec.1:
- help2man -N -n "execution utility for Mininet." \
-- -h "-h" -v "-v" --no-discard-stderr ./$< -o $@
-+ -h "-h" -v "-v" --no-discard-stderr ./$(MNEXEC) -o $@
-
- .PHONY: doc
-
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure 21 Aug 2017 18:47:12 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-configure,v 1.1.1.1 2017/08/21 18:47:12 akoshibe Exp $
-builds a config.mk (OS-dependent vars) used by Makefile
-Index: configure
---- configure.orig
-+++ configure
-@@ -0,0 +1,37 @@
-+#!/bin/sh
-+
-+# everything should be in /usr/local, but to keep things unchanged for
Linux...
-+
-+OS=`uname`
-+case $OS in
-+ *Linux*)
-+ prefix='/usr'
-+ mandir='/usr/share'
-+ inst=$(pwd)/util/install-linux.sh
-+ python=python
-+ ;;
-+ *FreeBSD*)
-+ prefix='/usr/local'
-+ mandir=$prefix
-+ inst=$(pwd)/util/install-freebsd.sh
-+ python=python
-+ ;;
-+ *OpenBSD*)
-+ prefix='/usr/local'
-+ mandir='/usr/share'
-+ inst=$(pwd)/util/install-openbsd.sh
-+ # could just link 'python2.7' to 'python'
-+ python=python2.7
-+ ;;
-+ *)
-+ echo "Unknown platform: $OS"
-+ exit 1
-+ ;;
-+esac
-+
-+ln -s $inst $(pwd)/util/install.sh
-+
-+echo "BINDIR=$prefix/bin" > config.mk
-+echo "MANDIR=$mandir/man/man1" >> config.mk
-+echo "PKGDIR=$prefix/lib/python2.7/site-packages" >> config.mk
-+echo "PYTHON=$python" >> config.mk
Index: patches/patch-mininet_node_py
===================================================================
RCS file: /cvs/ports/net/mininet/patches/patch-mininet_node_py,v
retrieving revision 1.3
diff -u -p -u -r1.3 patch-mininet_node_py
--- patches/patch-mininet_node_py 16 Sep 2017 06:03:05 -0000 1.3
+++ patches/patch-mininet_node_py 19 Nov 2017 07:57:41 -0000
@@ -904,24 +904,19 @@ Index: mininet/node.py
pstr = ':%d ' % self.port
clist = servers[ 0:1 ] + [ s for s in servers if pstr in s ]
raise Exception( "Please shut down the controller which is"
-@@ -1405,9 +1026,13 @@ class Controller( Node ):
+@@ -1405,7 +1026,10 @@ class Controller( Node ):
self.execed = False
def stop( self, *args, **kwargs ):
- "Stop controller."
-- self.cmd( 'kill %' + self.command )
-- self.cmd( 'wait %' + self.command )
+ """
+ Stop controller. Find processes associated with the command, and kill
-+ them.
++ them.
+ """
-+ pids = " ".join( self.cmd( 'pgrep ' + self.command ).split( '\n' ) )
-+ self.cmd( 'pkill ' + pids + ' 2>/dev/null' )
-+ self.cmd( 'wait ' + pids )
+ self.cmd( 'kill %' + self.command )
+ self.cmd( 'wait %' + self.command )
super( Controller, self ).stop( *args, **kwargs )
-
- def IP( self, intf=None ):
-@@ -1470,12 +1095,19 @@ class NOX( Controller ):
+@@ -1470,12 +1094,19 @@ class NOX( Controller ):
class Ryu( Controller ):
"Controller to run Ryu application"
@@ -943,7 +938,7 @@ Index: mininet/node.py
if not ryuArgs:
warn( 'warning: no Ryu modules specified; '
'running simple_switch only\n' )
-@@ -1538,7 +1170,50 @@ class RemoteController( Controller ):
+@@ -1538,7 +1169,50 @@ class RemoteController( Controller ):
else:
return True
Index: patches/patch-util_install-openbsd_sh
===================================================================
RCS file: patches/patch-util_install-openbsd_sh
diff -N patches/patch-util_install-openbsd_sh
--- patches/patch-util_install-openbsd_sh 21 Aug 2017 18:47:12 -0000
1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,110 +0,0 @@
-$OpenBSD: patch-util_install-openbsd_sh,v 1.1.1.1 2017/08/21 18:47:12 akoshibe
Exp $
-
-Index: util/install-openbsd.sh
---- util/install-openbsd.sh.orig
-+++ util/install-openbsd.sh
-@@ -0,0 +1,104 @@
-+#!/bin/sh
-+
-+# Mininet install script with just the bits that are currently supported.
-+# It follows the logic/contents of `install.sh`.
-+
-+dist=$(uname -s)
-+release=$(uname -r)
-+
-+if [ "${dist}" = "OpenBSD" ]; then
-+ install='doas pkg_add -vI'
-+ remove='doas pkg_delete'
-+ pkginst=${install}
-+else
-+ printf '%s\n' "This version of the install script is for OpenBSD," \
-+ "but you are using ${dist} - try running './configure'"
-+ exit 1
-+fi
-+
-+# Get directory containing mininet folder
-+MININET_DIR=$( CDPATH= cd -- "$( dirname -- "$0" )/../.." && pwd -P )
-+
-+# install everything
-+all () {
-+ mn_deps
-+}
-+
-+# base (non-OpenFlow) bits - Mininet Python bits, dependencies
-+mn_deps () {
-+ # check for OpenFlow support - 6.1 and later. Technically it works but
-+ # will only be able to do non-OFP networks.
-+ if [ $( expr ${release} '<=' 6.1 ) -eq 0 ]; then
-+ printf '%s\n' \
-+ "Detected release:${release}"\
-+ "Warning - OpenFlow is only supported by releases 6.1 and newer"\
-+ "Retry after updating to a newer release"
-+ exit 1
-+ fi
-+
-+ $install python-2.7.13p2 socat iperf help2man py-setuptools pyflakes \
-+ pylint pep8 py-pexpect
-+
-+ printf '%s\n' "Installing Mininet core"
-+ cur=$(pwd -P)
-+ cd ${MININET_DIR}/mininet
-+ doas make install
-+ doas cp util/switchd.conf /etc/switchd.mininet.conf
-+ cd ${cur}
-+}
-+
-+mn_undo () {
-+ printf '%s\n' "Uninstalling Mininet core"
-+ cur=$(pwd -P)
-+ cd ${MININET_DIR}/mininet
-+ doas make uninstall
-+ doas rm /etc/switchd.mininet.conf
-+ cd ${cur}
-+}
-+
-+# Install RYU. `pip install ryu` should actually be sufficient.
-+#ryu () {
-+# printf '%s\n' "Installing RYU..."
-+#
-+# $install python py27-setuptools py27-eventlet py27-routes \
-+# py27-webob py27-paramiko py27-pip py27-msgpack-python
-+# pip install oslo.config tinyrpc ovs
-+#
-+# # fetch RYU
-+# cd $MININET_DIR
-+# git clone git://github.com/osrg/ryu.git ryu
-+# cd ryu
-+#
-+# # install ryu
-+# doas python ./setup.py install
-+#}
-+
-+usage () {
-+ printf '%s\n' \
-+ "" \
-+ "Usage: $(basename $0) [-anh]" \
-+ "" \
-+ "options:" \
-+ " -a: (default) install (A)ll packages" \
-+ " -h: print this (H)elp message" \
-+ " -n: install Mini(N)et dependencies + core files" \
-+ " -u: (u)ninstall Mininet core files" \
-+ " -y: install R(y)u Controller"
-+ exit 2
-+}
-+
-+if [ $# -eq 0 ]; then
-+ all
-+else
-+ while getopts 'ahnu' OPTION; do
-+ case $OPTION in
-+ a) all ;;
-+ h) usage ;;
-+ n) mn_deps ;;
-+ u) mn_undo ;;
-+ # y) ryu ;; #eventually, maybe
-+ ?) usage ;;
-+ esac
-+ done
-+ shift $(($OPTIND - 1))
-+fi