added initial fpm commands for building packages and minor updates to support

This commit is contained in:
Blake J. Harnden 2017-12-21 16:19:12 -08:00
parent 58c6d03bc4
commit 59e6b6630a
8 changed files with 87 additions and 55 deletions

7
.gitignore vendored
View file

@ -26,3 +26,10 @@ stamp-h1
# ignore test coverage files
coverage.xml
# python files
*.egg-info
# ignore package files
*.rpm
*.deb

View file

@ -72,57 +72,62 @@ deb:
@echo "First create source archive with: dpkg-source -b core-@CORE_VERSION@"
@echo "Then build with: pbuilder-dist precise i386 build core*.dsc"
.PHONE: fpm
define fpm-python =
fpm -s python -t $1 \
-m "$(CORE_MAINTAINERS)" \
--vendor "$(CORE_VENDOR)" \
$2
endef
define fpm-gui =
fpm -s dir -t $1 -n core-gui \
-m "$(CORE_MAINTAINERS)" \
--license "BSD" \
--description "Common Open Research Emulator GUI front-end" \
--url http://www.nrl.navy.mil/itd/ncs/products/core \
--vendor "$(CORE_VENDOR)" \
-p core-gui_VERSION_ARCH.$1 \
-v $(CORE_VERSION) \
-d "bash" \
-d "tcl" \
-d "tk" \
$2 \
-C $(DESTDIR)
endef
.PHONY: fpm
fpm:
rm -f *.deb && rm -f *.rpm
$(call fpm-gui,rpm,-d "tkimg")
$(call fpm-gui,deb,-d "libtk-img")
$(call fpm-python,rpm,daemon/ns3/setup.py)
$(call fpm-python,deb,daemon/ns3/setup.py)
fpm -s python -t rpm \
-m "CORE Developers <core-dev@nrl.navy.mil>" \
--vendor "CORE Developers" \
daemon/setup.py
fpm -s python -t rpm \
-m "CORE Developers <core-dev@nrl.navy.mil>" \
--vendor "CORE Developers" \
daemon/src/setup.py
fpm -s python -t rpm \
-m "CORE Developers <core-dev@nrl.navy.mil>" \
--vendor "CORE Developers" \
daemon/ns3/setup.py
.PHONY: fpm-deb
fpm-deb:
fpm -s dir -t deb -n core -v $(CORE_VERSION) -C "$DESTDIR" \
-p core_VERSION_ARCH.deb \
--license "BSD 2-clause" \
--vendor "CORE Developers" \
--description "Emulate virtual networks in a box." \
--url http://www.nrl.navy.mil/itd/ncs/products/core \
-m "CORE Developers <core-dev@nrl.navy.mil>" \
-d "procps" \
-d "libc6 >= 2.14" \
-d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \
-d "iproute2" \
-d "libev4" \
-d "python >= 2.7" \
--deb-recommends quagga
.PHONY: fpm-rpm
fpm-rpm:
fpm -s dir -t rpm -n core -v $(CORE_VERSION) -C "$DESTDIR" \
-p core_VERSION_ARCH.rpm \
--license "BSD 2-clause" \
--vendor "CORE Developers" \
--description "Emulate virtual networks in a box." \
--url http://www.nrl.navy.mil/itd/ncs/products/core \
-m "CORE Developers <core-dev@nrl.navy.mil>" \
-d "procps" \
-d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \
-d "iproute" \
-d "libev" \
-d "python >= 2.7"
-m "$(CORE_MAINTAINERS)" \
--vendor "$(CORE_VENDOR)" \
-d "procps-ng" \
-d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \
-d "iproute" \
-d "libev" \
-d "net-tools" \
-d "python >= 2.7, python < 3.0" \
daemon/src/setup.py daemon/setup.py
fpm -s python -t deb \
-m "$(CORE_MAINTAINERS)" \
--vendor "$(CORE_VENDOR)" \
-d "procps" \
-d "libc6 >= 2.14" \
-d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \
-d "iproute2" \
-d "libev4" \
-d "python (>= 2.7), python (<< 3.0)" \
--deb-recommends quagga \
daemon/src/setup.py daemon/setup.py
.PHONY: core-restart
core-restart:

View file

@ -17,6 +17,8 @@ VERSION=$PACKAGE_VERSION
CORE_VERSION=$PACKAGE_VERSION
CORE_VERSION_DATE=m4_esyscmd_s([./revision.sh -d])
COREDPY_VERSION=$PACKAGE_VERSION
CORE_MAINTAINERS="CORE Developers <core-dev@nrl.navy.mil>"
CORE_VENDOR="CORE Developers"
#
# autoconf and automake initialization
@ -30,6 +32,8 @@ AM_INIT_AUTOMAKE([tar-ustar])
AC_SUBST(CORE_VERSION)
AC_SUBST(CORE_VERSION_DATE)
AC_SUBST(COREDPY_VERSION)
AC_SUBST(CORE_MAINTAINERS)
AC_SUBST(CORE_VENDOR)
#
# some of the following directory variables are not expanded at configure-time,

View file

@ -4,7 +4,7 @@ CORE_STATE_DIR = "@CORE_STATE_DIR@"
CORE_CONF_DIR = "@CORE_CONF_DIR@"
CORE_DATA_DIR = "@CORE_DATA_DIR@"
CORE_LIB_DIR = "@CORE_LIB_DIR@"
CORE_SBIN_DIR = "@SBINDIR@"
CORE_SBIN_DIR = "@BINDIR@"
BRCTL_BIN = "@brctl_path@/brctl"
SYSCTL_BIN = "@sysctl_path@/sysctl"

View file

@ -22,13 +22,29 @@ setup(
],
install_requires=[
"enum34",
"logzero"
#"logzero",
],
tests_require=[
"pytest",
"pytest-runner"
"pytest-runner",
"pytest-cov",
"mock"
"mock",
],
data_files=[
("/etc/core", [
"data/core.conf",
"data/xen.conf",
]),
("/etc/init.d", [
"../scripts/core-daemon",
]),
],
scripts=[
"sbin/core-cleanup",
"sbin/core-daemon",
"sbin/core-manage",
"sbin/coresendmsg",
"sbin/core-xen-cleanup",
],
description="Python components of CORE",
url="http://www.nrl.navy.mil/itd/ncs/products/core",

View file

@ -34,7 +34,7 @@ netns_SOURCES = ${SRC_NETNS}
noinst_LIBRARIES = libnetns.a
libnetns_a_SOURCES = netnsmodule.c vcmdmodule.c
libnetns.a:
SBINDIR=@SBINDIR@ LDFLAGS="$(LDFLAGS) @libev_LIBS@" CFLAGS="$(CFLAGS) @libev_CFLAGS@" $(PYTHON) setup.py build
SBINDIR=@SBINDIR@ LDFLAGS="$(LDFLAGS) @libev_LIBS@" CFLAGS="$(CFLAGS) @libev_CFLAGS@" $(PYTHON) setup.py build_ext
# Python libraries install
install-exec-local:

View file

@ -29,6 +29,7 @@ setup(
name="core-netns",
version="1.0",
description="Extension modules to support virtual nodes using Linux network namespaces",
scripts=["vcmd", "vnoded", "netns"],
ext_modules=[
netns,
vcmd

View file

@ -59,7 +59,6 @@ dist_coreaddons_DATA = $(ADDONS_FILES)
coreconfigsdir = $(datadir)/core/examples/configs
dist_coreconfigs_DATA = $(CONFIG_FILES)
dist-hook:
rm -rf $(distdir)/addons/.svn