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