debian packaging
authorDimitri Fontaine <dim@tapoueh.org>
Tue, 30 Nov 2010 16:02:10 +0000 (17:02 +0100)
committerDimitri Fontaine <dim@tapoueh.org>
Tue, 30 Nov 2010 16:02:10 +0000 (17:02 +0100)
Makefile
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control.in [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/pgversions [new file with mode: 0644]
debian/postgresql-8.4-pgfincore.dirs [new file with mode: 0644]
debian/postgresql-8.4-pgfincore.docs [new file with mode: 0644]
debian/postgresql-8.4-pgfincore.install [new file with mode: 0644]
debian/rules [new file with mode: 0755]

index 79169313486ef811877ab16d069ef65c5b9441ec..106cef4ba0987d411f80536048d74f283ee74f8e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,44 @@
+PKGNAME = pgfincore
+PKGVERS = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
+
+DEBDIR = /tmp/$(PKGNAME)
+EXPORT = $(DEBDIR)/export/$(PKGNAME)-$(PKGVERS)
+ORIG   = $(DEBDIR)/export/$(PKGNAME)_$(PKGVERS).orig.tar.gz
+ARCHIVE= $(DEBDIR)/export/$(PKGNAME)-$(PKGVERS).tar.gz
+DEBEXTS= {gz,changes,build,dsc}
+
 MODULES = pgfincore
 DATA_built = pgfincore.sql uninstall_pgfincore.sql
 DOCS = README.pgfincore
 
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
+PG_CONFIG ?= pg_config
+PGXS = $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
-else
-subdir = contrib/pgfincore
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-include $(top_srcdir)/contrib/contrib-global.mk
-endif
+
+deb:
+       # working copy from where to make the .orig archive
+       rm -rf $(DEBDIR)        
+       mkdir -p $(DEBDIR)/$(PKGNAME)-$(PKGVERS)
+       mkdir -p $(EXPORT)
+       rsync -Ca . $(EXPORT)
+
+       # get rid of temp and build files
+       for n in ".#*" "*~" "build-stamp" "configure-stamp" "prefix.sql" "prefix.so"; do \
+         find $(EXPORT) -name "$$n" -print0|xargs -0 rm -f; \
+       done
+
+       # prepare the .orig without the debian/ packaging stuff
+       rsync -Ca $(EXPORT) $(DEBDIR)
+       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
+       cp $(ORIG) $(ARCHIVE)
+
+       # build the debian package and copy them to ..
+       (cd $(EXPORT) && make -f debian/rules debian/control && debuild)
+
+       cp $(EXPORT)/debian/control debian
+       find $(DEBDIR)/export -maxdepth 1 -type f -name "*$(PGGVERS)*" -exec cp {} .. \;
+
+.PHONY: deb
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..ecab3eb
--- /dev/null
@@ -0,0 +1,6 @@
+pgfincore (0.3-1) unstable; urgency=low
+
+  * Initial packaging
+
+ -- Dimitri Fontaine <dim@tapoueh.org>  Tue, 30 Nov 2010 15:27:25 +0100
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control.in b/debian/control.in
new file mode 100644 (file)
index 0000000..93aba40
--- /dev/null
@@ -0,0 +1,16 @@
+Source: pgfincore
+Section: database
+Priority: extra
+Maintainer: Dimitri Fontaine <dim@tapoueh.org>
+Build-Depends: debhelper (>= 7), postgresql-server-dev-all, postgresql-server-dev-8.4
+Standards-Version: 3.9.1
+Homepage: http://villemain.org/projects/pgfincore
+
+Package: postgresql-PGVERSION-pgfincore
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-PGVERSION
+Description: set of PostgreSQL functions to manage blocks in memory
+ Those functions let you know which and how many disk block from a relation
+ are in the page cache of the operating system, and eventually write the
+ result to a file. Then using this file, it is possible to restore the page
+ cache state for each block of the relation.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..bb6c520
--- /dev/null
@@ -0,0 +1,38 @@
+This package was debianized by Dimitri Fontaine <dim@tapoueh.org> on
+Tue, 30 Nov 2010 15:27:25 +0100.
+
+It was downloaded from http://pgfoundry.org/projects/pgfincore/
+
+Copyright Holders:
+
+ Copyright (c) 2009 - CΓ©dric Villemain <cedric@villemain.org>
+
+License:
+/*
+ * Copyright (c) 2009 CΓ©dric Villemain <cedric@villemain.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *        notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *        notice, this list of conditions and the following disclaimer in the
+ *        documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of any co-contributors
+ *        may be used to endorse or promote products derived from this software
+ *        without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
diff --git a/debian/pgversions b/debian/pgversions
new file mode 100644 (file)
index 0000000..c9dc049
--- /dev/null
@@ -0,0 +1 @@
+8.4
diff --git a/debian/postgresql-8.4-pgfincore.dirs b/debian/postgresql-8.4-pgfincore.dirs
new file mode 100644 (file)
index 0000000..8b6e244
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/postgresql/8.4/lib
+usr/share/postgresql/8.4/contrib
diff --git a/debian/postgresql-8.4-pgfincore.docs b/debian/postgresql-8.4-pgfincore.docs
new file mode 100644 (file)
index 0000000..c6ec405
--- /dev/null
@@ -0,0 +1 @@
+README.pgfincore
diff --git a/debian/postgresql-8.4-pgfincore.install b/debian/postgresql-8.4-pgfincore.install
new file mode 100644 (file)
index 0000000..853ea04
--- /dev/null
@@ -0,0 +1,3 @@
+debian/pgfincore-8.4/pgfincore.so usr/lib/postgresql/8.4/lib
+debian/pgfincore-8.4/pgfincore.sql usr/share/postgresql/8.4/contrib
+debian/pgfincore-8.4/uninstall_pgfincore.sql usr/share/postgresql/8.4/contrib
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..81df2f1
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/make -f
+
+include /usr/share/postgresql-common/pgxs_debian_control.mk
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+SRCDIR = $(CURDIR)
+TARGET = $(CURDIR)/debian/pgfincore-%v
+
+build: debian/control
+
+clean:
+       dh_testdir
+       dh_testroot
+       pg_buildext clean $(SRCDIR) $(TARGET) "$(CFLAGS)"
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_prep 
+       dh_installdirs
+
+       # build all supported version
+       pg_buildext build $(SRCDIR) $(TARGET) "$(CFLAGS)"
+
+       # then install each of them
+       for v in `pg_buildext supported-versions $(SRCDIR)`; do \
+               dh_install -ppostgresql-$$v-pgfincore ;\
+       done
+
+binary-indep: build install
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs
+       dh_installdocs
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install debian/control