postgresql/postgresql-pl.spec

182 lines
5.9 KiB
RPMSpec

#
# spec file for package postgresql-pl (Version 8.4.3)
#
# Copyright (c) 2010 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/
#
Name: postgresql-pl
BuildRequires: bison flex gettext-devel
BuildRequires: openldap2-devel openssl-devel pam-devel readline-devel zlib-devel
BuildRequires: ncurses-devel
%if 0%{?suse_version} > 910
BuildRequires: krb5-devel libxslt-devel
%endif
BuildRequires: python-devel tcl-devel
Summary: The PL/Tcl, PL/Perl, and PL/Python Procedural Languages for PostgreSQL
Version: 8.4.3
Release: 1
%define pg_minor_version %(echo %version | cut -f1-2 -d.)
License: BSD3c(or similar)
Group: Productivity/Databases/Servers
Source0: postgresql-%version.tar.bz2
NoSource: 0
Patch0: postgresql-perl-rpath.patch
Url: http://www.postgresql.org/
Requires: postgresql-server = %pg_minor_version
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define pls plperl plpython tcl
%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 source package builds the PL/Tcl, PL/Perl, and PL/Python
procedural languages from the PostgreSQL source code. With these
modules one can use Perl, Python, and Tcl to write stored procedures,
functions, and triggers.
PostgreSQL also offers the built-in procedural language PL/pgSQL which is
included in the postgresql-server package.
%package -n postgresql-plperl
License: BSD3c(or similar)
Summary: The PL/Tcl, PL/Perl, and PL/Python procedural languages for PostgreSQL
Group: Productivity/Databases/Servers
Requires: perl = %perl_version
Obsoletes: postgresql-pl
Provides: postgresql-pl:%_libdir/postgresql/plperl.so
Requires: postgresql-server = %pg_minor_version
%description -n postgresql-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 -n postgresql-plpython
License: BSD3c(or similar)
Summary: The PL/Python Procedural Languages for PostgreSQL
Group: Productivity/Databases/Servers
Obsoletes: postgresql-pl
Provides: postgresql-pl:%_libdir/postgresql/plpython.so
Requires: python
Requires: postgresql-server = %pg_minor_version
%description -n postgresql-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 -n postgresql-pltcl
License: BSD3c(or similar)
Summary: PL/Tcl Procedural Language for PostgreSQL
Group: Productivity/Databases/Tools
Obsoletes: postgresql-pl
Provides: postgresql-pl:%_libdir/postgresql/pltcl.so
Requires: tcl
Requires: postgresql-server = %pg_minor_version
%description -n postgresql-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.
%prep
# The sources for the postgresql-pl package can be found
# in the postgresql source RPM.
%setup -q -n postgresql-%{version}
%patch0
%build
export CFLAGS="%optflags $SP"
./configure \
--prefix=%_prefix \
--libdir=%_libdir \
--bindir=%_bindir \
--includedir=%_includedir/pgsql \
--datadir=%_datadir/postgresql \
--mandir=%_mandir \
--with-docdir=%_docdir \
--disable-rpath \
--enable-nls \
--enable-thread-safety \
--enable-integer-datetimes \
--with-python \
--with-perl \
--with-tcl \
--with-tclconfig=%_libdir \
--with-openssl \
--with-pam \
--with-ldap \
%if 0%{?suse_version} > 910
--with-krb5 \
--with-gssapi \
--with-libxml \
--with-libxslt \
%endif
--with-system-tzdata=/usr/share/zoneinfo
# fmgroids.h is needed for plperl
make -C src/backend ../../src/include/utils/fmgroids.h
for f in %pls; do
make %{?jobs:-j%jobs} -C src/pl/$f all
done
%install
for f in %pls; do
make DESTDIR=%buildroot -C src/pl/$f install
done
for pl in pltcl plperl plpython;do
%find_lang $pl-%{pg_minor_version} postgresql-$pl.lang
done
%clean
rm -rf %buildroot
%files -n postgresql-pltcl -f postgresql-pltcl.lang
%defattr(-,root,root)
%dir %_libdir/postgresql
%_libdir/postgresql/pltcl.so
%_datadir/postgresql
%_bindir/pltcl*
%files -n postgresql-plperl -f postgresql-plperl.lang
%defattr(-,root,root)
%dir %_libdir/postgresql
%_libdir/postgresql/plperl.so
%files -n postgresql-plpython -f postgresql-plpython.lang
%defattr(-,root,root)
%dir %_libdir/postgresql
%_libdir/postgresql/plpython.so
%changelog