File barbie_seahorse_adventures.spec of Package barbie_seahorse_adventures

# spec file for package barbie_seahorse_adventures
# Copyright (c) 2016 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

Name:           barbie_seahorse_adventures
Version:        1.1
Release:        0
Summary:        You are a seahorse and you want to go to the moon!
License:        GPL-2.0
Group:          Amusements/Games/Action/Arcade
Source1:        %{name}.sh
Source2:        %{name}.desktop
Source3:        %{name}.appdata.xml
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  dos2unix
Requires:       python
Requires:       python-pygame
BuildArch:      noarch

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!

%setup -q -n barbie-%{version}

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

# Adjust python version
sed -i 's|/usr/bin/python|/usr/bin/python2|'

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


# install wrapper
install -Dm 0755 %{S:1} %{buildroot}%{_bindir}/%{name}

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

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

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

for f in preview pyweek-upload ; do
    install -Dm 0644 ${f}.py %{buildroot}%{_datadir}/%{name}

# 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
install -Dm 0644 icon64.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

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

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

%if 0%{?suse_version}
    %suse_update_desktop_file %{name}
    %fdupes -s %{buildroot}%{_prefix}

%doc *.txt
%dir %{_datadir}/appdata/