diff options
author | Rob Austein <sra@hactrn.net> | 2014-04-09 01:59:19 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-04-09 01:59:19 +0000 |
commit | 7170af54acc61fca23e72fdce0cb04633515bcf2 (patch) | |
tree | ba436716de52ed9ad61cf1c71a514310a5d53a65 | |
parent | a06ed1e84bf728c322b2c38deab0fe0625b785da (diff) |
Tweak setup.py to conditionalize installation of rpki-ca scripts; move
installation targets for Python library up from ca to top Makefile.
svn path=/branches/tk685/; revision=5771
-rw-r--r-- | Makefile.in | 11 | ||||
-rw-r--r-- | ca/Makefile.in | 2 | ||||
-rw-r--r-- | setup.py | 144 |
3 files changed, 82 insertions, 75 deletions
diff --git a/Makefile.in b/Makefile.in index 7441cb19..d08cd298 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,6 +29,7 @@ RP_TARGET = @RP_TARGET@ CA_TARGET = @CA_TARGET@ SETUP_PY_INSTALL_LAYOUT = @SETUP_PY_INSTALL_LAYOUT@ +SETUP_PY_ROOT = `${PYTHON} -c 'import sys; print "--root " + sys.argv[1] if sys.argv[1] else ""' '${DESTDIR}'` POW_SO = rpki/POW/_POW.so @@ -98,12 +99,10 @@ rpki-distclean: @true rpki-install: - @false + ${PYTHON} setup.py install ${SETUP_PY_ROOT} ${SETUP_PY_INSTALL_LAYOUT} --record installed rpki-deinstall: - @false - -### + xargs rm -fv <installed VERSION: .FORCE ${PYTHON} buildtools/make-version.py @@ -135,10 +134,10 @@ setup_autoconf.py: rpki/autoconf.py echo 'CFLAGS = """${CFLAGS}"""'; \ echo 'LDFLAGS = """${LDFLAGS}"""'; \ echo 'LIBS = """${LIBS}"""'; \ + echo 'RP_TARGET = """${RP_TARGET}"""'; \ + echo 'CA_TARGET = """${CA_TARGET}"""'; \ ) > $@ -SETUP_PY_ROOT = `${PYTHON} -c 'import sys; print "--root " + sys.argv[1] if sys.argv[1] else ""' '${DESTDIR}'` - .FORCE: ${POW_SO}: .FORCE setup_autoconf.py diff --git a/ca/Makefile.in b/ca/Makefile.in index 8da54712..3d69b760 100644 --- a/ca/Makefile.in +++ b/ca/Makefile.in @@ -41,7 +41,6 @@ clean:: install:: ${CA_INSTALL_TARGETS} install-always:: all - ${PYTHON} setup.py install ${SETUP_PY_ROOT} ${SETUP_PY_INSTALL_LAYOUT} --record installed @echo @echo "== Default configuration file location is ${sysconfdir}/rpki.conf ==" @echo @@ -50,7 +49,6 @@ install-always:: all uninstall deinstall:: -${libexecdir}/rpkigui-apache-conf-gen --remove --verbose - xargs rm -fv <installed distclean:: rm -f installed @@ -1,17 +1,19 @@ # $Id$ -# -# Copyright (C) 2011-2013 Internet Systems Consortium ("ISC") +# +# Copyright (C) 2014 Dragon Research Labs ("DRL") +# Portions copyright (C) 2011--2013 Internet Systems Consortium ("ISC") # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# copyright notices and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND DRL AND ISC DISCLAIM ALL +# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DRL OR +# ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA +# OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. from distutils.core import setup, Extension @@ -34,60 +36,68 @@ except ImportError: # pylint: disable=W0622 -setup(name = "rpkitoolkit", - version = VERSION, - description = "RPKI Toolkit", - license = "BSD", - url = "http://rpki.net/", - cmdclass = {"build_scripts" : setup_extensions.build_scripts, - "install_scripts" : setup_extensions.install_scripts}, - packages = ["rpki", - "rpki.POW", - "rpki.irdb", - "rpki.gui", - "rpki.gui.app", - "rpki.gui.cacheview", - "rpki.gui.api", - "rpki.gui.routeview"], - ext_modules = [Extension("rpki.POW._POW", ["ext/POW.c"], - extra_compile_args = autoconf.CFLAGS.split(), - extra_link_args = (autoconf.LDFLAGS + " " + - autoconf.LIBS).split())], - package_data = {"rpki.gui.app" : - ["migrations/*.py", - "static/*/*", - "templates/*.html", - "templates/*/*.html", - "templatetags/*.py"], - "rpki.gui.cacheview" : - ["templates/*/*.html"]}, - scripts = [(autoconf.sbindir, - ["ca/rpkic", - "ca/rpki-confgen", - "ca/rpki-start-servers", - "ca/rpki-sql-backup", - "ca/rpki-sql-setup", - "ca/rpki-manage", - "ca/rpkigui-query-routes", - "ca/irbe_cli"]), - (autoconf.libexecdir, - ["ca/irdbd", - "ca/pubd", - "ca/rootd", - "ca/rpkid", - "ca/rpkigui-import-routes", - "ca/rpkigui-check-expired", - "ca/rpkigui-rcynic", - "ca/rpkigui-apache-conf-gen"])], - data_files = [(autoconf.sysconfdir + "/rpki", - ["ca/rpki-confgen.xml"]), - (autoconf.datarootdir + "/rpki/wsgi", - ["ca/rpki.wsgi"]), - (autoconf.datarootdir + "/rpki/media/css", - glob("rpki/gui/app/static/css/*")), - (autoconf.datarootdir + "/rpki/media/js", - glob("rpki/gui/app/static/js/*")), - (autoconf.datarootdir + "/rpki/media/img", - glob("rpki/gui/app/static/img/*")), - (autoconf.datarootdir + "/rpki/upgrade-scripts", - glob("ca/upgrade-scripts/*"))]) +setup_args = dict( + name = "rpkitoolkit", + version = VERSION, + description = "RPKI Toolkit", + license = "BSD", + url = "http://rpki.net/", + cmdclass = {"build_scripts" : setup_extensions.build_scripts, + "install_scripts" : setup_extensions.install_scripts}, + packages = ["rpki", + "rpki.POW", + "rpki.irdb", + "rpki.gui", + "rpki.gui.app", + "rpki.gui.cacheview", + "rpki.gui.api", + "rpki.gui.routeview"], + ext_modules = [Extension("rpki.POW._POW", ["ext/POW.c"], + extra_compile_args = autoconf.CFLAGS.split(), + extra_link_args = (autoconf.LDFLAGS + " " + + autoconf.LIBS).split())], + package_data = {"rpki.gui.app" : + ["migrations/*.py", + "static/*/*", + "templates/*.html", + "templates/*/*.html", + "templatetags/*.py"], + "rpki.gui.cacheview" : + ["templates/*/*.html"]}) + +# Add rp stuff here too, eventually. + +if autoconf.CA_TARGET == "ca": + setup_args.update( + scripts = [(autoconf.sbindir, + ["ca/rpkic", + "ca/rpki-confgen", + "ca/rpki-start-servers", + "ca/rpki-sql-backup", + "ca/rpki-sql-setup", + "ca/rpki-manage", + "ca/rpkigui-query-routes", + "ca/irbe_cli"]), + (autoconf.libexecdir, + ["ca/irdbd", + "ca/pubd", + "ca/rootd", + "ca/rpkid", + "ca/rpkigui-import-routes", + "ca/rpkigui-check-expired", + "ca/rpkigui-rcynic", + "ca/rpkigui-apache-conf-gen"])], + data_files = [(autoconf.sysconfdir + "/rpki", + ["ca/rpki-confgen.xml"]), + (autoconf.datarootdir + "/rpki/wsgi", + ["ca/rpki.wsgi"]), + (autoconf.datarootdir + "/rpki/media/css", + glob("rpki/gui/app/static/css/*")), + (autoconf.datarootdir + "/rpki/media/js", + glob("rpki/gui/app/static/js/*")), + (autoconf.datarootdir + "/rpki/media/img", + glob("rpki/gui/app/static/img/*")), + (autoconf.datarootdir + "/rpki/upgrade-scripts", + glob("ca/upgrade-scripts/*"))]) + +setup(**setup_args) |