From: Marcin Krol Date: Wed, 22 Aug 2018 13:22:58 +0000 (+0000) Subject: - dropped libpgport patch X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=e5cd810d1003fb9edafc2ec6fd59e4348fa14f21;p=packages%2Fpostgresql.git - dropped libpgport patch - added common packages with shared directories - moved postgres user creation to main common package --- diff --git a/libpgport-pkglibdir.patch b/libpgport-pkglibdir.patch deleted file mode 100644 index 1f67846..0000000 --- a/libpgport-pkglibdir.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- 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 3c12f7d..6cc0fe8 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -45,7 +45,6 @@ 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 @@ -84,11 +83,10 @@ BuildRequires: zlib-devel Requires(post,preun): /sbin/chkconfig Requires(pre): /bin/id Requires(pre): /usr/bin/getgid -Requires(pre): /usr/sbin/groupadd -Requires(pre): /usr/sbin/useradd Requires(triggerpostun): /bin/id Requires(triggerpostun): /usr/sbin/usermod Requires: %{name}-clients >= %{version}-%{release} +Requires: %{name}-dirs = %{version}-%{release} Requires: postgresql-libs = %{version}-%{release} Requires: rc-scripts >= 0.4.3.0 Requires: tzdata @@ -172,6 +170,30 @@ PostgreSQL. PostgreSQL może być uruchomiony pod następującymi systemami: Solaris, SunOS, HPUX, AIX, Linux, Irix, FreeBSD i innymi systemami uniksowymi. +%package -n postgresql-common +Summary: Common PostgreSQL files and directories +Summary(pl.UTF-8): PostgreSQL - wspólne pliki i katalogi +Group: Applicataion/Databases +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd + +%description -n postgresql-common +Common PostgreSQL files and directories. + +%description -n postgresql-common -l pl.UTF-8 +PostgreSQL - wspólne pliki i katalogi. + +%package dirs +Summary: Common directories for PostgresSQL %{pgver} +Summary(pl.UTF-8): Wspólne pliki i katalogi dla PostgreSQL %{pgver} +Group: Applicataion/Databases + +%description dirs +Common directories for PostgresSQL %{pgver} + +%description dirs -l pl.UTF-8 +Wspólne pliki i katalogi dla PostgreSQL %{pgver} + %package -n postgresql-devel Summary: PostgreSQL development header files and libraries Summary(de.UTF-8): PostgreSQL-Entwicklungs-Header-Dateien und Libraries @@ -219,6 +241,7 @@ Summary(ru.UTF-8): Клиентские программы, необходимы Summary(uk.UTF-8): Клієнтські програми, необхідні для доступу до сервера PostgreSQL Group: Applications/Databases Requires: alternatives +Requires: %{name}-dirs = %{version}-%{release} Requires: postgresql-libs = %{version}-%{release} %description clients @@ -253,6 +276,7 @@ Summary(pl.UTF-8): Biblioteki dzielone programu PostgreSQL Summary(pt_BR.UTF-8): Biblioteca compartilhada do PostgreSQL Summary(zh_CN.UTF-8): PostgreSQL 客户所需要的共享库 Group: Libraries +Requires: postgresql-common = %{version}-%{release} %description -n postgresql-libs PostgreSQL shared libraries. @@ -264,6 +288,7 @@ Biblioteki dzielone programu PostgreSQL. Summary: Embedded SQL in C interface Summary(pl.UTF-8): Interfejs wbudowanego SQL-a w język C Group: Libraries +Requires: %{name}-dirs = %{version}-%{release} Requires: postgresql-libs = %{version}-%{release} Requires: postgresql-ecpg-libs = %{version}-%{release} @@ -554,7 +579,6 @@ 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 @@ -711,8 +735,6 @@ if [ "$foundold" = "1" ]; then echo exit 1 fi -%groupadd -g 88 -r postgres -%useradd -M -o -r -u 88 -d /home/services/postgres -s /bin/sh -g postgres -c "PostgreSQL Server" postgres %triggerpostun -- %{name} < 7.2-2 if [ -n "`/bin/id -u postgres 2>/dev/null`" ]; then @@ -729,7 +751,11 @@ if [ "$1" = "0" ]; then /sbin/chkconfig --del postgresql10 fi -%post clients +%pre -n postgresql-common +%groupadd -g 88 -r postgres +%useradd -M -o -r -u 88 -d /home/services/postgres -s /bin/sh -g postgres -c "PostgreSQL Server" postgres + +%post clients update-alternatives \ --install %{_bindir}/clusterdb clusterdb %{pgsqllibdir}/bin/clusterdb %{pgver}%{pgminver} \ --slave %{_mandir}/man1/clusterdb.1 clusterdb.1 %{pgsqldatadir}/man/man1/clusterdb.1* || : @@ -770,7 +796,7 @@ update-alternatives \ --install %{_bindir}/vacuumdb vacuumdb %{pgsqllibdir}/bin/vacuumdb %{pgver}%{pgminver} \ --slave %{_mandir}/man1/vacuumdb.1 vacuumdb.1 %{pgsqldatadir}/man/man1/vacuumdb.1* || : -%postun clients +%postun clients if [ $1 -eq 0 ]; then update-alternatives --remove clusterdb %{pgsqllibdir}/bin/clusterdb || : update-alternatives --remove createdb %{pgsqllibdir}/bin/createdb || : @@ -841,7 +867,6 @@ update-alternatives \ %{extensiondir}/plpgsql--*.sql %{extensiondir}/plpgsql.control -%dir %{pgsqldatadir} %{pgsqldatadir}/*.bki %{pgsqldatadir}/*.sample %{pgsqldatadir}/*.description @@ -873,6 +898,22 @@ update-alternatives \ %{pgsqldatadir}/man/man1/postgres.1* %{pgsqldatadir}/man/man1/postmaster.1* +%files -n postgresql-common +%defattr(644,root,root,755) +%dir %{_libdir}/postgresql +%dir %{_datadir}/postgresql + +%files dirs +%defattr(644,root,root,755) +%dir %{pgsqllibdir} +%dir %{pgsqllibdir}/bin +%dir %{pgsqllibdir}/lib +%dir %{pgsqldatadir} +%dir %{pgsqldatadir}/man +%dir %{pgsqldatadir}/man/man1 +%dir %{pgsqldatadir}/man/man3 +%dir %{pgsqldatadir}/man/man7 + %files doc %defattr(644,root,root,755) %doc doc/src/sgml/html howto @@ -947,9 +988,9 @@ update-alternatives \ %files -n postgresql-static %defattr(644,root,root,755) %{_libdir}/libpq.a -%{pgsqllibdir}/lib/libpgcommon.a -%{pgsqllibdir}/lib/libpgfeutils.a -%{pgsqllibdir}/lib/libpgport.a +%{_libdir}/libpgcommon.a +%{_libdir}/libpgfeutils.a +%{_libdir}/libpgport.a %files clients -f clients.lang %defattr(644,root,root,755)