]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # TODO: | |
3 | # - build all svga/sdl/X versions instead of bconds | |
4 | # - check if it builds, because I got an error with | |
5 | # *.desktop at the end of building process, and | |
6 | # cannot build package without commenting out line with | |
7 | # *.desktop in %files, but it might be my fault | |
8 | # so i keep section %files unchanged for now | |
9 | # | |
10 | # Conditional build: | |
11 | # video (default: X11-only version): | |
12 | %bcond_with svga # SVGALIB version | |
13 | %bcond_with sdl # SDL version | |
14 | %bcond_with sdlsvga # SDL/SVGALIB version | |
15 | # CD-Audio support: | |
16 | %bcond_with cda_internal # internal CD Audio Support | |
17 | %bcond_with cda_sdl # SDL CD Audio Support | |
18 | # other: | |
19 | %bcond_with arts # arts audio output support | |
20 | %bcond_with flac # with FLAC audio codec support | |
21 | %bcond_with wc2 # WarCraft 2 Expansion CD | |
22 | # | |
23 | Summary: Free cross-platform real-time strategy gaming engine | |
24 | Summary(pl.UTF-8): Wolnodostępny, międzyplatformowy silnik gier strategicznych czasu rzeczywistego | |
25 | Name: freecraft | |
26 | %define snap 030311 | |
27 | Version: 1.18 | |
28 | Release: 2 | |
29 | #Release: 0.pre1.%{snap}.1 | |
30 | Epoch: 1 | |
31 | License: GPL | |
32 | Group: X11/Applications/Games | |
33 | Source0: http://home.earthlink.net/~pappy86312/downloads/%{name}-%{snap}-src.tar.gz | |
34 | # Source0-md5: e7926083835d9f913e4bfc7e1ab13cc1 | |
35 | Source1: %{name}.desktop | |
36 | Source2: %{name}.png | |
37 | Patch0: %{name}-opt.patch | |
38 | Patch1: %{name}-nonint.patch | |
39 | Patch3: %{name}-flac-update.patch | |
40 | URL: http://freecraft.org/ | |
41 | %{?with_sdl:BuildRequires: SDL-devel} | |
42 | %{?with_sdlsvga:BuildRequires: SDL-devel} | |
43 | %{?with_arts:BuildRequires: arts-devel} | |
44 | BuildRequires: bzip2-devel | |
45 | %{?with_flac:BuildRequires: flac-devel >= 1.0.3} | |
46 | BuildRequires: libmad-devel | |
47 | BuildRequires: libpng-devel | |
48 | BuildRequires: libvorbis-devel | |
49 | %{?with_svga:BuildRequires: svgalib-devel} | |
50 | BuildRequires: zlib-devel | |
51 | Conflicts: %{name}-data < 1:1.18-0.pre1 | |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %description | |
55 | FreeCraft is a free cross-platform real-time strategy gaming engine. | |
56 | It is possible to play against human opponents over LAN, Internet, or | |
57 | against the computer. The engine can be used to build C&C, WC2, SC and | |
58 | AOE-like real-time strategy (RTS) games. It successfully runs under | |
59 | Linux, BSD, BeOS, MacOS/X, MacOS/Darwin and MS Windows (Windows XP is | |
60 | not supported). | |
61 | ||
62 | %description -l pl.UTF-8 | |
63 | FreeCraft to wolnodostępny, międzyplatformowy silnik gier | |
64 | strategicznych czasu rzeczywistego. Można grać przeciwko ludziom przez | |
65 | sieć lokalną lub Internet, a także przeciwko komputerowi. Silnik może | |
66 | być użyty do zbudowania gier strategicznych czasu rzeczywistego (RTS) | |
67 | w stylu C&C, WC2, SC i AOE. Działa pod systemami: Linux, BSD, BeOS, | |
68 | MacOS/X, MacOS/Darwin i MS Windows (XP jeszcze nie jest obsługiwane). | |
69 | ||
70 | %package data-wc2 | |
71 | Summary: Freecraft - files that allow using orignal game data | |
72 | Summary(pl.UTF-8): Freecraft - pliki pozwalające używać danych z oryginalnej gry | |
73 | Group: X11/Applications/Games | |
74 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
75 | Provides: %{name}-data = %{epoch}:%{version}-%{release} | |
76 | Obsoletes: %{name}-data-fcmp | |
77 | ||
78 | %description data-wc2 | |
79 | Freecraft - files that allow using orignal game data. | |
80 | ||
81 | NOTE: it requires data from orignal WC2 CD or Expansion CD. | |
82 | ||
83 | %description data-wc2 -l pl.UTF-8 | |
84 | Freecraft - pliki pozwalające używać danych z oryginalnej gry. | |
85 | ||
86 | UWAGA: wymaga do działania danych z oryginalnego CD lub Expansion CD | |
87 | WC2. | |
88 | ||
89 | %prep | |
90 | %setup -q -n %{name}-%{snap} | |
91 | %patch0 -p1 | |
92 | %patch1 -p1 | |
93 | ||
94 | %build | |
95 | # Version to compile | |
96 | %{?with_svga:WITH_VIDEO="V"} | |
97 | %{?with_sdl:WITH_VIDEO="S"} | |
98 | %{?with_sdlsvga:WITH_VIDEO="B"} | |
99 | %{!?with_svga:%{!?with_sdl:%{!?with_sdlsvga:WITH_VIDEO="X"}}} | |
100 | export WITH_VIDEO | |
101 | ||
102 | # sound support | |
103 | WITH_SOUND="y"; export WITH_SOUND | |
104 | ||
105 | # sound support arts | |
106 | %{!?with_arts:WITH_SOUND_ARTS="y"} | |
107 | %{?with_arts:WITH_SOUND_ARTS="n"} | |
108 | export WITH_SOUND_ARTS | |
109 | ||
110 | # threaded sound | |
111 | WITH_THREADEDSOUND="y"; export WITH_THREADEDSOUND | |
112 | ||
113 | # FLAC support | |
114 | WITH_FLAC="%{?with_flac:y}%{!?with_flac:n}"; export WITH_FLAC | |
115 | ||
116 | # Ogg support | |
117 | WITH_OGG="y"; export WITH_OGG | |
118 | ||
119 | # MAD MP3 support | |
120 | WITH_MAD="y"; export WITH_MAD | |
121 | ||
122 | # CD audio | |
123 | %{?with_cda_internal:WITH_CDA="i"} | |
124 | %{?with_cda_sdl:WITH_CDA="S"} | |
125 | %{!?with_cda_internal:%{!?with_cda_sdl:WITH_CDA="n"}} | |
126 | export WITH_CDA | |
127 | ||
128 | # COMPRESSION OPTIONS (both zlib and bzip2, no zziplib) | |
129 | WITH_COMP="O"; export WITH_COMP | |
130 | ||
131 | # WarCraft 2 Expansion CD | |
132 | WITH_WC2EXPCD="%{?with_wc2:y}%{!?with_wc2:n}"; export WITH_WC2EXPCD | |
133 | ||
134 | # Compile (NO!) | |
135 | WITH_COMPILE="n"; export WITH_COMPILE | |
136 | ||
137 | # Debug | |
138 | WITH_DEBUG="n"; export WITH_DEBUG | |
139 | ||
140 | OPTFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}" | |
141 | export OPTFLAGS | |
142 | ./setup | |
143 | ||
144 | %{__make} depend | |
145 | %{__make} | |
146 | ||
147 | %install | |
148 | rm -rf $RPM_BUILD_ROOT | |
149 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/games/%{name}/{,tools}} \ | |
150 | $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}} | |
151 | ||
152 | install freecraft $RPM_BUILD_ROOT%{_bindir}/freecraft-bin | |
153 | cp -r data $RPM_BUILD_ROOT%{_datadir}/games/%{name} | |
154 | ||
155 | install tools/build.sh $RPM_BUILD_ROOT%{_datadir}/games/%{name}/tools | |
156 | install tools/wartool $RPM_BUILD_ROOT%{_bindir} | |
157 | ln -sf %{_bindir}/wartool $RPM_BUILD_ROOT%{_datadir}/games/%{name}/tools/wartool | |
158 | ||
159 | cat > $RPM_BUILD_ROOT%{_bindir}/freecraft << EOF | |
160 | #!/bin/sh | |
161 | cd /usr/share/games/freecraft | |
162 | %{_bindir}/freecraft-bin "\$@" | |
163 | EOF | |
164 | ||
165 | rm -f doc/{*.lsm,gpl*} contrib/{doxygen*,macosx.tgz,msvc.zip,stdint.h} | |
166 | cp -rf contrib $RPM_BUILD_ROOT%{_datadir}/games/%{name} | |
167 | ||
168 | install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir} | |
169 | install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir} | |
170 | ||
171 | %clean | |
172 | rm -rf $RPM_BUILD_ROOT | |
173 | ||
174 | %files | |
175 | %defattr(644,root,root,755) | |
176 | %doc doc/* | |
177 | %attr(755,root,root) %{_bindir}/* | |
178 | %dir %{_datadir}/games/%{name} | |
179 | %attr(755,root,root) %{_datadir}/games/%{name}/tools | |
180 | %{_datadir}/games/%{name}/contrib | |
181 | %{_desktopdir}/*.desktop | |
182 | %{_pixmapsdir}/*.png | |
183 | ||
184 | %files data-wc2 | |
185 | %defattr(644,root,root,755) | |
186 | %{_datadir}/games/%{name}/data |