From b8986349258f867c21e4b217117de8a82c6716d4 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 4 Mar 2007 15:10:52 +0000 Subject: [PATCH] Script to turn a library build into a -dev package, by removing the binaries. git-svn-id: https://zero-install.svn.sourceforge.net/svnroot/zero-install/trunk/make-headers/trunk/make-headers@1580 9f8c893c-44ee-0310-b757-c8ca8341c71e --- make-headers.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 make-headers.py diff --git a/make-headers.py b/make-headers.py new file mode 100755 index 0000000..b008e30 --- /dev/null +++ b/make-headers.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +import os, shutil, re +configure = os.path.join(os.environ['SRCDIR'], 'configure') +prefix = os.environ['DISTDIR'] + +def run(*argv): + if os.spawnvp(os.P_WAIT, argv[0], argv): + raise Exception("Command '%s' failed" % repr(argv)) + +#run(configure, '--prefix', prefix) +run('make', 'install') + +os.chdir(prefix) +for path in ['bin', 'man', 'share']: + shutil.rmtree(path) + +os.chdir('lib') +for x in os.listdir('.'): + if os.path.isfile(x) or os.path.islink(x): + if re.match('^lib.*\.so[.0-9]*$', x) or \ + re.match('^lib.*\.la', x): + os.unlink(x) + +os.chdir('pkgconfig') +for pc in os.listdir('.'): + if pc.endswith('.pc'): + data = file(pc).read().split('\n') + for i in range(len(data)): + if data[i].startswith('prefix='): + data[i] = 'prefix=${pcfiledir}/../..' + out = file(pc, 'w') + out.write('\n'.join(data)) + out.close() + -- 2.11.4.GIT