--- postgresql94.spec	2016-02-12 19:29:32.066550175 +0100
+++ postgresql94.minimal.spec	2016-02-12 19:38:25.194956608 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package postgresql94
 #
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -35,37 +35,15 @@
 %define pgdocdir %_docdir/%pgname
 %define pgextensiondir %pgdatadir/extension
 %define pgmandir %_mandir
-
+%define pg_minor_version %(echo %version | sed -r 's/^([0-9]+\\.[0-9]+).*/\\1/')
 Name:           postgresql94
-
-%if %buildmain
-BuildRequires:  gettext-devel
-BuildRequires:  ncurses-devel
-BuildRequires:  pam-devel
-BuildRequires:  postgresql-init
-BuildRequires:  python-devel
-BuildRequires:  readline-devel
-BuildRequires:  tcl-devel
-BuildRequires:  timezone
-BuildRequires:  libuuid-devel
-BuildRequires:  zlib-devel
-# 
-%endif
-
-BuildRequires:  fdupes
-BuildRequires:  krb5-devel
-BuildRequires:  libxslt-devel
-BuildRequires:  openldap2-devel
-BuildRequires:  openssl-devel
-BuildRequires:  pkg-config
-BuildRequires:  update-alternatives
+Version:        9.4.5
+Release:        0
 #!BuildIgnore:  %pgname
 Summary:        Basic Clients and Utilities for PostgreSQL
 License:        PostgreSQL
 Group:          Productivity/Databases/Tools
-Version:        9.4.5
-Release:        0
-%define pg_minor_version %(echo %version | sed -r 's/^([0-9]+\\.[0-9]+).*/\\1/')
+Url:            http://www.postgresql.org/
 Source0:        https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
 Source1:        baselibs.conf
 Source3:        postgresql-README.SUSE
@@ -76,12 +54,31 @@
 Patch7:         postgresql-testsuite-seclabel-location.patch
 Patch8:         postgresql-testsuite-keep-results-file.patch
 Patch9:         postgresql-var-run-socket.patch
-Url:            http://www.postgresql.org/
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Provides:       postgresql = %version
+BuildRequires:  fdupes
+BuildRequires:  krb5-devel
+BuildRequires:  libxslt-devel
+BuildRequires:  openldap2-devel
+BuildRequires:  openssl-devel
+BuildRequires:  pkg-config
+BuildRequires:  update-alternatives
 Requires:       %libpq >= %majorversion
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
+Provides:       postgresql = %version
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+%if %buildmain
+BuildRequires:  gettext-devel
+BuildRequires:  libuuid-devel
+BuildRequires:  ncurses-devel
+BuildRequires:  pam-devel
+BuildRequires:  postgresql-init
+BuildRequires:  python-devel
+BuildRequires:  readline-devel
+BuildRequires:  tcl-devel
+BuildRequires:  timezone
+BuildRequires:  zlib-devel
+#
+%endif
 
 %description
 PostgreSQL is an advanced object-relational database management system
@@ -96,7 +93,6 @@
 package.
 
 %if %buildlibs
-
 %package -n %libpq
 Summary:        Shared Libraries Required for PostgreSQL Clients
 Group:          Productivity/Databases/Clients
@@ -124,7 +120,6 @@
 program or language bindings are using.
 
 %package -n %libecpg
-
 Summary:        Shared Libraries Required for PostgreSQL Clients
 Group:          Productivity/Databases/Clients
 Provides:       postgresql-libs:%_libdir/libecpg.so.6
@@ -143,14 +138,14 @@
 %package -n %pgname-devel
 Summary:        PostgreSQL development header files and libraries
 Group:          Development/Libraries/C and C++
-Provides:       postgresql-devel = %version
 Requires:       %libecpg >= %majorversion
 Requires:       %libpq >= %majorversion
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
+Conflicts:      postgresql-devel-exclusive < %majorversion
+Provides:       postgresql-devel = %version
 # Installation of postgresql??-devel is exclusive
 Provides:       postgresql-devel-exclusive = %majorversion
-Conflicts:      postgresql-devel-exclusive < %majorversion
 
 %description -n %pgname-devel
 PostgreSQL is an advanced object-relational database management system
@@ -167,19 +162,18 @@
 %endif
 
 %if %buildmain
-
 %package server
 Summary:        The Programs Needed to Create and Run a PostgreSQL Server
 Group:          Productivity/Databases/Servers
+Requires:       glibc-locale
 PreReq:         /sbin/chkconfig
 PreReq:         postgresql = %version
 PreReq:         postgresql-init >= %majorversion
-Requires:       glibc-locale
-Provides:       postgresql-server = %version
-Requires(preun): postgresql-init >= %majorversion
-Requires(postun): postgresql-init >= %majorversion
 Requires(post): update-alternatives
