EXTVERSION = 1.1
MODULES = $(EXTENSION)
-DATA = pgfincore.sql uninstall_pgfincore.sql
+DATA = $(EXTENSION).sql uninstall_$(EXTENSION).sql
DOCS = README.rst
REGRESS = $(EXTENSION)
PG_CONFIG = pg_config
-PG91 = $(shell $(PG_CONFIG) --version | grep -qE "8\.|9\.0" && echo no || echo yes)
+BUILD_EXTENSION = $(shell $(PG_CONFIG) --version | grep -qE "8\.|9\.0" && echo no || echo yes)
-ifeq ($(PG91),yes)
-all: pgfincore--$(EXTVERSION).sql
+ifeq ($(BUILD_EXTENSION),yes)
+all: $(EXTENSION)--$(EXTVERSION).sql
-pgfincore--$(EXTVERSION).sql: pgfincore.sql
+$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql
cp $< $@
-DATA = pgfincore--unpackaged--$(EXTVERSION).sql pgfincore--$(EXTVERSION).sql
+DATA = $(EXTENSION)--unpackaged--$(EXTVERSION).sql $(EXTENSION)--$(EXTVERSION).sql
REGRESS = $(EXTENSION).ext
EXTRA_CLEAN = $(EXTENSION)--$(EXTVERSION).sql
endif
include $(PGXS)
deb:
+ make clean
make -f debian/rules debian/control
dh clean
make -f debian/rules orig
debian/pgfincore-9.1/pgfincore.so usr/lib/postgresql/9.1/lib
debian/pgfincore-9.1/pgfincore*.sql usr/share/postgresql/9.1/extension
pgfincore--unpackaged--1.1.sql usr/share/postgresql/9.1/extension
-pgfincore.control /usr/share/postgresql/9.1/extension
+pgfincore.control usr/share/postgresql/9.1/extension
# build-arch and build-indep targets by Bill Allombert 2001
# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+# export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
-export SRCDIR = $(CURDIR)
-TARGET = $(CURDIR)/debian/pgfincore-%v
+EXTNAME = pgfincore
PKGVERS = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
EXCLUDE = --exclude-vcs --exclude=debian
+export SRCDIR = $(CURDIR)
+TARGET = $(CURDIR)/debian/$(EXTNAME)-%v
+
include /usr/share/postgresql-common/pgxs_debian_control.mk
-.PHONY: debian/control
override_dh_auto_clean: debian/control
- pg_buildext clean $(SRCDIR) $(TARGET) "$(CFLAGS)"
+ +pg_buildext clean $(SRCDIR) $(TARGET)
dh_clean
override_dh_auto_build:
override_dh_auto_install:
# then install each of them
for v in `pg_buildext supported-versions $(SRCDIR)`; do \
- dh_install -ppostgresql-$$v-pgfincore ;\
+ ls;\
+ dh_install -ppostgresql-$$v-$(EXTNAME) ;\
done
orig: clean
- cd .. && tar czf pgfincore_$(PKGVERS).orig.tar.gz $(EXCLUDE) pgfincore
+ cd .. && tar czf $(EXTNAME)_$(PKGVERS).orig.tar.gz $(EXCLUDE) $(EXTNAME)
%:
dh $@
+
+.PHONY: debian/control