From 5901f2e1deab1a0bd69441c254189ace9356ab9b Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Mon, 20 Nov 2017 16:42:48 -0500 Subject: [PATCH 1/3] daemon: use "require" to make eggs available for import Since version 5.0, python modules (e.g. core, corens3, and netns) are installed as .egg bundles, and are not available for importing by default, unless explicitly we use "pkg-resources.require()". Signed-off-by: Gabriel Somlo --- daemon/sbin/core-daemon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/sbin/core-daemon b/daemon/sbin/core-daemon index 59fbb861..0e615147 100755 --- a/daemon/sbin/core-daemon +++ b/daemon/sbin/core-daemon @@ -25,6 +25,9 @@ import sys import threading import time +from pkg_resources import require +require("core_python", "corens3_python", "core_python_netns") + from core import constants from core import corehandlers from core import coreserver From f8e941a2b0986b511be3dddc0a212d82ec1dbb4e Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Mon, 20 Nov 2017 17:07:50 -0500 Subject: [PATCH 2/3] daemon: add ${pyexecdir} to $PYTHONPATH in daemon/src/Makefile On x86_64, the "core_python_netns" module is installed into ${pyexecdir}, a.k.a. %{python_sitearch}, a.k.a. "/usr/lib64/python2.7/site-packages". Adding ${pyexecdir} to $PYTHONPATH will prevent the "install" target in "daemon/src/Makefile" from failing. Signed-off-by: Gabriel Somlo --- daemon/src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/src/Makefile.am b/daemon/src/Makefile.am index 0cec0814..ddafc601 100644 --- a/daemon/src/Makefile.am +++ b/daemon/src/Makefile.am @@ -40,7 +40,7 @@ libnetns.a: install-exec-local: $(MKDIR_P) ${DESTDIR}/${pythondir} $(MKDIR_P) ${DESTDIR}/${pyexecdir} - SBINDIR=${DESTDIR}/@SBINDIR@ PYTHONPATH=${DESTDIR}/${pythondir} $(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \ + SBINDIR=${DESTDIR}/@SBINDIR@ PYTHONPATH=${DESTDIR}/${pythondir}:${DESTDIR}/${pyexecdir} $(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \ --prefix=${DESTDIR}/${pyprefix} \ --install-purelib=${DESTDIR}/${pythondir} \ --install-platlib=${DESTDIR}/${pyexecdir} \ From 54d79270d53410844cc25fa538ddcc281bf30658 Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Mon, 20 Nov 2017 17:19:59 -0500 Subject: [PATCH 3/3] packaging: update RPM spec file to match 5.0 release Building compliant RPM packages for Fedora/RHEL/Centos requires all dependencies to be satisfied via the distribution specific packaging infrastructure (i.e. rpm + yum|dnf). To ensure that packages correctly pull in their dependencies (i.e., without relying on side-loaded software that just happens to be installed on the host where they're being built), the best practice recommended is to build them in "mock". E.g., rpmbuild -bs core.spec mock -r fedora-rawhide-x86_64 core-*.src.rpm This patch modifies the enclosed spec file to correctly list all other RPM packages required to build and run core-* RPMs. Note that at the time of this writing the "python-logzero" package is pending release into the Fedora (26 and newer) repositories: https://bugzilla.redhat.com/show_bug.cgi?id=1514100 Signed-off-by: Gabriel Somlo --- packaging/rpm/core.spec.in | 96 +++++--------------------------------- 1 file changed, 11 insertions(+), 85 deletions(-) diff --git a/packaging/rpm/core.spec.in b/packaging/rpm/core.spec.in index 1ccbbc86..b68b11de 100644 --- a/packaging/rpm/core.spec.in +++ b/packaging/rpm/core.spec.in @@ -24,6 +24,7 @@ building virtual networks using Linux network namespace containers and bridging. Summary: Common Open Research Emulator daemon back-end Group: System Tools Requires: bash bridge-utils ebtables iproute libev python net-tools +Requires: python2-logzero python-enum34 %if 0%{?el6} Requires: procps %else @@ -36,6 +37,8 @@ Requires: kernel-modules-extra Requires: iproute-tc %endif BuildRequires: make automake autoconf libev-devel python-devel bridge-utils ebtables iproute net-tools ImageMagick help2man +BuildRequires: python2-pytest-runner python2-sphinx +BuildRequires: python2-logzero python-enum34 %if 0%{?el6} BuildRequires: procps %else @@ -77,6 +80,10 @@ make -j4 %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install +rm -f $RPM_BUILD_ROOT/%{python_sitelib}/site.py* \ + $RPM_BUILD_ROOT/%{python_sitearch}/site.py* \ + $RPM_BUILD_ROOT/%{python_sitelib}/easy-install.pth \ + $RPM_BUILD_ROOT/%{python_sitearch}/easy-install.pth %clean rm -rf $RPM_BUILD_ROOT @@ -314,91 +321,8 @@ fi %doc %{_mandir}/man1/vnoded.1.gz /etc/logrotate.d/core-daemon /etc/systemd/system/core-daemon.service -%{python_sitearch}/core_python_netns-1.0-py%{python_version}.egg-info -%{python_sitearch}/netns.so -%{python_sitearch}/vcmd.so -%dir %{python_sitelib}/core -%{python_sitelib}/core/sdt.py* -%{python_sitelib}/core/service.py* -%{python_sitelib}/core/coreserver.py* -%dir %{python_sitelib}/core/addons -%{python_sitelib}/core/addons/__init__.py* -%dir %{python_sitelib}/core/api -%{python_sitelib}/core/api/coreapi.py* -%{python_sitelib}/core/api/data.py* -%{python_sitelib}/core/api/__init__.py* -%{python_sitelib}/core/broker.py* -%dir %{python_sitelib}/core/bsd -%{python_sitelib}/core/bsd/__init__.py* -%{python_sitelib}/core/bsd/netgraph.py* -%{python_sitelib}/core/bsd/nodes.py* -%{python_sitelib}/core/bsd/vnet.py* -%{python_sitelib}/core/bsd/vnode.py* -%{python_sitelib}/core/conf.py* -%{python_sitelib}/core/constants.py* -%{python_sitelib}/core/coreobj.py* -%dir %{python_sitelib}/core/emane -%{python_sitelib}/core/emane/bypass.py* -%{python_sitelib}/core/emane/commeffect.py* -%{python_sitelib}/core/emane/emane.py* -%{python_sitelib}/core/emane/ieee80211abg.py* -%{python_sitelib}/core/emane/__init__.py* -%{python_sitelib}/core/emane/nodes.py* -%{python_sitelib}/core/emane/rfpipe.py* -%{python_sitelib}/core/emane/tdma.py* -%{python_sitelib}/core/emane/universal.py* -%{python_sitelib}/core/__init__.py* -%{python_sitelib}/core/location.py* -%dir %{python_sitelib}/core/misc -%{python_sitelib}/core/misc/event.py* -%{python_sitelib}/core/misc/__init__.py* -%{python_sitelib}/core/misc/ipaddr.py* -%{python_sitelib}/core/misc/LatLongUTMconversion.py* -%{python_sitelib}/core/misc/quagga.py* -%{python_sitelib}/core/misc/utils.py* -%{python_sitelib}/core/misc/utm.py* -%{python_sitelib}/core/misc/xmldeployment.py* -%{python_sitelib}/core/misc/xmlparser.py* -%{python_sitelib}/core/misc/xmlparser0.py* -%{python_sitelib}/core/misc/xmlparser1.py* -%{python_sitelib}/core/misc/xmlsession.py* -%{python_sitelib}/core/misc/xmlutils.py* -%{python_sitelib}/core/misc/xmlwriter.py* -%{python_sitelib}/core/misc/xmlwriter0.py* -%{python_sitelib}/core/misc/xmlwriter1.py* -%{python_sitelib}/core/mobility.py* -%dir %{python_sitelib}/core/netns -%{python_sitelib}/core/netns/__init__.py* -%{python_sitelib}/core/netns/nodes.py* -%{python_sitelib}/core/netns/vif.py* -%{python_sitelib}/core/netns/vnet.py* -%{python_sitelib}/core/netns/vnodeclient.py* -%{python_sitelib}/core/netns/vnode.py* -%dir %{python_sitelib}/corens3 -%{python_sitelib}/corens3/constants.py* -%{python_sitelib}/corens3/__init__.py* -%{python_sitelib}/corens3/obj.py* -%{python_sitelib}/corens3_python-@COREDPY_VERSION@-py%{python_version}.egg-info -%dir %{python_sitelib}/core/phys -%{python_sitelib}/core/phys/__init__.py* -%{python_sitelib}/core/phys/pnodes.py* -%{python_sitelib}/core_python-@COREDPY_VERSION@-py%{python_version}.egg-info -%dir %{python_sitelib}/core/services -%{python_sitelib}/core/services/bird.py* -%{python_sitelib}/core/services/__init__.py* -%{python_sitelib}/core/services/dockersvc.py* -%{python_sitelib}/core/services/nrl.py* -%{python_sitelib}/core/services/quagga.py* -%{python_sitelib}/core/services/security.py* -%{python_sitelib}/core/services/startup.py* -%{python_sitelib}/core/services/ucarp.py* -%{python_sitelib}/core/services/utility.py* -%{python_sitelib}/core/services/xorp.py* -%{python_sitelib}/core/session.py* -%dir %{python_sitelib}/core/xen -%{python_sitelib}/core/xen/__init__.py* -%{python_sitelib}/core/xen/xenconfig.py* -%{python_sitelib}/core/xen/xen.py* +%{python_sitearch}/* +%{python_sitelib}/* %{_sbindir}/core-cleanup %{_sbindir}/core-daemon %{_sbindir}/core-manage @@ -409,6 +333,8 @@ fi %{_sbindir}/vnoded %changelog +* Mon Nov 20 2017 Gabriel Somlo - 5.0 +- update RPM spec file to match 5.0 release * Fri Sep 01 2017 CORE Developers - 5.0 - Added Ryu SD and Open vSwitch services, code cleanup and refactoring * Fri Jun 5 2015 CORE Developers - 4.8