updated rpm/deb files to be built for both sysv and systemd

This commit is contained in:
Blake J. Harnden 2018-01-04 14:33:25 -08:00
parent d799390c4a
commit 3da4c32825
3 changed files with 95 additions and 32 deletions

View file

@ -1,7 +1,26 @@
# Copyright (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
"""
Defines how CORE netns will be build for installation.
"""
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",
@ -38,5 +57,8 @@ setup(
author="Boeing Research & Technology",
author_email="core-dev@nrl.navy.mil",
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
}
)