From: Marcin Krol Date: Thu, 23 Aug 2018 10:50:58 +0000 (+0000) Subject: - fix package naming, don't hardcode version in init X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=4750936a7711359c9c306b14d0df2a6e8280fcba;p=packages%2Fpostgresql.git - fix package naming, don't hardcode version in init --- diff --git a/postgresql.init b/postgresql.init index eb4b2ec..8f30817 100644 --- a/postgresql.init +++ b/postgresql.init @@ -21,10 +21,10 @@ cd / PG_INIT_LOCALE=C # Get service config -if [ -f /etc/sysconfig/postgresql9.6 ]; then - . /etc/sysconfig/postgresql9.6 +if [ -f /etc/sysconfig/postgresql-@pgsqlversion@ ]; then + . /etc/sysconfig/postgresql-@pgsqlversion@ else - nls "Error: %s not found" /etc/sysconfig/postgresql9.6 + nls "Error: %s not found" /etc/sysconfig/postgresql-@pgsqlversion@ nls " PostgreSQL can't be run." exit 1 fi @@ -106,11 +106,11 @@ pgsubsys() { for pgdir in $PG_DB_CLUSTERS; do pgstatus "$pgdir" if [ "$PG_STATUS" = "running" ]; then - touch /var/lock/subsys/postgresql9.6 + touch /var/lock/subsys/postgresql-@pgsqlversion@ return fi done - rm -f /var/lock/subsys/postgresql9.6 + rm -f /var/lock/subsys/postgresql-@pgsqlversion@ } # diff --git a/postgresql.spec b/postgresql.spec index c3d930f..f1841ac 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -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%{pgsuffix} -Version: 9.6.10 +Name: postgresql-%{pgversion} +Version: %{pgversion}.10 Release: 1 License: BSD Group: Applications/Databases @@ -571,7 +571,7 @@ 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} +sed -e 's,@pgsqlbindir@,%{pgsqllibdir}/bin,g; s,@pgsqlversion@,%{pgversion},g;' %{SOURCE1} >$RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql-%{pgversion} install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql-%{pgversion} install -d howto