Skip to content

Commit

Permalink
Adapt debian/rules to newer development tools yet to be proposed, as …
Browse files Browse the repository at this point in the history
…an usage example.
  • Loading branch information
dimitri committed Jan 6, 2010
1 parent e1bcb8e commit eb67ed4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -46,7 +46,7 @@ deb:
rm -rf $(DEBDIR)/$(PKGNAME)-$(PKGVERS)/debian
(cd $(DEBDIR) && tar czf $(ORIG) $(PKGNAME)-$(PKGVERS))

# have a copy of the $ORIG file named $ARCHIVE for non-debian packagers
# have a copy of the $$ORIG file named $$ARCHIVE for non-debian packagers
cp $(ORIG) $(ARCHIVE)

# build the debian package and copy them to ..
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -2,7 +2,7 @@ Source: prefix
Section: database
Priority: extra
Maintainer: Dimitri Fontaine <dim@tapoueh.org>
Build-Depends: debhelper (>= 5.0.0), postgresql-server-dev-8.3, postgresql-server-dev-8.4
Build-Depends: debhelper (>= 7), postgresql-dev-common, postgresql-server-dev-8.3, postgresql-server-dev-8.4
Standards-Version: 3.8.3

Package: postgresql-8.3-prefix
Expand Down
30 changes: 9 additions & 21 deletions debian/rules
@@ -1,31 +1,21 @@
#!/usr/bin/make -f

PG_CFG83 = /usr/lib/postgresql/8.3/bin/pg_config
PG_CFG84 = /usr/lib/postgresql/8.4/bin/pg_config

CFLAGS83 = $(shell $(PG_CFG83) --cflags)
CFLAGS84 = $(shell $(PG_CFG84) --cflags)

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS83 += -O0
CFLAGS84 += -O0
CFLAGS += -O0
else
CFLAGS83 += -O2
CFLAGS84 += -O2
CFLAGS += -O2
endif

SRCDIR = $(CURDIR)
TGT83 = $(CURDIR)/debian/prefix-8.3
TGT84 = $(CURDIR)/debian/prefix-8.4
TARGET = $(CURDIR)/debian/prefix-%v

build:

clean:
dh_testdir
dh_testroot
$(MAKE) clean PG_CONFIG="$(PG_CFG83)"
$(MAKE) clean PG_CONFIG="$(PG_CFG84)"
rm -rf $(TGT83) $(TGT84)
pg_buildext clean $(SRCDIR) $(TARGET) 8.3 "$(CFLAGS)"
pg_buildext clean $(SRCDIR) $(TARGET) 8.4 "$(CFLAGS)"
dh_clean

install: build
Expand All @@ -34,13 +24,11 @@ install: build
dh_prep
dh_installdirs

mkdir -p $(TGT83) $(TGT84)

cd $(TGT83) && $(MAKE) -f $(SRCDIR)/Makefile CFLAGS="$(CFLAGS)" PG_CONFIG="$(PG_CFG83)" VPATH="$(SRCDIR)"
dh_install -ppostgresql-8.3-prefix
pg_buildext build $(SRCDIR) $(TARGET) 8.3 "$(CFLAGS)" && \
dh_install -ppostgresql-8.3-prefix || echo "skipping 8.3"

cd $(TGT84) && $(MAKE) -f $(SRCDIR)/Makefile CFLAGS="$(CFLAGS)" PG_CONFIG="$(PG_CFG84)" VPATH="$(SRCDIR)"
dh_install -ppostgresql-8.4-prefix
pg_buildext build $(SRCDIR) $(TARGET) 8.4 "$(CFLAGS)" && \
dh_install -ppostgresql-8.4-prefix || echo "skipping 8.4"

binary-indep: build install
binary-arch: build install
Expand Down

0 comments on commit eb67ed4

Please sign in to comment.