Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37842147
en ru br
ALT Linux repos
S:5.12.1-alt1_2jpp11
5.0: 3.0.3-alt1_4jpp5

Group :: Development/Java
RPM: jna

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2008, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

%define native %{?_with_native:1}%{!?_with_native:%{?_without_native:0}%{!?_without_native:%{?_native:%{_native}}%{!?_native:0}}}


Name:           jna
Summary:        Java Native Access
URL:            https://jna.dev.java.net/
Group:          Development/Java
Version:        3.0.3
Release:        alt1_4jpp5
License:        LGPL
#Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:%{_vendor}}
#Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}

BuildRequires: jpackage-utils >= 0:1.7.5
BuildRequires: ant >= 0:1.6.5
BuildRequires: ant-nodeps
BuildRequires: ant-junit
BuildRequires: junit
BuildRequires: ant-trax
BuildRequires: xalan-j2
%if %{native}
%define __find_provides true
BuildRequires: libX11-devel
BuildRequires: libXt-devel
%endif


Source0:        jna-3.0.3.tar.gz
# svn export https://jna.dev.java.net/svn/jna/tags/3.0.3 jna-3.0.3 --username guest
# password is void
Source1:        %{name}-%{version}.pom
Patch0:         %{name}-%{version}-build.patch

%if ! %{native}
BuildArch:      noarch
%endif

#Requires:         %{name}-native = %{epoch}:%{version}-%{release}

Requires(post): jpackage-utils >= 0:1.7.5
Requires(postun): jpackage-utils >= 0:1.7.5

%description
JNA provides Java programs easy access to native shared
libraries (DLLs on Windows) without writing anything but
Java code. No JNI or native code is required. This functionality
is comparable to Windows' Platform/Invoke and Python's ctypes.
Access is dynamic at runtime without code generation.
JNA's design aims to provide native access in a natural way
with a minimum of effort. No boilerplate or generated code is
required. While some attention is paid to performance,
correctness and ease of use take priority.
The JNA library uses a small native library stub to dynamically
invoke native code. The developer uses a Java interface to
describe functions and structures in the target native library.
This makes it quite easy to take advantage of native platform
features without incurring the high overhead of configuring and
building JNI code for multiple platforms.

%if %{native}
%package        native
Summary:        Native shared library %{name}
Group:          Development/Java

%description    native
%{summary}.

%else

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Documentation

%description    javadoc
%{summary}.
%endif

%prep
%setup -q
%patch0 -b .sav0

%build
unset CLASSPATH
export JAVA_HOME=%{_jvmdir}/java-1.5.0
export OPT_JAR_LIST="ant/ant-trax ant/ant-nodeps ant/ant-junit junit xalan-j2-serializer"
cd jnalib
%if %{native}
%ant native
%else
%ant compile jar javadoc
%endif

%install
%if %{native}
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}
install -m 644 jnalib/build*/native/libjnidispatch.so $RPM_BUILD_ROOT%{_libdir}/libjnidispatch.so
%else
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 jnalib/build*/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
%add_to_maven_depmap com.sun.jna jna %{version} JPP %{name}
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_datadir}/maven2/poms/JPP-%{name}.pom

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr jnalib/doc/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
%endif

%if ! %{native}
%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ "$1" = "0" ]; then
 rm -f %{_javadocdir}/%{name}
fi

%post
%update_maven_depmap

%postun
%update_maven_depmap
%endif

%if %{native}
%files native
%{_libdir}/*.so*
%else
%files
%{_javadir}/*.jar
%doc jnalib/release-notes.html jnalib/LICENSE.txt
%{_datadir}/maven2
%{_mavendepmapfragdir}

%files javadoc
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}
%endif

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin