From 419f32edef2c6beb43b802503b123fe913fe6fc9 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 15 Jun 2011 23:35:38 +0200 Subject: Add setup.py to install moz_version.py. --- debian/changelog | 1 + src/Makefile | 16 +--------------- src/setup.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 src/setup.py diff --git a/debian/changelog b/debian/changelog index 6be0c03..52a9878 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ mozilla-devscripts (0.26) UNRELEASED; urgency=low * Switch from python-support to dh_python2. * Bump Standards-Version to 3.9.1 (no changes required). * Drop DM-Upload-Allowed field. + * Add setup.py to install moz_version.py. -- Benjamin Drung Wed, 15 Jun 2011 22:31:48 +0200 diff --git a/src/Makefile b/src/Makefile index 933b8e2..04a65ae 100644 --- a/src/Makefile +++ b/src/Makefile @@ -51,14 +51,6 @@ extra_files = \ xpi.mk \ $(NULL) -bindir_files = \ - dh_xul-ext \ - install-xpi \ - xpi-pack \ - xpi-repack \ - xpi-unpack \ - moz-version - extra_dirs = \ mozclient \ mozclient/patches \ @@ -79,18 +71,12 @@ build: $(subst_files) chmod 644 $@ install: $(subst_files) $(extra_files) $(foreach dir,$(extra_dirs),$(wildcard $(dir)/*)) + python setup.py install --root="$(DESTDIR)" --no-compile --install-layout=deb install -m 755 -d $(DESTDIR)$(DATADIR) $(foreach dir,$(extra_dirs),$(DESTDIR)$(DATADIR)/$(dir)) install -m 644 $(subst_files) $(extra_files) $(DESTDIR)$(DATADIR) - install -m 755 -d $(DESTDIR)$(BINDIR) - install -m 755 $(bindir_files) $(DESTDIR)$(BINDIR) for dir in $(extra_dirs) ; do \ install -m 644 `echo $$dir/*` $(DESTDIR)$(DATADIR)/$$dir ; \ done - install -m 644 -D moz_version.py $(DESTDIR)$(DATADIR)/moz_version.py - for dir in $(shell pyversions -s); do \ - mkdir -p $(DESTDIR)$(PREFIX)/lib/$$dir/site-packages/; \ - ln -s ../../../share/mozilla-devscripts/moz_version.py $(DESTDIR)$(PREFIX)/lib/$$dir/site-packages/; \ - done find $(DESTDIR)$(DATADIR) -type f \( -name \*.pl -o -name \*.sh \) -exec chmod -v 755 {} \; chmod 755 $(DESTDIR)$(DATADIR)/minefield-packager.mk install -m 644 xul-app-data.csv.$(VENDOR) $(DESTDIR)$(DATADIR)/xul-app-data.csv diff --git a/src/setup.py b/src/setup.py new file mode 100644 index 0000000..9dbd571 --- /dev/null +++ b/src/setup.py @@ -0,0 +1,31 @@ +#!/usr/bin/python + +import os +import re + +from distutils.core import setup + +# look/set what version we have +changelog = "../debian/changelog" +if os.path.exists(changelog): + head = open(changelog).readline() + match = re.compile(".*\((.*)\).*").match(head) + if match: + version = match.group(1) + +scripts = [ + 'dh_xul-ext', + 'install-xpi', + 'xpi-pack', + 'xpi-repack', + 'xpi-unpack', + 'moz-version', +] + +if __name__ == '__main__': + setup(name='mozilla-devscripts', + version=version, + url='https://launchpad.net/mozilla-devscripts', + scripts=scripts, + py_modules=['moz_version'], + ) -- cgit v1.2.3