2012-10-04 16:22:52 +02:00
|
|
|
#
|
|
|
|
# spec file for package postgresql
|
|
|
|
#
|
2016-12-01 09:38:54 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2012-10-04 16:22:52 +02:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
2017-09-13 18:53:50 +02:00
|
|
|
%define defaultpackage postgresql10
|
2012-10-04 16:22:52 +02:00
|
|
|
|
2017-09-21 15:48:21 +02:00
|
|
|
%if 0%{?suse_version} >= 1300
|
|
|
|
%bcond_without systemd
|
|
|
|
%else
|
|
|
|
%bcond_with systemd
|
|
|
|
%endif
|
|
|
|
|
2012-10-04 16:22:52 +02:00
|
|
|
Name: postgresql
|
|
|
|
Summary: Basic Clients and Utilities for PostgreSQL
|
2013-01-09 10:55:46 +01:00
|
|
|
License: PostgreSQL
|
2012-10-04 16:22:52 +02:00
|
|
|
Group: Productivity/Databases/Tools
|
2017-09-13 18:53:50 +02:00
|
|
|
Version: 10
|
2012-10-04 16:22:52 +02:00
|
|
|
Release: 0
|
2016-12-01 09:38:54 +01:00
|
|
|
Url: https://www.postgresql.org/
|
2012-10-04 16:22:52 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2017-09-21 15:48:21 +02:00
|
|
|
Provides: postgresql-noarch = %version-%release
|
|
|
|
Requires: postgresql-implementation
|
|
|
|
Recommends: %defaultpackage
|
2012-10-05 19:31:16 +02:00
|
|
|
BuildArch: noarch
|
2017-09-21 15:48:21 +02:00
|
|
|
Source0: postgresql-init
|
|
|
|
Source1: postgresql-sysconfig
|
|
|
|
Source2: postgresql-firewall
|
|
|
|
Source3: postgresql-tmpfiles.conf
|
|
|
|
Source4: postgresql.service
|
|
|
|
Source5: postgresql-bashprofile
|
2017-09-21 18:15:27 +02:00
|
|
|
Source6: postgresql-script
|
2017-11-03 13:59:51 +01:00
|
|
|
Source7: postgresql-install-alternatives
|
2017-09-21 15:48:21 +02:00
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1100
|
|
|
|
%define fwdir /etc/sysconfig/SuSEfirewall2.d/services
|
|
|
|
%define fwname postgresql
|
|
|
|
%else
|
|
|
|
%define fwdir /etc/sysconfig/scripts
|
|
|
|
%define fwname SuSEfirewall2-postgresql
|
|
|
|
%endif
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
%package server
|
|
|
|
Summary: The Programs Needed to Create and Run a PostgreSQL Server
|
|
|
|
Group: Productivity/Databases/Servers
|
2017-09-21 15:48:21 +02:00
|
|
|
Provides: postgresql-server-noarch = %version-%release
|
|
|
|
Requires: postgresql-server-implementation
|
2017-11-03 13:59:51 +01:00
|
|
|
Requires: postgresql = %version-%release
|
2017-09-21 15:48:21 +02:00
|
|
|
Recommends: %defaultpackage-server
|
2017-10-06 16:39:51 +02:00
|
|
|
%if 0%{?suse_version} >= 1315
|
|
|
|
Requires(pre): shadow
|
|
|
|
%else
|
|
|
|
Requires(pre): pwdutils
|
|
|
|
%endif
|
2017-10-06 14:41:43 +02:00
|
|
|
Provides: postgresql-init = %version.0-%release
|
2017-10-06 19:05:30 +02:00
|
|
|
Obsoletes: postgresql-init < %version.0-%release
|
2017-09-21 15:48:21 +02:00
|
|
|
%if %{with systemd}
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
%{?systemd_requires}
|
|
|
|
%else
|
|
|
|
Requires(postun): %insserv_prereq
|
|
|
|
%endif
|
|
|
|
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2017-11-03 13:59:51 +01:00
|
|
|
%package test
|
|
|
|
Summary: The test suite for PostgreSQL
|
|
|
|
Group: Productivity/Databases/Servers
|
|
|
|
Provides: postgresql-test-noarch = %version-%release
|
|
|
|
Requires: postgresql-test-implementation
|
|
|
|
Recommends: %defaultpackage-implementation
|
|
|
|
|
|
|
|
%description test
|
|
|
|
This package contains the sources and pre-built binaries of various
|
|
|
|
tests for the PostgreSQL database management system, including
|
|
|
|
regression tests and benchmarks.
|
|
|
|
|
2012-10-04 16:22:52 +02:00
|
|
|
%package docs
|
|
|
|
Summary: HTML Documentation for PostgreSQL
|
|
|
|
Group: Productivity/Databases/Tools
|
2017-09-21 15:48:21 +02:00
|
|
|
Provides: postgresql-docs-noarch = %version-%release
|
|
|
|
Requires: postgresql-docs-implementation
|
|
|
|
Recommends: %defaultpackage-docs
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%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/postgresql/html/index.html .
|
|
|
|
Manual pages for the PostgreSQL SQL statements can be found in the
|
|
|
|
postgresql package.
|
|
|
|
|
|
|
|
%package contrib
|
|
|
|
Summary: Contributed Extensions and Additions to PostgreSQL
|
|
|
|
Group: Productivity/Databases/Tools
|
2017-09-25 11:57:54 +02:00
|
|
|
Provides: postgresql-contrib-noarch = %version-%release
|
2017-11-03 13:59:51 +01:00
|
|
|
Requires: postgresql-contrib-implementation
|
2017-09-21 15:48:21 +02:00
|
|
|
Recommends: %defaultpackage-contrib
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: PostgreSQL development header files and libraries
|
2017-10-06 14:41:43 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2017-09-21 15:48:21 +02:00
|
|
|
Provides: postgresql-devel-noarch = %version-%release
|
|
|
|
Requires: postgresql-devel-implementation
|
|
|
|
Recommends: %defaultpackage-devel
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%description 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.
|
|
|
|
|
|
|
|
%package plperl
|
|
|
|
Summary: The PL/Tcl, PL/Perl, and PL/Python procedural languages for PostgreSQL
|
|
|
|
Group: Productivity/Databases/Servers
|
2017-09-21 15:48:21 +02:00
|
|
|
Provides: postgresql-plperl-noarch = %version-%release
|
|
|
|
Requires: postgresql-plperl-implementation
|
|
|
|
Recommends: %defaultpackage-plperl
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%description plperl
|
|
|
|
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/Perl procedural language for PostgreSQL.
|
|
|
|
With this module one can use Perl to write stored procedures,
|
|
|
|
functions, and triggers.
|
|
|
|
|
|
|
|
%package plpython
|
|
|
|
Summary: The PL/Python Procedural Languages for PostgreSQL
|
|
|
|
Group: Productivity/Databases/Servers
|
2017-09-25 11:57:54 +02:00
|
|
|
Provides: postgresql-plpython-noarch = %version-%release
|
2017-09-21 15:48:21 +02:00
|
|
|
Requires: postgresql-plpython-implementation
|
|
|
|
Recommends: %defaultpackage-plpython
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
%package pltcl
|
|
|
|
Summary: PL/Tcl Procedural Language for PostgreSQL
|
|
|
|
Group: Productivity/Databases/Tools
|
2017-09-21 15:48:21 +02:00
|
|
|
Provides: postgresql-pltcl-noarch = %version-%release
|
|
|
|
Requires: postgresql-pltcl-implementation
|
|
|
|
Recommends: %defaultpackage-pltcl
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2017-10-06 14:41:43 +02:00
|
|
|
%prep
|
|
|
|
|
2012-10-04 16:22:52 +02:00
|
|
|
%build
|
|
|
|
echo "This is a dummy package to provide a dependency on the default PostgreSQL version." > README
|
|
|
|
|
|
|
|
%install
|
2015-09-30 09:30:44 +02:00
|
|
|
mkdir -p %buildroot/var/lib/pgsql/
|
2017-09-21 15:48:21 +02:00
|
|
|
install -m640 %{SOURCE5} %buildroot/var/lib/pgsql/.bash_profile
|
|
|
|
|
|
|
|
install -m755 -d %buildroot/var/adm/fillup-templates
|
|
|
|
install -m644 %{S:1} %buildroot/var/adm/fillup-templates/sysconfig.postgresql
|
|
|
|
|
|
|
|
install -m755 -d %buildroot%fwdir
|
|
|
|
install -m644 %{S:2} %buildroot%fwdir/%fwname
|
|
|
|
|
|
|
|
install -m755 -d %buildroot/usr/sbin
|
|
|
|
%if %{with systemd}
|
|
|
|
install -m755 -d %buildroot/%_tmpfilesdir
|
|
|
|
install -m644 %{S:3} %buildroot%_tmpfilesdir/postgresql.conf
|
|
|
|
|
2017-11-03 13:59:51 +01:00
|
|
|
install -m755 -d %buildroot/usr/share/postgresql
|
|
|
|
install -m755 %{S:6} %buildroot/usr/share/postgresql
|
|
|
|
install -m755 %{S:7} %buildroot/usr/share/postgresql/install-alternatives
|
2017-09-21 15:48:21 +02:00
|
|
|
|
|
|
|
install -m755 -d %buildroot%_unitdir
|
|
|
|
install -m444 %{S:4} %buildroot%_unitdir
|
|
|
|
|
|
|
|
ln -sf service %buildroot/usr/sbin/rcpostgresql
|
|
|
|
%else
|
|
|
|
install -m755 -d %buildroot/etc/init.d
|
|
|
|
install -m755 %{S:0} %buildroot/etc/init.d/postgresql
|
|
|
|
ln -sf /etc/init.d/postgresql %buildroot/usr/sbin/rcpostgresql
|
|
|
|
%endif
|
|
|
|
|
2017-11-03 13:59:51 +01:00
|
|
|
%define eflag /run/postgresql-was-enabled
|
|
|
|
%define aflag /run/postgresql-was-running
|
|
|
|
|
2017-09-21 15:48:21 +02:00
|
|
|
%pre server
|
2017-10-06 14:41:43 +02:00
|
|
|
getent group postgres > /dev/null ||
|
|
|
|
groupadd -g 26 -o -r postgres
|
|
|
|
getent passwd postgres > /dev/null ||
|
|
|
|
useradd -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
|
|
|
|
-c "PostgreSQL Server" -u 26 postgres
|
2017-10-06 16:39:51 +02:00
|
|
|
%if %{with systemd}
|
2017-10-06 14:41:43 +02:00
|
|
|
%service_add_pre postgresql.service
|
2017-11-03 13:59:51 +01:00
|
|
|
|
|
|
|
# Save the "enabled" and "active" state across the transition of
|
|
|
|
# ownership of postgresql.service from postgresql-init to
|
|
|
|
# postgresql-server.
|
|
|
|
if [ "$FIRST_ARG" -ge 1 ]; then \
|
|
|
|
if [ x$(systemctl is-enabled postgresql.service 2>/dev/null ||:) = "xenabled" ]; then
|
|
|
|
touch %eflag
|
|
|
|
fi
|
|
|
|
systemctl is-active postgresql.service &>/dev/null && touch %aflag ||:
|
|
|
|
fi
|
2017-10-06 16:39:51 +02:00
|
|
|
%endif
|
2017-09-21 15:48:21 +02:00
|
|
|
|
|
|
|
%post server
|
|
|
|
%fillup_only -n postgresql
|
|
|
|
%if %{with systemd}
|
|
|
|
%tmpfiles_create %_tmpfilesdir/postgresql.conf
|
|
|
|
%service_add_post postgresql.service
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%preun server
|
|
|
|
%if %{with systemd}
|
2017-11-03 13:59:51 +01:00
|
|
|
# Cannot use systemd macros here, because they're doing too much
|
|
|
|
/usr/bin/systemctl --no-reload disable postgresql.service || :
|
2017-09-21 15:48:21 +02:00
|
|
|
%else
|
|
|
|
%stop_on_removal postgresql
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun server
|
|
|
|
%if %{with systemd}
|
2017-11-03 13:59:51 +01:00
|
|
|
# Cannot use systemd macros here, because they're doing too much
|
|
|
|
rm -f "/var/lib/systemd/migrated/postgresql"
|
|
|
|
/usr/bin/systemctl daemon-reload || :
|
|
|
|
|
2017-09-21 15:48:21 +02:00
|
|
|
%else
|
|
|
|
%insserv_cleanup
|
|
|
|
%endif
|
2012-10-04 16:22:52 +02:00
|
|
|
|
2017-11-03 13:59:51 +01:00
|
|
|
%if %{with systemd}
|
|
|
|
%posttrans server
|
|
|
|
# Save the "enabled" and "active" state across the transition of
|
|
|
|
# ownership of postgresql.service from postgresql-init to
|
|
|
|
# postgresql-server.
|
|
|
|
if test -f %eflag; then
|
|
|
|
rm -f %eflag
|
|
|
|
systemctl enable postgresql.service
|
|
|
|
fi
|
|
|
|
if test -f %aflag; then
|
|
|
|
rm -f %aflag
|
|
|
|
systemctl start postgresql.service
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
|
2012-10-04 16:22:52 +02:00
|
|
|
%files
|
2012-10-04 17:07:56 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-10-04 16:22:52 +02:00
|
|
|
%doc README
|
2017-11-03 13:59:51 +01:00
|
|
|
%dir /usr/share/postgresql
|
|
|
|
/usr/share/postgresql/install-alternatives
|
2012-10-04 16:22:52 +02:00
|
|
|
|
|
|
|
%files server
|
2015-09-30 10:07:39 +02:00
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc README
|
|
|
|
%attr(750,postgres,postgres) %dir /var/lib/pgsql
|
2015-09-28 17:09:38 +02:00
|
|
|
%attr(640,postgres,postgres) %config(noreplace) /var/lib/pgsql/.bash_profile
|
2012-10-04 16:22:52 +02:00
|
|
|
|
2017-09-21 15:48:21 +02:00
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
%dir %fwdir
|
|
|
|
%endif
|
|
|
|
%config %fwdir/%fwname
|
|
|
|
/var/adm/fillup-templates/sysconfig.postgresql
|
|
|
|
/usr/sbin/rcpostgresql
|
|
|
|
%if %{with systemd}
|
|
|
|
%_tmpfilesdir/postgresql.conf
|
|
|
|
%_unitdir/
|
2017-11-03 13:59:51 +01:00
|
|
|
/usr/share/postgresql/postgresql-script
|
2017-09-21 15:48:21 +02:00
|
|
|
%else
|
|
|
|
%config /etc/init.d/postgresql
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
2012-10-04 16:22:52 +02:00
|
|
|
%files docs
|
2012-10-04 17:07:56 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-10-04 16:22:52 +02:00
|
|
|
%doc README
|
|
|
|
|
|
|
|
%files contrib
|
2012-10-04 17:07:56 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-10-04 16:22:52 +02:00
|
|
|
%doc README
|
|
|
|
|
|
|
|
%files devel
|
2012-10-04 17:07:56 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-10-04 16:22:52 +02:00
|
|
|
%doc README
|
|
|
|
|
|
|
|
%files plperl
|
2012-10-04 17:07:56 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-10-04 16:22:52 +02:00
|
|
|
%doc README
|
|
|
|
|
|
|
|
%files plpython
|
2012-10-04 17:07:56 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-10-04 16:22:52 +02:00
|
|
|
%doc README
|
|
|
|
|
|
|
|
%files pltcl
|
2012-10-04 17:07:56 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-10-04 16:22:52 +02:00
|
|
|
%doc README
|
|
|
|
|
2017-09-13 18:53:50 +02:00
|
|
|
%changelog
|