aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-04-09 21:33:13 +0000
committerRob Austein <sra@hactrn.net>2014-04-09 21:33:13 +0000
commitf9102a8cbbbbea27670e8ca628d90c6689441efd (patch)
treee77e40a5ca35aa67b0b1bc12fbc487f20b4c58fa
parentcbdca1699ea9866131d8e0c9d18028d017f8e227 (diff)
Clean up source regeneration (h/ and schemas/), debug builds with
--disable-*-tools set. svn path=/branches/tk685/; revision=5775
-rw-r--r--Makefile.in65
-rw-r--r--buildtools/defstack.py5
-rwxr-xr-xconfigure4
-rw-r--r--configure.ac4
-rw-r--r--h/Makefile.in24
-rw-r--r--h/rpki/sk_manifest.h2
-rw-r--r--h/rpki/sk_roa.h2
-rw-r--r--schemas/Makefile.in69
-rw-r--r--setup.py32
9 files changed, 81 insertions, 126 deletions
diff --git a/Makefile.in b/Makefile.in
index e2b50610..f9468915 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -6,6 +6,7 @@ LIBS = @LIBS@
PYTHON = @PYTHON@
INSTALL = @INSTALL@ -m 555
+TRANG = @TRANG@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -40,6 +41,15 @@ SETUP_PY_ROOT = `${PYTHON} -c 'import sys; print "--root " + sys.argv[1] if sys.
POW_SO = rpki/POW/_POW.so
+RNGS = schemas/relaxng/left-right-schema.rng \
+ schemas/relaxng/up-down-schema.rng \
+ schemas/relaxng/publication-schema.rng \
+ schemas/relaxng/myrpki.rng \
+ schemas/relaxng/router-certificate-schema.rng
+
+SQLS = schemas/sql/rpkid.sql \
+ schemas/sql/pubd.sql
+
default: all
all: VERSION rpki/autoconf.py setup_autoconf.py
@@ -83,20 +93,26 @@ ca-deinstall: ; cd ca; ${MAKE} deinstall
noop-all noop-clean noop-test noop-distclean noop-install noop-deinstall:
@true
-rpki-prereqs:
- cd h; ${MAKE} all
- cd schemas; ${MAKE} all
-
-rpki-all: setup_autoconf.py rpki-prereqs ${POW_SO} build/stamp
+rpki-all: \
+ setup_autoconf.py \
+ ${RNGS} \
+ ${abs_top_srcdir}/h/rpki/sk_manifest.h \
+ ${abs_top_srcdir}/h/rpki/sk_roa.h \
+ ${abs_top_srcdir}/rpki/relaxng.py \
+ ${abs_top_srcdir}/rpki/sql_schemas.py \
+ ${POW_SO} \
+ build/stamp
rpki-clean:
- rm -rf build dist ${POW_SO}
+ rm -rf build dist ${POW_SO} h/rpki/*.h.tmp rpki/*.py.tmp
find . -type f -name '*.py[co]' -delete
-rpki-test: unit-tests
+rpki-test: all
+ @echo Running unit tests
+ PWD=`pwd`; for i in rpki/*.py; do echo "[$$i]"; PYTHONPATH=$$PWD ${PYTHON} $$i; done
rpki-distclean:
- rm installed
+ rm -f installed
rpki-install:
${PYTHON} setup.py install ${SETUP_PY_ROOT} ${SETUP_PY_INSTALL_LAYOUT} --record installed
@@ -147,9 +163,36 @@ build/stamp: .FORCE setup_autoconf.py
${PYTHON} setup.py build
touch $@
-unit-tests: all
- @echo Running unit tests
- PWD=`pwd`; for i in rpki/*.py; do echo "[$$i]"; PYTHONPATH=$$PWD ${PYTHON} $$i; done
+${abs_top_srcdir}/h/rpki/sk_manifest.h: ${abs_top_srcdir}/h/rpki/manifest.h
+ ${PYTHON} buildtools/defstack.py h/rpki/manifest.h >$@.tmp
+ mv $@.tmp $@
+
+${abs_top_srcdir}/h/rpki/sk_roa.h: ${abs_top_srcdir}/h/rpki/roa.h
+ ${PYTHON} buildtools/defstack.py h/rpki/roa.h >$@.tmp
+ mv $@.tmp $@
+
+${abs_top_srcdir}/rpki/relaxng.py: buildtools/make-relaxng.py ${RNGS}
+ cd schemas/relaxng; ${PYTHON} ${abs_top_srcdir}/buildtools/make-relaxng.py *.rng >$@.tmp
+ mv $@.tmp $@
+
+${abs_top_srcdir}/rpki/sql_schemas.py: buildtools/make-sql-schemas.py ${SQLS}
+ cd schemas/sql; ${PYTHON} ${abs_top_srcdir}/buildtools/make-sql-schemas.py >$@.tmp
+ mv $@.tmp $@
+
+schemas/relaxng/left-right-schema.rng: schemas/relaxng/left-right-schema.rnc
+ ${TRANG} schemas/relaxng/left-right-schema.rnc schemas/relaxng/left-right-schema.rng
+
+schemas/relaxng/up-down-schema.rng: schemas/relaxng/up-down-schema.rnc
+ ${TRANG} schemas/relaxng/up-down-schema.rnc schemas/relaxng/up-down-schema.rng
+
+schemas/relaxng/publication-schema.rng: schemas/relaxng/publication-schema.rnc
+ ${TRANG} schemas/relaxng/publication-schema.rnc schemas/relaxng/publication-schema.rng
+
+schemas/relaxng/myrpki.rng: schemas/relaxng/myrpki.rnc
+ ${TRANG} schemas/relaxng/myrpki.rnc schemas/relaxng/myrpki.rng
+
+schemas/relaxng/router-certificate-schema.rng: schemas/relaxng/router-certificate-schema.rnc
+ ${TRANG} schemas/relaxng/router-certificate-schema.rnc schemas/relaxng/router-certificate-schema.rng
lint:
find rpki -name '*.py' | xargs pylint --rcfile ${abs_top_srcdir}/buildtools/pylint.rc
diff --git a/buildtools/defstack.py b/buildtools/defstack.py
index 4d93ce66..757516f3 100644
--- a/buildtools/defstack.py
+++ b/buildtools/defstack.py
@@ -22,6 +22,7 @@
# PERFORMANCE OF THIS SOFTWARE.
import fileinput
+import os.path
import sys
import re
@@ -76,7 +77,9 @@ token = None
for line in fileinput.input():
if token is None:
- token = "".join(c if c.isalnum() else "_" for c in fileinput.filename().upper())
+ path = fileinput.filename().split(os.path.sep)
+ path = os.path.join(path[-2], path[-1]) if len(path) > 1 else path[-1]
+ token = "".join(c if c.isalnum() else "_" for c in path.upper())
sys.stdout.write(header.replace("%", token))
if "DECLARE_STACK_OF" in line:
diff --git a/configure b/configure
index 725f68af..4e123255 100755
--- a/configure
+++ b/configure
@@ -5022,7 +5022,7 @@ if test $build_ca_tools = yes; then CA_TARGET=ca; else CA_TARGET=n
-ac_config_files="$ac_config_files Makefile h/Makefile schemas/Makefile"
+ac_config_files="$ac_config_files Makefile"
# OpenSSL has its own build system that bears no relationship to
@@ -5832,8 +5832,6 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "h/Makefile") CONFIG_FILES="$CONFIG_FILES h/Makefile" ;;
- "schemas/Makefile") CONFIG_FILES="$CONFIG_FILES schemas/Makefile" ;;
"openssl/Makefile") CONFIG_FILES="$CONFIG_FILES openssl/Makefile" ;;
"openssl/tests/Makefile") CONFIG_FILES="$CONFIG_FILES openssl/tests/Makefile" ;;
"rp/Makefile") CONFIG_FILES="$CONFIG_FILES rp/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index a2a4dc79..b5c9a6a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -770,9 +770,7 @@ AC_SUBST(OPENSSL_TARGET)
AC_SUBST(RP_TARGET)
AC_SUBST(CA_TARGET)
-AC_CONFIG_FILES([Makefile
- h/Makefile
- schemas/Makefile])
+AC_CONFIG_FILES([Makefile])
# OpenSSL has its own build system that bears no relationship to
# anything but itself, and our use of it is a bit weird, so this is a
diff --git a/h/Makefile.in b/h/Makefile.in
deleted file mode 100644
index d976661b..00000000
--- a/h/Makefile.in
+++ /dev/null
@@ -1,24 +0,0 @@
-# $Id$
-
-PYTHON = @PYTHON@
-
-abs_top_srcdir = @abs_top_srcdir@
-
-all: rpki/sk_manifest.h rpki/sk_roa.h
-
-rpki/sk_manifest.h: rpki/manifest.h
- ${PYTHON} ${abs_top_srcdir}/buildtools/defstack.py rpki/manifest.h >$@.tmp
- mv $@.tmp $@
-
-rpki/sk_roa.h: rpki/roa.h
- ${PYTHON} ${abs_top_srcdir}/buildtools/defstack.py rpki/roa.h >$@.tmp
- mv $@.tmp $@
-
-clean:
- rm -f *.h.tmp
-
-test install deinstall uninstall:
- @true
-
-distclean: clean
- rm -f Makefile
diff --git a/h/rpki/sk_manifest.h b/h/rpki/sk_manifest.h
index ead7cbe4..59ff80a5 100644
--- a/h/rpki/sk_manifest.h
+++ b/h/rpki/sk_manifest.h
@@ -1,6 +1,6 @@
/*
* Automatically generated, do not edit.
- * Generator $Id: defstack.py 4725 2012-09-19 21:28:34Z sra $
+ * Generator $Id: defstack.py 4878 2012-11-15 22:13:53Z sra $
*/
#ifndef __RPKI_MANIFEST_H__DEFSTACK_H__
diff --git a/h/rpki/sk_roa.h b/h/rpki/sk_roa.h
index cb5c5e17..13036955 100644
--- a/h/rpki/sk_roa.h
+++ b/h/rpki/sk_roa.h
@@ -1,6 +1,6 @@
/*
* Automatically generated, do not edit.
- * Generator $Id: defstack.py 4725 2012-09-19 21:28:34Z sra $
+ * Generator $Id: defstack.py 4878 2012-11-15 22:13:53Z sra $
*/
#ifndef __RPKI_ROA_H__DEFSTACK_H__
diff --git a/schemas/Makefile.in b/schemas/Makefile.in
deleted file mode 100644
index 80ba3b17..00000000
--- a/schemas/Makefile.in
+++ /dev/null
@@ -1,69 +0,0 @@
-# $Id$
-
-PYTHON = @PYTHON@
-TRANG = @TRANG@
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@ @POW_LDFLAGS@
-LIBS = @LIBS@
-
-INSTALL = @INSTALL@ -m 555
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datarootdir = @datarootdir@
-datadir = @datadir@
-localstatedir = @localstatedir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-sysconfdir = @sysconfdir@
-
-abs_builddir = @abs_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-abs_top_builddir= @abs_top_builddir@
-srcdir = @srcdir@
-
-all:: ${abs_top_srcdir}/rpki/relaxng.py ${abs_top_srcdir}/rpki/sql_schemas.py
-
-install clean test distclean deinstall uninstall::
- @true
-
-distclean::
- rm -f Makefile
-
-RNGS = relaxng/left-right-schema.rng \
- relaxng/up-down-schema.rng \
- relaxng/publication-schema.rng \
- relaxng/myrpki.rng \
- relaxng/router-certificate-schema.rng
-
-SQLS = sql/rpkid.sql sql/pubd.sql
-
-${abs_top_srcdir}/rpki/relaxng.py: ${abs_top_srcdir}/buildtools/make-relaxng.py ${RNGS}
- cd relaxng; ${PYTHON} ${abs_top_srcdir}/buildtools/make-relaxng.py *.rng >$@.tmp
- mv $@.tmp $@
-
-${abs_top_srcdir}/rpki/sql_schemas.py: ${abs_top_srcdir}/buildtools/make-sql-schemas.py ${SQLS}
- cd sql; ${PYTHON} ${abs_top_srcdir}/buildtools/make-sql-schemas.py >$@.tmp
- mv $@.tmp $@
-
-relaxng/left-right-schema.rng: relaxng/left-right-schema.rnc
- ${TRANG} relaxng/left-right-schema.rnc relaxng/left-right-schema.rng
-
-relaxng/up-down-schema.rng: relaxng/up-down-schema.rnc
- ${TRANG} relaxng/up-down-schema.rnc relaxng/up-down-schema.rng
-
-relaxng/publication-schema.rng: relaxng/publication-schema.rnc
- ${TRANG} relaxng/publication-schema.rnc relaxng/publication-schema.rng
-
-relaxng/myrpki.rng: relaxng/myrpki.rnc
- ${TRANG} relaxng/myrpki.rnc relaxng/myrpki.rng
-
-relaxng/router-certificate-schema.rng: relaxng/router-certificate-schema.rnc
- ${TRANG} relaxng/router-certificate-schema.rnc relaxng/router-certificate-schema.rng
-
-dont-run-trang:
- touch relaxng/*.rng
diff --git a/setup.py b/setup.py
index 09534317..86f40983 100644
--- a/setup.py
+++ b/setup.py
@@ -44,8 +44,16 @@ setup_args = dict(
license = "BSD",
url = "http://rpki.net/",
cmdclass = {"build_scripts" : setup_extensions.build_scripts,
- "install_scripts" : setup_extensions.install_scripts},
- packages = ["rpki",
+ "install_scripts" : setup_extensions.install_scripts})
+
+# If and when we start using setup.py to install RP scripts or start
+# trying to separate RP and CA modules in the rpki package tree, we'll
+# need to do something about sharing "packages", "scripts", etc.
+# Write that code when we need it.
+
+if autoconf.RP_TARGET == "rp":
+ setup_args.update(
+ packages = ["rpki",
"rpki.POW",
"rpki.irdb",
"rpki.gui",
@@ -53,20 +61,18 @@ setup_args = dict(
"rpki.gui.cacheview",
"rpki.gui.api",
"rpki.gui.routeview"],
- ext_modules = [Extension("rpki.POW._POW", ["ext/POW.c"],
+ 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.
+ package_data = {"rpki.gui.app" :
+ ["migrations/*.py",
+ "static/*/*",
+ "templates/*.html",
+ "templates/*/*.html",
+ "templatetags/*.py"],
+ "rpki.gui.cacheview" :
+ ["templates/*/*.html"]})
if autoconf.CA_TARGET == "ca":
setup_args.update(