-
Notifications
You must be signed in to change notification settings - Fork 0
/
Maelstrom.spec.in
103 lines (89 loc) · 2.46 KB
/
Maelstrom.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Note that this is NOT a relocatable package
%define name @PACKAGE@
%define version @VERSION@
%define release 1
%define prefix /usr
Summary: Simple DirectMedia Layer
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
URL: http://www.devolution.com/~slouken/Maelstrom/
Copyright: GPL
Group: Games
BuildRoot: /var/tmp/%{name}-buildroot
%description
Maelstrom is a rockin' asteroids game ported from the Macintosh
Originally written by Andrew Welch of Ambrosia Software, and ported
to UNIX and then SDL by Sam Lantinga <slouken@devolution.com>
%prep
rm -rf ${RPM_BUILD_ROOT}
%setup -q
%build
# Needed for snapshot releases.
if [ ! -f configure ]; then
CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix
else
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
fi
if [ "$SMP" != "" ]; then
(make "MAKE=make -k -j $SMP"; exit 0)
make
else
make
fi
%install
rm -rf $RPM_BUILD_ROOT
make install prefix=$RPM_BUILD_ROOT/%{prefix}
%clean
rm -rf $RPM_BUILD_ROOT
%post
# Add desktop menu bar items
function Add_DeskTop_MenuItem
{
desktop=$1; deskfile=$2
if [ -d "$desktop" ]; then
desktop="$desktop/Games"
if [ ! -d "$desktop" ]; then
mkdir "$desktop" 2>/dev/null
fi
if [ -w "$desktop" ]; then
echo "Creating $desktop/$deskfile"
cat >"$desktop/$deskfile" <<__EOF__
# KDE Config File
[KDE Desktop Entry]
Name=Maelstrom
Comment=Maelstrom
Exec=/usr/bin/Maelstrom
Icon=/usr/games/Maelstrom/icon.xpm
Terminal=0
Type=Application
__EOF__
fi
fi
}
echo "============================================================="
echo "Adding desktop menu items ..."
for gnomedir in "/opt/gnome" "/usr/share/gnome" "$HOME/.gnome"
do Add_DeskTop_MenuItem "$gnomedir/apps" "maelstrom.desktop"
done
for kdedir in "/opt/kde" "/usr/share/kde" "$HOME/.kde"
do Add_DeskTop_MenuItem "$kdedir/share/applnk" "maelstrom.kdelnk"
done
%postun
echo "============================================================="
echo "Removing desktop menu items ..."
for gnomedir in "/opt/gnome" "/usr/share/gnome" "$HOME/.gnome"
do rm -f "$gnomedir/apps/Games/maelstrom.desktop"
done
for kdedir in "/opt/kde" "/usr/share/kde" "$HOME/.kde"
do rm -f "$kdedir/share/applnk/Games/maelstrom.kdelnk"
done
%files
%defattr(-, root, root)
%doc COPYING* CREDITS README* Changelog Docs
%{prefix}/bin/Maelstrom
%{prefix}/games/Maelstrom
%changelog
* Tue Sep 21 1999 Sam Lantinga <slouken@devolution.com>
- first attempt at a spec file