File opensc-java.spec of Package opensc-java

#
# spec file for package opensc-java (Version 0.2.2)
#
# Copyright (c) 2009 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


Name:           opensc-java
BuildRequires:  java2-devel-packages opensc-devel
Version:        0.2.2
Release:        78
Summary:        OpenSC JAVA Integration
License:        LGPL v2.1 or later
# We do not use official opensc-PKCS11-0.2.2-sources.jar, as it contains
# only java sources but binary helper is missing.
#%( exec >&2 ; cd %{_sourcedir} ; if ! test -f %{name}-pkcs11-%{version}.tar.bz2 ; then svn co http://www.opensc-project.org/svn/opensc-java/releases/pkcs11-%{version} ; tar -jcf %{name}-pkcs11-%{version}.tar.bz2 pkcs11-%{version} ; LC_ALL=C svn log pkcs11-%{version} >ChangeLog ; rm -rf pkcs11-%{version} ; fi )
Source:         %{name}-pkcs11-%{version}.tar.bz2
# We do not compile java sources but use precompiled library:
# - it is digitally signed by key provided by Sun
# - does not need maven
Source1:        http://www.opensc-project.org/files/opensc-java/maven/org/opensc/opensc-PKCS11/%{version}/opensc-PKCS11-%{version}.jar
Source2:        ChangeLog
Patch:          opensc-java-config.patch
Patch1:         opensc-java-no-strip.patch
Url:            http://www.opensc-project.org/opensc-java/
Group:          Productivity/Security
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       java >= 1.5

%description
The OpenSC JAVA project aims to provide smart card functionality to
JAVA 1.5 or later. The JAVA integration should provide simple
APDU-scripting and an automated Smart Card initalization through
PKCS#15 as well as a complete integration of Smart Cards into the JAVA
security provider infrastructure.

Currently, the project consists of a basic PKCS#11 security provider,
which is able to issue RSA/DSA signatures using a fully initialized
Smart Card. The first release- 0.1.1- of this security provider is
signed with a certificate, that has been officially approved by Sun.
The version is already capable of establishing a peer-authenticated
SSL/TLS connection with the client certificate stored in a
cryptographic token.



%prep
%setup -q -n pkcs11-%{version}
%patch
%patch1
cp -a %{S:1} %{S:2} .
sed -i "s:@CFLAGS@:$RPM_OPT_FLAGS:" jni/build/unix/*/*.data jni/src/scripts/config.data.default

%build
cd jni/build/unix/release
../../../src/scripts/config.pl $PWD
make %{?jobs:-j%jobs} PREFIX=%{_prefix}

%install
# jar
%__mkdir_p %{buildroot}%{_jnidir}-ext
%__install -m 644 opensc-PKCS11-0.2.2.jar %{buildroot}%{_jnidir}-ext/opensc-PKCS11.jar
# lib
cd jni/build/unix/release
%makeinstall PREFIX=%{_prefix}
#%__mkdir_p %{buildroot}%{_libdir}
#%__install -m 755 dist/tmp/libopensc-PKCS11-*.so %{buildroot}%{_libdir}/
# NOTE: Code is not compatible with Java 1.4.
export NO_BRP_CHECK_BYTECODE_VERSION=true

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(0644,root,root,0755)
%doc ChangeLog LICENSE README TODO
%{_libdir}/*.so
%dir %{_jnidir}-ext
%{_jnidir}-ext/*.jar

%changelog
* Thu Apr 03 2008 sbrabec@suse.cz
- Updated to version 0.2.2:
  * build by maven instead of ant
  * fixes and improvements
  * see ChangeLog for details
* Tue Sep 18 2007 ro@suse.de
- fix build (WARNING: this package gets files from apache.org)
* Fri Mar 30 2007 ro@suse.de
- added unzip to buildreq
* Wed Oct 04 2006 sbrabec@suse.cz
- New SuSE package, version 0.1.1.
openSUSE Build Service is sponsored by