LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File postgresql-jdbc.spec of Package postgresql-jdbc (Project Java:packages)

#
# spec file for package postgresql-jdbc
#
# 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/
#
# norootforbuild

%define         buildnum 1002

Name:           postgresql-jdbc
Version:	    9.2
Release:        1
Summary:        Official JDBC Driver for PostgreSQL

Group:          Development/Languages/Java
License:        BSD License
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:	jpackage-utils
BuildRequires:	java-devel
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/Javam

%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