File barbie_seahorse_adventures.spec of Package barbie_seahorse_adventures

#
# spec file for package barbie_seahorse_adventures
#
# Copyright (c) 2021 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:           barbie_seahorse_adventures
Version:        1.3
Release:        0
Summary:        You are a seahorse and you want to go to the moon!
License:        GPL-2.0-only
Group:          Amusements/Games/Action/Arcade
URL:            http://www.imitationpickles.org/barbie/
Source0:        https://codeload.github.com/dulsi/seahorse-adventures/tar.gz/refs/tags/release-%{version}#/seahorse-adventures-release-%{version}.tar.gz
Source1:        %{name}.sh
Source2:        %{name}.desktop
Source3:        %{name}.appdata.xml
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
Requires:       python3
Requires:       python3-pygame
BuildArch:      noarch

%description
You are a seahorse and you want to go to the moon!

When you play - make sure to check out all 3 phases - Jungle, Volcano, and Moon!

%prep
%setup -q -n seahorse-adventures-release-%{version}
mv LICENSE.txt LICENSE

# Remove not needed files
rm -f data/REMOVE_ME.txt data/sample.txt lib/pgu/LICENSE.txt

# Adjust python version
sed -i 's|%{_bindir}/python|%{_bindir}/python3|' leveledit.py tileedit.py
sed -i 's|%{_bindir}/env python|%{_bindir}/python3|' run_game.py

# Convert to unix line end
find . -name "*.py" -exec dos2unix "{}" "+"

%build

%install
# install wrapper
install -Dm 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}

# install directories
mkdir -p %{buildroot}%{_datadir}/%{name}/{data,lib}
for d in data lib ; do
    cp -a $d %{buildroot}%{_datadir}/%{name}
done

# install files
install -Dm 0644 *.ini %{buildroot}%{_datadir}/%{name}

for f in leveledit run_game tileedit ; do
    install -Dm 0555 ${f}.py %{buildroot}%{_datadir}/%{name}
done

# install icons
for i in 32 64 128 ; do
    install -Dm 0644 icon${i}.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done

# install Desktop file
install -Dm 0644 %{SOURCE2} %{buildroot}%{_datadir}/applications/%{name}.desktop

# install app store metadata
install -Dm 0644 %{SOURCE3} %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml

%suse_update_desktop_file %{name}
%fdupes -s %{buildroot}%{_prefix}

%files
%doc *.txt
%license LICENSE
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/%{name}

%changelog
openSUSE Build Service is sponsored by