]> git.pld-linux.org Git - packages/wesnoth.git/blob - wesnoth.spec
fec4709149fbd53929766d9028782c27525110f4
[packages/wesnoth.git] / wesnoth.spec
1 # TODO
2 # - package rest of developement tools
3 # - rename language files sr@latin to sr@Latn and include them
4 # - use desktop file included with project (consider which one are better)
5 #
6 # Conditional build
7 %bcond_without  server  # without server
8 %bcond_without  tools   # without tools
9 #
10 Summary:        Strategy game with a fantasy theme
11 Summary(pl.UTF-8):      Strategiczna gra z motywem fantasy
12 Name:           wesnoth
13 Version:        1.3.11
14 Release:        1
15 License:        GPL v2+
16 Group:          X11/Applications/Games/Strategy
17 Source0:        http://www.wesnoth.org/files/%{name}-%{version}.tar.bz2
18 # Source0-md5:  a6e064156919b081abba19fb57544de9
19 Source1:        %{name}.desktop
20 Source2:        %{name}_editor.desktop
21 Source3:        %{name}d.init
22 Patch0:         %{name}-Makefile.patch
23 Patch1:         %{name}-locale_dir.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
30 BuildRequires:  autoconf >= 2.59
31 BuildRequires:  automake >= 1:1.9
32 BuildRequires:  gettext-devel
33 BuildRequires:  libpng-devel
34 BuildRequires:  libstdc++-devel
35 BuildRequires:  libtool >= 2:1.5
36 BuildRequires:  python-devel
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.268
39 BuildRequires:  zipios++-devel
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 Battle for Wesnoth is a fantasy strategy game. Battle for control of
44 villages, using variety of units which have advantages and
45 disadvantages in different types of terrains and against different
46 types of attacks. Units gain experience and advance levels, and are
47 carried over from one scenario to the next campaign.
48
49 %description -l pl.UTF-8
50 Battle for Wesnoth jest strategiczną grą fantasy. Batalia o kontrolę
51 nad wsiami przy pomocy różnego rodzaju oddziałów, które mają przewagę
52 lub jej brak w odmiennym ukształtowaniu terenu i przeciwko różnym
53 sposobom ataku. Oddziały zdobywają doświadczenie i poziomy
54 zaawansowania i są przenoszone z jednej scenerii do następnej
55 kampanii.
56
57 %package server
58 Summary:        Network server for Wesnoth
59 Summary(pl.UTF-8):      Sieciowy serwer dla Wesnoth
60 Group:          X11/Applications/Games/Strategy
61 Requires(post,preun):   /sbin/chkconfig
62 Requires(postun):       /usr/sbin/groupdel
63 Requires(postun):       /usr/sbin/userdel
64 Requires(pre):  /usr/sbin/groupadd
65 Requires(pre):  /usr/sbin/useradd
66 Requires:       rc-scripts >= 0.4.0.17
67
68 %description server
69 Server for playing networked games of Wesnoth.
70
71 %description server -l pl.UTF-8
72 Serwer do prowadzenia sieciowych gier Wesnoth.
73
74 %package tools
75 Summary:        Tools for Wesnoth
76 Summary(pl.UTF-8):      Narzędzia dla Wesnoth
77 Group:          X11/Applications/Games/Strategy
78 Requires:       %{name} = %{version}-%{release}
79
80 %description tools
81 Map editor and translations tools.
82
83 %description tools -l pl.UTF-8
84 Edytor map i narzędzia do tłumaczeń.
85
86 %prep
87 %setup -q
88 %patch0 -p1
89 %patch1 -p1
90
91 %build
92 %{__gettextize}
93 %{__aclocal}
94 %{__autoconf}
95 %{__autoheader}
96 %{__automake}
97 %configure \
98         %{?with_server:--enable-server} \
99         %{?with_tools:--enable-editor} \
100         %{?with_tools:--enable-tools} \
101         --docdir=%{_docdir}/%{name}-%{version} \
102         --with-icondir=%{_pixmapsdir} \
103         --with-zipios
104 %{__make}
105
106 %install
107 rm -rf $RPM_BUILD_ROOT
108 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/var/run/wesnothd,/etc/rc.d/init.d}
109
110 %{__make} install \
111         DESTDIR=$RPM_BUILD_ROOT
112
113 # install additional docs
114 install changelog README  $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
115 gzip -9nf $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/{changelog,README}
116
117 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
118 install %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}
119 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/wesnothd
120
121 mv -f $RPM_BUILD_ROOT%{_datadir}/locale/{gl_ES,gl}
122 mv -f $RPM_BUILD_ROOT%{_datadir}/locale/{nb_NO,nb}
123
124 rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/ca_ES@valencia
125
126 # unsupported(?)
127 rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/la
128
129 # the same as manuals from %{_mandir}/man?
130 rm -rf $RPM_BUILD_ROOT%{_mandir}/en_GB
131
132 %find_lang %{name} --all-name
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %pre server
138 %groupadd -P %{name}-server -g 178  wesnothd
139 %useradd -P %{name}-server -u 178 -d /var/run/wesnothd -c "Wesnothd User" -g wesnothd wesnothd
140
141 %post server
142 /sbin/chkconfig --add wesnothd
143 %service wesnothd restart
144
145 %preun server
146 if [ "$1" = "0" ]; then
147         %service wesnothd stop
148         /sbin/chkconfig --del wesnothd
149         %userremove wesnothd
150         %groupremove wesnothd
151 fi
152
153 %files -f %{name}.lang
154 %defattr(644,root,root,755)
155 %doc %{_docdir}/%{name}-%{version}
156 %attr(755,root,root) %{_bindir}/wesnoth
157 %{_mandir}/man6/wesnoth.6*
158 %lang(bg) %{_mandir}/bg/man6/wesnoth.6*
159 %lang(cs) %{_mandir}/cs/man6/wesnoth.6*
160 %lang(da) %{_mandir}/da/man6/wesnoth.6*
161 %lang(de) %{_mandir}/de/man6/wesnoth.6*
162 %lang(es) %{_mandir}/es/man6/wesnoth.6*
163 %lang(fr) %{_mandir}/fr/man6/wesnoth.6*
164 %lang(hu) %{_mandir}/hu/man6/wesnoth.6*
165 %lang(it) %{_mandir}/it/man6/wesnoth.6*
166 %lang(ja) %{_mandir}/ja/man6/wesnoth.6*
167 %lang(nl) %{_mandir}/nl/man6/wesnoth.6*
168 %lang(pl) %{_mandir}/pl/man6/wesnoth.6*
169 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnoth.6*
170 %lang(ru) %{_mandir}/ru/man6/wesnoth.6*
171 %lang(sk) %{_mandir}/sk/man6/wesnoth.6*
172 %lang(sr) %{_mandir}/sr/man6/wesnoth.6*
173 %lang(sv) %{_mandir}/sv/man6/wesnoth.6*
174 %{_datadir}/%{name}
175 %{_desktopdir}/%{name}.desktop
176 %{_pixmapsdir}/%{name}-icon.png
177
178 %if %{with server}
179 %files server
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{_bindir}/wesnothd
182 %attr(754,root,root) /etc/rc.d/init.d/wesnothd
183 %{_mandir}/man6/wesnothd.6*
184 %lang(bg) %{_mandir}/bg/man6/wesnothd.6*
185 %lang(cs) %{_mandir}/cs/man6/wesnothd.6*
186 %lang(da) %{_mandir}/da/man6/wesnothd.6*
187 %lang(de) %{_mandir}/de/man6/wesnothd.6*
188 %lang(es) %{_mandir}/es/man6/wesnothd.6*
189 %lang(fr) %{_mandir}/fr/man6/wesnothd.6*
190 %lang(hu) %{_mandir}/hu/man6/wesnothd.6*
191 %lang(it) %{_mandir}/it/man6/wesnothd.6*
192 %lang(ja) %{_mandir}/ja/man6/wesnothd.6*
193 %lang(nl) %{_mandir}/nl/man6/wesnothd.6*
194 %lang(pl) %{_mandir}/pl/man6/wesnothd.6*
195 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnothd.6*
196 %lang(ru) %{_mandir}/ru/man6/wesnothd.6*
197 %lang(sk) %{_mandir}/sk/man6/wesnothd.6*
198 %lang(sr) %{_mandir}/sr/man6/wesnothd.6*
199 %lang(sv) %{_mandir}/sv/man6/wesnothd.6*
200 %attr(770,wesnothd,wesnothd) %dir /var/run/wesnothd
201 %endif
202
203 %if %{with tools}
204 %files tools
205 %defattr(644,root,root,755)
206 %attr(755,root,root) %{_bindir}/cutter
207 %attr(755,root,root) %{_bindir}/exploder
208 %attr(755,root,root) %{_bindir}/wesnoth_editor
209 %{_mandir}/man6/wesnoth_editor.6*
210 %lang(bg) %{_mandir}/bg/man6/wesnoth_editor.6*
211 %lang(cs) %{_mandir}/cs/man6/wesnoth_editor.6*
212 %lang(da) %{_mandir}/da/man6/wesnoth_editor.6*
213 %lang(de) %{_mandir}/de/man6/wesnoth_editor.6*
214 %lang(es) %{_mandir}/es/man6/wesnoth_editor.6*
215 %lang(fr) %{_mandir}/fr/man6/wesnoth_editor.6*
216 %lang(hu) %{_mandir}/hu/man6/wesnoth_editor.6*
217 %lang(it) %{_mandir}/it/man6/wesnoth_editor.6*
218 %lang(ja) %{_mandir}/ja/man6/wesnoth_editor.6*
219 %lang(nl) %{_mandir}/nl/man6/wesnoth_editor.6*
220 %lang(pl) %{_mandir}/pl/man6/wesnoth_editor.6*
221 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnoth_editor.6*
222 %lang(ru) %{_mandir}/ru/man6/wesnoth_editor.6*
223 %lang(sk) %{_mandir}/sk/man6/wesnoth_editor.6*
224 %lang(sr) %{_mandir}/sr/man6/wesnoth_editor.6*
225 %lang(sv) %{_mandir}/sv/man6/wesnoth_editor.6*
226 %{_desktopdir}/%{name}_editor.desktop
227 %{_pixmapsdir}/%{name}_editor-icon.png
228 %endif
This page took 0.049582 seconds and 2 git commands to generate.