deb: fwd-port fix for braindamaged Debian's python
authorMarko Kreen <markokr@gmail.com>
Mon, 1 Nov 2010 15:44:21 +0000 (17:44 +0200)
committerMarko Kreen <markokr@gmail.com>
Tue, 2 Nov 2010 13:41:48 +0000 (15:41 +0200)
They broke distutils install just for fun, thus each
python .deb needs their braindamaged hack to work.

Makefile
debian/packages.in

index 769a60d867b1a460d8eb56cf4a7bc68083ddd1a9..ce4589d0cf190ec0314a92e2a2d7fd6e523c6a13 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -56,10 +56,9 @@ modules-install: config.mak
 python-install: config.mak sub-all
        mkdir -p $(DESTDIR)/$(bindir)
        rm -rf build
-       $(PYTHON) setup_pkgloader.py install --prefix=$(prefix) --root=$(DESTDIR)/
+       $(PYTHON) setup_pkgloader.py install --prefix=$(prefix) --root=$(DESTDIR)/ $(BROKEN_PYTHON)
        find build -name 'pkgloader*' | xargs rm
-       $(PYTHON) setup_skytools.py install --prefix=$(prefix) --root=$(DESTDIR)/ --record=tmp_files.lst \
-               --install-lib=$(prefix)/lib/python$(pyver)/site-packages/skytools-3.0
+       $(PYTHON) setup_skytools.py install --prefix=$(prefix) --root=$(DESTDIR)/ $(BROKEN_PYTHON) --record=tmp_files.lst
        for s in $(SFX_SCRIPTS); do \
                exe=`echo $$s|sed -e 's!.*/!!' -e 's/[.]py//'`; \
                install $$s $(DESTDIR)/$(bindir)/$${exe}$(SCRIPT_SUFFIX) || exit 1; \
@@ -88,37 +87,37 @@ distclean: sub-distclean
        rm -rf autom4te.cache config.log config.status config.mak
 
 deb80:
-       ./configure --with-pgconfig=/usr/lib/postgresql/8.0/bin/pg_config
+       ./configure --with-pgconfig=/usr/lib/postgresql/8.0/bin/pg_config --with-python=$(PYTHON)
        sed -e s/PGVER/8.0/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
        yada rebuild
        debuild -uc -us -b
 
 deb81:
-       ./configure --with-pgconfig=/usr/lib/postgresql/8.1/bin/pg_config
+       ./configure --with-pgconfig=/usr/lib/postgresql/8.1/bin/pg_config --with-python=$(PYTHON)
        sed -e s/PGVER/8.1/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
        yada rebuild
        debuild -uc -us -b
 
 deb82:
-       ./configure --with-pgconfig=/usr/lib/postgresql/8.2/bin/pg_config
+       ./configure --with-pgconfig=/usr/lib/postgresql/8.2/bin/pg_config --with-python=$(PYTHON)
        sed -e s/PGVER/8.2/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
        yada rebuild
        debuild -uc -us -b
 
 deb83:
-       ./configure --with-pgconfig=/usr/lib/postgresql/8.3/bin/pg_config
+       ./configure --with-pgconfig=/usr/lib/postgresql/8.3/bin/pg_config --with-python=$(PYTHON)
        sed -e s/PGVER/8.3/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
        yada rebuild
        debuild -uc -us -b
 
 deb84:
-       ./configure --with-pgconfig=/usr/lib/postgresql/8.4/bin/pg_config
+       ./configure --with-pgconfig=/usr/lib/postgresql/8.4/bin/pg_config --with-python=$(PYTHON)
        sed -e s/PGVER/8.4/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
        yada rebuild
        debuild -uc -us -b
 
 deb90:
-       ./configure --with-pgconfig=/usr/lib/postgresql/9.0/bin/pg_config
+       ./configure --with-pgconfig=/usr/lib/postgresql/9.0/bin/pg_config --with-python=$(PYTHON)
        sed -e s/PGVER/9.0/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
        yada rebuild
        debuild -uc -us -b
@@ -145,6 +144,11 @@ tags:
 check:
        ./misc/docheck.sh
 
+# workaround for Debian's broken python
+debfix:
+       @$(PYTHON) setup_skytools.py install --help | grep -q install-layout \
+       && echo BROKEN_PYTHON=--install-layout=deb || echo 'WORKING_PYTHON=found'
+
 .PHONY: all clean distclean install deb debclean tgz tags
 .PHONY: python-all python-clean python-install check
 
index 35ae1354eabee03463c8090bc3d57cb2b6d86adb..1f849404845bafac15b3d036efd3ed2c125e8ad3 100644 (file)
@@ -10,7 +10,8 @@ Copyright: BSD
  Copyright 2006 Marko Kreen
 Build: sh
  PATH=/usr/lib/postgresql/PGVER/bin:$PATH \
- ./configure --prefix=/usr --with-pgconfig=/usr/lib/postgresql/PGVER/bin/pg_config --with-asciidoc
+ ./configure --prefix=/usr --with-pgconfig=/usr/lib/postgresql/PGVER/bin/pg_config \
+   --with-python=pythonPYVER --with-asciidoc
  #PATH=/usr/lib/postgresql/PGVER/bin:$PATH \
  #make DESTDIR=$ROOT
 Clean: sh
@@ -29,7 +30,8 @@ Description: Skype database tools - Python parts
  walmgr - failover server scripts
 Install: sh
  PATH=/usr/lib/postgresql/PGVER/bin:$PATH \
- make python-install DESTDIR=$ROOT prefix=/usr
+ make python-install DESTDIR=$ROOT prefix=/usr `make -s debfix`
+ cd $ROOT/usr/lib/pythonPYVER/* && mkdir skytools-3.0 && mv pgq skytools londiste skytools-3.0
 
 Package: skytools-modules-PGVER
 Architecture: any