diff options
author | Rob Austein <sra@hactrn.net> | 2013-02-25 02:49:39 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-02-25 02:49:39 +0000 |
commit | 10408f676d398b1961d24daf360d42f79b8ecfc5 (patch) | |
tree | 2aa3c618ea856812cbb406f7d5d1d1cb35934ab6 /ac_rpki.py.in | |
parent | b7f9f8ae8cec1f8fe46c87ae530c3d5d056fccc9 (diff) |
Punt top-level setup.py, for now. There's a lot of useful code in
this which we might want to salvage some day, but the
platform-specific packaging ended up evolving in a very different
direction, so for now this stuff is just a distraction. SVN will
remember it for us, dust it off some day in the future if needed.
svn path=/branches/tk377/; revision=5064
Diffstat (limited to 'ac_rpki.py.in')
-rw-r--r-- | ac_rpki.py.in | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/ac_rpki.py.in b/ac_rpki.py.in deleted file mode 100644 index 4cf912dc..00000000 --- a/ac_rpki.py.in +++ /dev/null @@ -1,91 +0,0 @@ -# -*- Python -*- - -# Experimental interface between distutils and autoconf for rpki CA tools. -# -# This is not yet ready for prime time. - -# $Id$ -# -# Copyright (C) 2012 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 -# PERFORMANCE OF THIS SOFTWARE. - -import re -import os - -class Autoconf(object): - - def __init__(self): - self._names = set() - self._lists = set() - - def _configure_strings(self, **kwargs): - for k, v in kwargs.iteritems(): - setattr(self, k, v.strip()) - self._names.update(kwargs) - - def _configure_lists(self, **kwargs): - self._configure_strings(**kwargs) - self._lists.update(kwargs) - - @property - def build_openssl(self): - return "openssl" in self.TOP_LEVEL_SUBDIRS - - _re = re.compile(r"\$\{[^}]+\}") - - def _repl(self, m): - orig = m.group(0) - name = orig[2:-1] - return getattr(self, name, os.getenv(name, orig)) - - def _fixup(self): - - done = False - while not done: - done = True - for name in self._names: - v, n = self._re.subn(self._repl, getattr(self, name)) - if v != getattr(self, name): - setattr(self, name, v) - done = False - - for name in self._lists: - setattr(self, name, getattr(self, name).split()) - -ac = Autoconf() - -ac._configure_lists( - TOP_LEVEL_SUBDIRS = '''@TOP_LEVEL_SUBDIRS@''', - CFLAGS = '''@CFLAGS@''', - LDFLAGS = '''@LDFLAGS@ @POW_LDFLAGS@''', - LIBS = '''@LIBS@''') - -ac._configure_strings( - prefix = '''@prefix@''', - sbindir = '''@sbindir@''', - sysconfdir = '''@sysconfdir@''', - abs_top_builddir = '''@abs_top_builddir@''', - abs_top_srcdir = '''@abs_top_srcdir@''', - abs_builddir = '''@abs_builddir@''', - exec_prefix = '''@exec_prefix@''', - libexecdir = '''@libexecdir@''', - PYTHON = '''@PYTHON@''') - -ac._fixup() - -if __name__ == "__main__": - for name in ac._names: - print "%s: %r" % (name, getattr(ac, name)) - print - print "build_openssl:", ac.build_openssl |