initial cleanup passing over all makefiles and configure.ac
This commit is contained in:
parent
ac705f4908
commit
6210e70c80
28 changed files with 328 additions and 641 deletions
106
Makefile.am
106
Makefile.am
|
@ -10,53 +10,63 @@
|
||||||
if WANT_DOCS
|
if WANT_DOCS
|
||||||
DOCS = doc
|
DOCS = doc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if WANT_GUI
|
if WANT_GUI
|
||||||
GUI = gui
|
GUI = gui
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if WANT_DAEMON
|
if WANT_DAEMON
|
||||||
DAEMON = scripts daemon
|
DAEMON = scripts daemon
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if WANT_NETNS
|
if WANT_NETNS
|
||||||
NETNS = netns ns3
|
NETNS = netns ns3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# keep docs last due to dependencies on binaries
|
# keep docs last due to dependencies on binaries
|
||||||
SUBDIRS = ${GUI} ${DAEMON} ${DOCS} ${NETNS}
|
SUBDIRS = $(GUI) $(DAEMON) $(NETNS) $(DOCS)
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I config
|
ACLOCAL_AMFLAGS = -I config
|
||||||
|
|
||||||
# extra files to include with distribution tarball
|
# extra files to include with distribution tarball
|
||||||
EXTRA_DIST = bootstrap.sh LICENSE \
|
EXTRA_DIST = bootstrap.sh \
|
||||||
README.md ASSIGNMENT_OF_COPYRIGHT.pdf \
|
LICENSE \
|
||||||
|
README.md \
|
||||||
|
ASSIGNMENT_OF_COPYRIGHT.pdf \
|
||||||
Changelog \
|
Changelog \
|
||||||
python-prefix.py revision.sh \
|
python-prefix.py \
|
||||||
.version .version.date
|
revision.sh \
|
||||||
|
.version \
|
||||||
|
.version.date
|
||||||
|
|
||||||
DISTCLEAN_TARGETS = aclocal.m4 config.h.in
|
DISTCLEAN_TARGETS = aclocal.m4 config.h.in
|
||||||
|
|
||||||
# extra cruft to remove
|
# extra cruft to remove
|
||||||
DISTCLEANFILES = aclocal.m4 config.h.in configure Makefile.in config/compile
|
DISTCLEANFILES = aclocal.m4 \
|
||||||
|
config.h.in \
|
||||||
|
configure \
|
||||||
|
Makefile.in \
|
||||||
|
config/compile
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = \
|
MAINTAINERCLEANFILES = .version \
|
||||||
.version \
|
|
||||||
.version.date
|
.version.date
|
||||||
|
|
||||||
define fpm-python =
|
define fpm-python =
|
||||||
fpm -s python -t $1 \
|
fpm -s python -t $1 \
|
||||||
-m "$(CORE_MAINTAINERS)" \
|
-m "$(PACKAGE_MAINTAINERS)" \
|
||||||
--vendor "$(CORE_VENDOR)" \
|
--vendor "$(PACKAGE_VENDOR)" \
|
||||||
$2
|
$2
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define fpm-gui =
|
define fpm-gui =
|
||||||
fpm -s dir -t $1 -n core-gui \
|
fpm -s dir -t $1 -n core-gui \
|
||||||
-m "$(CORE_MAINTAINERS)" \
|
-m "$(PACKAGE_MAINTAINERS)" \
|
||||||
--license "BSD" \
|
--license "BSD" \
|
||||||
--description "Common Open Research Emulator GUI front-end" \
|
--description "Common Open Research Emulator GUI front-end" \
|
||||||
--url http://www.nrl.navy.mil/itd/ncs/products/core \
|
--url http://www.nrl.navy.mil/itd/ncs/products/core \
|
||||||
--vendor "$(CORE_VENDOR)" \
|
--vendor "$(PACKAGE_VENDOR)" \
|
||||||
-p core-gui_VERSION_ARCH.$1 \
|
-p core-gui_VERSION_ARCH.$1 \
|
||||||
-v $(CORE_VERSION) \
|
-v $(PACKAGE_VERSION) \
|
||||||
-d "bash" \
|
-d "bash" \
|
||||||
-d "tcl" \
|
-d "tcl" \
|
||||||
-d "tk" \
|
-d "tk" \
|
||||||
|
@ -66,10 +76,13 @@ endef
|
||||||
|
|
||||||
define fpm-daemon-rpm =
|
define fpm-daemon-rpm =
|
||||||
fpm -s python -t rpm \
|
fpm -s python -t rpm \
|
||||||
-p NAME_$1_VERSION_ARCH.rpm \
|
-p NAME_sysv_VERSION_ARCH.rpm \
|
||||||
--python-setup-py-arguments --service=$1 \
|
--rpm-init scripts/core-daemon \
|
||||||
-m "$(CORE_MAINTAINERS)" \
|
--python-install-bin $(bindir) \
|
||||||
--vendor "$(CORE_VENDOR)" \
|
--python-install-data $(prefix) \
|
||||||
|
--python-install-lib $(pythondir) \
|
||||||
|
-m "$(PACKAGE_MAINTAINERS)" \
|
||||||
|
--vendor "$(PACKAGE_VENDOR)" \
|
||||||
-d "procps-ng" \
|
-d "procps-ng" \
|
||||||
-d "bash >= 3.0" \
|
-d "bash >= 3.0" \
|
||||||
-d "bridge-utils" \
|
-d "bridge-utils" \
|
||||||
|
@ -84,9 +97,12 @@ endef
|
||||||
define fpm-daemon-deb =
|
define fpm-daemon-deb =
|
||||||
fpm -s python -t deb \
|
fpm -s python -t deb \
|
||||||
-p NAME_$1_VERSION_ARCH.deb \
|
-p NAME_$1_VERSION_ARCH.deb \
|
||||||
--python-setup-py-arguments --service=$1 \
|
--python-install-bin $(bindir) \
|
||||||
-m "$(CORE_MAINTAINERS)" \
|
--python-install-data $(prefix) \
|
||||||
--vendor "$(CORE_VENDOR)" \
|
--python-install-lib $(pythondir) \
|
||||||
|
$2 $3 \
|
||||||
|
-m "$(PACKAGE_MAINTAINERS)" \
|
||||||
|
--vendor "$(PACKAGE_VENDOR)" \
|
||||||
-d "procps" \
|
-d "procps" \
|
||||||
-d "libc6 >= 2.14" \
|
-d "libc6 >= 2.14" \
|
||||||
-d "bash >= 3.0" \
|
-d "bash >= 3.0" \
|
||||||
|
@ -106,27 +122,51 @@ fpm: clean-local-fpm
|
||||||
$(call fpm-gui,deb,-d "libtk-img")
|
$(call fpm-gui,deb,-d "libtk-img")
|
||||||
$(call fpm-python,rpm,ns3/setup.py)
|
$(call fpm-python,rpm,ns3/setup.py)
|
||||||
$(call fpm-python,deb,ns3/setup.py)
|
$(call fpm-python,deb,ns3/setup.py)
|
||||||
$(call fpm-daemon-rpm,systemd)
|
$(call fpm-daemon-rpm)
|
||||||
$(call fpm-daemon-rpm,sysv)
|
$(call fpm-daemon-deb,sysv,--deb-init,scripts/core-daemon)
|
||||||
$(call fpm-daemon-deb,systemd)
|
$(call fpm-daemon-deb,systemd,--deb-systemd,scripts/core-daemon.service)
|
||||||
$(call fpm-daemon-deb,sysv)
|
|
||||||
|
|
||||||
.PHONY: clean-local-fpm
|
.PHONY: clean-local-fpm
|
||||||
clean-local-fpm:
|
clean-local-fpm:
|
||||||
-rm -rf *.deb
|
-rm -rf *.deb
|
||||||
-rm -rf *.rpm
|
-rm -rf *.rpm
|
||||||
|
|
||||||
.PHONY: core-restart
|
|
||||||
core-restart:
|
|
||||||
/etc/init.d/core-daemon stop
|
|
||||||
daemon/sbin/core-cleanup
|
|
||||||
rm -f /var/log/core-daemon.log
|
|
||||||
/etc/init.d/core-daemon start
|
|
||||||
|
|
||||||
clean-local: clean-local-fpm
|
clean-local: clean-local-fpm
|
||||||
|
|
||||||
.version: Makefile
|
.version: Makefile
|
||||||
echo $(CORE_VERSION) > $@
|
echo $(PACKAGE_VERSION) > $@
|
||||||
|
|
||||||
.version.date: Makefile
|
.version.date: Makefile
|
||||||
echo $(CORE_VERSION_DATE) > $@
|
echo $(PACKAGE_DATE) > $@
|
||||||
|
|
||||||
|
define change-files =
|
||||||
|
$(info creating file $1 from $1.in)
|
||||||
|
@$(SED) -e 's,[@]sbindir[@],$(sbindir),g' \
|
||||||
|
-e 's,[@]bindir[@],$(bindir),g' \
|
||||||
|
-e 's,[@]PYTHON[@],$(PYTHON),g' \
|
||||||
|
-e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
|
||||||
|
-e 's,[@]PACKAGE_DATE[@],$(PACKAGE_DATE),g' \
|
||||||
|
-e 's,[@]CORE_LIB_DIR[@],$(CORE_LIB_DIR),g' \
|
||||||
|
-e 's,[@]CORE_STATE_DIR[@],$(CORE_STATE_DIR),g' \
|
||||||
|
-e 's,[@]CORE_DATA_DIR[@],$(CORE_DATA_DIR),g' \
|
||||||
|
-e 's,[@]CORE_CONF_DIR[@],$(CORE_CONF_DIR),g' \
|
||||||
|
-e 's,[@]CORE_GUI_CONF_DIR[@],$(CORE_GUI_CONF_DIR),g' \
|
||||||
|
-e 's,[@]brctl_path[@],$(brctl_path),g' \
|
||||||
|
-e 's,[@]sysctl_path[@],$(sysctl_path),g' \
|
||||||
|
-e 's,[@]ip_path[@],$(ip_path),g' \
|
||||||
|
-e 's,[@]tc_path[@],$(tc_path),g' \
|
||||||
|
-e 's,[@]ebtables_path[@],$(ebtables_path),g' \
|
||||||
|
-e 's,[@]mount_path[@],$(mount_path),g' \
|
||||||
|
-e 's,[@]umount_path[@],$(umount_path),g' \
|
||||||
|
-e 's,[@]ovs_vs_path[@],$(ovs_vs_path),g' \
|
||||||
|
-e 's,[@]ovs_of_path[@],$(ovs_of_path),g' \
|
||||||
|
< $1.in > $1
|
||||||
|
endef
|
||||||
|
|
||||||
|
all: change-files
|
||||||
|
|
||||||
|
.PHONY: change-files
|
||||||
|
change-files:
|
||||||
|
$(call change-files,gui/core-gui)
|
||||||
|
$(call change-files,scripts/core-daemon.service)
|
||||||
|
$(call change-files,daemon/core/constants.py)
|
||||||
|
|
272
configure.ac
272
configure.ac
|
@ -9,82 +9,37 @@
|
||||||
# -*- Autoconf -*-
|
# -*- Autoconf -*-
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
#
|
|
||||||
# this defines the CORE version number, must be static for AC_INIT
|
# this defines the CORE version number, must be static for AC_INIT
|
||||||
#
|
|
||||||
AC_INIT(core, 5.1, core-dev@nrl.navy.mil)
|
AC_INIT(core, 5.1, core-dev@nrl.navy.mil)
|
||||||
VERSION=$PACKAGE_VERSION
|
|
||||||
CORE_VERSION=$PACKAGE_VERSION
|
|
||||||
CORE_VERSION_DATE=m4_esyscmd_s([date +%Y%m%d])
|
|
||||||
COREDPY_VERSION=$PACKAGE_VERSION
|
|
||||||
CORE_MAINTAINERS="CORE Developers <core-dev@nrl.navy.mil>"
|
|
||||||
CORE_VENDOR="CORE Developers"
|
|
||||||
|
|
||||||
#
|
|
||||||
# autoconf and automake initialization
|
# autoconf and automake initialization
|
||||||
#
|
|
||||||
AC_CONFIG_SRCDIR([netns/version.h.in])
|
AC_CONFIG_SRCDIR([netns/version.h.in])
|
||||||
AC_CONFIG_AUX_DIR(config)
|
AC_CONFIG_AUX_DIR(config)
|
||||||
AC_CONFIG_MACRO_DIR(config)
|
AC_CONFIG_MACRO_DIR(config)
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AM_INIT_AUTOMAKE([tar-ustar])
|
AM_INIT_AUTOMAKE([tar-ustar])
|
||||||
|
|
||||||
AC_SUBST(CORE_VERSION)
|
# define variables used for packaging and date display
|
||||||
AC_SUBST(CORE_VERSION_DATE)
|
PACKAGE_DATE=m4_esyscmd_s([date +%Y%m%d])
|
||||||
AC_SUBST(COREDPY_VERSION)
|
PACKAGE_VENDOR="CORE Developers"
|
||||||
AC_SUBST(CORE_MAINTAINERS)
|
PACKAGE_MAINTAINERS="$PACKAGE_VENDOR <$PACKAGE_BUGREPORT>"
|
||||||
AC_SUBST(CORE_VENDOR)
|
CORE_LIB_DIR="\${prefix}/lib/core"
|
||||||
|
# TODO: hard setting path, until support by setup.py
|
||||||
|
CORE_CONF_DIR="/etc/core"
|
||||||
|
CORE_DATA_DIR="\${datarootdir}/core"
|
||||||
|
# TODO: verify there is need to hard set /var
|
||||||
|
CORE_STATE_DIR="\${localstatedir}"
|
||||||
|
|
||||||
#
|
AC_SUBST(PACKAGE_DATE)
|
||||||
# some of the following directory variables are not expanded at configure-time,
|
AC_SUBST(PACKAGE_MAINTAINERS)
|
||||||
# so we have special checks to expand them
|
AC_SUBST(PACKAGE_VENDOR)
|
||||||
#
|
|
||||||
|
|
||||||
# CORE GUI files in LIBDIR
|
|
||||||
# AC_PREFIX_DEFAULT is /usr/local, but not expanded yet
|
|
||||||
if test "x$prefix" = "xNONE" ; then
|
|
||||||
prefix="/usr/local"
|
|
||||||
fi
|
|
||||||
if test "x$exec_prefix" = "xNONE" ; then
|
|
||||||
exec_prefix="$prefix"
|
|
||||||
fi
|
|
||||||
if test "$libdir" = "\${exec_prefix}/lib" ; then
|
|
||||||
libdir="${exec_prefix}/lib"
|
|
||||||
fi
|
|
||||||
if test "$sbindir" = "\${exec_prefix}/sbin" ; then
|
|
||||||
sbindir="${exec_prefix}/sbin"
|
|
||||||
fi
|
|
||||||
if test "$bindir" = "\${exec_prefix}/bin" ; then
|
|
||||||
bindir="${exec_prefix}/bin"
|
|
||||||
fi
|
|
||||||
# this can be /usr/lib or /usr/lib64
|
|
||||||
LIB_DIR="${libdir}"
|
|
||||||
# don't let the Tcl files install to /usr/lib64/core
|
|
||||||
CORE_LIB_DIR="${prefix}/lib/core"
|
|
||||||
AC_SUBST(LIB_DIR)
|
|
||||||
AC_SUBST(CORE_LIB_DIR)
|
AC_SUBST(CORE_LIB_DIR)
|
||||||
SBINDIR="${sbindir}"
|
|
||||||
AC_SUBST(SBINDIR)
|
|
||||||
BINDIR="${bindir}"
|
|
||||||
AC_SUBST(BINDIR)
|
|
||||||
|
|
||||||
# CORE daemon configuration file (core.conf) in CORE_CONF_DIR
|
|
||||||
if test "$sysconfdir" = "\${prefix}/etc" ; then
|
|
||||||
sysconfdir="/etc"
|
|
||||||
CORE_CONF_DIR="/etc/core"
|
|
||||||
else
|
|
||||||
CORE_CONF_DIR="$sysconfdir/core"
|
|
||||||
fi
|
|
||||||
AC_SUBST(CORE_CONF_DIR)
|
AC_SUBST(CORE_CONF_DIR)
|
||||||
if test "$datarootdir" = "\${prefix}/share" ; then
|
|
||||||
datarootdir="${prefix}/share"
|
|
||||||
fi
|
|
||||||
CORE_DATA_DIR="$datarootdir/core"
|
|
||||||
AC_SUBST(CORE_DATA_DIR)
|
AC_SUBST(CORE_DATA_DIR)
|
||||||
|
AC_SUBST(CORE_STATE_DIR)
|
||||||
|
|
||||||
# CORE GUI configuration files and preferences in CORE_GUI_CONF_DIR
|
# CORE GUI configuration files and preferences in CORE_GUI_CONF_DIR
|
||||||
# scenario files in ~/.core/configs/
|
# scenario files in ~/.core/configs/
|
||||||
#AC_ARG_VAR(CORE_GUI_CONF_DIR, [GUI configuration directory.])
|
|
||||||
AC_ARG_WITH([guiconfdir],
|
AC_ARG_WITH([guiconfdir],
|
||||||
[AS_HELP_STRING([--with-guiconfdir=dir],
|
[AS_HELP_STRING([--with-guiconfdir=dir],
|
||||||
[specify GUI configuration directory])],
|
[specify GUI configuration directory])],
|
||||||
|
@ -102,91 +57,27 @@ AC_ARG_ENABLE([daemon],
|
||||||
(default is yes)])],
|
(default is yes)])],
|
||||||
[], [enable_daemon=yes])
|
[], [enable_daemon=yes])
|
||||||
AC_SUBST(enable_daemon)
|
AC_SUBST(enable_daemon)
|
||||||
if test "x$enable_daemon" = "xno"; then
|
|
||||||
want_python=no
|
|
||||||
want_linux_netns=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
# CORE state files
|
SEARCHPATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin"
|
||||||
if test "$localstatedir" = "\${prefix}/var" ; then
|
|
||||||
# use /var instead of /usr/local/var (/usr/local/var/log isn't standard)
|
|
||||||
CORE_STATE_DIR="/var"
|
|
||||||
else
|
|
||||||
CORE_STATE_DIR="$localstatedir"
|
|
||||||
fi
|
|
||||||
AC_SUBST(CORE_STATE_DIR)
|
|
||||||
|
|
||||||
# default compiler flags
|
# default compiler flags
|
||||||
# _GNU_SOURCE is defined to get c99 defines for lrint()
|
# _GNU_SOURCE is defined to get c99 defines for lrint()
|
||||||
CFLAGS="$CFLAGS -O3 -Werror -Wall -D_GNU_SOURCE"
|
CFLAGS="$CFLAGS -O3 -Werror -Wall -D_GNU_SOURCE"
|
||||||
# debug flags
|
|
||||||
#CFLAGS="$CFLAGS -g -Werror -Wall -D_GNU_SOURCE"
|
|
||||||
|
|
||||||
# Checks for programs.
|
# checks for programs
|
||||||
AC_PROG_AWK
|
AC_PROG_AWK
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
AC_PROG_SED
|
||||||
|
|
||||||
AM_PATH_PYTHON(2.6, want_python=yes, want_python=no)
|
want_python=no
|
||||||
SEARCHPATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin"
|
want_linux_netns=no
|
||||||
#
|
if test "x$enable_daemon" = "xyes"; then
|
||||||
# daemon dependencies
|
want_python=yes
|
||||||
#
|
want_linux_netns=yes
|
||||||
if test "x$enable_daemon" = "xyes" ; then
|
|
||||||
AC_CHECK_PROG(brctl_path, brctl, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(sysctl_path, sysctl, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(ebtables_path, ebtables, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(ip_path, ip, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(tc_path, tc, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(ifconfig_path, ifconfig, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(ngctl_path, ngctl, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(vimage_path, vimage, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(umount_path, umount, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(convert, convert, yes, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(ovs_vs_path, ovs-vsctl, $as_dir, no, $SEARCHPATH)
|
|
||||||
AC_CHECK_PROG(ovs_of_path, ovs-ofctl, $as_dir, no, $SEARCHPATH)
|
|
||||||
fi
|
|
||||||
|
|
||||||
#AC_CHECK_PROG(dia, dia, yes, no)
|
|
||||||
AC_CHECK_PROG(help2man, help2man, yes, no, $SEARCHPATH)
|
|
||||||
if test "x$convert" = "xno" ; then
|
|
||||||
AC_MSG_WARN([Could not locate ImageMagick convert.])
|
|
||||||
#want_docs_missing="convert"
|
|
||||||
fi
|
|
||||||
#if test "x$dia" = "xno" ; then
|
|
||||||
# AC_MSG_WARN([Could not locate dia.])
|
|
||||||
# want_docs_missing="dia"
|
|
||||||
#fi
|
|
||||||
if test "x$help2man" = "xno" ; then
|
|
||||||
AC_MSG_WARN([Could not locate help2man.])
|
|
||||||
want_docs_missing="$want_docs_missing help2man"
|
|
||||||
fi
|
|
||||||
if test "x$want_docs_missing" = "x" ; then
|
|
||||||
want_docs=yes
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([Could not find required helper utilities (${want_docs_missing}) so the CORE documentation will not be built.])
|
|
||||||
want_docs=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check for sphinx required during make
|
|
||||||
AC_CHECK_PROG(sphinxapi_path, sphinx-apidoc, $as_dir, no, $SEARCHPATH)
|
|
||||||
if test "x$sphinxapi_path" = "xno" ; then
|
|
||||||
AC_MSG_ERROR(["Could not location sphinx-apidoc, from the python-sphinx package"])
|
|
||||||
fi
|
|
||||||
|
|
||||||
#AC_PATH_PROGS(tcl_path, [tclsh tclsh8.5 tclsh8.4], no)
|
|
||||||
#if test "x$tcl_path" = "xno" ; then
|
|
||||||
# AC_MSG_ERROR([Could not locate tclsh. Please install Tcl/Tk.])
|
|
||||||
#fi
|
|
||||||
#AC_PATH_PROGS(wish_path, [wish wish8.5 wish8.4], no)
|
|
||||||
#if test "x$wish_path" = "xno" ; then
|
|
||||||
# AC_MSG_ERROR([Could not locate wish. Please install Tcl/Tk.])
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if test "x$enable_daemon" = "xyes" ; then
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
AC_CHECK_LIB([netgraph], [NgMkSockNode])
|
AC_CHECK_LIB([netgraph], [NgMkSockNode])
|
||||||
|
|
||||||
|
@ -207,17 +98,41 @@ if test "x$enable_daemon" = "xyes" ; then
|
||||||
AC_FUNC_MALLOC
|
AC_FUNC_MALLOC
|
||||||
AC_FUNC_REALLOC
|
AC_FUNC_REALLOC
|
||||||
AC_CHECK_FUNCS([atexit dup2 gettimeofday memset socket strerror uname])
|
AC_CHECK_FUNCS([atexit dup2 gettimeofday memset socket strerror uname])
|
||||||
fi
|
|
||||||
|
|
||||||
# Host-specific detection
|
AM_PATH_PYTHON(2.6)
|
||||||
want_linux_netns=yes
|
|
||||||
|
|
||||||
if test "x$want_python" = "xno"; then
|
AC_CHECK_PROG(brctl_path, brctl, $as_dir, no, $SEARCHPATH)
|
||||||
want_linux_netns=no
|
if test "x$brctl_path" = "xno" ; then
|
||||||
fi
|
AC_MSG_ERROR([Could not locate brctl (from bridge-utils package).])
|
||||||
|
fi
|
||||||
|
AC_CHECK_PROG(sysctl_path, sysctl, $as_dir, no, $SEARCHPATH)
|
||||||
|
AC_CHECK_PROG(ebtables_path, ebtables, $as_dir, no, $SEARCHPATH)
|
||||||
|
if test "x$ebtables_path" = "xno" ; then
|
||||||
|
AC_MSG_ERROR([Could not locate ebtables (from ebtables package).])
|
||||||
|
fi
|
||||||
|
AC_CHECK_PROG(ip_path, ip, $as_dir, no, $SEARCHPATH)
|
||||||
|
if test "x$ip_path" = "xno" ; then
|
||||||
|
AC_MSG_ERROR([Could not locate ip (from iproute package).])
|
||||||
|
fi
|
||||||
|
AC_CHECK_PROG(tc_path, tc, $as_dir, no, $SEARCHPATH)
|
||||||
|
if test "x$tc_path" = "xno" ; then
|
||||||
|
AC_MSG_ERROR([Could not locate tc (from iproute package).])
|
||||||
|
fi
|
||||||
|
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
|
||||||
|
AC_CHECK_PROG(umount_path, umount, $as_dir, no, $SEARCHPATH)
|
||||||
|
AC_CHECK_PROG(convert, convert, yes, no, $SEARCHPATH)
|
||||||
|
if test "x$convert" = "xno" ; then
|
||||||
|
AC_MSG_WARN([Could not locate ImageMagick convert.])
|
||||||
|
fi
|
||||||
|
AC_CHECK_PROG(ovs_vs_path, ovs-vsctl, $as_dir, no, $SEARCHPATH)
|
||||||
|
if test "x$ovs_vs_path" = "xno" ; then
|
||||||
|
AC_MSG_WARN([Could not locate ovs-vsctl cannot use OVS nodes])
|
||||||
|
fi
|
||||||
|
AC_CHECK_PROG(ovs_of_path, ovs-ofctl, $as_dir, no, $SEARCHPATH)
|
||||||
|
if test "x$ovs_of_path" = "xno" ; then
|
||||||
|
AC_MSG_WARN([Could not locate ovs-ofctl cannot use OVS nodes])
|
||||||
|
fi
|
||||||
|
|
||||||
if test "x$want_python" = "xyes"; then
|
|
||||||
if test "x$want_linux_netns" = "xyes"; then
|
|
||||||
CFLAGS_save=$CFLAGS
|
CFLAGS_save=$CFLAGS
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
CPPFLAGS_save=$CPPFLAGS
|
||||||
if test "x$PYTHON_INCLUDE_DIR" = "x"; then
|
if test "x$PYTHON_INCLUDE_DIR" = "x"; then
|
||||||
|
@ -239,41 +154,38 @@ if test "x$want_python" = "xyes"; then
|
||||||
AC_SUBST(libev_CFLAGS)
|
AC_SUBST(libev_CFLAGS)
|
||||||
AC_SUBST(libev_LIBS, [-lev]),
|
AC_SUBST(libev_LIBS, [-lev]),
|
||||||
AC_MSG_ERROR([Python bindings require libev (try installing your 'libev-devel' or 'libev-dev' package)])))
|
AC_MSG_ERROR([Python bindings require libev (try installing your 'libev-devel' or 'libev-dev' package)])))
|
||||||
fi
|
|
||||||
AC_SUBST(pyprefix, `eval ${PYTHON} ./python-prefix.py ${PYTHON_PREFIX} ${PYTHON_VERSION}`)
|
|
||||||
if test "${pyprefix}" != "${PYTHON_PREFIX}"; then
|
|
||||||
pythondir=`echo ${pythondir} | sed -e 's,[$][{]prefix[}],${pyprefix},g'`
|
|
||||||
pyexecdir=`echo ${pyexecdir} | sed -e 's,[$][{]exec_prefix[}],${pyprefix},g'`
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# Namespace support requires Python support
|
|
||||||
want_linux_netns=no
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
progs_missing=""
|
AC_CHECK_PROG(help2man, help2man, yes, no, $SEARCHPATH)
|
||||||
if test "x$want_linux_netns" = "xyes"; then
|
|
||||||
if test "x$brctl_path" = "xno" ; then
|
if test "x$help2man" = "xno" ; then
|
||||||
progs_missing="${progs_missing}brctl "
|
AC_MSG_WARN([Could not locate help2man.])
|
||||||
brctl_path="/usr/sbin"
|
want_docs_missing="$want_docs_missing help2man"
|
||||||
AC_MSG_ERROR([Could not locate brctl (from bridge-utils package).])
|
|
||||||
fi
|
|
||||||
if test "x$ebtables_path" = "xno" ; then
|
|
||||||
progs_missing="${progs_missing}ebtables "
|
|
||||||
ebtables_path="/sbin"
|
|
||||||
AC_MSG_ERROR([Could not locate ebtables (from ebtables package).])
|
|
||||||
fi
|
|
||||||
if test "x$ip_path" = "xno" ; then
|
|
||||||
progs_missing="${progs_missing}ip "
|
|
||||||
ip_path="/sbin"
|
|
||||||
AC_MSG_ERROR([Could not locate ip (from iproute package).])
|
|
||||||
fi
|
|
||||||
if test "x$tc_path" = "xno" ; then
|
|
||||||
progs_missing="${progs_missing}tc "
|
|
||||||
tc_path="/sbin"
|
|
||||||
AC_MSG_ERROR([Could not locate tc (from iproute package).])
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "x$want_docs_missing" = "x" ; then
|
||||||
|
want_docs=yes
|
||||||
|
else
|
||||||
|
AC_MSG_WARN([Could not find required helper utilities (${want_docs_missing}) so the CORE documentation will not be built.])
|
||||||
|
want_docs=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check for sphinx required during make
|
||||||
|
AC_CHECK_PROG(sphinxapi_path, sphinx-apidoc, $as_dir, no, $SEARCHPATH)
|
||||||
|
if test "x$sphinxapi_path" = "xno" ; then
|
||||||
|
AC_MSG_ERROR(["Could not location sphinx-apidoc, from the python-sphinx package"])
|
||||||
|
fi
|
||||||
|
|
||||||
|
#AC_PATH_PROGS(tcl_path, [tclsh tclsh8.5 tclsh8.4], no)
|
||||||
|
#if test "x$tcl_path" = "xno" ; then
|
||||||
|
# AC_MSG_ERROR([Could not locate tclsh. Please install Tcl/Tk.])
|
||||||
|
#fi
|
||||||
|
|
||||||
|
#AC_PATH_PROGS(wish_path, [wish wish8.5 wish8.4], no)
|
||||||
|
#if test "x$wish_path" = "xno" ; then
|
||||||
|
# AC_MSG_ERROR([Could not locate wish. Please install Tcl/Tk.])
|
||||||
|
#fi
|
||||||
|
|
||||||
AC_ARG_WITH([startup],
|
AC_ARG_WITH([startup],
|
||||||
[AS_HELP_STRING([--with-startup=option],
|
[AS_HELP_STRING([--with-startup=option],
|
||||||
[option=systemd,suse,none to install systemd/SUSE init scripts])],
|
[option=systemd,suse,none to install systemd/SUSE init scripts])],
|
||||||
|
@ -288,7 +200,6 @@ AM_CONDITIONAL(WANT_DAEMON, test x$enable_daemon = xyes)
|
||||||
AM_CONDITIONAL(WANT_DOCS, test x$want_docs = xyes)
|
AM_CONDITIONAL(WANT_DOCS, test x$want_docs = xyes)
|
||||||
AM_CONDITIONAL(WANT_PYTHON, test x$want_python = xyes)
|
AM_CONDITIONAL(WANT_PYTHON, test x$want_python = xyes)
|
||||||
AM_CONDITIONAL(WANT_NETNS, test x$want_linux_netns = xyes)
|
AM_CONDITIONAL(WANT_NETNS, test x$want_linux_netns = xyes)
|
||||||
|
|
||||||
AM_CONDITIONAL(WANT_INITD, test x$with_startup = xinitd)
|
AM_CONDITIONAL(WANT_INITD, test x$with_startup = xinitd)
|
||||||
AM_CONDITIONAL(WANT_SYSTEMD, test x$with_startup = xsystemd)
|
AM_CONDITIONAL(WANT_SYSTEMD, test x$with_startup = xsystemd)
|
||||||
AM_CONDITIONAL(WANT_SUSE, test x$with_startup = xsuse)
|
AM_CONDITIONAL(WANT_SUSE, test x$with_startup = xsuse)
|
||||||
|
@ -299,28 +210,26 @@ else
|
||||||
HELP2MAN=:
|
HELP2MAN=:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Output files
|
# Output files
|
||||||
|
#gui/core-gui
|
||||||
|
#scripts/core-daemon.service
|
||||||
|
#daemon/core/constants.py
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
gui/core-gui
|
|
||||||
gui/version.tcl
|
gui/version.tcl
|
||||||
gui/Makefile
|
gui/Makefile
|
||||||
gui/icons/Makefile
|
gui/icons/Makefile
|
||||||
scripts/Makefile
|
scripts/Makefile
|
||||||
scripts/core-daemon.service
|
|
||||||
scripts/perf/Makefile
|
scripts/perf/Makefile
|
||||||
doc/Makefile
|
doc/Makefile
|
||||||
doc/conf.py
|
doc/conf.py
|
||||||
doc/man/Makefile
|
doc/man/Makefile
|
||||||
doc/figures/Makefile
|
doc/figures/Makefile
|
||||||
daemon/Makefile
|
daemon/Makefile
|
||||||
daemon/core/constants.py
|
|
||||||
daemon/doc/Makefile
|
daemon/doc/Makefile
|
||||||
daemon/doc/conf.py
|
daemon/doc/conf.py
|
||||||
netns/Makefile
|
netns/Makefile
|
||||||
netns/version.h
|
netns/version.h
|
||||||
ns3/Makefile
|
ns3/Makefile],)
|
||||||
ns3/corens3/constants.py],)
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
# Summary text
|
# Summary text
|
||||||
|
@ -331,12 +240,12 @@ ${PACKAGE_STRING} Configuration:
|
||||||
Host System Type: ${host}
|
Host System Type: ${host}
|
||||||
C Compiler and flags: ${CC} ${CFLAGS}
|
C Compiler and flags: ${CC} ${CFLAGS}
|
||||||
Install prefix: ${prefix}
|
Install prefix: ${prefix}
|
||||||
|
Exec prefix: ${exec_prefix}
|
||||||
Build GUI: ${enable_gui}
|
Build GUI: ${enable_gui}
|
||||||
GUI path: ${CORE_LIB_DIR}
|
GUI path: ${CORE_LIB_DIR}
|
||||||
GUI config: ${CORE_GUI_CONF_DIR}
|
GUI config: ${CORE_GUI_CONF_DIR}
|
||||||
Daemon path: ${SBINDIR}
|
Daemon path: ${sbindir}
|
||||||
Daemon config: ${CORE_CONF_DIR}
|
Daemon config: ${CORE_CONF_DIR}
|
||||||
Python install prefix: ${pyprefix}
|
|
||||||
Python modules: ${pythondir}
|
Python modules: ${pythondir}
|
||||||
Logs: ${CORE_STATE_DIR}/log
|
Logs: ${CORE_STATE_DIR}/log
|
||||||
|
|
||||||
|
@ -352,8 +261,3 @@ if test "x${want_linux_netns}" = "xyes" ; then
|
||||||
------------------------------------------------------------------------"
|
------------------------------------------------------------------------"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x${progs_missing}" != "x" ; then
|
|
||||||
echo ">>> NOTE: the following programs could not be found:"
|
|
||||||
echo " $progs_missing
|
|
||||||
------------------------------------------------------------------------"
|
|
||||||
fi
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
recursive-include sbin *.sh *.py
|
|
||||||
include data/core.conf
|
|
||||||
recursive-include examples/netns *.py *.sh
|
|
||||||
recursive-exclude examples/netns *.pyc *.pyo
|
|
|
@ -14,66 +14,10 @@ if WANT_DOCS
|
||||||
SUBDIRS = doc
|
SUBDIRS = doc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SBIN_FILES = \
|
SCRIPT_FILES := $(notdir $(wildcard sbin/*))
|
||||||
sbin/core-cleanup \
|
MAN_FILES := $(notdir $(wildcard ../doc/man/*.1))
|
||||||
sbin/core-daemon \
|
|
||||||
sbin/core-manage \
|
|
||||||
sbin/coresendmsg
|
|
||||||
|
|
||||||
dist_sbin_SCRIPTS = $(SBIN_FILES)
|
LOGROTATE_DIR = $(DESTDIR)/$(sysconfdir)/logrotate.d
|
||||||
|
|
||||||
CONF_FILES = \
|
|
||||||
data/core.conf
|
|
||||||
|
|
||||||
coreconfdir = $(CORE_CONF_DIR)
|
|
||||||
dist_coreconf_DATA = $(CONF_FILES)
|
|
||||||
|
|
||||||
EXAMPLE_FILES = \
|
|
||||||
examples/controlnet_updown \
|
|
||||||
examples/emanemanifest2core.py \
|
|
||||||
examples/emanemodel2core.py \
|
|
||||||
examples/findcore.py \
|
|
||||||
examples/stopsession.py
|
|
||||||
|
|
||||||
coreexdir = $(datadir)/core/examples
|
|
||||||
dist_coreex_SCRIPTS = $(EXAMPLE_FILES)
|
|
||||||
|
|
||||||
EXAMPLE_MYSERVICES_FILES = \
|
|
||||||
examples/myservices/README.txt \
|
|
||||||
examples/myservices/__init__.py \
|
|
||||||
examples/myservices/sample.py
|
|
||||||
|
|
||||||
coreexmyservicesdir = $(coreexdir)/myservices
|
|
||||||
dist_coreexmyservices_DATA = $(EXAMPLE_MYSERVICES_FILES)
|
|
||||||
|
|
||||||
EXAMPLE_NETNS_FILES = \
|
|
||||||
examples/netns/basicrange.py \
|
|
||||||
examples/netns/daemonnodes.py \
|
|
||||||
examples/netns/distributed.py \
|
|
||||||
examples/netns/emane80211.py \
|
|
||||||
examples/netns/howmanynodes.py \
|
|
||||||
examples/netns/iperf-performance-chain.py \
|
|
||||||
examples/netns/iperf-performance.sh \
|
|
||||||
examples/netns/ospfmanetmdrtest.py \
|
|
||||||
examples/netns/switch.py \
|
|
||||||
examples/netns/switchtest.py \
|
|
||||||
examples/netns/twonodes.sh \
|
|
||||||
examples/netns/wlanemanetests.py \
|
|
||||||
examples/netns/wlantest.py
|
|
||||||
|
|
||||||
coreexnetnsdir = $(coreexdir)/netns
|
|
||||||
dist_coreexnetns_SCRIPTS= $(EXAMPLE_NETNS_FILES)
|
|
||||||
|
|
||||||
EXAMPLE_SERVICES_FILES = \
|
|
||||||
examples/services/sampleFirewall \
|
|
||||||
examples/services/sampleIPsec \
|
|
||||||
examples/services/sampleVPNClient \
|
|
||||||
examples/services/sampleVPNServer
|
|
||||||
|
|
||||||
coreexservicesdir = $(coreexdir)/services
|
|
||||||
dist_coreexservices_DATA= $(EXAMPLE_SERVICES_FILES)
|
|
||||||
|
|
||||||
LOGROTATE_DIR = $(sysconfdir)/logrotate.d
|
|
||||||
LOGROTATE_FILE = data/core-daemon.logrotate
|
LOGROTATE_FILE = data/core-daemon.logrotate
|
||||||
|
|
||||||
# Python package build
|
# Python package build
|
||||||
|
@ -83,45 +27,38 @@ build:
|
||||||
|
|
||||||
# Python package install
|
# Python package install
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
$(MKDIR_P) ${DESTDIR}/${pythondir}
|
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \
|
||||||
$(MKDIR_P) ${DESTDIR}/${pyexecdir}
|
--root=/$(DESTDIR) \
|
||||||
PYTHONPATH=${DESTDIR}/${pythondir} $(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \
|
--prefix=$(prefix) \
|
||||||
--prefix=${DESTDIR}/${pyprefix} \
|
--install-lib=$(pythondir) \
|
||||||
--install-purelib=${DESTDIR}/${pythondir} \
|
--single-version-externally-managed
|
||||||
--install-platlib=${DESTDIR}/${pyexecdir}
|
|
||||||
|
|
||||||
install-data-local:
|
#install-data-local:
|
||||||
$(MKDIR_P) $(DESTDIR)$(LOGROTATE_DIR)
|
# $(MKDIR_P) $(DESTDIR)$(LOGROTATE_DIR)
|
||||||
$(INSTALL_DATA) $(LOGROTATE_FILE) \
|
# $(INSTALL_DATA) $(LOGROTATE_FILE) \
|
||||||
$(DESTDIR)$(LOGROTATE_DIR)/`basename $(LOGROTATE_FILE) .logrotate`
|
# $(DESTDIR)$(LOGROTATE_DIR)/`basename $(LOGROTATE_FILE) .logrotate`
|
||||||
|
|
||||||
uninstall-local:
|
#uninstall-local:
|
||||||
rm -f $(DESTDIR)$(LOGROTATE_DIR)/`basename $(LOGROTATE_FILE) .logrotate`
|
# rm -f $(DESTDIR)$(LOGROTATE_DIR)/`basename $(LOGROTATE_FILE) .logrotate`
|
||||||
|
|
||||||
# Python package uninstall
|
# Python package uninstall
|
||||||
|
#rmdir -p $(LOGROTATE_DIR) || true
|
||||||
uninstall-hook:
|
uninstall-hook:
|
||||||
rm -rf ${pythondir}/core_python-${COREDPY_VERSION}-py${PYTHON_VERSION}.egg-info
|
rm -rf $(DESTDIR)/etc/core
|
||||||
rm -f ${pythondir}/core_python_netns-1.0-py${PYTHON_VERSION}.egg-info
|
rm -rf $(DESTDIR)/$(datadir)/core
|
||||||
rm -rf ${pythondir}/core
|
rm -f $(addprefix $(DESTDIR)/$(datadir)/man/man1/, $(MAN_FILES))
|
||||||
rmdir -p $(coreexservicesdir) || true
|
rm -f $(addprefix $(DESTDIR)/$(bindir)/,$(SCRIPT_FILES))
|
||||||
rmdir -p $(coreexnetnsdir) || true
|
rm -rf $(DESTDIR)/$(pythondir)/core-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg-info
|
||||||
rmdir -p $(coreexmyservicesdir) || true
|
rm -rf $(DESTDIR)/$(pythondir)/core
|
||||||
rmdir -p $(coreexdir) || true
|
|
||||||
rmdir -p $(coreconfdir) || true
|
|
||||||
rmdir -p $(LOGROTATE_DIR) || true
|
|
||||||
|
|
||||||
# Python package cleanup
|
# Python package cleanup
|
||||||
clean-local:
|
clean-local:
|
||||||
-rm -rf build
|
-rm -rf build
|
||||||
|
|
||||||
# Python RPM package
|
|
||||||
rpm:
|
|
||||||
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) bdist_rpm
|
|
||||||
|
|
||||||
# because we include entire directories with EXTRA_DIST, we need to clean up
|
# because we include entire directories with EXTRA_DIST, we need to clean up
|
||||||
# the source control files
|
# the source control files
|
||||||
dist-hook:
|
dist-hook:
|
||||||
rm -rf `find $(distdir)/ -name .svn` `find $(distdir)/ -name '*.pyc'`
|
rm -rf `find $(distdir)/ -name '*.pyc'`
|
||||||
|
|
||||||
DISTCLEANFILES = Makefile.in core/*.pyc MANIFEST
|
DISTCLEANFILES = Makefile.in core/*.pyc MANIFEST
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,16 @@
|
||||||
# Constants created by autoconf ./configure script
|
COREDPY_VERSION = "@PACKAGE_VERSION@"
|
||||||
COREDPY_VERSION = "@COREDPY_VERSION@"
|
|
||||||
CORE_STATE_DIR = "@CORE_STATE_DIR@"
|
CORE_STATE_DIR = "@CORE_STATE_DIR@"
|
||||||
CORE_CONF_DIR = "@CORE_CONF_DIR@"
|
CORE_CONF_DIR = "@CORE_CONF_DIR@"
|
||||||
CORE_DATA_DIR = "@CORE_DATA_DIR@"
|
CORE_DATA_DIR = "@CORE_DATA_DIR@"
|
||||||
CORE_LIB_DIR = "@CORE_LIB_DIR@"
|
CORE_LIB_DIR = "@CORE_LIB_DIR@"
|
||||||
CORE_SBIN_DIR = "@SBINDIR@"
|
|
||||||
CORE_BIN_DIR = "@BINDIR@"
|
|
||||||
|
|
||||||
|
VNODED_BIN = "@bindir@/vnoded"
|
||||||
|
VCMD_BIN = "@bindir@/vcmd"
|
||||||
BRCTL_BIN = "@brctl_path@/brctl"
|
BRCTL_BIN = "@brctl_path@/brctl"
|
||||||
SYSCTL_BIN = "@sysctl_path@/sysctl"
|
SYSCTL_BIN = "@sysctl_path@/sysctl"
|
||||||
IP_BIN = "@ip_path@/ip"
|
IP_BIN = "@ip_path@/ip"
|
||||||
TC_BIN = "@tc_path@/tc"
|
TC_BIN = "@tc_path@/tc"
|
||||||
EBTABLES_BIN = "@ebtables_path@/ebtables"
|
EBTABLES_BIN = "@ebtables_path@/ebtables"
|
||||||
IFCONFIG_BIN = "@ifconfig_path@/ifconfig"
|
|
||||||
NGCTL_BIN = "@ngctl_path@/ngctl"
|
|
||||||
VIMAGE_BIN = "@vimage_path@/vimage"
|
|
||||||
QUAGGA_STATE_DIR = "@CORE_STATE_DIR@/run/quagga"
|
QUAGGA_STATE_DIR = "@CORE_STATE_DIR@/run/quagga"
|
||||||
MOUNT_BIN = "@mount_path@/mount"
|
MOUNT_BIN = "@mount_path@/mount"
|
||||||
UMOUNT_BIN = "@umount_path@/umount"
|
UMOUNT_BIN = "@umount_path@/umount"
|
||||||
|
|
|
@ -86,7 +86,7 @@ class SimpleLxcNode(PyCoreNode):
|
||||||
|
|
||||||
# create a new namespace for this node using vnoded
|
# create a new namespace for this node using vnoded
|
||||||
vnoded = [
|
vnoded = [
|
||||||
"%s/vnoded" % constants.CORE_BIN_DIR,
|
constants.VNODED_BIN,
|
||||||
"-v",
|
"-v",
|
||||||
"-c", self.ctrlchnlname,
|
"-c", self.ctrlchnlname,
|
||||||
"-l", self.ctrlchnlname + ".log",
|
"-l", self.ctrlchnlname + ".log",
|
||||||
|
|
|
@ -14,8 +14,6 @@ from core import constants
|
||||||
from core import logger
|
from core import logger
|
||||||
from core.misc import utils
|
from core.misc import utils
|
||||||
|
|
||||||
VCMD = os.path.join(constants.CORE_BIN_DIR, "vcmd")
|
|
||||||
|
|
||||||
|
|
||||||
class VnodeClient(object):
|
class VnodeClient(object):
|
||||||
"""
|
"""
|
||||||
|
@ -134,7 +132,7 @@ class VnodeClient(object):
|
||||||
:rtype: int
|
:rtype: int
|
||||||
"""
|
"""
|
||||||
args = utils.split_args(args)
|
args = utils.split_args(args)
|
||||||
return os.spawnlp(os.P_WAIT, VCMD, VCMD, "-c", self.ctrlchnlname, "--", *args)
|
return os.spawnlp(os.P_WAIT, constants.VCMD_BIN, constants.VCMD_BIN, "-c", self.ctrlchnlname, "--", *args)
|
||||||
|
|
||||||
def redircmd(self, infd, outfd, errfd, args, wait=True):
|
def redircmd(self, infd, outfd, errfd, args, wait=True):
|
||||||
"""
|
"""
|
||||||
|
@ -171,7 +169,7 @@ class VnodeClient(object):
|
||||||
:return: terminal command result
|
:return: terminal command result
|
||||||
:rtype: int
|
:rtype: int
|
||||||
"""
|
"""
|
||||||
args = ("xterm", "-ut", "-title", self.name, "-e", VCMD, "-c", self.ctrlchnlname, "--", sh)
|
args = ("xterm", "-ut", "-title", self.name, "-e", constants.VCMD_BIN, "-c", self.ctrlchnlname, "--", sh)
|
||||||
if "SUDO_USER" in os.environ:
|
if "SUDO_USER" in os.environ:
|
||||||
args = ("su", "-s", "/bin/sh", "-c",
|
args = ("su", "-s", "/bin/sh", "-c",
|
||||||
"exec " + " ".join(map(lambda x: "'%s'" % x, args)),
|
"exec " + " ".join(map(lambda x: "'%s'" % x, args)),
|
||||||
|
@ -185,7 +183,7 @@ class VnodeClient(object):
|
||||||
:param str sh: shell to execute command in
|
:param str sh: shell to execute command in
|
||||||
:return: str
|
:return: str
|
||||||
"""
|
"""
|
||||||
return "%s -c %s -- %s" % (VCMD, self.ctrlchnlname, sh)
|
return "%s -c %s -- %s" % (constants.VCMD_BIN, self.ctrlchnlname, sh)
|
||||||
|
|
||||||
def shcmd(self, cmd, sh="/bin/sh"):
|
def shcmd(self, cmd, sh="/bin/sh"):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -49,9 +49,9 @@ copyright = u'2017, core-dev'
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '@CORE_VERSION@'
|
version = '@PACKAGE_VERSION@'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '@CORE_VERSION@'
|
release = '@PACKAGE_VERSION@'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|
|
@ -4,13 +4,13 @@ Defines how CORE will be built for installation.
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
from distutils.command.install import install
|
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import find_packages
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
_CORE_DIR = "/etc/core"
|
_CORE_DIR = "/etc/core"
|
||||||
_MAN_DIR = "/usr/local/share/man/man1"
|
_MAN_DIR = "share/man/man1"
|
||||||
_SHARE_DIR = "/usr/local/share/core"
|
_EXAMPLES_DIR = "share/core"
|
||||||
_SYSV = "/etc/init.d"
|
_SYSV = "/etc/init.d"
|
||||||
_SYSTEMD = "/etc/systemd/system"
|
_SYSTEMD = "/etc/systemd/system"
|
||||||
|
|
||||||
|
@ -30,31 +30,6 @@ def glob_files(glob_path):
|
||||||
return glob.glob(glob_path)
|
return glob.glob(glob_path)
|
||||||
|
|
||||||
|
|
||||||
class CustomInstall(install):
|
|
||||||
user_options = install.user_options + [
|
|
||||||
("service=", None, "determine which service file to include")
|
|
||||||
]
|
|
||||||
|
|
||||||
def initialize_options(self):
|
|
||||||
install.initialize_options(self)
|
|
||||||
self.service = "sysv"
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
install.finalize_options(self)
|
|
||||||
assert self.service in ("sysv", "systemd"), "must be sysv or systemd"
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.service == "sysv":
|
|
||||||
self.distribution.data_files.append((
|
|
||||||
_SYSV, ["../scripts/core-daemon"]
|
|
||||||
))
|
|
||||||
else:
|
|
||||||
self.distribution.data_files.append((
|
|
||||||
_SYSTEMD, ["../scripts/core-daemon.service"]
|
|
||||||
))
|
|
||||||
install.run(self)
|
|
||||||
|
|
||||||
|
|
||||||
data_files = [
|
data_files = [
|
||||||
(_CORE_DIR, [
|
(_CORE_DIR, [
|
||||||
"data/core.conf",
|
"data/core.conf",
|
||||||
|
@ -62,7 +37,7 @@ data_files = [
|
||||||
]),
|
]),
|
||||||
(_MAN_DIR, glob_files("../doc/man/**.1")),
|
(_MAN_DIR, glob_files("../doc/man/**.1")),
|
||||||
]
|
]
|
||||||
data_files.extend(recursive_files(_SHARE_DIR, "examples"))
|
data_files.extend(recursive_files(_EXAMPLES_DIR, "examples"))
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="core",
|
name="core",
|
||||||
|
@ -90,7 +65,4 @@ setup(
|
||||||
author_email="core-dev@nrl.navy.mil",
|
author_email="core-dev@nrl.navy.mil",
|
||||||
license="BSD",
|
license="BSD",
|
||||||
long_description="Python scripts and modules for building virtual emulated networks.",
|
long_description="Python scripts and modules for building virtual emulated networks.",
|
||||||
cmdclass={
|
|
||||||
"install": CustomInstall
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -49,9 +49,9 @@ copyright = u'2017, core-dev'
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '@CORE_VERSION@'
|
version = '@PACKAGE_VERSION@'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '@CORE_VERSION@'
|
release = '@PACKAGE_VERSION@'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|
|
@ -22,10 +22,10 @@ generate-mans:
|
||||||
$(HELP2MAN) --no-info --source CORE $(top_srcdir)/netns/vnoded -o vnoded.1.new
|
$(HELP2MAN) --no-info --source CORE $(top_srcdir)/netns/vnoded -o vnoded.1.new
|
||||||
$(HELP2MAN) --no-info --source CORE $(top_srcdir)/netns/vcmd -o vcmd.1.new
|
$(HELP2MAN) --no-info --source CORE $(top_srcdir)/netns/vcmd -o vcmd.1.new
|
||||||
$(HELP2MAN) --no-info --source CORE $(top_srcdir)/netns/netns -o netns.1.new
|
$(HELP2MAN) --no-info --source CORE $(top_srcdir)/netns/netns -o netns.1.new
|
||||||
$(HELP2MAN) --version-string=$(CORE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/core-daemon -o core-daemon.1.new
|
$(HELP2MAN) --version-string=$(PACKAGE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/core-daemon -o core-daemon.1.new
|
||||||
$(HELP2MAN) --version-string=$(CORE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/coresendmsg -o coresendmsg.1.new
|
$(HELP2MAN) --version-string=$(PACKAGE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/coresendmsg -o coresendmsg.1.new
|
||||||
$(HELP2MAN) --version-string=$(CORE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/core-cleanup -o core-cleanup.1.new
|
$(HELP2MAN) --version-string=$(PACKAGE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/core-cleanup -o core-cleanup.1.new
|
||||||
$(HELP2MAN) --version-string=$(CORE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/core-manage -o core-manage.1.new
|
$(HELP2MAN) --version-string=$(PACKAGE_VERSION) --no-info --source CORE $(top_srcdir)/daemon/sbin/core-manage -o core-manage.1.new
|
||||||
|
|
||||||
.PHONY: diff
|
.PHONY: diff
|
||||||
diff:
|
diff:
|
||||||
|
|
|
@ -10,61 +10,26 @@
|
||||||
|
|
||||||
SUBDIRS = icons
|
SUBDIRS = icons
|
||||||
|
|
||||||
TCL_FILES = annotations.tcl api.tcl canvas.tcl cfgparse.tcl \
|
TCL_FILES := $(wildcard *.tcl)
|
||||||
core.tcl debug.tcl editor.tcl exec.tcl \
|
ADDONS_FILES := $(wildcard addons/*)
|
||||||
filemgmt.tcl gpgui.tcl \
|
CONFIG_FILES := $(wildcard configs/*)
|
||||||
graph_partitioning.tcl help.tcl \
|
|
||||||
initgui.tcl ipv4.tcl ipv6.tcl \
|
|
||||||
linkcfg.tcl mobility.tcl nodecfg.tcl \
|
|
||||||
nodes.tcl services.tcl ns2imunes.tcl plugins.tcl \
|
|
||||||
tooltips.tcl topogen.tcl traffic.tcl util.tcl \
|
|
||||||
version.tcl widget.tcl wlan.tcl wlanscript.tcl \
|
|
||||||
exceptions.tcl
|
|
||||||
|
|
||||||
ADDONS_FILES = addons/ipsecservice.tcl
|
|
||||||
|
|
||||||
CONFIG_FILES = configs/sample1.imn configs/sample1.scen \
|
|
||||||
configs/sample1-bg.gif configs/sample2-ssh.imn \
|
|
||||||
configs/sample3-bgp.imn configs/sample4-nrlsmf.imn \
|
|
||||||
configs/sample4.scen configs/sample4-bg.jpg \
|
|
||||||
configs/sample5-mgen.imn configs/sample6-emane-rfpipe.imn \
|
|
||||||
configs/sample7-emane-ieee80211abg.imn \
|
|
||||||
configs/sample8-ipsec-service.imn \
|
|
||||||
configs/sample9-vpn.imn \
|
|
||||||
configs/sample10-kitchen-sink.imn
|
|
||||||
|
|
||||||
#
|
|
||||||
# CORE GUI script (/usr/local/bin/core-gui)
|
# CORE GUI script (/usr/local/bin/core-gui)
|
||||||
#
|
|
||||||
dist_bin_SCRIPTS = core-gui
|
dist_bin_SCRIPTS = core-gui
|
||||||
|
|
||||||
#
|
|
||||||
# Tcl/Tk scripts (/usr/local/lib/core)
|
# Tcl/Tk scripts (/usr/local/lib/core)
|
||||||
#
|
|
||||||
coredir = $(CORE_LIB_DIR)
|
coredir = $(CORE_LIB_DIR)
|
||||||
dist_core_DATA = $(TCL_FILES)
|
dist_core_DATA = $(TCL_FILES)
|
||||||
dist_core_SCRIPTS = $(OTHER_FILES)
|
dist_core_SCRIPTS = $(OTHER_FILES)
|
||||||
|
|
||||||
#
|
|
||||||
# Addon files
|
# Addon files
|
||||||
#
|
|
||||||
coreaddonsdir = $(coredir)/addons
|
coreaddonsdir = $(coredir)/addons
|
||||||
dist_coreaddons_DATA = $(ADDONS_FILES)
|
dist_coreaddons_DATA = $(ADDONS_FILES)
|
||||||
|
|
||||||
#
|
|
||||||
# Sample configs (/usr/local/share/core/examples/configs)
|
# Sample configs (/usr/local/share/core/examples/configs)
|
||||||
#
|
|
||||||
coreconfigsdir = $(datadir)/core/examples/configs
|
coreconfigsdir = $(datadir)/core/examples/configs
|
||||||
dist_coreconfigs_DATA = $(CONFIG_FILES)
|
dist_coreconfigs_DATA = $(CONFIG_FILES)
|
||||||
|
|
||||||
dist-hook:
|
|
||||||
rm -rf $(distdir)/addons/.svn
|
|
||||||
|
|
||||||
uninstall-hook:
|
|
||||||
rmdir -p $(coreconfigsdir) || true
|
|
||||||
rmdir -p $(coreaddonsdir) || true
|
|
||||||
rmdir -p $(coredir) || true
|
|
||||||
|
|
||||||
# extra cruft to remove
|
# extra cruft to remove
|
||||||
DISTCLEANFILES = Makefile.in
|
DISTCLEANFILES = Makefile.in
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ case $1 in
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-v | --version)
|
-v | --version)
|
||||||
exec echo "`basename $0` version @CORE_VERSION@ (@CORE_VERSION_DATE@)"
|
exec echo "`basename $0` version @PACKAGE_VERSION@ (@PACKAGE_DATE@)"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -63,7 +63,7 @@ SHELL=/bin/sh
|
||||||
export SHELL
|
export SHELL
|
||||||
|
|
||||||
export LIBDIR="@CORE_LIB_DIR@"
|
export LIBDIR="@CORE_LIB_DIR@"
|
||||||
export SBINDIR="@SBINDIR@"
|
export SBINDIR="@sbindir@"
|
||||||
# eval is used here to expand "~" to user's home dir
|
# eval is used here to expand "~" to user's home dir
|
||||||
if [ x$CONFDIR = x ]; then export CONFDIR=`eval "echo @CORE_GUI_CONF_DIR@"` ; fi
|
if [ x$CONFDIR = x ]; then export CONFDIR=`eval "echo @CORE_GUI_CONF_DIR@"` ; fi
|
||||||
export CORE_STATE_DIR="@CORE_STATE_DIR@"
|
export CORE_STATE_DIR="@CORE_STATE_DIR@"
|
||||||
|
|
|
@ -5,79 +5,17 @@
|
||||||
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
|
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
TINY_ICONS = tiny/button.play.gif \
|
TINY_ICONS := $(wildcard tiny/*)
|
||||||
tiny/select.gif tiny/marker.gif \
|
NORM_ICONS := $(wildcard normal/*)
|
||||||
tiny/rj45.gif tiny/text.gif \
|
SVG_ICONS := $(wildcard svg/*)
|
||||||
tiny/edit-delete.gif tiny/stop.gif \
|
|
||||||
tiny/blank.gif tiny/mobility.gif \
|
|
||||||
tiny/script_play.gif tiny/arrow.gif \
|
|
||||||
tiny/lanswitch.gif tiny/script_pause.gif \
|
|
||||||
tiny/pc.gif tiny/rectangle.gif \
|
|
||||||
tiny/observe.gif tiny/document-new.gif \
|
|
||||||
tiny/document-save.gif \
|
|
||||||
tiny/view-refresh.gif tiny/moboff.gif \
|
|
||||||
tiny/document-properties.gif tiny/arrow.up.gif \
|
|
||||||
tiny/host.gif tiny/hub.gif \
|
|
||||||
tiny/twonode.gif tiny/router.gif \
|
|
||||||
tiny/eraser.gif \
|
|
||||||
tiny/stock_connect.gif tiny/stock_disconnect.gif \
|
|
||||||
tiny/ping.gif tiny/link.gif \
|
|
||||||
tiny/start.gif \
|
|
||||||
tiny/trace.gif tiny/button.stop.gif \
|
|
||||||
tiny/arrow.down.gif tiny/oval.gif \
|
|
||||||
tiny/wlan.gif tiny/delete.gif \
|
|
||||||
tiny/run.gif tiny/tunnel.gif \
|
|
||||||
tiny/script_stop.gif \
|
|
||||||
tiny/router_black.gif tiny/router_green.gif \
|
|
||||||
tiny/router_red.gif tiny/router_yellow.gif \
|
|
||||||
tiny/router_purple.gif \
|
|
||||||
tiny/ap.gif tiny/mdr.gif \
|
|
||||||
tiny/folder.gif \
|
|
||||||
tiny/cel.gif \
|
|
||||||
tiny/fileopen.gif \
|
|
||||||
tiny/plot.gif
|
|
||||||
|
|
||||||
NORM_ICONS = normal/gps-diagram.xbm \
|
|
||||||
normal/router_black.gif normal/host.gif \
|
|
||||||
normal/hub.gif \
|
|
||||||
normal/router.gif \
|
|
||||||
normal/rj45.gif normal/antenna.gif \
|
|
||||||
normal/text.gif \
|
|
||||||
normal/lanswitch.gif normal/core-icon.png \
|
|
||||||
normal/core-icon.xbm normal/oval.gif \
|
|
||||||
normal/wlan.gif normal/pc.gif \
|
|
||||||
normal/tunnel.gif normal/core-logo-275x75.gif \
|
|
||||||
normal/router_red.gif normal/router_green.gif \
|
|
||||||
normal/simple.xbm \
|
|
||||||
normal/document-properties.gif \
|
|
||||||
normal/thumb-unknown.gif \
|
|
||||||
normal/router_purple.gif normal/router_yellow.gif \
|
|
||||||
normal/ap.gif normal/mdr.gif
|
|
||||||
|
|
||||||
SVG_ICONS = svg/ap.svg \
|
|
||||||
svg/cel.svg \
|
|
||||||
svg/hub.svg \
|
|
||||||
svg/lanswitch.svg \
|
|
||||||
svg/mdr.svg \
|
|
||||||
svg/otr.svg \
|
|
||||||
svg/rj45.svg \
|
|
||||||
svg/router_black.svg \
|
|
||||||
svg/router_green.svg \
|
|
||||||
svg/router_purple.svg \
|
|
||||||
svg/router_red.svg \
|
|
||||||
svg/router.svg \
|
|
||||||
svg/router_yellow.svg \
|
|
||||||
svg/start.svg \
|
|
||||||
svg/tunnel.svg \
|
|
||||||
svg/vlan.svg
|
|
||||||
|
|
||||||
#
|
|
||||||
# Icon files (/usr/local/share/core/icons/[tiny,normal,svg])
|
# Icon files (/usr/local/share/core/icons/[tiny,normal,svg])
|
||||||
#
|
|
||||||
coreiconnormaldir = $(CORE_DATA_DIR)/icons/normal
|
coreiconnormaldir = $(CORE_DATA_DIR)/icons/normal
|
||||||
dist_coreiconnormal_DATA = $(NORM_ICONS)
|
dist_coreiconnormal_DATA = $(NORM_ICONS)
|
||||||
|
|
||||||
coreicontinydir = $(CORE_DATA_DIR)/icons/tiny
|
coreicontinydir = $(CORE_DATA_DIR)/icons/tiny
|
||||||
dist_coreicontiny_DATA = $(TINY_ICONS)
|
dist_coreicontiny_DATA = $(TINY_ICONS)
|
||||||
|
|
||||||
coreiconsvgdir = $(CORE_DATA_DIR)/icons/svg
|
coreiconsvgdir = $(CORE_DATA_DIR)/icons/svg
|
||||||
dist_coreiconsvg_DATA = $(SVG_ICONS)
|
dist_coreiconsvg_DATA = $(SVG_ICONS)
|
||||||
|
|
||||||
|
@ -87,12 +25,5 @@ dist_iconpixmap_DATA = core-gui.xpm
|
||||||
icondesktopdir = $(datarootdir)/applications
|
icondesktopdir = $(datarootdir)/applications
|
||||||
dist_icondesktop_DATA = core-gui.desktop
|
dist_icondesktop_DATA = core-gui.desktop
|
||||||
|
|
||||||
uninstall-hook:
|
|
||||||
rmdir -p $(icondesktopdir) || true
|
|
||||||
rmdir -p $(iconpixmapdir) || true
|
|
||||||
rmdir -p $(coreiconsvgdir) || true
|
|
||||||
rmdir -p $(coreicontinydir) || true
|
|
||||||
rmdir -p $(coreiconnormaldir) || true
|
|
||||||
|
|
||||||
# extra cruft to remove
|
# extra cruft to remove
|
||||||
DISTCLEANFILES = Makefile.in
|
DISTCLEANFILES = Makefile.in
|
||||||
|
|
0
gui/icons/normal/OVS.gif
Executable file → Normal file
0
gui/icons/normal/OVS.gif
Executable file → Normal file
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 744 B |
0
gui/icons/svg/OVS.svg
Executable file → Normal file
0
gui/icons/svg/OVS.svg
Executable file → Normal file
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
0
gui/icons/tiny/OVS.gif
Executable file → Normal file
0
gui/icons/tiny/OVS.gif
Executable file → Normal file
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 744 B |
|
@ -6,5 +6,5 @@
|
||||||
#
|
#
|
||||||
# define the version number and release date here
|
# define the version number and release date here
|
||||||
#
|
#
|
||||||
set CORE_VERSION @CORE_VERSION@
|
set CORE_VERSION @PACKAGE_VERSION@
|
||||||
set CORE_VERSION_DATE @CORE_VERSION_DATE@
|
set CORE_VERSION_DATE @PACKAGE_DATE@
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
include *.h
|
include *.h
|
||||||
include sbin/*
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
AM_CFLAGS = -Wall -fno-strict-aliasing -O3 -g @libev_CFLAGS@
|
AM_CFLAGS = -Wall -fno-strict-aliasing -O3 -g @libev_CFLAGS@
|
||||||
SETUPPY = setup.py
|
SETUPPY = setup.py
|
||||||
SETUPPYFLAGS = -v
|
SETUPPYFLAGS = -v
|
||||||
# -DDEBUG
|
|
||||||
|
|
||||||
SRC_COMMON = vnode_msg.c vnode_cmd.c vnode_chnl.c vnode_io.c \
|
SRC_COMMON = vnode_msg.c vnode_cmd.c vnode_chnl.c vnode_io.c \
|
||||||
vnode_msg.h vnode_cmd.h vnode_chnl.h vnode_io.h \
|
vnode_msg.h vnode_cmd.h vnode_chnl.h vnode_io.h \
|
||||||
|
@ -21,12 +20,12 @@ SRC_VCMD = vcmd_main.c vnode_client.c \
|
||||||
vnode_client.h
|
vnode_client.h
|
||||||
SRC_NETNS = netns_main.c netns.c netns.h
|
SRC_NETNS = netns_main.c netns.c netns.h
|
||||||
|
|
||||||
sbin_PROGRAMS = vnoded vcmd netns
|
noinst_PROGRAMS = vnoded vcmd netns
|
||||||
vnoded_LDADD = @libev_LIBS@
|
vnoded_LDADD = @libev_LIBS@
|
||||||
vnoded_SOURCES = ${SRC_COMMON} ${SRC_VNODED}
|
vnoded_SOURCES = $(SRC_COMMON) $(SRC_VNODED)
|
||||||
vcmd_LDADD = @libev_LIBS@
|
vcmd_LDADD = @libev_LIBS@
|
||||||
vcmd_SOURCES = ${SRC_COMMON} ${SRC_VCMD}
|
vcmd_SOURCES = $(SRC_COMMON) $(SRC_VCMD)
|
||||||
netns_SOURCES = ${SRC_NETNS}
|
netns_SOURCES = $(SRC_NETNS)
|
||||||
|
|
||||||
# this triggers automake to run setup.py for building the Python libraries
|
# this triggers automake to run setup.py for building the Python libraries
|
||||||
# actual library names are netns.so and vcmd.so
|
# actual library names are netns.so and vcmd.so
|
||||||
|
@ -34,23 +33,23 @@ netns_SOURCES = ${SRC_NETNS}
|
||||||
noinst_LIBRARIES = libnetns.a
|
noinst_LIBRARIES = libnetns.a
|
||||||
libnetns_a_SOURCES = netnsmodule.c vcmdmodule.c
|
libnetns_a_SOURCES = netnsmodule.c vcmdmodule.c
|
||||||
libnetns.a:
|
libnetns.a:
|
||||||
SBINDIR=@SBINDIR@ LDFLAGS="$(LDFLAGS) @libev_LIBS@" CFLAGS="$(CFLAGS) @libev_CFLAGS@" $(PYTHON) setup.py build_ext
|
LDFLAGS="$(LDFLAGS) @libev_LIBS@" CFLAGS="$(CFLAGS) @libev_CFLAGS@" $(PYTHON) setup.py build_ext
|
||||||
|
|
||||||
# Python libraries install
|
# Python libraries install
|
||||||
install-exec-local:
|
install-exec-local:
|
||||||
$(MKDIR_P) ${DESTDIR}/${pythondir}
|
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \
|
||||||
$(MKDIR_P) ${DESTDIR}/${pyexecdir}
|
--root=/$(DESTDIR) \
|
||||||
SBINDIR=${DESTDIR}/@SBINDIR@ PYTHONPATH=${DESTDIR}/${pythondir} $(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \
|
--prefix=$(prefix) \
|
||||||
--prefix=${DESTDIR}/${pyprefix} \
|
--install-lib=$(pythondir) \
|
||||||
--install-purelib=${DESTDIR}/${pythondir} \
|
--single-version-externally-managed \
|
||||||
--install-platlib=${DESTDIR}/${pyexecdir} \
|
|
||||||
--no-compile
|
--no-compile
|
||||||
|
|
||||||
# Python libraries uninstall
|
# Python libraries uninstall
|
||||||
uninstall-hook:
|
uninstall-hook:
|
||||||
rm -f ${pyexecdir}/core_python_netns-1.0-py${PYTHON_VERSION}.egg-info
|
rm -rf core_netns.egg-info
|
||||||
rm -f ${pyexecdir}/netns.so
|
rm -rf $(DESTDIR)/$(pythondir)/core_netns-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg-info
|
||||||
rm -f ${pyexecdir}/vcmd.so
|
rm -f $(DESTDIR)/$(bindir)/{vnoded,vcmd,netns}
|
||||||
|
rm -f $(DESTDIR)/$(pythondir)/{netns.so,vcmd.so}
|
||||||
|
|
||||||
# Python libraries cleanup
|
# Python libraries cleanup
|
||||||
clean-local: clean-local-check
|
clean-local: clean-local-check
|
||||||
|
@ -58,15 +57,8 @@ clean-local: clean-local-check
|
||||||
clean-local-check:
|
clean-local-check:
|
||||||
-rm -rf build
|
-rm -rf build
|
||||||
|
|
||||||
rpmbuild.sh:
|
|
||||||
echo SBINDIR=@SBINDIR@ LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS) @libev_CFLAGS@" $(PYTHON) setup.py build > rpmbuild.sh
|
|
||||||
chmod a+x rpmbuild.sh
|
|
||||||
|
|
||||||
rpm: rpmbuild.sh
|
|
||||||
$(PYTHON) setup.py bdist_rpm --build-script=rpmbuild.sh --requires="libev" --build-requires="libev-devel"
|
|
||||||
|
|
||||||
# extra cruft to remove
|
# extra cruft to remove
|
||||||
DISTCLEANFILES = Makefile.in rpmbuild.sh MANIFEST
|
DISTCLEANFILES = Makefile.in MANIFEST
|
||||||
|
|
||||||
# include source files for Python libraries with distribution tarball
|
# include source files for Python libraries with distribution tarball
|
||||||
EXTRA_DIST = setup.py MANIFEST.in
|
EXTRA_DIST = setup.py MANIFEST.in
|
||||||
|
|
|
@ -3,25 +3,8 @@ Defines how CORE netns will be build for installation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from setuptools import setup, Extension
|
from setuptools import setup, Extension
|
||||||
from distutils.command.install import install
|
|
||||||
|
|
||||||
|
|
||||||
class CustomInstall(install):
|
|
||||||
user_options = install.user_options + [
|
|
||||||
("service=", None, "determine which service file to include")
|
|
||||||
]
|
|
||||||
|
|
||||||
def initialize_options(self):
|
|
||||||
install.initialize_options(self)
|
|
||||||
self.service = "sysv"
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
install.finalize_options(self)
|
|
||||||
assert self.service in ("sysv", "systemd"), "must be sysv or systemd"
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
install.run(self)
|
|
||||||
|
|
||||||
netns = Extension(
|
netns = Extension(
|
||||||
"netns",
|
"netns",
|
||||||
sources=[
|
sources=[
|
||||||
|
@ -58,7 +41,4 @@ setup(
|
||||||
author_email="core-dev@nrl.navy.mil",
|
author_email="core-dev@nrl.navy.mil",
|
||||||
license="BSD",
|
license="BSD",
|
||||||
long_description="Extension modules and utilities to support virtual nodes using Linux network namespaces",
|
long_description="Extension modules and utilities to support virtual nodes using Linux network namespaces",
|
||||||
cmdclass={
|
|
||||||
"install": CustomInstall
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
#ifndef _VERSION_H_
|
#ifndef _VERSION_H_
|
||||||
#define _VERSION_H_
|
#define _VERSION_H_
|
||||||
|
|
||||||
#define CORE_VERSION "@CORE_VERSION@"
|
#define CORE_VERSION "@PACKAGE_VERSION@"
|
||||||
|
|
||||||
#endif /* _VERSION_H_ */
|
#endif /* _VERSION_H_ */
|
||||||
|
|
|
@ -10,14 +10,9 @@
|
||||||
SETUPPY = setup.py
|
SETUPPY = setup.py
|
||||||
SETUPPYFLAGS = -v
|
SETUPPYFLAGS = -v
|
||||||
|
|
||||||
EXAMPLE_FILES = \
|
#EXAMPLE_FILES := $(wildcard examples/*)
|
||||||
examples/ns3lte.py \
|
#coreexampledir = $(datadir)/core/examples/corens3
|
||||||
examples/ns3wifi.py \
|
#dist_coreexample_SCRIPTS = $(EXAMPLE_FILES)
|
||||||
examples/ns3wifirandomwalk.py \
|
|
||||||
examples/ns3wimax.py
|
|
||||||
|
|
||||||
coreexampledir = $(datadir)/core/examples/corens3
|
|
||||||
dist_coreexample_SCRIPTS= $(EXAMPLE_FILES)
|
|
||||||
|
|
||||||
# Python package build
|
# Python package build
|
||||||
noinst_SCRIPTS = build
|
noinst_SCRIPTS = build
|
||||||
|
@ -26,32 +21,28 @@ build:
|
||||||
|
|
||||||
# Python package install
|
# Python package install
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
$(MKDIR_P) ${DESTDIR}/${pythondir}
|
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \
|
||||||
$(MKDIR_P) ${DESTDIR}/${pyexecdir}
|
--root=/$(DESTDIR) \
|
||||||
PYTHONPATH=${DESTDIR}/${pythondir} $(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \
|
--prefix=$(prefix) \
|
||||||
--prefix=${DESTDIR}/${pyprefix} \
|
--install-lib=$(pythondir) \
|
||||||
--install-purelib=${DESTDIR}/${pythondir} \
|
--single-version-externally-managed \
|
||||||
--install-platlib=${DESTDIR}/${pyexecdir} \
|
|
||||||
--no-compile
|
--no-compile
|
||||||
|
|
||||||
# Python package uninstall
|
# Python package uninstall
|
||||||
uninstall-hook:
|
uninstall-hook:
|
||||||
rm -f ${pythondir}/corens3_python-${COREDPY_VERSION}-py${PYTHON_VERSION}.egg-info
|
rm -rf core_ns3.egg-info
|
||||||
rm -rf ${pythondir}/corens3
|
rm -rf $(DESTDIR)/$(pythondir)/core_ns3-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg-info
|
||||||
rmdir -p $(coreexampledir) || true
|
rm -rf $(DESTDIR)/$(pythondir)/corens3
|
||||||
|
rm -rf $(DESTDIR)/$(datadir)/corens3
|
||||||
|
|
||||||
# Python package cleanup
|
# Python package cleanup
|
||||||
clean-local:
|
clean-local:
|
||||||
-rm -rf build
|
-rm -rf build
|
||||||
|
|
||||||
# Python RPM package
|
|
||||||
rpm:
|
|
||||||
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) bdist_rpm
|
|
||||||
|
|
||||||
# because we include entire directories with EXTRA_DIST, we need to clean up
|
# because we include entire directories with EXTRA_DIST, we need to clean up
|
||||||
# the source control files
|
# the source control files
|
||||||
dist-hook:
|
dist-hook:
|
||||||
rm -rf `find $(distdir)/ -name .svn` `find $(distdir)/ -name '*.pyc'`
|
rm -rf `find $(distdir)/ -name '*.pyc'`
|
||||||
|
|
||||||
DISTCLEANFILES = Makefile.in *.pyc corens3/*.pyc MANIFEST
|
DISTCLEANFILES = Makefile.in *.pyc corens3/*.pyc MANIFEST
|
||||||
|
|
||||||
|
|
1
ns3/corens3/.gitignore
vendored
1
ns3/corens3/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
constants.py
|
|
|
@ -1,18 +0,0 @@
|
||||||
# Constants created by autoconf ./configure script
|
|
||||||
COREDPY_VERSION = "@COREDPY_VERSION@"
|
|
||||||
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@"
|
|
||||||
|
|
||||||
BRCTL_BIN = "@brctl_path@/brctl"
|
|
||||||
IP_BIN = "@ip_path@/ip"
|
|
||||||
TC_BIN = "@tc_path@/tc"
|
|
||||||
EBTABLES_BIN = "@ebtables_path@/ebtables"
|
|
||||||
IFCONFIG_BIN = "@ifconfig_path@/ifconfig"
|
|
||||||
NGCTL_BIN = "@ngctl_path@/ngctl"
|
|
||||||
VIMAGE_BIN = "@vimage_path@/vimage"
|
|
||||||
QUAGGA_STATE_DIR = "@CORE_STATE_DIR@/run/quagga"
|
|
||||||
MOUNT_BIN = "@mount_path@/mount"
|
|
||||||
UMOUNT_BIN = "@umount_path@/umount"
|
|
|
@ -1,11 +1,16 @@
|
||||||
|
import glob
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
_EXAMPLES_DIR = "share/corens3/examples"
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="core-ns3",
|
name="core-ns3",
|
||||||
version="5.1",
|
version="5.1",
|
||||||
packages=[
|
packages=[
|
||||||
"corens3",
|
"corens3",
|
||||||
],
|
],
|
||||||
|
data_files=[(_EXAMPLES_DIR, glob.glob("examples/*"))],
|
||||||
description="Python ns-3 components of CORE",
|
description="Python ns-3 components of CORE",
|
||||||
url="http://www.nrl.navy.mil/itd/ncs/products/core",
|
url="http://www.nrl.navy.mil/itd/ncs/products/core",
|
||||||
author="Boeing Research & Technology",
|
author="Boeing Research & Technology",
|
||||||
|
|
|
@ -5,7 +5,7 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/var/run/core-daemon.pid
|
PIDFile=/var/run/core-daemon.pid
|
||||||
ExecStart=@PYTHON@ @SBINDIR@/core-daemon -d
|
ExecStart=@PYTHON@ @bindir@/core-daemon -d
|
||||||
TasksMax=infinity
|
TasksMax=infinity
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -17,7 +17,7 @@ dist_hooks_SCRIPTS = perflogstart.sh perflogstop.sh sessiondatacollect.sh \
|
||||||
configuration_hook.sh datacollect_hook.sh
|
configuration_hook.sh datacollect_hook.sh
|
||||||
|
|
||||||
# Files installed to /etc/core/
|
# Files installed to /etc/core/
|
||||||
perfconfdir=$(sysconfdir)/core
|
perfconfdir=$(CORE_CONF_DIR)
|
||||||
dist_perfconf_DATA = perflogserver.conf
|
dist_perfconf_DATA = perflogserver.conf
|
||||||
|
|
||||||
uninstall-hook:
|
uninstall-hook:
|
||||||
|
|
Loading…
Reference in a new issue