# # spec file for package postgresql91 # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define majorversion 9.1 %define packageversion 91 %define pgname postgresql%packageversion %define libpq libpq5 %define libecpg libecpg6 %define libpq_so libpq.so.5 %define libecpg_so libecpg.so.6 %define buildmain 1 %define buildlibs 1 %define pgbasedir %_prefix/lib/%pgname %define pgbindir %pgbasedir/bin %define pglibdir %pgbasedir/%_lib %define pgincludedir %_includedir/pgsql %define pgdatadir %_datadir/%pgname %define pgdocdir %_docdir/%pgname %define pgextensiondir %pgdatadir/extension %define pgmandir %_mandir Name: postgresql%packageversion %if %buildmain BuildRequires: gettext-devel BuildRequires: ncurses-devel BuildRequires: pam-devel BuildRequires: python-devel BuildRequires: readline-devel BuildRequires: tcl-devel BuildRequires: uuid-devel BuildRequires: zlib-devel BuildRequires: pwdutils %endif %if 0%{?suse_version} >= 1110 BuildRequires: fdupes %else %define fdupes # %endif %if 0%{?suse_version} > 910 BuildRequires: krb5-devel BuildRequires: libxslt-devel %endif BuildRequires: openldap2-devel BuildRequires: openssl-devel BuildRequires: update-alternatives Summary: Basic Clients and Utilities for PostgreSQL License: BSD 3-Clause Group: Productivity/Databases/Tools Version: 9.1.5 Release: 0 %define pg_minor_version %(echo %version | sed -r 's/^([0-9]+\\.[0-9]+).*/\\1/') Source0: postgresql-%version.tar.bz2 Source1: baselibs.conf Source3: postgresql-README.SUSE Source15: postgresql-bashprofile Source17: postgresql-rpmlintrc Patch1: postgresql-conf.patch Patch2: postgresql-regress.patch Patch3: postgresql-sle10-timestamptz.patch Patch4: postgresql-plperl.patch Patch5: postgresql-pg_upgrade.patch Url: http://www.postgresql.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build Provides: postgresql = %version # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql < 8.3.19 Requires: %libpq >= %version Requires(post): update-alternatives Requires(postun): update-alternatives %description PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, and user-defined types and functions. This package contains the basic utility and client programs necessary to maintain and work with local or remote PostgreSQL databases as well as manual pages for the SQL commands that PostgreSQL supports. Full HTML documentation for PostgreSQL can be found in the postgresql-docs package. %if %buildlibs %package -n %libpq Summary: Shared Libraries Required for PostgreSQL Clients Group: Productivity/Databases/Clients Provides: postgresql-libs = %version Provides: postgresql-libs:%_libdir/libpq.so.5 Obsoletes: %libpq < %version Conflicts: %libpq < %version Obsoletes: postgresql-libs < %version # The packaging scheme changed starting with 8.3.19 # bug437293 Conflicts: postgresql-libs < 8.3.19 %if "%_lib" == "lib64" Conflicts: postgresql-libs-32bit < 8.3.19 %endif %ifarch ia64 Conflicts: postgresql-libs-x86 < 8.3.19 %endif %ifarch ppc64 Obsoletes: postgresql-libs-64bit %endif %description -n %libpq PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This package provides the client library that most PostgreSQL client 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 %description -n %libecpg PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This package provides the runtime library of the embedded SQL C preprocessor for PostgreSQL. %package -n %pgname-devel License: BSD 3-Clause Summary: PostgreSQL development header files and libraries Group: Productivity/Databases/Tools Provides: postgresql-devel = %version Requires: %libecpg = %version Requires: %libpq = %version Requires(post): update-alternatives Requires(postun): update-alternatives Obsoletes: postgresql-devel < %version # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql-devel < 8.3.19 %description -n %pgname-devel PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, and user-defined types and functions. This package contains the header files and libraries needed to compile C applications which will directly interact with a PostgreSQL database management server and the ECPG Embedded C Postgres preprocessor. You need to install this package if you want to develop applications in C which will interact with a PostgreSQL server. Authors: -------- Marc G. Fournier Tom Lane Vadim B. Mikheev Bruce Momjian Jan Wieck %endif %if %buildmain %package server License: BSD 3-Clause Summary: The Programs Needed to Create and Run a PostgreSQL Server Group: Productivity/Databases/Servers PreReq: pwdutils PreReq: /sbin/chkconfig PreReq: postgresql = %version PreReq: postgresql-init >= %majorversion Requires: glibc-locale Provides: postgresql-server = %version # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql-server < 8.3.19 Requires(preun): postgresql-init >= %majorversion Requires(postun): postgresql-init >= %majorversion Requires(post): update-alternatives Requires(postun): update-alternatives %description server PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, sub-queries, triggers, and user-defined types and functions. This package includes the programs needed to create and run a PostgreSQL server, which will in turn allow you to create and maintain PostgreSQL databases. Authors: -------- Marc G. Fournier Tom Lane Vadim B. Mikheev Bruce Momjian Jan Wieck %package docs License: BSD 3-Clause Summary: HTML Documentation for PostgreSQL Group: Productivity/Databases/Tools Provides: postgresql-docs = %version # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql-docs < 8.3.19 %if 0%{?suse_version} >= 1120 BuildArch: noarch %endif %description docs PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, and user-defined types and functions. This package contains the HTML documentation for PostgreSQL. The start page is: file:///usr/share/doc/packages/%name/html/index.html . Manual pages for the PostgreSQL SQL statements can be found in the postgresql package. Authors: -------- Marc G. Fournier Tom Lane Vadim B. Mikheev Bruce Momjian Jan Wieck %package contrib License: BSD 3-Clause Summary: Contributed Extensions and Additions to PostgreSQL Group: Productivity/Databases/Tools PreReq: postgresql-server = %version Provides: postgresql-contrib = %version # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql-contrib < 8.3.19 Requires(post): update-alternatives %description contrib PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, and user-defined types and functions. The postgresql-contrib package includes extensions and additions that are distributed along with the PostgreSQL sources, but are not (yet) officially part of the PostgreSQL core. Documentation for the modules contained in this package can be found in /usr/share/doc/packages/postgresql/contrib. Authors: -------- Marc G. Fournier Tom Lane Vadim B. Mikheev Bruce Momjian Jan Wieck %package plperl License: BSD 3-Clause 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 # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql-plperl < 8.3.19 Requires: postgresql-server = %version %description plperl This package contains the the PL/Tcl, PL/Perl, and PL/Python procedural languages for the back-end. With these modules one can use Perl, Python, and Tcl to write stored procedures, functions and triggers. PostgreSQL also offers the builtin procedural language PL/SQL. Authors: -------- Andrew Yu Jolly Chen Bruce Momjian Thomas G. Lockhart Tom Lane The Hermit Hacker etc. %package plpython License: BSD 3-Clause Summary: The PL/Python Procedural Languages for PostgreSQL Group: Productivity/Databases/Servers Provides: postgresql-plpython = %version # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql-plpython < 8.3.19 Requires: postgresql-server = %version Requires: python %description plpython PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, and user-defined types and functions. This package contains the PL/Python procedural language for PostgreSQL. With this module one can use Python to write stored procedures, functions, and triggers. PostgreSQL also offers the built-in procedural language PL/SQL which is included in the postgresql-server package. Authors: -------- Marc G. Fournier Tom Lane Vadim B. Mikheev Bruce Momjian Jan Wieck %package pltcl License: BSD 3-Clause Summary: PL/Tcl Procedural Language for PostgreSQL Group: Productivity/Databases/Tools Provides: postgresql-pltcl = %version # The packaging scheme changed starting with 8.3.19 Conflicts: postgresql-pltcl < 8.3.19 Requires: postgresql-server = %version Requires: tcl %description pltcl PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, and user-defined types and functions. This package contains the PL/Tcl procedural language for PostgreSQL. With thie module one can use Tcl to write stored procedures, functions, and triggers. PostgreSQL also offers the built-in procedural language PL/SQL which is included in the postgresql-server package. Authors: -------- Marc G. Fournier Tom Lane Vadim B. Mikheev Bruce Momjian Jan Wieck %endif %prep %setup -q -n postgresql-%version # Keep the timestamp of configure, because patching it would otherwise # confuse PostgreSQL's build system touch -r configure tmp %patch1 %patch2 # apply the following patch only on SLE10 %if 0%{?suse_version} == 1010 %patch3 -p1 %endif %patch4 %patch5 touch -r tmp configure rm tmp %build PACKAGE_TARNAME=%name %configure \ --bindir=%pgbindir \ --libdir=%pglibdir \ --includedir=%pgincludedir \ --datadir=%pgdatadir \ --docdir=%pgdocdir \ --mandir=%pgmandir \ --disable-rpath \ --enable-nls \ --enable-thread-safety \ --enable-integer-datetimes \ %if %buildmain --with-python \ --with-perl \ --with-tcl \ --with-tclconfig=%_libdir \ --with-pam \ --with-ossp-uuid \ --with-libxml \ --with-libxslt \ %else --without-readline \ %endif --with-openssl \ --with-ldap \ %if 0%{?suse_version} > 910 --with-gssapi \ --with-krb5 \ %endif --with-system-tzdata=/usr/share/zoneinfo %if !%buildmain make -C src/backend %{?jobs:-j%jobs} libpq-recursive make -C src/port %{?jobs:-j%jobs} libpgport.a make -C src/interfaces %{?jobs:-j%jobs} make -C src/bin/pg_config %{?jobs:-j%jobs} pg_config %else make %{?_smp_mflags} PACKAGE_TARNAME=%name world %ifnarch %arm %if 0%{?suse_version} > 910 %check # temporarily disabled exit 0 # # Run the regression tests. # make check || { for f in src/test/regress/log/* regression.diffs; do if test -f $f; then cat $f fi done exit 1 } %endif %endif %endif %install %if %buildmain make DESTDIR=%buildroot PACKAGE_TARNAME=%name install install-docs %endif %if %buildmain != %buildlibs %if %buildlibs SUBINSTALL=install install -d %buildroot%pgmandir/man1 install -m644 doc/src/sgml/man1/{ecpg,pg_config}.1 %buildroot%pgmandir/man1 %else SUBINSTALL=uninstall rm -f %buildroot%pgmandir/*/ecpg* rm -f %buildroot%pgmandir/*/pg_config* %endif # Install them for postgresql-libs and uninstall them for postgresql make -C src DESTDIR=%buildroot $SUBINSTALL-local for dir in \ config \ src/bin/pg_config \ src/interfaces \ src/include \ src/makefiles \ src/port \ src/test/regress do make -C $dir DESTDIR=%buildroot $SUBINSTALL done %endif %if %buildlibs # The client libraries go to libdir mkdir -p %buildroot/%_libdir ls %buildroot/%pglibdir/lib* | grep -v walreceiver | xargs mv -t %buildroot/%_libdir # Don't ship static libraries, libpgport.a is needed, though. rm -f $(ls %buildroot/%_libdir/*.a | grep -F -v libpgport.a) %endif %if %buildmain # # Install and collect the contrib stuff # touch flag; sleep 1 # otherwise we have installed files that are not newer than flag make DESTDIR=%buildroot -C contrib install 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 sed 's,@LIBDIR@,%_libdir,g' %{SOURCE15} > \ %buildroot/var/lib/pgsql/.bash_profile install -d -m755 %buildroot%pgdocdir cp doc/KNOWN_BUGS doc/MISSING_FEATURES COPYRIGHT \ README HISTORY doc/bug.template %buildroot%pgdocdir cp -a %SOURCE3 %buildroot%pgdocdir/README.SUSE %endif # Use versioned names for the man pages: for f in %buildroot%pgmandir/man*/*; do mv $f ${f}pg%packageversion done %if %buildlibs %find_lang libpq5-%{pg_minor_version} libpq.lang %find_lang ecpglib6-%{pg_minor_version} libecpg.lang %endif cat > alternatives <<"EOF" shopt -s nullglob for FILE in %pgbindir/*; do NAME=$(basename $FILE) DIR=%_bindir case "$NAME" in psql) continue;; rc*) DIR=%_sbindir ;; esac SLAVES="$SLAVES --slave $DIR/$NAME $NAME $FILE" done if test -n "$SLAVES"; then update-alternatives --quiet --install \ /usr/bin/psql psql %pgbindir/psql %packageversion \ $SLAVES fi EOF mkdir -p %buildroot{%_bindir,%_mandir/man1} genlists () { # usage: genlists packagename basenames PKG=$1 shift for f in $@ do BIN=%_bindir/$f PGBIN=%pgbindir/$f MAN=%pgmandir/man1/$f.1* ln -s $PGBIN %buildroot$BIN echo "$PGBIN" >> $PKG.files echo "%verify(not link) $BIN" >> $PKG.files test -e %buildroot$MAN && echo "%doc $MAN" >> $PKG.files %find_lang $f-%pg_minor_version $PKG.files ||: done } %if %buildmain genlists main \ createdb clusterdb createlang createuser dropdb droplang \ dropuser pg_dump pg_dumpall pg_restore psql vacuumdb \ reindexdb pg_basebackup %find_lang plpgsql-%pg_minor_version main.files %find_lang pgscripts-%pg_minor_version main.files genlists server \ initdb pg_ctl pg_controldata pg_resetxlog postgres postmaster genlists contrib \ oid2name pg_archivecleanup pg_standby pg_test_fsync pg_upgrade \ pgbench vacuumlo for pl in plperl plpython pltcl; do %find_lang $pl-%{pg_minor_version} $pl.lang done %endif %if %buildlibs genlists devel \ pg_config ecpg %endif %fdupes %buildroot %if %buildmain %postun if test "$1" == 0; then update-alternatives --remove psql %pgbindir/psql fi %post -f alternatives %pre server groupadd -g 26 -o -r postgres >/dev/null 2>/dev/null || : useradd -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ -c "PostgreSQL Server" -u 26 postgres 2>/dev/null || : %post server -f alternatives %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 BIN=$(readlink /proc/$PID/exe) DIR=$(dirname ${BIN% *}) if test "$DIR" = "%pgbindir"; then %stop_on_removal postgresql fi fi %postun server -f alternatives # Restart only when we are updating the currently running version PID=$(pidof -s postgres) || : if test -n "$PID" -a -x /etc/init.d/postgresql; then BIN=$(readlink /proc/$PID/exe) DIR=$(dirname ${BIN% *}) if test "$DIR" = "%pgbindir"; then %restart_on_update postgresql fi fi %post contrib -f alternatives %postun contrib -f alternatives %endif %if %buildlibs %post -n %pgname-devel -f alternatives %postun -n %pgname-devel -f alternatives %post -n %libpq -p /sbin/ldconfig %postun -n %libpq -p /sbin/ldconfig %post -n %libecpg -p /sbin/ldconfig %postun -n %libecpg -p /sbin/ldconfig %endif %if %buildmain %files -f main.files %defattr(-,root,root) %dir %pgbindir %doc %pgmandir/man7/* %docdir %pgdocdir %dir %pgdocdir %pgdocdir/[[:upper:]]* %pgdocdir/bug.template %files docs %defattr(-,root,root) %doc %pgmandir/man3/* %docdir %pgdocdir %dir %pgdocdir %pgdocdir/html %files contrib -f contrib.files %defattr(-,root,root) %docdir %pgdocdir %dir %pgdocdir %pgdocdir/extension %dir %pgdatadir %files server -f server.files %defattr(-,root,root) %dir %pgbasedir %dir %pgextensiondir %dir %pglibdir %pglibdir/plpgsql.so %pglibdir/dict_snowball.so %pgdatadir/tsearch_data %exclude %pgdatadir/tsearch_data/*.rules %dir %pgdatadir %pgdatadir/timezone* %pgdatadir/*.* %if %buildlibs %exclude %pgdatadir/pg_service.conf.sample %endif %exclude %pgdatadir/*.pltcl %pglibdir/*_and_*.so %pglibdir/euc2004_sjis2004.so %pglibdir/libpqwalreceiver.so %pgextensiondir/plpgsql* %attr(750,postgres,postgres) %dir /var/lib/pgsql %attr(640,postgres,postgres) %config(noreplace) /var/lib/pgsql/.bash_profile %files pltcl -f pltcl.lang %defattr(-,root,root) %pgextensiondir/pltcl* %pglibdir/pltcl.so %pgdatadir/*.pltcl %pgbindir/pltcl* %files plperl -f plperl.lang %defattr(-,root,root) %pgextensiondir/plperl* %pglibdir/plperl.so %files plpython -f plpython.lang %defattr(-,root,root) %pgextensiondir/plpython* %pglibdir/plpython*.so %endif %if %buildlibs %files -n %libpq -f libpq.lang %defattr(-,root,root) %dir %pgbasedir %dir %pgdatadir %_libdir/libpq.so.* %pgdatadir/pg_service.conf.sample %files -n %libecpg -f libecpg.lang %defattr(-,root,root) %_libdir/libecpg*.so.* %_libdir/libpgtypes.so.* %files -n %pgname-devel -f devel.files %defattr(-,root,root) %dir %pgbindir %dir %pglibdir %_libdir/libpgport.a %_libdir/libpq.so %_libdir/libecpg.so %_libdir/libecpg_compat.so %_libdir/libpgtypes.so %pglibdir/pgxs %pgincludedir %dir %pgdatadir %endif %changelog