From: Marcin Krol Date: Wed, 22 Aug 2018 12:28:34 +0000 (+0000) Subject: - libpgport patch from debian X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=1e3d14aed7fb15868122c642354316d38365ae66;p=packages%2Fpostgresql.git - libpgport patch from debian - added alternative for pg_config --- diff --git a/libpgport-pkglibdir.patch b/libpgport-pkglibdir.patch new file mode 100644 index 0000000..1f67846 --- /dev/null +++ b/libpgport-pkglibdir.patch @@ -0,0 +1,68 @@ +--- a/src/common/Makefile ++++ b/src/common/Makefile +@@ -59,13 +59,13 @@ all: libpgcommon.a libpgcommon_srv.a + + # libpgcommon is needed by some contrib + install: all installdirs +- $(INSTALL_STLIB) libpgcommon.a '$(DESTDIR)$(libdir)/libpgcommon.a' ++ $(INSTALL_STLIB) libpgcommon.a '$(DESTDIR)$(pkglibdir)/libpgcommon.a' + + installdirs: +- $(MKDIR_P) '$(DESTDIR)$(libdir)' ++ $(MKDIR_P) '$(DESTDIR)$(pkglibdir)' + + uninstall: +- rm -f '$(DESTDIR)$(libdir)/libpgcommon.a' ++ rm -f '$(DESTDIR)$(pkglibdir)/libpgcommon.a' + + libpgcommon.a: $(OBJS_FRONTEND) + rm -f $@ +--- a/src/fe_utils/Makefile ++++ b/src/fe_utils/Makefile +@@ -35,13 +35,13 @@ distprep: psqlscan.c + + # libpgfeutils could be useful to contrib, so install it + install: all installdirs +- $(INSTALL_STLIB) libpgfeutils.a '$(DESTDIR)$(libdir)/libpgfeutils.a' ++ $(INSTALL_STLIB) libpgfeutils.a '$(DESTDIR)$(pkglibdir)/libpgfeutils.a' + + installdirs: +- $(MKDIR_P) '$(DESTDIR)$(libdir)' ++ $(MKDIR_P) '$(DESTDIR)$(pkglibdir)' + + uninstall: +- rm -f '$(DESTDIR)$(libdir)/libpgfeutils.a' ++ rm -f '$(DESTDIR)$(pkglibdir)/libpgfeutils.a' + + clean distclean: + rm -f libpgfeutils.a $(OBJS) lex.backup +--- a/src/port/Makefile ++++ b/src/port/Makefile +@@ -46,13 +46,13 @@ all: libpgport.a libpgport_srv.a + + # libpgport is needed by some contrib + install: all installdirs +- $(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(libdir)/libpgport.a' ++ $(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(pkglibdir)/libpgport.a' + + installdirs: +- $(MKDIR_P) '$(DESTDIR)$(libdir)' ++ $(MKDIR_P) '$(DESTDIR)$(pkglibdir)' + + uninstall: +- rm -f '$(DESTDIR)$(libdir)/libpgport.a' ++ rm -f '$(DESTDIR)$(pkglibdir)/libpgport.a' + + libpgport.a: $(OBJS) + rm -f $@ +--- a/src/Makefile.global.in ++++ b/src/Makefile.global.in +@@ -490,7 +490,7 @@ libpq = -L$(libpq_builddir) -lpq + # pgport before libpq. This does cause duplicate -lpgport's to appear + # on client link lines. + ifdef PGXS +-libpq_pgport = -L$(libdir) -lpgcommon -lpgport $(libpq) ++libpq_pgport = -L$(pkglibdir) -lpgcommon -lpgport $(libpq) + else + libpq_pgport = -L$(top_builddir)/src/common -lpgcommon -L$(top_builddir)/src/port -lpgport $(libpq) + endif diff --git a/postgresql.spec b/postgresql.spec index 3306e81..b5d0463 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -45,6 +45,7 @@ Patch3: per-version-dirs.patch Patch4: postgresql-disable_horology_test.patch Patch5: postgresql-heimdal.patch Patch6: postgresql-link.patch +Patch7: libpgport-pkglibdir.patch URL: http://www.postgresql.org/ BuildRequires: autoconf >= 2.69 BuildRequires: automake @@ -552,6 +553,7 @@ Różne moduły dołączone do PostgreSQL-a. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 # force rebuild of bison/flex files find src -name \*.l -o -name \*.y | xargs touch @@ -784,6 +786,15 @@ if [ $1 -eq 0 ]; then update-alternatives --remove vacuumdb %{pgsqllibdir}/bin/vacuumdb || : fi +%post -n postgresql-devel +update-alternatives \ + --install %{_bindir}/pg_config pg_config %{pgsqllibdir}/bin/pg_config %{pgver}%{pgminver} \ + --slave %{_mandir}/man1/pg_config.1 pg_config.1 %{pgsqldatadir}/man/man1/pg_config.1* || : + +%postun -n postgresql-devel + update-alternatives --remove pg_config %{pgsqllibdir}/bin/pg_config || : + + %post -n postgresql-libs -p /sbin/ldconfig %postun -n postgresql-libs -p /sbin/ldconfig @@ -935,9 +946,9 @@ fi %files -n postgresql-static %defattr(644,root,root,755) %{_libdir}/libpq.a -%{_libdir}/libpgcommon.a -%{_libdir}/libpgfeutils.a -%{_libdir}/libpgport.a +%{pgsqllibdir}/lib/libpgcommon.a +%{pgsqllibdir}/lib/libpgfeutils.a +%{pgsqllibdir}/lib/libpgport.a %files clients -f clients.lang %defattr(644,root,root,755)