File SweetHome3D.spec of Package SweetHome3D

# spec file for package SweetHome3D
# Copyright (c) 2019 SUSE LLC.
# Copyright (c) 2016 Michiel van der Wulp
# 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

Name:           SweetHome3D
Version:        6.5
Release:        0
Summary:        An application for placing your furniture on a house 2D plan, with a 3D preview
License:        GPL-2.0-or-later
Group:          Productivity/Graphics/3D Editors
Source1:        %{name}.png
Source2:        %{name}.desktop
Source3:        %{name}
BuildRequires:  ant
BuildRequires:  dos2unix
BuildRequires:  java-3d
BuildRequires:  java-devel
BuildRequires:  jpackage-utils
BuildRequires:  unzip
BuildRequires:  xerces-j2
BuildRequires:  xmlbeans
BuildRequires:  xml-apis
BuildRequires:  xml-resolver
Requires:       java
Requires:       java-3d
BuildArch:      noarch

Sweet Home 3D is a free application that helps you placing your
furniture on a house 2D plan, with a 3D preview.

%setup -q -n %{name}-%{version}-src

rm -r lib/linux
rm -r lib/macosx
rm -r lib/windows
rm    lib/j3d*.jar
rm    lib/vecmath*.jar
ln -s %{_javadir}/java-3d/*.jar lib/

dos2unix     *.TXT
chmod 644 *.TXT

# Generate launcher script from template
sed 's|@DATADIR@|%{_datadir}|g' %{SOURCE3} > %{name}.sh

%{ant} application furniture textures help

# jars
install -Dpm 644 build/%{name}.jar %{buildroot}%{_javadir}/%{name}/%{name}-%{version}.jar

pushd %{buildroot}%{_javadir}/%{name}
for jar in *-%{version}*; do
    ln -sf ${jar} `echo $jar | sed "s|-%{version}||g"`

for i in Furniture Textures Help; do
    install -pm 644 build/$i.jar %{buildroot}%{_javadir}/%{name}

# remove java3d links
rm lib/j3d*.jar lib/vecmath.jar
# copy other unpackaged libs
install -pm 644 lib/*.jar %{buildroot}%{_javadir}/%{name}
install -pm 644 libtest/jnlp.jar %{buildroot}%{_javadir}/%{name}

# startscript
install -D -m 755 %{name}.sh -t %{buildroot}%{_bindir}

# icon and menu-entry
install -D -m 644 %{SOURCE1} -t %{buildroot}%{_datadir}/pixmaps
install -D -m 644 %{SOURCE2} -t %{buildroot}%{_datadir}/applications

%license COPYING.TXT
%dir %{_javadir}/%{name}

openSUSE Build Service is sponsored by