aboutsummaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
Diffstat (limited to 'emulators')
-rw-r--r--emulators/gns3/Makefile30
-rw-r--r--emulators/gns3/distinfo4
-rw-r--r--emulators/gns3/files/patch-Page_PreferencesCapture.py11
-rw-r--r--emulators/gns3/files/patch-Page_PreferencesDynamips.py13
-rw-r--r--emulators/gns3/files/patch-Page_PreferencesQemu.py11
-rw-r--r--emulators/gns3/files/patch-qemuwrapper.py52
-rw-r--r--emulators/gns3/pkg-message7
-rw-r--r--emulators/gns3/pkg-plist7
8 files changed, 123 insertions, 12 deletions
diff --git a/emulators/gns3/Makefile b/emulators/gns3/Makefile
index 47174be08b16..b2eaeb90149b 100644
--- a/emulators/gns3/Makefile
+++ b/emulators/gns3/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= gns3
-PORTVERSION= 0.7.3
-PORTREVISION= 1
+PORTVERSION= 0.7.4
CATEGORIES= emulators
MASTER_SITES= SF/gns-3/GNS3/${PORTVERSION}
DISTNAME= GNS3-${PORTVERSION}-src
@@ -15,18 +14,36 @@ DISTNAME= GNS3-${PORTVERSION}-src
MAINTAINER= olivier@cochard.me
COMMENT= Graphical Cisco network simulator
+LICENSE= GPLv2
+
+BUILD_DEPENDS= qemu:${PORTSDIR}/emulators/qemu
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/PyQt4/QtGui.so:${PORTSDIR}/x11-toolkits/py-qt4-gui \
${PYTHON_SITELIBDIR}/PyQt4/QtSvg.so:${PORTSDIR}/graphics/py-qt4-svg \
${PYTHON_SITELIBDIR}/PyQt4/QtNetwork.so:${PORTSDIR}/net/py-qt4-network \
dynamips:${PORTSDIR}/emulators/dynamips-community \
dynagen:${PORTSDIR}/emulators/dynagen \
- qemu>=0.11:${PORTSDIR}/emulators/qemu
+ qemu:${PORTSDIR}/emulators/qemu
-USE_PYTHON= 2.5+
+USE_PYTHON= 2.6+
USE_PYDISTUTILS= yes
PYDISTUTILS_PKGNAME= GNS3
MAN1= gns3.1
-LICENSE= GPLv2
+
+.include <bsd.port.pre.mk>
+
+post-patch:
+ ${REINPLACE_CMD} \
+ "s|%%PREFIX%%|${PREFIX}|;s|%%LOCALBASE%%|${LOCALBASE}|" \
+ ${WRKSRC}/src/GNS3/Ui/ConfigurationPages/*.py
+
+.if !defined(NO_IGNORE)
+pre-configure:
+ @if qemu -help | ${GREP} -q -- "-net udp" >/dev/null 2>&1; then \
+ : ; \
+ else \
+ ${ECHO_MSG} "===> ${PKGNAME} must be used with a gns3 patched qemu"; exit 1; \
+ fi
+.endif
post-install:
.if !defined(NO_INSTALL_MANPAGES)
@@ -35,4 +52,5 @@ post-install:
${INSTALL_SCRIPT} ${WRKSRC}/qemuwrapper/qemuwrapper.py \
${PREFIX}/bin/qemuwrapper.py
@${CAT} ${PKGMESSAGE}
-.include <bsd.port.mk>
+
+.include <bsd.port.post.mk>
diff --git a/emulators/gns3/distinfo b/emulators/gns3/distinfo
index 7986aa2a8712..04b29918cb04 100644
--- a/emulators/gns3/distinfo
+++ b/emulators/gns3/distinfo
@@ -1,2 +1,2 @@
-SHA256 (GNS3-0.7.3-src.tar.gz) = 352e8a076d83992269ec4a12fb33ab2431f14f968c0facc0571d7e6dd83521de
-SIZE (GNS3-0.7.3-src.tar.gz) = 4418850
+SHA256 (GNS3-0.7.4-src.tar.gz) = 77a2c9b251d199a435ba85936349a1f8b1760df14a2594b68f8c1fee36f9588d
+SIZE (GNS3-0.7.4-src.tar.gz) = 4512420
diff --git a/emulators/gns3/files/patch-Page_PreferencesCapture.py b/emulators/gns3/files/patch-Page_PreferencesCapture.py
new file mode 100644
index 000000000000..fb6e8adeb8d5
--- /dev/null
+++ b/emulators/gns3/files/patch-Page_PreferencesCapture.py
@@ -0,0 +1,11 @@
+--- src/GNS3/Ui/ConfigurationPages/Page_PreferencesCapture.py.orig 2011-07-03 00:10:04.000000000 +0200
++++ src/GNS3/Ui/ConfigurationPages/Page_PreferencesCapture.py 2011-07-03 00:10:29.000000000 +0200
+@@ -52,7 +52,7 @@
+ elif sys.platform.startswith('win'):
+ self.conf.cap_cmd = unicode("C:\Program Files\Wireshark\wireshark.exe %c")
+ else:
+- self.conf.cap_cmd = unicode("/usr/bin/wireshark %c")
++ self.conf.cap_cmd = unicode("%%LOCALBASE%%/bin/wireshark %c")
+
+ if self.conf.workdir == '':
+ if os.environ.has_key("TEMP"):
diff --git a/emulators/gns3/files/patch-Page_PreferencesDynamips.py b/emulators/gns3/files/patch-Page_PreferencesDynamips.py
new file mode 100644
index 000000000000..83e56b003a82
--- /dev/null
+++ b/emulators/gns3/files/patch-Page_PreferencesDynamips.py
@@ -0,0 +1,13 @@
+--- src/GNS3/Ui/ConfigurationPages/Page_PreferencesDynamips.py.orig 2011-07-03 00:11:46.000000000 +0200
++++ src/GNS3/Ui/ConfigurationPages/Page_PreferencesDynamips.py 2011-07-03 00:32:42.000000000 +0200
+@@ -55,7 +55,9 @@
+ # Default path to dynamips executable
+ if self.conf.path == '' and sys.platform.startswith('win'):
+ self.conf.path = unicode('dynamips-wxp.exe')
+-
++ else:
++ self.conf.path = unicode('%%LOCALBASE%%/bin/dynamips')
++
+ # Default path to working directory
+ if self.conf.workdir == '':
+ if os.environ.has_key("TEMP"):
diff --git a/emulators/gns3/files/patch-Page_PreferencesQemu.py b/emulators/gns3/files/patch-Page_PreferencesQemu.py
new file mode 100644
index 000000000000..b2f3ca3f4e35
--- /dev/null
+++ b/emulators/gns3/files/patch-Page_PreferencesQemu.py
@@ -0,0 +1,11 @@
+--- src/GNS3/Ui/ConfigurationPages/Page_PreferencesQemu.py.orig 2011-07-03 00:06:36.000000000 +0200
++++ src/GNS3/Ui/ConfigurationPages/Page_PreferencesQemu.py 2011-07-03 00:07:26.000000000 +0200
+@@ -97,7 +97,7 @@
+ if sys.platform.startswith('win'):
+ self.conf.qemuwrapper_path = unicode('qemuwrapper.exe')
+ else:
+- path = os.getcwd() + '/qemuwrapper/qemuwrapper.py'
++ path = '%%PREFIX%%/bin/qemuwrapper.py'
+ self.conf.qemuwrapper_path = unicode(path, errors='replace')
+
+ # Default path to working directory
diff --git a/emulators/gns3/files/patch-qemuwrapper.py b/emulators/gns3/files/patch-qemuwrapper.py
new file mode 100644
index 000000000000..89f3aaf38000
--- /dev/null
+++ b/emulators/gns3/files/patch-qemuwrapper.py
@@ -0,0 +1,52 @@
+--- qemuwrapper/qemuwrapper.py.orig
++++ qemuwrapper/qemuwrapper.py
+@@ -45,6 +45,7 @@ import SocketServer
+ import time
+ import random
+ import pemubin
++import ctypes
+
+
+ __author__ = 'Thomas Pani and Jeremy Grossmann'
+@@ -118,6 +119,33 @@ class xEMUInstance(object):
+ def unbase_disk(self):
+ pass
+
++ def preexec(self):
++ # FreeBSD preexec_fn hack to unblock signals in child processes
++ # to work around the bug in this PR:
++ # http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/153167
++ # inspired by:
++ # http://stackoverflow.com/questions/3791398/how-to-stop-python-from-propagating-signals-to-subprocesses
++
++ # Get the size of the array used to
++ # represent the signal mask
++ SIGSET_NWORDS = 1024 / (8 * ctypes.sizeof(ctypes.c_uint))
++
++ # Define the sigset_t structure
++ class SIGSET(ctypes.Structure):
++ _fields_ = [
++ ('val', ctypes.c_uint * SIGSET_NWORDS)
++ ]
++
++ # Create a new sigset_t to mask out SIGINT
++ sigs = (ctypes.c_uint * SIGSET_NWORDS)()
++ mask = SIGSET(sigs)
++
++ SIG_SETMASK = 3
++ libc = ctypes.CDLL('libc.so')
++
++ # Unblock all signals
++ libc.sigprocmask(SIG_SETMASK, ctypes.pointer(mask), 0)
++
+ def start(self):
+ command = self._build_command()
+
+@@ -125,6 +152,7 @@ class xEMUInstance(object):
+ try:
+ self.process = subprocess.Popen(command,
+ stdin=subprocess.PIPE,
++ preexec_fn=self.preexec,
+ cwd=self.workdir)
+ except OSError, e:
+ print >> sys.stderr, "Unable to start instance", self.name, "of", self.__class__
diff --git a/emulators/gns3/pkg-message b/emulators/gns3/pkg-message
index 1a5393594e94..ebff777dc321 100644
--- a/emulators/gns3/pkg-message
+++ b/emulators/gns3/pkg-message
@@ -1,6 +1,5 @@
-===============================================================================
+=====================================
GNS3 FreeBSD limitations :
-There are some limitations with GNS3 under FreeBSD because qemu port isn't
-patched for suppporting PIX/ASA and UDP communications with Dynamips.
-===============================================================================
+pemu (PIX emulator) is not available
+=====================================
diff --git a/emulators/gns3/pkg-plist b/emulators/gns3/pkg-plist
index 004dbc22d5a2..5dc76ee88f44 100644
--- a/emulators/gns3/pkg-plist
+++ b/emulators/gns3/pkg-plist
@@ -94,6 +94,9 @@ bin/qemuwrapper.py
%%PYTHON_SITELIBDIR%%/GNS3/HypervisorManager.py
%%PYTHON_SITELIBDIR%%/GNS3/HypervisorManager.pyc
%%PYTHON_SITELIBDIR%%/GNS3/HypervisorManager.pyo
+%%PYTHON_SITELIBDIR%%/GNS3/IDLEPCDialog.py
+%%PYTHON_SITELIBDIR%%/GNS3/IDLEPCDialog.pyc
+%%PYTHON_SITELIBDIR%%/GNS3/IDLEPCDialog.pyo
%%PYTHON_SITELIBDIR%%/GNS3/IOSDialog.py
%%PYTHON_SITELIBDIR%%/GNS3/IOSDialog.pyc
%%PYTHON_SITELIBDIR%%/GNS3/IOSDialog.pyo
@@ -109,6 +112,7 @@ bin/qemuwrapper.py
%%PYTHON_SITELIBDIR%%/GNS3/Langs/Lang_es.qm
%%PYTHON_SITELIBDIR%%/GNS3/Langs/Lang_fa.qm
%%PYTHON_SITELIBDIR%%/GNS3/Langs/Lang_fr.qm
+%%PYTHON_SITELIBDIR%%/GNS3/Langs/Lang_gr.qm
%%PYTHON_SITELIBDIR%%/GNS3/Langs/Lang_it.qm
%%PYTHON_SITELIBDIR%%/GNS3/Langs/Lang_jp.qm
%%PYTHON_SITELIBDIR%%/GNS3/Langs/Lang_kr.qm
@@ -357,6 +361,9 @@ bin/qemuwrapper.py
%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_About.py
%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_About.pyc
%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_About.pyo
+%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_IDLEPCDialog.py
+%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_IDLEPCDialog.pyc
+%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_IDLEPCDialog.pyo
%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_IOSDialog.py
%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_IOSDialog.pyc
%%PYTHON_SITELIBDIR%%/GNS3/Ui/Form_IOSDialog.pyo