]> TLD Linux GIT Repositories - packages/postgresql.git/commitdiff
- fix package naming, don't hardcode version in init
authorMarcin Krol <hawk@tld-linux.org>
Thu, 23 Aug 2018 10:50:58 +0000 (10:50 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Thu, 23 Aug 2018 10:50:58 +0000 (10:50 +0000)
postgresql.init
postgresql.spec

index eb4b2ec5fe43114cd7bd094c0b5ec9dd65bc2c7b..8f308171836413e5dd01472b7f7de22c59985606 100644 (file)
@@ -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@
 }
 
 #
index c3d930f08ec269aea07420ad46c98a6bd0bcaae4..f1841ac191ab572273a43dda269c56adcbe864cf 100644 (file)
@@ -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