File jxplorer.spec of Package jxplorer

#
# spec file for package jxplorer
#
# Copyright (c) 2018 SUSE LINUX 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:           jxplorer
Version:        3.3.1.2
Release:        0
Summary:        Cross Platform LDAP Browser and Editor
License:        CAOSL-1.0
Group:          Productivity/Networking/LDAP/Clients
Url:            http://%{name}.org/
Source:         %{name}-%{version}.tar.xz
Patch0:         %{name}-dsml.patch
BuildArch:      noarch
ExcludeArch:    %{arm}
BuildRequires:  ImageMagick
BuildRequires:  ant
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  javahelp2
BuildRequires:  junit
BuildRequires:  update-desktop-files
Requires:       javahelp2
Requires:       jre >= 1.4.2

%description
JXplorer is a cross platform LDAP browser and editor. It is a standards compliant general purpose LDAP client that can be used to search, read and edit any standard LDAP directory, or any directory service with an LDAP or DSML interface.


%prep
%setup -q -n %{name}
%patch0

%build
%{__mkdir_p} help
%{__mkdir_p} jasper/lib
%{__mkdir_p} jasper/lib_extras

# decompress help files
(cd help && %jar -xf ../jars/help.jar && %{__rm} -fr META-INF)

# remove the third party jars
find . -type f -iname "*.jar" -delete

export CLASSPATH=$(build-classpath javahelp2 junit)
%ant -Dant.build.javac.source=1.4 jar build_help
convert %{_builddir}/%{name}/images/logo_64.png -transparent '#ffffff' png32:%{name}.png

%install
%{__install} -m 755 -d %{buildroot}%{_bindir}
%{__install} -m 755 -d %{buildroot}%{_datadir}/pixmaps
%{__install} -m 755 -d %{buildroot}%{_datadir}/%{name}/plugins
%{__install} -m 755 -d %{buildroot}%{_datadir}/%{name}/language
%{__install} -m 755 -d %{buildroot}%{_docdir}/%{name}
%{__install} -m 0644 -p -T jars/help.jar %{buildroot}%{_datadir}/%{name}/help-%{version}.jar
%{__install} -m 0644 -p -T jars/%{name}.jar %{buildroot}%{_datadir}/%{name}/%{name}-%{version}.jar
%{__install} -m 0644 -p -t %{buildroot}%{_datadir}/pixmaps %{name}.png
%{__cp} -a -t %{buildroot}%{_docdir}/%{name} example.ldif README.*.TXT
%{__mv} -t %{buildroot}%{_docdir}/%{name} language/README_LANGUAGE.txt security.default/README_SECURITY.TXT
%{__install} -d -m 0755 %{buildroot}%{_defaultlicensedir}/%{name}
%{__install} -m 0644 -p -t %{buildroot}%{_defaultlicensedir}/%{name} licence.txt
%{__cp} -a -t %{buildroot}%{_datadir}/%{name} csvconfig.txt.default htmldocs icons images log4j.xml security.default templates
%{__cp} -a -t %{buildroot}%{_datadir}/%{name}/language language/JX.properties language/JX_[a-z][a-z].properties language/JX_[a-z][a-z]_[A-Z][A-Z].properties
%{__rm} -f %{buildroot}%{_datadir}/%{name}/templates/JXsplash.gif.notused
%suse_update_desktop_file -c %{name} JXplorer "%{summary}" %{name} %{name} System Network
(cd %{buildroot}%{_datadir}/%{name} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%version/}; done)
cat > %{buildroot}%{_bindir}/%{name} << EOF
#!/bin/sh

JXOPTS="\${JXOPTS} -Dfile.encoding=utf-8 -Djxplorer.config=\${HOME}/.jxplorer/"
cd %{_datadir}/%{name}
exec /usr/bin/java \${JXOPTS} -cp %{_datadir}/%{name}/*:%{_javadir}/*:jasper com.ca.directory.jxplorer.JXplorer "\${@}"
EOF
chmod 0755 %{buildroot}%{_bindir}/%{name}
%fdupes %{buildroot}/%{_datadir}/%{name}

%files
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%doc
%defattr(-,root,root,-)
%{_docdir}/%{name}/
%{_defaultlicensedir}/%{name}/

%changelog