From: Marcin Krol Date: Thu, 23 Aug 2018 10:11:02 +0000 (+0000) Subject: - keep version and suffix separate, we may need it in future X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=b19a7e8f4294c339af9665aee5d786b36d9b26af;p=packages%2Fpostgresql.git - keep version and suffix separate, we may need it in future --- diff --git a/postgresql.spec b/postgresql.spec index 57c5aad..fb47121 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -14,8 +14,8 @@ # %define beta %{nil} -%define pgver 10 -%define pgminver 5 +%define pgversion 10 +%define pgsuffix 10 Summary: PostgreSQL Data Base Management System Summary(de.UTF-8): PostgreSQL Datenbankverwaltungssystem @@ -27,8 +27,8 @@ 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%{pgver} -Version: %{pgver}.%{pgminver} +Name: postgresql%{pgversion} +Version: %{pgversion}.5 Release: 2 License: BSD Group: Applications/Databases @@ -98,8 +98,8 @@ Obsoletes: postgresql-server Obsoletes: postgresql-test BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -%define pgsqldatadir %{_datadir}/postgresql/%{pgver} -%define pgsqllibdir %{_libdir}/postgresql/%{pgver} +%define pgsqldatadir %{_datadir}/postgresql/%{pgversion} +%define pgsqllibdir %{_libdir}/postgresql/%{pgversion} %define moduledir %{pgsqllibdir}/lib %define extensiondir %{pgsqldatadir}/extension @@ -186,15 +186,15 @@ Common PostgreSQL files and directories. 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} +Summary: Common directories for PostgresSQL %{pgversion} +Summary(pl.UTF-8): Wspólne pliki i katalogi dla PostgreSQL %{pgversion} Group: Applicataion/Databases %description dirs -Common directories for PostgresSQL %{pgver} +Common directories for PostgresSQL %{pgversion} %description dirs -l pl.UTF-8 -Wspólne pliki i katalogi dla PostgreSQL %{pgver} +Wspólne pliki i katalogi dla PostgreSQL %{pgversion} %package -n postgresql-devel Summary: PostgreSQL development header files and libraries @@ -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/postgresql10 -install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql10 +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 @@ -696,11 +696,11 @@ tar zxf %{SOURCE2} -C howto for f in libpq5 pgscripts postgres psql initdb ecpg ecpglib6 \ plpgsql %{?with_perl:plperl} %{?with_python:plpython} \ pg_archivecleanup pg_basebackup pg_config pg_controldata pg_ctl pg_dump pg_resetwal pg_rewind pg_test_fsync pg_test_timing pg_upgrade pg_waldump; do - %find_lang $f-%{pgver} + %find_lang $f-%{pgversion} done # merge locales merge_lang() { - cat $(for f in $@; do echo ${f}-%{pgver}.lang ; done) + cat $(for f in $@; do echo ${f}-%{pgversion}.lang ; done) } merge_lang pgscripts postgres plpgsql \ pg_basebackup pg_controldata pg_resetwal pg_rewind pg_upgrade pg_test_fsync pg_test_timing pg_waldump > main.lang @@ -708,14 +708,14 @@ merge_lang psql initdb \ pg_archivecleanup pg_ctl pg_dump > clients.lang %if %{with tcl} -%find_lang pltcl-%{pgver} +%find_lang pltcl-%{pgversion} %endif %if %{with selinux} %{__mv} $RPM_BUILD_ROOT{%{pgsqldatadir}/contrib,%{extensiondir}}/sepgsql.sql %endif -cp -p src/pl/plperl/ppport.h $RPM_BUILD_ROOT%{_includedir}/postgresql/%{pgver}/server/ +cp -p src/pl/plperl/ppport.h $RPM_BUILD_ROOT%{_includedir}/postgresql/%{pgversion}/server/ # package it...? nah, why bother. %{__rm} -r $RPM_BUILD_ROOT%{pgsqldatadir}/doc/html @@ -725,8 +725,8 @@ rm -rf $RPM_BUILD_ROOT %pre PG_DB_CLUSTERS="" -if [ -f /etc/sysconfig/postgresql10 ]; then - . /etc/sysconfig/postgresql10 +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 @@ -734,7 +734,7 @@ fi foundold=0 for pgdir in $PG_DB_CLUSTERS; do if [ -f $pgdir/PG_VERSION ]; then - if [ $(cat $pgdir/PG_VERSION) != '%{pgver}' ]; then + if [ $(cat $pgdir/PG_VERSION) != '%{pgversion}' ]; then echo "Found database(s) in older, incompatible format in cluster $pgdir." foundold=1 fi @@ -770,13 +770,13 @@ echo "files so they reflect your changes." echo %post -/sbin/chkconfig --add postgresql10 -%service postgresql10 restart "postgresql10 server" +/sbin/chkconfig --add postgresql%{pgversion} +%service postgresql%{pgversion} restart "postgresql%{pgversion} server" %preun if [ "$1" = "0" ]; then - %service postgresql10 stop - /sbin/chkconfig --del postgresql10 + %service postgresql%{pgversion} stop + /sbin/chkconfig --del postgresql%{pgversion} fi %pre -n postgresql-common @@ -785,43 +785,43 @@ fi %posttrans clients update-alternatives \ - --install %{_bindir}/clusterdb clusterdb %{pgsqllibdir}/bin/clusterdb %{pgver}%{pgminver} \ + --install %{_bindir}/clusterdb clusterdb %{pgsqllibdir}/bin/clusterdb %{pgsuffix} \ --slave %{_mandir}/man1/clusterdb.1 clusterdb.1 %{pgsqldatadir}/man/man1/clusterdb.1* || : update-alternatives \ - --install %{_bindir}/createdb createdb %{pgsqllibdir}/bin/createdb %{pgver}%{pgminver} \ + --install %{_bindir}/createdb createdb %{pgsqllibdir}/bin/createdb %{pgsuffix} \ --slave %{_mandir}/man1/createdb.1 createdb.1 %{pgsqldatadir}/man/man1/createdb.1* || : update-alternatives \ - --install %{_bindir}/createuser createuser %{pgsqllibdir}/bin/createuser %{pgver}%{pgminver} \ + --install %{_bindir}/createuser createuser %{pgsqllibdir}/bin/createuser %{pgsuffix} \ --slave %{_mandir}/man1/createuser.1 createuser.1 %{pgsqldatadir}/man/man1/createuser.1* || : update-alternatives \ - --install %{_bindir}/dropdb dropdb %{pgsqllibdir}/bin/dropdb %{pgver}%{pgminver} \ + --install %{_bindir}/dropdb dropdb %{pgsqllibdir}/bin/dropdb %{pgsuffix} \ --slave %{_mandir}/man1/dropdb.1 dropdb.1 %{pgsqldatadir}/man/man1/dropdb.1* || : update-alternatives \ - --install %{_bindir}/dropuser dropuser %{pgsqllibdir}/bin/dropuser %{pgver}%{pgminver} \ + --install %{_bindir}/dropuser dropuser %{pgsqllibdir}/bin/dropuser %{pgsuffix} \ --slave %{_mandir}/man1/dropuser.1 dropuser.1 %{pgsqldatadir}/man/man1/dropuser.1* || : update-alternatives \ - --install %{_bindir}/pg_archivecleanup pg_archivecleanup %{pgsqllibdir}/bin/pg_archivecleanup %{pgver}%{pgminver} \ + --install %{_bindir}/pg_archivecleanup pg_archivecleanup %{pgsqllibdir}/bin/pg_archivecleanup %{pgsuffix} \ --slave %{_mandir}/man1/pg_archivecleanup.1 pg_archivecleanup.1 %{pgsqldatadir}/man/man1/pg_archivecleanup.1* || : update-alternatives \ - --install %{_bindir}/pg_dump pg_dump %{pgsqllibdir}/bin/pg_dump %{pgver}%{pgminver} \ + --install %{_bindir}/pg_dump pg_dump %{pgsqllibdir}/bin/pg_dump %{pgsuffix} \ --slave %{_mandir}/man1/pg_dump.1 pg_dump.1 %{pgsqldatadir}/man/man1/pg_dump.1* || : update-alternatives \ - --install %{_bindir}/pg_dumpall pg_dumpall %{pgsqllibdir}/bin/pg_dumpall %{pgver}%{pgminver} \ + --install %{_bindir}/pg_dumpall pg_dumpall %{pgsqllibdir}/bin/pg_dumpall %{pgsuffix} \ --slave %{_mandir}/man1/pg_dumpall.1 pg_dumpall.1 %{pgsqldatadir}/man/man1/pg_dumpall.1* || : update-alternatives \ - --install %{_bindir}/pg_isready pg_isready %{pgsqllibdir}/bin/pg_isready %{pgver}%{pgminver} \ + --install %{_bindir}/pg_isready pg_isready %{pgsqllibdir}/bin/pg_isready %{pgsuffix} \ --slave %{_mandir}/man1/pg_isready.1 pg_isready.1 %{pgsqldatadir}/man/man1/pg_isready.1* || : update-alternatives \ - --install %{_bindir}/pg_restore pg_restore %{pgsqllibdir}/bin/pg_restore %{pgver}%{pgminver} \ + --install %{_bindir}/pg_restore pg_restore %{pgsqllibdir}/bin/pg_restore %{pgsuffix} \ --slave %{_mandir}/man1/pg_restore.1 pg_restore.1 %{pgsqldatadir}/man/man1/pg_restore.1* || : update-alternatives \ - --install %{_bindir}/psql psql %{pgsqllibdir}/bin/psql %{pgver}%{pgminver} \ + --install %{_bindir}/psql psql %{pgsqllibdir}/bin/psql %{pgsuffix} \ --slave %{_mandir}/man1/psql.1 pgsql.1 %{pgsqldatadir}/man/man1/psql.1* || : update-alternatives \ - --install %{_bindir}/reindexdb reindexdb %{pgsqllibdir}/bin/reindexdb %{pgver}%{pgminver} \ + --install %{_bindir}/reindexdb reindexdb %{pgsqllibdir}/bin/reindexdb %{pgsuffix} \ --slave %{_mandir}/man1/reindexdb.1 reindexdb.1 %{pgsqldatadir}/man/man1/reindexdb.1* || : update-alternatives \ - --install %{_bindir}/vacuumdb vacuumdb %{pgsqllibdir}/bin/vacuumdb %{pgver}%{pgminver} \ + --install %{_bindir}/vacuumdb vacuumdb %{pgsqllibdir}/bin/vacuumdb %{pgsuffix} \ --slave %{_mandir}/man1/vacuumdb.1 vacuumdb.1 %{pgsqldatadir}/man/man1/vacuumdb.1* || : %postun clients @@ -843,7 +843,7 @@ fi %posttrans -n postgresql-devel update-alternatives \ - --install %{_bindir}/pg_config pg_config %{pgsqllibdir}/bin/pg_config %{pgver}%{pgminver} \ + --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 @@ -859,8 +859,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/postgresql10 -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/postgresql10 +%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 @@ -947,17 +947,17 @@ update-alternatives \ %doc doc/src/sgml/html howto %{_examplesdir}/%{name}-%{version} -%files -n postgresql-libs -f libpq5-%{pgver}.lang +%files -n postgresql-libs -f libpq5-%{pgversion}.lang %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/libpq.so.*.* %attr(755,root,root) %ghost %{_libdir}/libpq.so.5 -%files ecpg -f ecpg-%{pgver}.lang +%files ecpg -f ecpg-%{pgversion}.lang %defattr(644,root,root,755) %attr(755,root,root) %{pgsqllibdir}/bin/ecpg %{pgsqldatadir}/man/man1/ecpg.1* -%files -n postgresql-ecpg-libs -f ecpglib6-%{pgver}.lang +%files -n postgresql-ecpg-libs -f ecpglib6-%{pgversion}.lang %attr(755,root,root) %{_libdir}/libecpg.so.*.* %attr(755,root,root) %ghost %{_libdir}/libecpg.so.6 %attr(755,root,root) %{_libdir}/libecpg_compat.so.*.* @@ -981,7 +981,7 @@ update-alternatives \ %{_libdir}/libecpg_compat.a %{_libdir}/libpgtypes.a -%files -n postgresql-devel -f pg_config-%{pgver}.lang +%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) %{_libdir}/libpq.so @@ -1006,8 +1006,8 @@ update-alternatives \ %files backend-devel %defattr(644,root,root,755) -%dir %{_includedir}/postgresql/%{pgver} -%{_includedir}/postgresql/%{pgver}/server +%dir %{_includedir}/postgresql/%{pgversion} +%{_includedir}/postgresql/%{pgversion}/server %dir %{moduledir}/pgxs %attr(755,root,root) %{moduledir}/pgxs/config %{moduledir}/pgxs/src @@ -1052,7 +1052,7 @@ update-alternatives \ %{pgsqldatadir}/man/man7/*.7* %if %{with perl} -%files module-plperl -f plperl-%{pgver}.lang +%files module-plperl -f plperl-%{pgversion}.lang %defattr(644,root,root,755) %attr(755,root,root) %{moduledir}/plperl.so %{extensiondir}/plperl--*.sql @@ -1062,7 +1062,7 @@ update-alternatives \ %endif %if %{with python} -%files module-plpython -f plpython-%{pgver}.lang +%files module-plpython -f plpython-%{pgversion}.lang %defattr(644,root,root,755) %attr(755,root,root) %{moduledir}/plpython2.so %{extensiondir}/plpython*--*.sql @@ -1070,7 +1070,7 @@ update-alternatives \ %endif %if %{with tcl} -%files module-pltcl -f pltcl-%{pgver}.lang +%files module-pltcl -f pltcl-%{pgversion}.lang %defattr(644,root,root,755) %attr(755,root,root) %{moduledir}/pltcl.so %{extensiondir}/pltcl*--*.sql