Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deps-packaging/postgresql/cfbuild-postgresql.spec
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
%define postgresql_major_version 17
%define postgresql_minor_version 0
%define postgresql_version ${postgresql_major_version}.${postgresql_minor_version}
%define postgresql_version 17.0

Summary: CFEngine Build Automation -- postgresql
Expand All @@ -13,10 +16,14 @@ BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}-buildroot

AutoReqProv: no

%define prefix %{buildprefix}
# Build PostgreSQL in a major-version named dir so that binaries are linked to the specific major version.
# This makes pg_upgrade work more easily.
# In the past we simply used the main prefix: /var/cfengine by default and this caused trouble with symbols when using pg_upgrade because both old and new postgresql binaries linked to /var/cfengine/lib/libpq.so and similar.
%define prefix %{buildprefix}/PostgreSQL/${postgresql_major_version}

%prep
mkdir -p %{_builddir}
mkdir -p ${prefix} # maybe not needed?
%setup -q -n postgresql-%{postgresql_version}

%build
Expand Down

This file was deleted.

43 changes: 0 additions & 43 deletions deps-packaging/postgresql/debian/cfbuild-postgresql.install

This file was deleted.

19 changes: 11 additions & 8 deletions deps-packaging/postgresql/debian/rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/make -f

POSTGRESQL_MAJOR_VERSION=17
POSTGRESQL_MINOR_VERSION=0
BUILD_PREFIX=$(PREFIX)/PostgreSQL/$(POSTGRESQL_MAJOR_VERSION)
PREFIX=$(BUILDPREFIX)

clean:
Expand All @@ -12,7 +15,7 @@ build: build-stamp
build-stamp:
dh_testdir

LD_LIBRARY_PATH=$(PREFIX)/lib CPPFLAGS=-I$(PREFIX)/include ./configure --prefix=$(PREFIX) --without-zlib --without-readline --with-openssl --without-icu
LD_LIBRARY_PATH=$(PREFIX)/lib CPPFLAGS=-I$(PREFIX)/include ./configure --prefix=$(BUILD_PREFIX) --without-zlib --without-readline --with-openssl --without-icu
# force generated-headers in src/backend because the headers are needed for other things and somehow dependencies don't work properly
make -C ./src/backend generated-headers
make
Expand All @@ -26,13 +29,13 @@ install: build
dh_installdirs
make install DESTDIR=$(CURDIR)/debian/tmp
make -C contrib install DESTDIR=$(CURDIR)/debian/tmp
rm -f $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/postgresl.conf.cfengine
patch -d $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/ -o postgresql.conf.cfengine < $(CURDIR)/postgresql.conf.cfengine.patch
patch $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/postgresql.conf.sample $(CURDIR)/postgresql.conf.sample.patch
chmod --reference $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/postgresql.conf.sample $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/postgresql.conf.cfengine
chown --reference $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/postgresql.conf.sample $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/postgresql.conf.cfengine
patch $(CURDIR)/debian/tmp$(PREFIX)/share/postgresql/pg_hba.conf.sample $(CURDIR)/pg_hba.conf.sample.patch
rm -f $(CURDIR)/debian/tmp$(PREFIX)/lib/*.a
rm -f $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/postgresl.conf.cfengine
patch -d $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/ -o postgresql.conf.cfengine < $(CURDIR)/postgresql.conf.cfengine.patch
patch $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/postgresql.conf.sample $(CURDIR)/postgresql.conf.sample.patch
chmod --reference $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/postgresql.conf.sample $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/postgresql.conf.cfengine
chown --reference $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/postgresql.conf.sample $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/postgresql.conf.cfengine
patch $(CURDIR)/debian/tmp$(BUILD_PREFIX)/share/postgresql/pg_hba.conf.sample $(CURDIR)/pg_hba.conf.sample.patch
rm -f $(CURDIR)/debian/tmp$(BUILD_PREFIX)/lib/*.a

binary-indep: build install

Expand Down