Skip to content
Browse files

buildsystem reorg

- put python modules under 'skytools-3.0'
- install pkgloader separately
- install scripts in Makefile instead setup.py (it did not support rename)
  removing .py afterwards is dangerous as we may overwrite old scripts.
- move setup.py under misc/ as it really is not usable standalone
- drop override PYTHON
  • Loading branch information...
1 parent 37cd5f3 commit 6388404892349577cffb4a9b41e2421367c859aa @markokr committed Jun 5, 2009
Showing with 37 additions and 37 deletions.
  1. +18 −7 Makefile
  2. +1 −1 config.mak.in
  3. +0 −15 misc/strip_ext.py
  4. +14 −0 setup_pkgloader.py
  5. +3 −13 setup.py → setup_skytools.py
  6. +1 −1 source.cfg
View
25 Makefile
@@ -7,6 +7,10 @@ pyver = $(shell $(PYTHON) -V 2>&1 | sed 's/^[^ ]* \([0-9]*\.[0-9]*\).*/\1/')
SUBDIRS = sql doc
+SCRIPTS = python/londiste.py python/qadmin.py python/pgqadm.py python/walmgr.py \
+ scripts/queue_loader.py scripts/queue_mover.py scripts/queue_splitter.py \
+ scripts/scriptmgr.py scripts/skytools_upgrade.py
+
all: python-all sub-all config.mak
install: sub-install python-install
@@ -19,10 +23,10 @@ sub-all sub-install sub-clean sub-distclean:
.PHONY: sub-all sub-clean sub-install sub-distclean
python-all: config.mak
- $(PYTHON) setup.py build
+ $(PYTHON) setup_skytools.py build
clean: sub-clean
- $(PYTHON) setup.py clean
+ $(PYTHON) setup_skytools.py clean
rm -rf build
find python -name '*.py[oc]' -print | xargs rm -f
rm -f python/skytools/installer_config.py source.list
@@ -40,10 +44,17 @@ modules-install: config.mak
test \! -d compat || $(MAKE) -C compat $@ DESTDIR=$(DESTDIR)
python-install: config.mak sub-all
- $(PYTHON) setup.py install --prefix=$(prefix) --root=$(DESTDIR)/ --record=tmp_files.lst
- grep '/bin/[a-z_0-9]*.py' tmp_files.lst \
- | $(PYTHON) misc/strip_ext.py $(if $(DESTDIR), $(DESTDIR), /)
- rm -f tmp_files.lst
+ mkdir -p $(DESTDIR)/$(bindir)
+ $(PYTHON) setup_pkgloader.py install --prefix=$(prefix) --root=$(DESTDIR)/
+ $(PYTHON) setup_skytools.py install --prefix=$(prefix) --root=$(DESTDIR)/ --record=tmp_files.lst \
+ --install-lib=$(prefix)/lib/python$(pyver)/site-packages/skytools-3.0
+ for s in $(SCRIPTS); do \
+ exe=`echo $$s|sed -e 's!.*/!!' -e 's/[.]py//'`; \
+ install $$s $(DESTDIR)/$(bindir)/$$exe || exit 1; \
+ done
+ #grep '/bin/[a-z_0-9]*.py' tmp_files.lst \
+ #| $(PYTHON) misc/strip_ext.py $(if $(DESTDIR), $(DESTDIR), /)
+ #rm -f tmp_files.lst
$(MAKE) -C doc DESTDIR=$(DESTDIR) install
python-install python-all: python/skytools/installer_config.py
@@ -93,7 +104,7 @@ deb84:
tgz: config.mak clean
$(MAKE) -C doc man html
rm -f source.list
- $(PYTHON) setup.py sdist -t source.cfg -m source.list
+ $(PYTHON) setup_skytools.py sdist -t source.cfg -m source.list
debclean: distclean
rm -rf debian/tmp-* debian/build* debian/control debian/packages-tmp*
View
2 config.mak.in
@@ -11,7 +11,7 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
-override PYTHON = @PYTHON@
+PYTHON = @PYTHON@
override PG_CONFIG = @PG_CONFIG@
# additional CPPFLAGS to pgxs modules
View
15 misc/strip_ext.py
@@ -1,15 +0,0 @@
-#! /usr/bin/env python
-
-import sys, os, os.path
-
-while 1:
- fn = sys.stdin.readline().strip()
- if not fn:
- break
- full1 = os.path.join(sys.argv[1], fn)
- full2 = os.path.splitext(full1)[0]
- if full1 == full2:
- continue
- print full1, full2
- os.rename(full1, full2)
-
View
14 setup_pkgloader.py
@@ -0,0 +1,14 @@
+#! /usr/bin/env python
+
+from distutils.core import setup
+
+setup(
+ name = "pkgloader",
+ license = "BSD",
+ version = '1.0',
+ maintainer = "Marko Kreen",
+ maintainer_email = "markokr@gmail.com",
+ package_dir = {'': 'python'},
+ py_modules = ['pkgloader'],
+)
+
View
16 setup.py → setup_skytools.py
@@ -1,5 +1,8 @@
#! /usr/bin/env python
+# this script does not perform full installation,
+# it is meant for use from Makefile
+
import sys, os.path, re
from distutils.core import setup
from distutils.extension import Extension
@@ -34,19 +37,6 @@
url = "http://pgfoundry.org/projects/skytools/",
package_dir = {'': 'python'},
packages = ['skytools', 'londiste', 'pgq', 'pgq.cascade'],
- scripts = ['python/londiste.py',
- 'python/qadmin.py',
- 'python/pgqadm.py',
- 'python/walmgr.py',
- 'scripts/bulk_loader.py',
- 'scripts/cube_dispatcher.py',
- 'scripts/queue_loader.py',
- 'scripts/queue_mover.py',
- 'scripts/queue_splitter.py',
- 'scripts/scriptmgr.py',
- 'scripts/skytools_upgrade.py',
- 'scripts/table_dispatcher.py',
- ],
data_files = [
('share/doc/skytools/conf', [
'python/conf/wal-master.ini',
View
2 source.cfg
@@ -6,7 +6,7 @@ include Makefile COPYRIGHT README NEWS config.mak.in configure configure.ac sour
recursive-include sql *.sql Makefile *.out *.in *.[ch] README* *.ini *.templ
recursive-include python/conf *.ini
-recursive-include misc *.sh *.rc *.py Cindent
+recursive-include misc *.sh *.rc *.py *.css Cindent
recursive-include scripts *.py *.templ *.ini
recursive-include lib *.[ch] Makefile Setup.mk README COPYRIGHT
recursive-include debian changelog packages.in

0 comments on commit 6388404

Please sign in to comment.
Something went wrong with that request. Please try again.