]> git.pld-linux.org Git - packages/wesnoth.git/blob - wesnoth.spec
- added gcc patch (fixes build with gcc 4.6)
[packages/wesnoth.git] / wesnoth.spec
1 # TODO
2 # - unpackaged language files
3 # Conditional build
4 %bcond_without  server  # without server
5 %bcond_without  tools   # without tools
6 %bcond_without  fribidi # without Bidirectional language support
7 #
8 Summary:        Strategy game with a fantasy theme
9 Summary(hu.UTF-8):      Fantasy környezetben játszódó stratégiai játék
10 Summary(pl.UTF-8):      Strategiczna gra z motywem fantasy
11 Name:           wesnoth
12 Version:        1.8.5
13 Release:        2
14 Epoch:          1
15 License:        GPL v2+
16 Group:          X11/Applications/Games/Strategy
17 Source0:        http://downloads.sourceforge.net/wesnoth/%{name}-%{version}.tar.bz2
18 # Source0-md5:  a800285d1406690755dd0ea22b98b6df
19 Source1:        %{name}d.init
20 Patch0:         %{name}-libpng.patch
21 Patch1:         %{name}-desktop.patch
22 Patch2:         %{name}-locale_dir.patch
23 Patch3:         %{name}-gcc.patch
24 URL:            http://www.wesnoth.org/
25 BuildRequires:  SDL-devel >= 1.2.14-4
26 BuildRequires:  SDL_image-devel >= 1.2
27 BuildRequires:  SDL_mixer-devel >= 1.2
28 BuildRequires:  SDL_net-devel >= 1.2
29 BuildRequires:  SDL_ttf-devel >= 2.0.8
30 BuildRequires:  asciidoc
31 BuildRequires:  boost-devel >= 1.33
32 BuildRequires:  cmake >= 2.4
33 BuildRequires:  dbus-devel
34 %{?with_fribidi:BuildRequires:  fribidi-devel}
35 BuildRequires:  gettext-devel
36 BuildRequires:  libpng-devel
37 BuildRequires:  libstdc++-devel
38 BuildRequires:  libvorbis-devel
39 BuildRequires:  lua51-devel
40 BuildRequires:  pango-devel
41 BuildRequires:  pkgconfig
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.268
44 BuildRequires:  sed >= 4.0
45 BuildRequires:  zlib-devel
46 Requires:       SDL >= 1.2.14-4
47 # sr@Latn vs. sr@latin
48 Conflicts:      glibc-misc < 6:2.7
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 Battle for Wesnoth is a fantasy strategy game. Battle for control of
53 villages, using variety of units which have advantages and
54 disadvantages in different types of terrains and against different
55 types of attacks. Units gain experience and advance levels, and are
56 carried over from one scenario to the next campaign.
57
58 %description -l hu.UTF-8
59 Battle for Wesnoth (Harc Wesnothért) egy fantasy környezetben játszódó
60 stratégiai játék. Harc a falvak megszerzéséért, különböző egységek
61 felhasználásával, amelyeknek különböző előnyeik és hátrányaik vannak a
62 különféle terepeken és a különböző támadási stílusok ellen. Az
63 egységek tapasztalatot gyűjtenek, és fejlődnek, amelyek átvihetők a
64 következő pályára.
65
66 %description -l pl.UTF-8
67 Bitwa o Wesnoth jest strategiczną grą fantasy. Batalia o kontrolę nad
68 wsiami przy pomocy różnego rodzaju oddziałów, które mają przewagę lub
69 jej brak w odmiennym ukształtowaniu terenu i przeciwko różnym sposobom
70 ataku. Oddziały zdobywają doświadczenie i poziomy zaawansowania i są
71 przenoszone z jednej scenerii do następnej kampanii.
72
73 %package server
74 Summary:        Network server for Wesnoth
75 Summary(hu.UTF-8):      Hálózati szerver Wesnoth-hoz
76 Summary(pl.UTF-8):      Sieciowy serwer dla Wesnoth
77 Group:          X11/Applications/Games/Strategy
78 Requires(post,preun):   /sbin/chkconfig
79 Requires(postun):       /usr/sbin/groupdel
80 Requires(postun):       /usr/sbin/userdel
81 Requires(pre):  /usr/sbin/groupadd
82 Requires(pre):  /usr/sbin/useradd
83 Requires:       rc-scripts >= 0.4.0.17
84 Provides:       group(wesnothd)
85 Provides:       user(wesnothd)
86 # sr@Latn vs. sr@latin
87 Conflicts:      glibc-misc < 6:2.7
88
89 %description server
90 Server for playing networked games of Wesnoth.
91
92 %description server -l hu.UTF-8
93 Szerver a Wesnoth hálózati játékához.
94
95 %description server -l pl.UTF-8
96 Serwer do prowadzenia sieciowych gier Wesnoth.
97
98 %package tools
99 Summary:        Tools for Wesnoth
100 Summary(hu.UTF-8):      Eszközök a Wesnoth-hoz
101 Summary(pl.UTF-8):      Narzędzia dla Wesnoth
102 Group:          X11/Applications/Games/Strategy
103 Requires:       %{name} = %{epoch}:%{version}-%{release}
104
105 %description tools
106 Map editor and translations tools.
107
108 %description tools -l hu.UTF-8
109 Pályaszerkesztők és fordítási eszközök.
110
111 %description tools -l pl.UTF-8
112 Edytor map i narzędzia do tłumaczeń.
113
114 %prep
115 %setup -q
116 %patch0 -p1
117 %patch1 -p1
118 %patch2 -p1
119 %patch3 -p1
120
121 # don't install locales in %{_datadir}/%{name}
122 %{__sed} -i 's,${DATADIR}/${LOCALEDIR},${DATAROOTDIR}/${LOCALEDIR},' CMakeLists.txt
123
124 # link using libpng instead of libpng12
125 %{__sed} -i 's,png12,png,' src/CMakeLists.txt
126
127 %build
128 install -d build
129 cd build
130 %cmake .. \
131         -DCMAKE_BUILD_TYPE=%{!?debug:Release}%{?debug:Debug} \
132         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
133         -DENABLE_STRICT_COMPILATION="off" \
134         -DBINDIR="%{_bindir}" \
135         -DMANDIR="%{_mandir}" \
136         -DLOCALEDIR="locale" \
137         %{!?with_server:-DENABLE_SERVER="off"} \
138         %{?with_server:-DENABLE_CAMPAIGN_SERVER="on"} \
139         %{!?with_tools:-DENABLE_EDITOR="off"} \
140         %{?with_tools:-DENABLE_TOOLS="on"} \
141         %{!?with_fribidi:-DENABLE_FRIBIDI="off"} \
142 %if "%{_lib}" == "lib64"
143         -DLIB_SUFFIX=64
144 %endif
145
146 %{__make}
147
148 %install
149 rm -rf $RPM_BUILD_ROOT
150 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/var/run/wesnothd,/etc/rc.d/init.d,%{_docdir}/%{name}-%{version}}
151
152 %{__make} -C build install \
153         DESTDIR=$RPM_BUILD_ROOT
154
155 # install additional docs
156 install changelog README  $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
157 gzip -9nf $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/{changelog,README}
158
159 %if %{with server}
160 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/wesnothd
161 %endif
162
163 mv -f $RPM_BUILD_ROOT%{_datadir}/locale/{ca_ES,ca}@valencia
164 mv -f $RPM_BUILD_ROOT%{_datadir}/locale/nb{_NO,}
165 mv -f $RPM_BUILD_ROOT%{_datadir}/locale/fur{_IT,}
166 mv -f $RPM_BUILD_ROOT%{_mandir}/{ca_ES,ca}@valencia
167
168 # not supported by glibc (as of 2.13-3)
169 # what is racv?
170 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale/racv
171 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale/sr@ijekavian
172 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale/sr@ijekavianlatin
173
174 # the same as manuals from %{_mandir}/man?
175 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/en_GB
176
177 %find_lang %{name} --all-name
178
179 %clean
180 rm -rf $RPM_BUILD_ROOT
181
182 %pre server
183 %groupadd -P %{name}-server -g 178  wesnothd
184 %useradd -P %{name}-server -u 178 -d /var/run/wesnothd -c "Wesnothd User" -g wesnothd wesnothd
185
186 %post server
187 /sbin/chkconfig --add wesnothd
188 %service wesnothd restart
189
190 %preun server
191 if [ "$1" = "0" ]; then
192         %service wesnothd stop
193         /sbin/chkconfig --del wesnothd
194         %userremove wesnothd
195         %groupremove wesnothd
196 fi
197
198 %files -f %{name}.lang
199 %defattr(644,root,root,755)
200 %doc %{_docdir}/%{name}-%{version}
201 %attr(755,root,root) %{_bindir}/wesnoth
202 %{_mandir}/man6/wesnoth.6*
203 %lang(cs) %{_mandir}/cs/man6/wesnoth.6*
204 %lang(de) %{_mandir}/de/man6/wesnoth.6*
205 %lang(es) %{_mandir}/es/man6/wesnoth.6*
206 %lang(et) %{_mandir}/et/man6/wesnoth.6*
207 %lang(fi) %{_mandir}/fi/man6/wesnoth.6*
208 %lang(fr) %{_mandir}/fr/man6/wesnoth.6*
209 %lang(gl) %{_mandir}/gl/man6/wesnoth.6*
210 %lang(hu) %{_mandir}/hu/man6/wesnoth.6*
211 %lang(id) %{_mandir}/id/man6/wesnoth.6*
212 %lang(it) %{_mandir}/it/man6/wesnoth.6*
213 %lang(ja) %{_mandir}/ja/man6/wesnoth.6*
214 %lang(lt) %{_mandir}/lt/man6/wesnoth.6*
215 %lang(pl) %{_mandir}/pl/man6/wesnoth.6*
216 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnoth.6*
217 %lang(sk) %{_mandir}/sk/man6/wesnoth.6*
218 %lang(sr) %{_mandir}/sr/man6/wesnoth.6*
219 %lang(sr@latin) %{_mandir}/sr@latin/man6/wesnoth.6*
220 %lang(tr) %{_mandir}/tr/man6/wesnoth.6*
221 %lang(zh_CN) %{_mandir}/zh_CN/man6/wesnoth.6*
222 %lang(zh_TW) %{_mandir}/zh_TW/man6/wesnoth.6*
223 %{_datadir}/%{name}
224 %{_desktopdir}/*.desktop
225 %{_pixmapsdir}/*-icon.png
226
227 %if %{with server}
228 %files server
229 %defattr(644,root,root,755)
230 %attr(755,root,root) %{_bindir}/campaignd
231 %attr(755,root,root) %{_bindir}/wesnothd
232 %attr(754,root,root) /etc/rc.d/init.d/wesnothd
233 %{_mandir}/man6/wesnothd.6*
234 %lang(cs) %{_mandir}/cs/man6/wesnothd.6*
235 %lang(de) %{_mandir}/de/man6/wesnothd.6*
236 %lang(es) %{_mandir}/es/man6/wesnothd.6*
237 %lang(et) %{_mandir}/et/man6/wesnothd.6*
238 %lang(fi) %{_mandir}/fi/man6/wesnothd.6*
239 %lang(fr) %{_mandir}/fr/man6/wesnothd.6*
240 %lang(gl) %{_mandir}/gl/man6/wesnothd.6*
241 %lang(hu) %{_mandir}/hu/man6/wesnothd.6*
242 %lang(id) %{_mandir}/id/man6/wesnothd.6*
243 %lang(it) %{_mandir}/it/man6/wesnothd.6*
244 %lang(ja) %{_mandir}/ja/man6/wesnothd.6*
245 %lang(lt) %{_mandir}/lt/man6/wesnothd.6*
246 %lang(pl) %{_mandir}/pl/man6/wesnothd.6*
247 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnothd.6*
248 %lang(sk) %{_mandir}/sk/man6/wesnothd.6*
249 %lang(sr) %{_mandir}/sr/man6/wesnothd.6*
250 %lang(sr@latin) %{_mandir}/sr@latin/man6/wesnothd.6*
251 %lang(tr) %{_mandir}/tr/man6/wesnothd.6*
252 %lang(zh_CN) %{_mandir}/zh_CN/man6/wesnothd.6*
253 %lang(zh_TW) %{_mandir}/zh_TW/man6/wesnothd.6*
254 %attr(770,wesnothd,wesnothd) %dir /var/run/wesnothd
255 %endif
256
257 %if %{with tools}
258 %files tools
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_bindir}/cutter
261 %attr(755,root,root) %{_bindir}/exploder
262 %endif
This page took 0.086649 seconds and 4 git commands to generate.