File postgresql-jdbc.spec of Package postgresql-jdbc
#
# spec file for package postgresql-jdbc
#
# Copyright (c) 2013 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 buildnum 1002
Name: postgresql-jdbc
Version: 9.2
Release: 0
Summary: Official JDBC Driver for PostgreSQL
License: BSD-3-Clause
Group: Development/Languages/Java
Url: http://jdbc.postgresql.org
Source0: http://jdbc.postgresql.org/download/%{name}-%{version}-%{buildnum}.src.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ant
BuildRequires: ant-trax
BuildRequires: java-devel
BuildRequires: javapackages-tools
BuildArch: noarch
%description
PostgreSQL JDBC Driver allows Java programmers to connect to a PostgreSQL
database using standard, database independent Java code.
The driver provides are reasonably complete implementation of the JDBC 3
specification in addition to some PostgreSQL specific extensions.
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Libraries/Java
%description javadoc
PostgreSQL JDBC Driver API documentation.
%prep
%setup -n %{name}-%{version}-%{buildnum}.src -q
# remove all third party jars
find . -iname '*.jar' | xargs rm -rf
%build
%{ant}
# build the public api
%{ant} publicapi
%install
# create directory for installing the jars
%{__install} -d -m 755 %{buildroot}%{_javadir}
%{__install} -m 655 $RPM_BUILD_DIR/%{name}-%{version}-%{buildnum}.src/jars/postgresql.jar \
%{buildroot}/%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}/%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# javadoc
%{__install} -d -m 755 %{buildroot}/%{_javadocdir}/%{name}-%{version}
%{__cp} -pr build/publicapi/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,0755)
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/%{name}-%{version}
%changelog