deb cleanup
authorMarko Kreen <markokr@gmail.com>
Fri, 4 Jan 2013 08:55:33 +0000 (10:55 +0200)
committerMarko Kreen <markokr@gmail.com>
Fri, 4 Jan 2013 08:55:33 +0000 (10:55 +0200)
* use installed pg_buildext
* use installed pgxs_debian_control.mk
* 'make deb' forces control file regeneration

This reduces crap maintained locally.

It also does mean that to build against server-dev-X.Y package
that is not for Debians default Postgres version, following packages
need to be installed from PGDG (wiki.postgresql.org/wiki/Apt) repo:

  postgresql-client-common
  postgresql-common
  postgresql-server-dev-all

Makefile
debian/rules

index ddff4308755b709ca93e87ce80fe96004a1fd8df..c6d2f1f63e95967b503f1c850b535b2ad18bd77e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,8 @@ distclean: sub-distclean
        rm -rf autom4te.cache config.log config.status config.mak
 
 deb:
+       rm -f debian/control
+       make -f debian/rules debian/control
        debuild -uc -us -b
 
 tgz: config.mak clean
index 42f6c149b16d6513aea1e400487fad25ceac3d5b..3d02ad9bdbad302f4b66c3a3e1655cc8ac031c92 100755 (executable)
@@ -4,32 +4,15 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# This has to be exported to make some magic below work.
-#export DH_OPTIONS
-
-# The build system is averse to VPATH building, so we can't properly use
-# postgresql-server-dev-all
 SRCDIR      = $(CURDIR)
 PKGVERS     = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
 ORIG_EXCLUDE=--exclude-vcs --exclude=debian
 
-PG_BUILDEXT = ./debian/pg_buildext
+PG_BUILDEXT = pg_buildext
 
-## include /usr/share/postgresql-common/pgxs_debian_control.mk
-# produce a debian/control file from a debian/control.in
-debian/control-pgstamp: debian/control.in debian/pgversions
-       ( set -e; \
-         VERSIONS=`$(PG_BUILDEXT) supported-versions $(CURDIR)`; \
-         grep-dctrl -vP PGVERSION debian/control.in > debian/control.tmp; \
-         for v in $$VERSIONS; do                    \
-               grep -q "^$$v" debian/pgversions   \
-               && grep-dctrl -P PGVERSION debian/control.in       \
-               | sed -e "s:PGVERSION:$$v:" >> debian/control.tmp; \
-         done; \
-         mv debian/control.tmp debian/control ) || (rm -f debian/control.tmp; exit 1)
-       touch $@
+include /usr/share/postgresql-common/pgxs_debian_control.mk
 
-config.mak: debian/control-pgstamp
+config.mak:
        #./autogen.sh
        ./configure --prefix=/usr --with-asciidoc --with-sk3-subdir
 
@@ -41,7 +24,6 @@ override_dh_auto_clean: config.mak
        for version in `cat $(CURDIR)/debian/pgversions`; do \
                rm -rf "debian/postgresql-$${version}-pgq3"; \
        done
-       rm -f debian/control-pgstamp
 
 # build sql modules for several postgres versions
 override_dh_auto_install: config.mak