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