From 65edc75e8f6d8d0c725bdd0078753accca31e71d Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 27 Dec 2009 20:37:47 -0500 Subject: [PATCH] Generate postgresql.conf with LC_ALL=en_US.UTF-8 pg_createcluster. Generate a new /etc/postgresql/8.3/main/postgresql.conf with pg_createcluster instead of taking it from the build host. Ensure that it is generated with the en_US.UTF-8 locale. svn path=/trunk/packages/invirt-database/; revision=2798 --- debian/changelog | 8 ++++++++ debian/invirt-database-server.install | 1 + debian/rules | 20 +++++++++++++++++--- debian/transform_postgresql.conf.invirt | 5 +++-- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index dde051e..9e53ebb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +invirt-database (0.2.4) unstable; urgency=low + + * Generate a new /etc/postgresql/8.3/main/postgresql.conf with + pg_createcluster instead of taking it from the build host. Ensure + that it is generated with the en_US.UTF-8 locale. + + -- Anders Kaseorg Sun, 27 Dec 2009 20:32:21 -0500 + invirt-database (0.2.3) unstable; urgency=low * Test whether invirt user exists in postinst diff --git a/debian/invirt-database-server.install b/debian/invirt-database-server.install index 89661c5..a8795e6 100644 --- a/debian/invirt-database-server.install +++ b/debian/invirt-database-server.install @@ -1,3 +1,4 @@ postgresql-8.3.invirt etc/init.d +debian/postgresql.conf.invirt etc/postgresql/8.3/main pg_hba.conf.mako etc/postgresql/8.3/main invirt-database-tables usr/bin diff --git a/debian/rules b/debian/rules index d2e9b8f..38b97df 100755 --- a/debian/rules +++ b/debian/rules @@ -4,15 +4,29 @@ DEB_PYTHON_SYSTEM=pysupport DEB_DIVERT_EXTENSION = .invirt -DEB_TRANSFORM_FILES_invirt-database-server += \ - /etc/postgresql/8.3/main/postgresql.conf.invirt - DEB_DIVERT_FILES_invirt-database-server += \ + /etc/postgresql/8.3/main/postgresql.conf.invirt \ /etc/init.d/postgresql-8.3.invirt include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk include /usr/share/cdbs/1/rules/config-package.mk +common-build-indep:: debian/postgresql.conf.invirt + +debian/postgresql.conf.invirt: debian/transform_postgresql.conf.invirt + set -e; \ + export invirt_tmp="$$(mktemp -dt invirt-database.XXXXXX)"; \ + PG_CLUSTER_CONF_ROOT="$$invirt_tmp/etc/postgresql" \ + LC_ALL=en_US.UTF-8 \ + pg_createcluster 8.3 main \ + --datadir="$$invirt_tmp/var/lib/postgresql/8.3/main" \ + --socketdir=/var/run/postgresql \ + --port=5432; \ + chmod +x $<; \ + $< < "$$invirt_tmp/etc/postgresql/8.3/main/postgresql.conf" > $@; \ + rm -rf "$$invirt_tmp" + clean:: rm -rf invirt.database.egg-info + rm -f debian/postgresql.conf.invirt diff --git a/debian/transform_postgresql.conf.invirt b/debian/transform_postgresql.conf.invirt index 57ea82a..ade4486 100755 --- a/debian/transform_postgresql.conf.invirt +++ b/debian/transform_postgresql.conf.invirt @@ -1,4 +1,5 @@ #!/usr/bin/perl -0p -s/^#?listen_addresses = '[^']*'(.*)$/listen_addresses = '*'$1/m or die; -s/^#?port = [0-9]*(.*)$/port = 5432$1/m or die; +s#\Q$ENV{invirt_tmp}\E##g; +s/^#ssl = off/ssl = true/m or die; +s/^#?listen_addresses = '[^']*'/listen_addresses = '*'/m or die; -- 1.7.9.5