File makehuman.spec of Package makehuman

#
# spec file for package makehuman
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           makehuman
Version:        1.2.0
Release:        0
Summary:        Create 3D models for human-like characters
License:        AGPL-3.0-or-later
URL:            http://makehumancommunity.org/
Source0:        %name-%version.tar.gz
Source1:        makehuman
Source2:        makehuman.png
BuildRequires:  unzip
Requires:       python3-numpy
Requires:       python3-opengl
Requires:       python3-qt5
BuildArch:      noarch
Requires:       makehuman-base-female
Requires:       makehuman-base-male

%description
MakeHuman is a tool to create 3D objects for human character models,
which you can import into Blender or other 3D applications.

%package base-female
Summary:        Model data for MakeHuman female characters
Requires:       makehuman

%description base-female
Model data for needed for MakeHuman female characters

%package base-male
Summary:        Model data for MakeHuman male characters
Requires:       makehuman

%description base-male
Model data for needed for MakeHuman male characters

%prep
%setup -q -n %name-%version

%build
cd makehuman

%install
install -d -m 755 %buildroot/%_datadir
cp -r makehuman %buildroot/%_datadir/

mkdir -p %buildroot/usr/bin/
install -Dm 755 %{SOURCE1} %{buildroot}/usr/bin/makehuman

mkdir -p %buildroot/usr/share/pixmaps/
cp -f %{SOURCE2} %{buildroot}/usr/share/pixmaps/makehuman.png

%post
# Create desktop file
if test -e "/usr/share/applications/MakeHuman.desktop" ; then
  rm -f "/usr/share/applications/MakeHuman.desktop"
fi

cat > "/usr/share/applications/MakeHuman.desktop" << EOM
[Desktop Entry]
Name=MakeHuman
Comment=MakeHuman is a free, open source tool for creating realistic 3D human characters.
GenericName=MakeHuman is a free, open source tool for creating realistic 3D human characters.
Exec=/usr/share/makehuman/makehuman
Terminal=false
Type=Application
Icon=makehuman
Categories=Graphics
EOM

%postun
if [ "$1" = 0 ]; then
  rm -f "/usr/share/applications/MakeHuman.desktop"
fi

%files
%_datadir/%name/
/usr/bin/makehuman
/usr/share/pixmaps/makehuman.png
%exclude %_datadir/%name/data/targets/macrodetails/
%exclude %_datadir/%name/data/targets/breast/female-*.target

%files base-female
%dir %_datadir/%name/data/targets/macrodetails
%dir %_datadir/%name/data/targets/macrodetails/height
%dir %_datadir/%name/data/targets/macrodetails/proportions
%_datadir/%name/data/targets/breast/female-*.target
%_datadir/%name/data/targets/macrodetails/*-female-*.target
%_datadir/%name/data/targets/macrodetails/height/female-*.target
%_datadir/%name/data/targets/macrodetails/proportions/female-*.target

%files base-male
%dir %_datadir/%name/data/targets/macrodetails
%dir %_datadir/%name/data/targets/macrodetails/height
%dir %_datadir/%name/data/targets/macrodetails/proportions
%_datadir/%name/data/targets/macrodetails/*-male-*.target
%_datadir/%name/data/targets/macrodetails/height/male-*.target
%_datadir/%name/data/targets/macrodetails/proportions/male-*.target

%changelog
openSUSE Build Service is sponsored by