From 26b1b0150525b4ad840c1ff0f8a0fc19b7880ac8 Mon Sep 17 00:00:00 2001 From: "Blake J. Harnden" Date: Thu, 11 Jan 2018 11:21:56 -0800 Subject: [PATCH] updated to readme for building packages, update to makefile to install and build gui with one command --- .gitignore | 3 +++ Changelog | 11 +++++++++++ Makefile.am | 2 ++ README.rst | 25 +++++++++++++++++++++++-- daemon/setup.py | 31 +++++++++++++++++++++---------- 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 8f0324f9..46a93660 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,9 @@ core-*.tar.gz debian stamp-h1 +# python build directory +dist + # intellij *.iml .idea diff --git a/Changelog b/Changelog index 8d9f14c0..b9228986 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,14 @@ +2018-XX-XX CORE 5.1 + * DAEMON: + - default nodes are now set in the node map + - moved ns3 and netns directories to the top of the repo + - changes to make use of fpm as the tool for building packages + - removed usage of logzero to avoid dependency issues for built packages + * TEST: + - fixed some broken tests + * BUGFIXES: + - #142 - duplication of custom services + 2017-09-01 CORE 5.0 * DEVELOPMENT: - support for editorconfig to help standardize development across IDEs, from the defined configuration file diff --git a/Makefile.am b/Makefile.am index 5c8cbe3f..fd63834a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -101,6 +101,7 @@ endef define fpm-daemon-rpm = fpm -s python -t rpm \ + --verbose \ -p NAME_$1_VERSION_ARCH.rpm \ --python-setup-py-arguments --service=$1 \ -m "$(CORE_MAINTAINERS)" \ @@ -136,6 +137,7 @@ endef .PHONY: fpm fpm: clean-local-fpm + $(MAKE) -C gui install DESTDIR=$(DESTDIR) $(call fpm-gui,rpm,-d "tkimg") $(call fpm-gui,deb,-d "libtk-img") $(call fpm-python,rpm,ns3/setup.py) diff --git a/README.rst b/README.rst index 3dff84d8..1e85692f 100644 --- a/README.rst +++ b/README.rst @@ -44,8 +44,8 @@ Note: You may need to pass the proxy settings to sudo make install: Here is what is installed with 'make install': /usr/local/bin/core-gui - /usr/local/sbin/core-daemon - /usr/local/sbin/[vcmd, vnoded, coresendmsg, core-cleanup.sh] + /usr/local/bin/core-daemon + /usr/local/bin/[vcmd, vnoded, coresendmsg, core-cleanup.sh] /usr/local/lib/core/* /usr/local/share/core/* /usr/local/lib/python2.6/dist-packages/core/* @@ -66,6 +66,27 @@ Once that has been done you can run the following commands: ./configure make html +Building Packages +================= + +Install fpm + + http://fpm.readthedocs.io/en/latest/installing.html + +Build package commands, DESTDIR is used for gui packaging only + +* ./bootstrap.sh +* ./configure +* make +* mkdir /tmp/core-gui +* make fpm DESTDIR=/tmp/core-gui + +This will produce: + +* CORE GUI rpm/deb files +* CORE ns3 rpm/deb files +* CORE python rpm/deb files for SysV and systemd service types + Running CORE ============ diff --git a/daemon/setup.py b/daemon/setup.py index 1e438853..552a357c 100644 --- a/daemon/setup.py +++ b/daemon/setup.py @@ -9,6 +9,13 @@ from setuptools import setup, find_packages from distutils.command.install import install +_CORE_DIR = "/etc/core" +_MAN_DIR = "/usr/local/share/man/man1" +_SHARE_DIR = "/usr/local/share/core" +_SYSV = "/etc/init.d" +_SYSTEMD = "/etc/systemd/system" + + def recursive_files(data_path, files_path): data_files = [] for path, directories, filenames in os.walk(files_path): @@ -40,15 +47,26 @@ class CustomInstall(install): def run(self): if self.service == "sysv": self.distribution.data_files.append(( - "/etc/init.d", ["../scripts/core-daemon"] + _SYSV, ["../scripts/core-daemon"] )) else: self.distribution.data_files.append(( - "/etc/systemd/system", ["../scripts/core-daemon.service"] + _SYSTEMD, ["../scripts/core-daemon.service"] )) install.run(self) +data_files = [ + (_CORE_DIR, [ + "data/core.conf", + "data/xen.conf", + "data/logging.conf", + ]), + (_MAN_DIR, glob_files("../doc/man/**.1")), +] +data_files.extend(recursive_files(_SHARE_DIR, "examples")) + + setup( name="core", version="5.1", @@ -62,14 +80,7 @@ setup( "pytest-cov", "mock", ], - data_files=[ - ("/etc/core", [ - "data/core.conf", - "data/xen.conf", - "data/logging.conf", - ]), - ("/usr/local/share/man/man1", glob_files("../doc/man/**.1")), - ] + recursive_files("/usr/local/share/core", "examples"), + data_files=data_files, scripts=[ "sbin/core-cleanup", "sbin/core-daemon",