+Requires(postun): postgresql-init >= %majorversion
 Requires(postun): update-alternatives
+Requires(preun): postgresql-init >= %majorversion
+Provides:       postgresql-server = %version
 
 %description server
 PostgreSQL is an advanced object-relational database management system
@@ -216,7 +210,7 @@
 types and functions.
 
 This package contains the HTML documentation for PostgreSQL. The start
-page is: file:///usr/share/doc/packages/%name/html/index.html .
+page is: file://%{_docdir}/%name/html/index.html .
 Manual pages for the PostgreSQL SQL statements can be found in the
 postgresql package.
 
@@ -225,8 +219,8 @@
 Group:          Productivity/Databases/Tools
 #FIXME
 PreReq:         %pgname-server = %version
-Provides:       postgresql-contrib = %version
 Requires(post): update-alternatives
+Provides:       postgresql-contrib = %version
 
 %description contrib
 PostgreSQL is an advanced object-relational database management system
@@ -239,15 +233,15 @@
 officially part of the PostgreSQL core.
 
 Documentation for the modules contained in this package can be found in
-/usr/share/doc/packages/postgresql/contrib.
+%{_docdir}/postgresql/contrib.
 
 %package plperl
 Summary:        The PL/Tcl, PL/Perl, and  PL/Python procedural languages for PostgreSQL
 Group:          Productivity/Databases/Servers
-Requires:       perl = %perl_version
-Provides:       postgresql-plperl = %version
 #FIXME
 Requires:       %pgname-server = %version
+Requires:       perl = %perl_version
+Provides:       postgresql-plperl = %version
 
 %description plperl
 This package contains the the PL/Tcl, PL/Perl, and PL/Python procedural
@@ -259,10 +253,10 @@
 %package plpython
 Summary:        The PL/Python Procedural Languages for PostgreSQL
 Group:          Productivity/Databases/Servers
-Provides:       postgresql-plpython = %version
 #FIXME
 Requires:       %pgname-server = %version
 Requires:       python
+Provides:       postgresql-plpython = %version
 
 %description plpython
 PostgreSQL is an advanced object-relational database management system
@@ -280,10 +274,10 @@
 %package pltcl
 Summary:        PL/Tcl Procedural Language for PostgreSQL
 Group:          Productivity/Databases/Tools
-Provides:       postgresql-pltcl = %version
 #FIXME
 Requires:       %pgname-server = %version
 Requires:       tcl
+Provides:       postgresql-pltcl = %version
 
 %description pltcl
 PostgreSQL is an advanced object-relational database management system
@@ -291,7 +285,7 @@
 transactions, foreign keys, subqueries, triggers, and user-defined
 types and functions.
 
-This package contains the PL/Tcl procedural language for PostgreSQL. 
+This package contains the PL/Tcl procedural language for PostgreSQL.
 With thie module one can use Tcl to write stored procedures, functions,
 and triggers.
 
@@ -346,7 +340,7 @@
 	--with-gssapi \
 	--with-krb5 \
 %endif
-	--with-system-tzdata=/usr/share/zoneinfo
+	--with-system-tzdata=%{_datadir}/zoneinfo
 %if !%buildmain
 make -C src/backend %{?_smp_mflags} libpq-recursive
 %if %builddevel
@@ -365,7 +359,6 @@
 make %{?_smp_mflags} PACKAGE_TARNAME=%name world
 %ifnarch %arm
 %if 0%{?suse_version} > 910
-
 %check
 #
 # Run the regression tests.
@@ -441,7 +434,7 @@
 find %buildroot -type f -cnewer flag -printf "/%%P\n" |
      grep -v -e %_docdir -e %pgbindir > contrib.files
 rm flag
-install -d -m 750 %buildroot/var/lib/pgsql
+install -d -m 750 %buildroot%{_localstatedir}/lib/pgsql
 install -d -m755 %buildroot%pgdocdir
 cp doc/KNOWN_BUGS doc/MISSING_FEATURES COPYRIGHT \
    README HISTORY doc/bug.template %buildroot%pgdocdir
@@ -478,12 +471,12 @@
 done
 if test -n "$SLAVES"; then
 	update-alternatives --quiet --install \
-        /usr/lib/postgresql postgresql %pgbasedir %packageversion \
+        %{_prefix}/lib/postgresql postgresql %pgbasedir %packageversion \
         $SLAVES
 fi
 EOF
 mkdir -p %buildroot{%_bindir,%_mandir/man1}
