diff options
author | Rob Austein <sra@hactrn.net> | 2013-04-05 19:10:24 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-04-05 19:10:24 +0000 |
commit | f25b1a9a55fd9e61b19d073fe8426cc2aac3c0ef (patch) | |
tree | 4495dac631992d4fe843a42b15b833ec6fb9d12b /rpkid | |
parent | 0b3938408e8340af9487a02c144661f60ea94931 (diff) |
Whack build environment with a club to get rpki-ca package to start up
properly after install on Ubuntu. Some cleanup still required,
rpki-ca cron stuff isn't done yet, and GUI has not yet been tested
with this, but daemons now start up properly upon install as an Ubuntu
user would expect, which is some kind of progress.
svn path=/trunk/; revision=5283
Diffstat (limited to 'rpkid')
-rw-r--r-- | rpkid/Makefile.in | 62 | ||||
-rw-r--r-- | rpkid/irbe_cli.py | 2 | ||||
-rw-r--r-- | rpkid/irdbd.py | 2 | ||||
-rw-r--r-- | rpkid/portal-gui/scripts/rpki-manage.py | 4 | ||||
-rw-r--r-- | rpkid/portal-gui/scripts/rpkigui-check-expired.py | 2 | ||||
-rw-r--r-- | rpkid/portal-gui/scripts/rpkigui-import-routes.py | 2 | ||||
-rw-r--r-- | rpkid/portal-gui/scripts/rpkigui-rcynic.py | 2 | ||||
-rw-r--r-- | rpkid/pubd.py | 2 | ||||
-rw-r--r-- | rpkid/rootd.py | 2 | ||||
-rw-r--r-- | rpkid/rpki-confgen.py | 2 | ||||
-rw-r--r-- | rpkid/rpki-confgen.xml | 6 | ||||
-rw-r--r-- | rpkid/rpki-sql-backup.py | 2 | ||||
-rw-r--r-- | rpkid/rpki-sql-setup.py | 2 | ||||
-rw-r--r-- | rpkid/rpki-start-servers.py | 2 | ||||
-rw-r--r-- | rpkid/rpkic.py | 2 | ||||
-rw-r--r-- | rpkid/rpkid.py | 2 | ||||
-rw-r--r-- | rpkid/setup.py | 46 |
17 files changed, 96 insertions, 48 deletions
diff --git a/rpkid/Makefile.in b/rpkid/Makefile.in index 35b26617..5c697f91 100644 --- a/rpkid/Makefile.in +++ b/rpkid/Makefile.in @@ -56,7 +56,7 @@ POW_SO = rpki/POW/_POW.so SCRIPTS = \ rpki-sql-backup rpki-sql-setup rpki-start-servers irbe_cli irdbd \ - pubd rootd rpkic rpkid \ + pubd rootd rpkic rpkid rpki-confgen \ portal-gui/scripts/rpkigui-import-routes \ portal-gui/scripts/rpkigui-check-expired \ portal-gui/scripts/rpkigui-rcynic \ @@ -71,11 +71,11 @@ BUILD_SCRIPTS = \ DATA_FILES = portal-gui/routeviews.sh # these files get put in ${sysconfdir}/rpki -CONF_FILES = portal-gui/apache.conf +CONF_FILES = portal-gui/apache.conf rpki-confgen.xml all:: ${POW_SO} rpki/relaxng.py myrpki.rng rpki/sql_schemas.py ${SCRIPTS} ${BUILD_SCRIPTS} -${POW_SO}: ext/POW.c setup.py +${POW_SO}: ext/POW.c setup.py setup_autoconf.py ${SETUP_PY} build_ext --inplace clean:: @@ -220,59 +220,61 @@ install:: clean:: rm -f examples/rpki.conf -# Scripts +# Scripts. This whole business of copying scripts is a holdover from +# a more complex build process which we haven't quite finished +# cleaning up yet. In theory, eventually this will all be handled by +# setup.py without any need for copying anything here. -COMPILE_PYTHON = \ - rm -f $@; \ - ${PYTHON} ${abs_top_srcdir}/buildtools/make-python-executable.py <$? >$@; \ - chmod 555 $@ +COPY_SCRIPT = cp -pf $? $@; chmod 555 $@ rpki-sql-backup: rpki-sql-backup.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} rpki-sql-setup: rpki-sql-setup.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} rpki-start-servers: rpki-start-servers.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} irbe_cli: irbe_cli.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} irdbd: irdbd.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} pubd: pubd.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} rootd: rootd.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} rpkic: rpkic.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} rpkid: rpkid.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} + +rpki-confgen: rpki-confgen.py + ${COPY_SCRIPT} # These are here for legacy reasons, but no longer required. The problem is # that anyone with an existing copy of the repository will already have # previously built files by these names, so I can't rename them in the # repository, or svn will abort when the user tries to update. portal-gui/scripts/rpkigui-rcynic: portal-gui/scripts/rpkigui-rcynic.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} portal-gui/scripts/rpkigui-import-routes: portal-gui/scripts/rpkigui-import-routes.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} portal-gui/scripts/rpkigui-check-expired: portal-gui/scripts/rpkigui-check-expired.py - ${COMPILE_PYTHON} + ${COPY_SCRIPT} portal-gui/rpki.wsgi: ${srcdir}/portal-gui/rpki.wsgi.in - cp $? $@ + ${COPY_SCRIPT} portal-gui/scripts/rpki-manage: ${srcdir}/portal-gui/scripts/rpki-manage.py - cp $? $@ - chmod 755 $@ + ${COPY_SCRIPT} rpki/autoconf.py: Makefile @echo 'Generating $@'; \ @@ -282,5 +284,17 @@ rpki/autoconf.py: Makefile echo 'localstatedir = "${localstatedir}"'; \ echo 'sbindir = "${sbindir}"'; \ echo 'sharedstatedir = "${sharedstatedir}"'; \ - echo 'sysconfdir = "${sysconfdir}"' \ + echo 'sysconfdir = "${sysconfdir}"'; \ + echo 'libexecdir = "${libexecdir}"'; \ + ) > $@ + +setup_autoconf.py: rpki/autoconf.py + @echo 'Generating $@'; \ + (cat rpki/autoconf.py; \ + echo 'CFLAGS = """${CFLAGS}"""'; \ + echo 'LDFLAGS = """${LDFLAGS}"""'; \ + echo 'LIBS = """${LIBS}"""'; \ ) > $@ + +clean:: + rm -f setup_autoconf.py setup_autoconf.pyc diff --git a/rpkid/irbe_cli.py b/rpkid/irbe_cli.py index 9d691da4..f8f87990 100644 --- a/rpkid/irbe_cli.py +++ b/rpkid/irbe_cli.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ Command line IR back-end control program for rpkid and pubd. diff --git a/rpkid/irdbd.py b/rpkid/irdbd.py index ef99048e..63370ab5 100644 --- a/rpkid/irdbd.py +++ b/rpkid/irdbd.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ $Id$ diff --git a/rpkid/portal-gui/scripts/rpki-manage.py b/rpkid/portal-gui/scripts/rpki-manage.py index 7bf84709..0d581ce9 100644 --- a/rpkid/portal-gui/scripts/rpki-manage.py +++ b/rpkid/portal-gui/scripts/rpki-manage.py @@ -4,8 +4,8 @@ import os from django.core.management import execute_from_command_line # django-admin seems to have problems creating the superuser account when -# $LANG is unset -if not 'LANG' in os.environ: +# $LANG is unset or is set to something totally incompatible with UTF-8. +if os.environ.get('LANG') in (None, "", "C"): os.environ['LANG'] = 'en_US.UTF-8' os.environ['DJANGO_SETTINGS_MODULE'] = 'rpki.gui.default_settings' diff --git a/rpkid/portal-gui/scripts/rpkigui-check-expired.py b/rpkid/portal-gui/scripts/rpkigui-check-expired.py index 90c492ff..eb0c7fbb 100644 --- a/rpkid/portal-gui/scripts/rpkigui-check-expired.py +++ b/rpkid/portal-gui/scripts/rpkigui-check-expired.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # Copyright (C) 2012 SPARTA, Inc. a Parsons Company # # Permission to use, copy, modify, and distribute this software for any diff --git a/rpkid/portal-gui/scripts/rpkigui-import-routes.py b/rpkid/portal-gui/scripts/rpkigui-import-routes.py index 776a16e2..fa3ff3e9 100644 --- a/rpkid/portal-gui/scripts/rpkigui-import-routes.py +++ b/rpkid/portal-gui/scripts/rpkigui-import-routes.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # Copyright (C) 2012, 2013 SPARTA, Inc. a Parsons Company # # Permission to use, copy, modify, and distribute this software for any diff --git a/rpkid/portal-gui/scripts/rpkigui-rcynic.py b/rpkid/portal-gui/scripts/rpkigui-rcynic.py index 4f18c5bb..c8f1b994 100644 --- a/rpkid/portal-gui/scripts/rpkigui-rcynic.py +++ b/rpkid/portal-gui/scripts/rpkigui-rcynic.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # Copyright (C) 2011 SPARTA, Inc. dba Cobham # Copyright (C) 2012, 2013 SPARTA, Inc. a Parsons Company # diff --git a/rpkid/pubd.py b/rpkid/pubd.py index c806d124..8445b6e1 100644 --- a/rpkid/pubd.py +++ b/rpkid/pubd.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ $Id$ diff --git a/rpkid/rootd.py b/rpkid/rootd.py index dd6adb41..8e98bd89 100644 --- a/rpkid/rootd.py +++ b/rpkid/rootd.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ $Id$ diff --git a/rpkid/rpki-confgen.py b/rpkid/rpki-confgen.py index a2d4fbd1..9913a1e5 100644 --- a/rpkid/rpki-confgen.py +++ b/rpkid/rpki-confgen.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import sys import getopt import textwrap diff --git a/rpkid/rpki-confgen.xml b/rpkid/rpki-confgen.xml index b92b4ae4..055ea813 100644 --- a/rpkid/rpki-confgen.xml +++ b/rpkid/rpki-confgen.xml @@ -25,7 +25,7 @@ </option> <option name = "run_rpkid" - value = "True"> + value = "yes"> <doc> Whether you want to run your own copy of rpkid (and irdbd). You want this on unless somebody else is hosting rpkid service for you. @@ -64,7 +64,7 @@ </option> <option name = "run_pubd" - value = "False"> + value = "yes"> <doc> Whether you want to run your own copy of pubd. In general, it's best to use your parent's pubd if you can, to reduce the overall @@ -99,7 +99,7 @@ </option> <option name = "run_rootd" - value = "False"> + value = "no"> <doc> Whether you want to run your very own copy of rootd. Don't enable this unless you really know what you're doing. diff --git a/rpkid/rpki-sql-backup.py b/rpkid/rpki-sql-backup.py index ea11d957..561aa4e5 100644 --- a/rpkid/rpki-sql-backup.py +++ b/rpkid/rpki-sql-backup.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ Back up data from SQL databases, looking at config file to figure out which databases and what credentials to use with them. diff --git a/rpkid/rpki-sql-setup.py b/rpkid/rpki-sql-setup.py index 3ca42b04..01de0822 100644 --- a/rpkid/rpki-sql-setup.py +++ b/rpkid/rpki-sql-setup.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ Automated setup of all the pesky SQL stuff we need. Prompts for MySQL root password, pulls other information from rpki.conf. diff --git a/rpkid/rpki-start-servers.py b/rpkid/rpki-start-servers.py index 722f51e6..3babfd1c 100644 --- a/rpkid/rpki-start-servers.py +++ b/rpkid/rpki-start-servers.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ Start servers, logging to files, looking at config file to figure out which servers the user wants started. diff --git a/rpkid/rpkic.py b/rpkid/rpkic.py index 6ef3a67b..0dd1c122 100644 --- a/rpkid/rpkic.py +++ b/rpkid/rpkic.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ $Id$ diff --git a/rpkid/rpkid.py b/rpkid/rpkid.py index 181fabf9..4f52040e 100644 --- a/rpkid/rpkid.py +++ b/rpkid/rpkid.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + """ $Id$ diff --git a/rpkid/setup.py b/rpkid/setup.py index eded0251..c4d0fb60 100644 --- a/rpkid/setup.py +++ b/rpkid/setup.py @@ -20,19 +20,29 @@ import os # We can't build POW without these settings, but allow them to be null # so that things like "python setup.py --help" will work. -ac_cflags = os.getenv("AC_CFLAGS", "").split() -ac_ldflags = os.getenv("AC_LDFLAGS", "").split() -ac_libs = os.getenv("AC_LIBS", "").split() -ac_scripts = os.getenv("AC_SCRIPTS", "").split() +ac_scripts = os.getenv("AC_SCRIPTS", "").split() ac_aux_scripts = os.getenv("AC_AUX_SCRIPTS", "").split() ac_data_files = os.getenv("AC_DATA_FILES", "").split() ac_conf_files = os.getenv("AC_CONF_FILES", "").split() -ac_sbindir = os.getenv("AC_SBINDIR", "").strip() -ac_abs_builddir = os.getenv("AC_ABS_BUILDDIR", "").strip() -ac_libexecdir = os.getenv("AC_LIBEXECDIR", "").strip() -ac_datarootdir = os.getenv("AC_DATAROOTDIR", "").strip() -ac_sysconfdir = os.getenv("AC_SYSCONFDIR", "").strip() +try: + import setup_autoconf + ac_cflags = setup_autoconf.CFLAGS.split() + ac_ldflags = setup_autoconf.LDFLAGS.split() + ac_libs = setup_autoconf.LIBS.split() + ac_sbindir = setup_autoconf.sbindir + ac_libexecdir = setup_autoconf.libexecdir + ac_datarootdir = os.path.join(setup_autoconf.datarootdir, "rpki") + ac_sysconfdir = os.path.join(setup_autoconf.sysconfdir, "rpki") + +except ImportError: + ac_cflags = () + ac_ldflags = () + ac_libs = () + ac_sbindir = None + ac_libexecdir = None + ac_datarootdir = None + ac_sysconfdir = None # Non-standard extension build specification: we need to force # whatever build options our top-level ./configure selected, and we @@ -52,21 +62,19 @@ pow = Extension("rpki.POW._POW", ["ext/POW.c"], # installed files. # # bdist_rpm seems to get confused by relative names for scripts, so we -# have to prefix source names here with the build directory name. +# have to prefix source names here with the build directory name. Well, +# if we care about bdist_rpm, which it now looks like we don't, but +# leave it alone for the moment. data_files = [] if ac_sbindir and ac_scripts: - data_files.append((ac_sbindir, - ["%s/%s" % (ac_abs_builddir, f) for f in ac_scripts])) + data_files.append((ac_sbindir, [os.path.abspath(f) for f in ac_scripts])) if ac_libexecdir and ac_aux_scripts: - data_files.append((ac_libexecdir, - ["%s/%s" % (ac_abs_builddir, f) for f in ac_aux_scripts])) + data_files.append((ac_libexecdir, [os.path.abspath(f) for f in ac_aux_scripts])) if ac_datarootdir and ac_data_files: - data_files.append((ac_datarootdir, - ["%s/%s" % (ac_abs_builddir, f) for f in ac_data_files])) + data_files.append((ac_datarootdir, [os.path.abspath(f) for f in ac_data_files])) if ac_sysconfdir and ac_conf_files: - data_files.append((ac_sysconfdir, - ["%s/%s" % (ac_abs_builddir, f) for f in ac_conf_files])) + data_files.append((ac_sysconfdir, [os.path.abspath(f) for f in ac_conf_files])) if not data_files: data_files = None @@ -85,4 +93,4 @@ setup(name = "rpkitoolkit", 'templatetags/*.py'], 'rpki.gui.cacheview': ['templates/*/*.html'] }, - data_files = data_files) + data_files = data_files) |