File VirtualLab.spec of Package VirtualLab
#
# spec file for package VirtualLab
#
# Copyright (c) 2012 Lars Vogdt
#
# 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: VirtualLab
Version: 6.2.2
Release: 1
License: GPL-2.0+
Summary: The Virtual Microscope interface
Url: http://virtual.itg.uiuc.edu/
Group: Productivity/Scientific/Other
BuildRequires: java-devel >= 1.4.0
BuildArch: noarch
BuildRequires: unzip
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
Source: %{name}%{version}-with-samples.zip
Source1: %{name}.png
Source2: %{name}.desktop
Source3: VirtualLabConfig.xml
Source4: VirtualLab-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define installpath %{_datadir}/java/%{name}
%description
The Virtual Microscope interface supports the browsing of high-resolution,
multi-dimensional image datasets from our Scanning Electron Microscope (SEM)
and our Light Microscope (LM).
%prep
%setup -T -c %name-%{version}
cp %{SOURCE0} .
unzip *.zip
rm *.zip
pushd "Virtual Lab"
find . -type f "(" -iname "*.dll" -o -iname "*.jnilib" ")" -delete
# None of them need the x bit..
find . -type f -exec chmod a-x "{}" "+"
chmod a+r resources/Virtuallab.6.2.2.jar
mv * ../
popd
rm -rf "Virtual Lab"
%build
%install
%if 0%{?suse_version}
export NO_BRP_CHECK_BYTECODE_VERSION="true"
%endif
mkdir -p %{buildroot}%installpath
mkdir -p %{buildroot}%{_bindir}
cp -ar * %{buildroot}%installpath/
install -m644 %{SOURCE3} %{buildroot}%installpath/VirtualLabConfig.xml
# startscript
cat > %{name}.sh <<EOF
#!/bin/sh
cd "%installpath"
exec java -Dapple.laf.useScreenMenuBar=true -Djava.library.path=resources/ -Xmx1024m -jar "%installpath/resources/Virtuallab.6.2.2.jar" "\$@"
EOF
install -m 755 %{name}.sh %{buildroot}%{_bindir}/
# install menu entry
install -D -m644 %SOURCE1 %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -m644 %SOURCE2 %{buildroot}%{_datadir}/applications/%{name}.desktop
%if 0%{?suse_version}
%suse_update_desktop_file %{name} Chemistry
%endif
# reduce size
%if 0%{?suse_version} > 1010
%fdupes -s %{buildroot}
%endif
%files
%defattr(-,root,root)
%attr(755,root,root) %{_bindir}/%{name}.sh
%installpath
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%changelog