-mkdir -p %buildroot/etc/alternatives
+mkdir -p %buildroot%{_sysconfdir}/alternatives
 genlists ()
 {
     # usage: genlists packagename basenames
@@ -492,7 +485,7 @@
     for f in $@
     do
         BIN=%_bindir/$f
-        ALTBIN=/etc/alternatives/$f
+        ALTBIN=%{_sysconfdir}/alternatives/$f
         PGBIN=%pgbindir/$f
         MAN=%pgmandir/man1/$f.1*
 
@@ -525,8 +518,8 @@
     %find_lang $pl-%{pg_minor_version} $pl.lang
 done
 %endif
-ln -s /etc/alternatives/postgresql %buildroot/usr/lib/postgresql
-touch %buildroot/etc/alternatives/postgresql
+ln -s %{_sysconfdir}/alternatives/postgresql %buildroot/usr/lib/postgresql
+touch %buildroot%{_sysconfdir}/alternatives/postgresql
 %if %builddevel
 genlists devel \
         pg_config ecpg
@@ -534,7 +527,6 @@
 %fdupes %buildroot
 
 %if %buildmain
-
 %postun
 if test "$1" == 0; then
     update-alternatives --remove postgresql %pgbasedir
@@ -547,7 +539,7 @@
 %preun server
 # Stop only when we are uninstalling the currently running version
 PID=$(pidof -s postgres) || :
-if test -n "$PID" -a -x /etc/init.d/postgresql; then
+if test -n "$PID" -a -x %{_initddir}/postgresql; then
     BIN=$(readlink /proc/$PID/exe)
     DIR=$(dirname ${BIN% *})
     if test "$DIR" = "%pgbindir"; then
@@ -559,7 +551,7 @@
 # Restart only when we are updating the currently running version
 # or from the old packaging scheme
 PID=$(pidof -s postgres) || :
-if test -n "$PID" -a -x /etc/init.d/postgresql; then
+if test -n "$PID" -a -x %{_initddir}/postgresql; then
     BIN=$(readlink /proc/$PID/exe)
     DIR=$(dirname ${BIN% *})
     if test "$DIR" = "%pgbindir" -o "$DIR" = "%_bindir"; then
@@ -574,7 +566,6 @@
 %endif
 
 %if %builddevel
-
 %post -n %pgname-devel -f alternatives
 
 %postun -n %pgname-devel -f alternatives
@@ -591,7 +582,6 @@
 %endif
 
 %if %buildmain
-
 %files -f main.files
 %defattr(-,root,root)
 %dir %pgbindir
@@ -601,8 +591,8 @@
 %pgdocdir/[[:upper:]]*
 %pgdocdir/bug.template
 %dir %pglibdir
-/usr/lib/postgresql
-%ghost /etc/alternatives/postgresql
+%{_prefix}/lib/postgresql
+%ghost %{_sysconfdir}/alternatives/postgresql
 
 %files test
 %defattr(-,root,root,-)
@@ -621,8 +611,8 @@
 %dir %pgdocdir
 %pgdocdir/extension
 %dir %pgdatadir
-/usr/lib/postgresql
-%ghost /etc/alternatives/postgresql
+%{_prefix}/lib/postgresql
+%ghost %{_sysconfdir}/alternatives/postgresql
 
 %files server -f server.files
 %defattr(-,root,root)
@@ -634,8 +624,8 @@
 %pgdatadir/tsearch_data
 %exclude %pgdatadir/tsearch_data/*.rules
 %dir %pgdatadir
-/usr/lib/postgresql
-%ghost /etc/alternatives/postgresql
+%{_prefix}/lib/postgresql
+%ghost %{_sysconfdir}/alternatives/postgresql
 %pgdatadir/timezone*
 %pgdatadir/*.*
 %if %buildlibs
@@ -646,7 +636,7 @@
 %pglibdir/euc2004_sjis2004.so
 %pglibdir/libpqwalreceiver.so
 %pgextensiondir/plpgsql*
-%attr(750,postgres,postgres) %dir /var/lib/pgsql
+%attr(750,postgres,postgres) %dir %{_localstatedir}/lib/pgsql
 
 %files pltcl -f pltcl.lang
 %defattr(-,root,root)
@@ -666,8 +656,8 @@
 %pglibdir/plpython*.so
 
 %endif
-%if %buildlibs
 
+%if %buildlibs
 %files -n %libpq -f libpq.lang
 %defattr(-,root,root)
 %dir %pgbasedir
@@ -683,7 +673,6 @@
 %endif
 
 %if %builddevel
-
 %files -n %pgname-devel -f devel.files
 %defattr(-,root,root)
 %dir %pgbasedir
@@ -694,8 +683,8 @@
 %_libdir/lib*.so
 %pglibdir/pgxs
 %pgincludedir
-/usr/lib/postgresql
-%ghost /etc/alternatives/postgresql
+%{_prefix}/lib/postgresql
+%ghost %{_sysconfdir}/alternatives/postgresql
 
 %endif
 
