File DreamWeb.spec of Package DreamWeb

#
# spec file for package DreamWeb
#
# Copyright (c) 2022 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:           DreamWeb
URL:            http://www.scummvm.org/games
Version:        20040315
Release:        0
Summary:        DreamWeb
License:        SUSE-Freeware
Group:          Amusements/Games/Other
Source0:        https://downloads.scummvm.org/frs/extras/Dreamweb/dreamweb-cd-uk-1.1.zip
Source1:        https://downloads.scummvm.org/frs/extras/Dreamweb/dreamweb-cd-us-1.1.zip
Source2:        https://downloads.scummvm.org/frs/extras/Dreamweb/dreamweb-cd-de-1.1.zip
Source3:        https://downloads.scummvm.org/frs/extras/Dreamweb/dreamweb-cd-fr-1.1.zip
Source4:        https://downloads.scummvm.org/frs/extras/Dreamweb/dreamweb-cd-it-1.1.zip
Source5:        https://downloads.scummvm.org/frs/extras/Dreamweb/dreamweb-cd-es-1.1.zip
Source6:        https://downloads.scummvm.org/frs/extras/Dreamweb/dreamweb-manuals-en-lores.zip
Source7:        %name
Source8:        %name.desktop
Source9:        %name.png
Source10:       info
BuildRequires:  fdupes
BuildRequires:  unzip
BuildRequires:  update-desktop-files
Requires:       scummvm
Recommends:     xmessage
BuildArch:      noarch

%description
In your dreams you travel to the Dreamweb. Everyone does. The plane
of subconsciousness affects your life every day. It controls the
very heart of civilisation itself. This web is controlled by seven
people who each contain the power of a node within the web. The
characteristics of these people imbue the web, and hence the World,
with their own strengths and weaknesses. As one of the nodes dies
it is transferred to another human, and so the forces within the
web fluctuate as the nodes attain differing aspects.

But all this is about to be shattered. The forces of evil have
understood the power of the web, and now all seven nodes are
controlled by evil people. The web itself is about to be overrun
and destined to remain evil. Forever!

Only one person can stop this terrible catastrophe. The chosen one.
Ryan. YOU!

You have been summoned by the keepers of the Web. You must destroy
the controllers of all seven nodes to allow the Web to regenerate
and thus restore the equilibrium. The fate of civilisation rests in
your hand.

To aid you in this most difficult mission, Ryan's diary ‘The Diary
of a (Mad?) Man’ has been faithfully reproduced. Read the diary
carefully, it will help you in your quest.

Good luck.

%prep
mkdir -p en us de fr it es
unzip -d en %_sourcedir/dreamweb-cd-uk-1.1.zip
unzip -d us %_sourcedir/dreamweb-cd-us-1.1.zip
unzip -d de %_sourcedir/dreamweb-cd-de-1.1.zip
unzip -d fr %_sourcedir/dreamweb-cd-fr-1.1.zip
unzip -d it %_sourcedir/dreamweb-cd-it-1.1.zip
unzip -d es %_sourcedir/dreamweb-cd-es-1.1.zip
for i in en us de fr it es; do
  test -d $i/diary    && mv $i/diary diary-$i
  test -d $i/tagebuch && mv $i/tagebuch diary-$i
  test -d $i/manual   && mv $i/manual manual-$i
  test -d $i/handbuch && mv $i/handbuch manual-$i
  test -d $i/manuel   && mv $i/manuel manual-$i
  test -d $i/manuale  && mv $i/manuale manual-$i
  mv $i/license.txt license-$i.txt
  rm $i/INSTALL.EXE
  # italian version needs DREAMWEB.EXE for speech sound for some reason
  test "$i" == "it" || rm $i/DREAMW*.EXE
done
unzip %_sourcedir/dreamweb-manuals-en-lores.zip
chmod 644 "Box Art"/*

%build

%install
mkdir -p %{buildroot}%{_bindir}
install -m 755 %{_sourcedir}/%{name} %{buildroot}/%{_bindir}

mkdir -p %{buildroot}%{_datadir}/%{name}/{en,us,de,fr,it,es}
for i in en us de fr it es; do
  install -m 644 $i/{DREAMW*.*,track*1.flac} %{buildroot}%{_datadir}/%{name}/$i
  case $i in
        fr)
	    DIR=FRENCH
            ;;
	es)
	    DIR=SPANISH
	    ;;
        *)
	    DIR=SPEECH
            ;;
    esac
    mkdir -p %{buildroot}%{_datadir}/%{name}/$i/$DIR
    install -m 644 $i/$DIR/* %{buildroot}%{_datadir}/%{name}/$i/$DIR
done

install -m 644 $RPM_SOURCE_DIR/info %{buildroot}%{_datadir}/%{name}

mkdir -p %{buildroot}/%{_datadir}/pixmaps/
install -m 644 %{_sourcedir}/%name.png %{buildroot}/%{_datadir}/pixmaps

%suse_update_desktop_file -i %name Game X-SuSE-AdventureGame

%fdupes -s %{buildroot}

%files
%defattr(-,root,root)
%doc diary-* manual-* license-*.txt "Box Art" "Diary Of A Madman.pdf" "User Manual.pdf" license.txt
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%name.desktop
%{_datadir}/pixmaps/%name.png

%changelog
openSUSE Build Service is sponsored by