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
%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
fi
%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
%posttrans clients
%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