From f59fdf710d92f0e2331a5da4ff72adf8d1bbe15e Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Thu, 23 Aug 2018 10:34:33 +0000 Subject: [PATCH 1/1] - move pg_config to system bindir, versioning cosmetics --- postgresql.spec | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/postgresql.spec b/postgresql.spec index fb47121..aa5b9db 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -27,7 +27,7 @@ Summary(ru.UTF-8): PostgreSQL - система управления базами Summary(tr.UTF-8): Veri Tabanı Yönetim Sistemi Summary(uk.UTF-8): PostgreSQL - система керування базами даних Summary(zh_CN.UTF-8): PostgreSQL 客户端程序和库文件 -Name: postgresql%{pgversion} +Name: postgresql-%{pgversion} Version: %{pgversion}.5 Release: 2 License: BSD @@ -660,7 +660,7 @@ rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \ $RPM_BUILD_ROOT/var/{lib/pgsql,log,run/postgresql} \ $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \ - $RPM_BUILD_ROOT%{_mandir} + $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} install src/tutorial/*.sql $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} @@ -681,8 +681,8 @@ done touch $RPM_BUILD_ROOT/var/log/pgsql -sed -e 's,@pgsqlbindir@,%{pgsqllibdir}/bin,g' %{SOURCE1} >$RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql%{pgversion} -install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql%{pgversion} +sed -e 's,@pgsqlbindir@,%{pgsqllibdir}/bin,g' %{SOURCE1} >$RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql-%{pgversion} +install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql-%{pgversion} install -d howto tar zxf %{SOURCE2} -C howto @@ -717,6 +717,9 @@ merge_lang psql initdb \ cp -p src/pl/plperl/ppport.h $RPM_BUILD_ROOT%{_includedir}/postgresql/%{pgversion}/server/ +%{__mv} $RPM_BUILD_ROOT{%{pgsqllibdir}/bin,%{_bindir}}/pg_config +%{__mv} $RPM_BUILD_ROOT{%{pgsqldatadir}/man,%{_mandir}}/man1/pg_config.1 + # package it...? nah, why bother. %{__rm} -r $RPM_BUILD_ROOT%{pgsqldatadir}/doc/html @@ -725,8 +728,8 @@ rm -rf $RPM_BUILD_ROOT %pre PG_DB_CLUSTERS="" -if [ -f /etc/sysconfig/postgresql%{pgversion} ]; then - . /etc/sysconfig/postgresql%{pgversion} +if [ -f /etc/sysconfig/postgresql-%{pgversion} ]; then + . /etc/sysconfig/postgresql-%{pgversion} if [ -z "$PG_DB_CLUSTERS" -a -n "$POSTGRES_DATA_DIR" ]; then PG_DB_CLUSTERS="$POSTGRES_DATA_DIR" fi @@ -770,13 +773,13 @@ echo "files so they reflect your changes." echo %post -/sbin/chkconfig --add postgresql%{pgversion} -%service postgresql%{pgversion} restart "postgresql%{pgversion} server" +/sbin/chkconfig --add postgresql-%{pgversion} +%service postgresql-%{pgversion} restart "postgresql-%{pgversion} server" %preun if [ "$1" = "0" ]; then - %service postgresql%{pgversion} stop - /sbin/chkconfig --del postgresql%{pgversion} + %service postgresql-%{pgversion} stop + /sbin/chkconfig --del postgresql-%{pgversion} fi %pre -n postgresql-common @@ -841,15 +844,9 @@ if [ $1 -eq 0 ]; then update-alternatives --remove vacuumdb %{pgsqllibdir}/bin/vacuumdb || : fi -%posttrans -n postgresql-devel -update-alternatives \ - --install %{_bindir}/pg_config pg_config %{pgsqllibdir}/bin/pg_config %{pgsuffix} \ - --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 @@ -859,8 +856,8 @@ update-alternatives \ %files -f main.lang %defattr(644,root,root,755) %doc COPYRIGHT README HISTORY doc/{bug.template,KNOWN_BUGS,MISSING_FEATURES,TODO} -%attr(754,root,root) /etc/rc.d/init.d/postgresql%{pgversion} -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/postgresql%{pgversion} +%attr(754,root,root) /etc/rc.d/init.d/postgresql-%{pgversion} +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/postgresql-%{pgversion} %attr(755,root,root) %{pgsqllibdir}/bin/initdb %attr(755,root,root) %{pgsqllibdir}/bin/pg_basebackup @@ -983,7 +980,7 @@ update-alternatives \ %files -n postgresql-devel -f pg_config-%{pgversion}.lang %defattr(644,root,root,755) -%attr(755,root,root) %{pgsqllibdir}/bin/pg_config +%attr(755,root,root) %{_bindir}/pg_config %attr(755,root,root) %{_libdir}/libpq.so %dir %{_includedir}/postgresql %{_includedir}/libpq-events.h @@ -1002,7 +999,7 @@ update-alternatives \ %{_includedir}/postgresql/internal/libpq %{_includedir}/libpq %{_libdir}/pkgconfig/libpq.pc -%{pgsqldatadir}/man/man1/pg_config.1* +%{_mandir}/man1/pg_config.1* %files backend-devel %defattr(644,root,root,755) -- 2.46.0