]> git.pld-linux.org Git - packages/wesnoth.git/blame - wesnoth.spec
- unified cmake args, strip -DNDEBUG from flags instead of using Release build type...
[packages/wesnoth.git] / wesnoth.spec
CommitLineData
4f6ef9bb 1# TODO
2bf53405 2# - system lua?
f8498762 3# - unpackaged language files
d94078df 4#
eb35425c 5# Conditional build
dad9a32e 6%bcond_without server # without server
e579b435 7%bcond_without fribidi # without Bidirectional language support
eb718a6d 8
dad9a32e 9Summary: Strategy game with a fantasy theme
d78dbe99 10Summary(hu.UTF-8): Fantasy környezetben játszódó stratégiai játék
2bf53405 11Summary(pl.UTF-8): Gra strategiczna z motywem fantasy
dad9a32e 12Name: wesnoth
78fe2aaa 13Version: 1.14.16
2bf53405 14Release: 1
d31a0af5 15Epoch: 1
482a922c 16License: GPL v2+
dad9a32e 17Group: X11/Applications/Games/Strategy
d7602b85 18Source0: http://downloads.sourceforge.net/wesnoth/%{name}-%{version}.tar.bz2
78fe2aaa 19# Source0-md5: 769733a55ab5742815e0acf8c51e13e4
3647514b 20Source1: %{name}d.init
0e4bc507 21Source2: %{name}.tmpfiles
47449d91
KM
22Source3: %{name}.sysconfig
23Source4: %{name}d.service
4d5620e7 24URL: http://www.wesnoth.org/
47449d91
KM
25BuildRequires: SDL2-devel >= 2.0.4
26BuildRequires: SDL2_image-devel >= 2.0.0
27BuildRequires: SDL2_mixer-devel >= 2.0.0
28BuildRequires: SDL2_ttf-devel >= 2.0.12
29BuildRequires: boost-devel >= 1.50.0
30BuildRequires: bzip2-devel
31BuildRequires: cairo-devel >= 1.10.0
32BuildRequires: cmake >= 2.8.5
309b98f8 33BuildRequires: dbus-devel
2bf53405 34BuildRequires: fontconfig-devel >= 2.4.1
938b933e 35%{?with_fribidi:BuildRequires: fribidi-devel >= 0.10.9}
b7f10e01 36BuildRequires: gettext-tools
47449d91 37BuildRequires: libicu-devel
759b9d08 38BuildRequires: libpng-devel
938b933e 39BuildRequires: libstdc++-devel >= 6:4.7
47449d91 40BuildRequires: libvorbis-devel
938b933e 41BuildRequires: openssl-devel >= 1.0
47449d91 42BuildRequires: pango-devel >= 1:1.22.0
c94bb8a1 43BuildRequires: pkgconfig
938b933e
JB
44BuildRequires: readline-devel
45BuildRequires: rpm-build >= 4.6
f1cb8481 46BuildRequires: rpm-pythonprov
2bf53405 47BuildRequires: rpmbuild(macros) >= 1.605
d22c6766 48BuildRequires: sed >= 4.0
47449d91 49BuildRequires: systemd-devel
2bf53405
JB
50BuildRequires: xorg-lib-libICE-devel
51BuildRequires: xorg-lib-libSM-devel
52BuildRequires: xorg-lib-libX11-devel
53BuildRequires: xorg-lib-libXext-devel
d7602b85 54BuildRequires: zlib-devel
47449d91
KM
55Requires(post,postun): desktop-file-utils
56Requires(post,postun): gtk-update-icon-cache
eb718a6d 57Requires: %{name}-data = %{epoch}:%{version}
47449d91 58Requires: SDL2 >= 2.0.4
2bf53405 59Requires: fontconfig >= 2.4.1
938b933e 60%{?with_fribidi:Requires: fribidi >= 0.10.9}
47449d91 61Requires: pango >= 1:1.22.8
9cf45cc2 62Obsoletes: wesnoth-tools < 1:1.14
dad9a32e 63BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65%description
66Battle for Wesnoth is a fantasy strategy game. Battle for control of
67villages, using variety of units which have advantages and
68disadvantages in different types of terrains and against different
69types of attacks. Units gain experience and advance levels, and are
70carried over from one scenario to the next campaign.
71
d78dbe99 72%description -l hu.UTF-8
a60f6f21 73Battle for Wesnoth (Harc Wesnothért) egy fantasy környezetben játszódó
74stratégiai játék. Harc a falvak megszerzéséért, különböző egységek
75felhasználásával, amelyeknek különböző előnyeik és hátrányaik vannak a
76különféle terepeken és a különböző támadási stílusok ellen. Az
77egységek tapasztalatot gyűjtenek, és fejlődnek, amelyek átvihetők a
78következő pályára.
d78dbe99 79
7840b0fd 80%description -l pl.UTF-8
a60f6f21 81Bitwa o Wesnoth jest strategiczną grą fantasy. Batalia o kontrolę nad
82wsiami przy pomocy różnego rodzaju oddziałów, które mają przewagę lub
83jej brak w odmiennym ukształtowaniu terenu i przeciwko różnym sposobom
84ataku. Oddziały zdobywają doświadczenie i poziomy zaawansowania i są
85przenoszone z jednej scenerii do następnej kampanii.
dad9a32e 86
dad9a32e 87%package server
88Summary: Network server for Wesnoth
717cee4c 89Summary(hu.UTF-8): Hálózati szerver Wesnoth-hoz
157e8e1f 90Summary(pl.UTF-8): Sieciowy serwer dla Wesnoth
dad9a32e 91Group: X11/Applications/Games/Strategy
392ee82f 92Requires(post,preun): /sbin/chkconfig
40b36f90
JK
93Requires(postun): /usr/sbin/groupdel
94Requires(postun): /usr/sbin/userdel
95Requires(pre): /usr/sbin/groupadd
96Requires(pre): /usr/sbin/useradd
759b9d08 97Requires: rc-scripts >= 0.4.0.17
745d3686
ER
98Provides: group(wesnothd)
99Provides: user(wesnothd)
dad9a32e 100
101%description server
102Server for playing networked games of Wesnoth.
103
d78dbe99
ZU
104%description server -l hu.UTF-8
105Szerver a Wesnoth hálózati játékához.
106
7840b0fd 107%description server -l pl.UTF-8
dad9a32e 108Serwer do prowadzenia sieciowych gier Wesnoth.
dad9a32e 109
eb718a6d 110%package data
2bf53405
JB
111Summary: Strategy game with a fantasy theme - data files
112Summary(pl.UTF-8): Gra strategiczna z motywem fantasy - pliki danych
eb718a6d 113Group: Applications/Games
eb718a6d 114BuildArch: noarch
eb718a6d
ER
115
116%description data
117This package contains the data files for Wesnoth.
118
2bf53405
JB
119%description data -l pl.UTF-8
120Ten pakiet zawiera pliki danych dla gry Wesnoth.
121
dad9a32e 122%prep
b5dcf87b 123%setup -q
d7602b85 124
125# don't install locales in %{_datadir}/%{name}
d94078df 126%{__sed} -i 's,${DATADIR}/${LOCALEDIR},${LOCALEDIR},' CMakeLists.txt
dad9a32e 127
47449d91
KM
128%{__sed} -i '1s,/usr/bin/env python3$,%{__python3},' \
129 data/tools/{GUI.pyw,about_cfg_to_wiki,addon_manager/__init__.py,addon_manager/html.py,campaign2wiki.py,extractbindings,hexometer.py,imgcheck,steam-changelog,terrain2wiki.py,unit_tree/TeamColorizer,unit_tree/__init__.py,unit_tree/animations.py,unit_tree/helpers.py,unit_tree/html_output.py,unit_tree/overview.py,unit_tree/wiki_output.py,wesnoth/campaignserver_client.py,wesnoth/libgithub.py,wesnoth/wescamp.py,wesnoth/wmliterator3.py,wesnoth/wmlparser3.py,wesnoth/wmltools3.py,wesnoth_addon_manager,wmlindent,wmllint,wmllint-1.4,wmlscope,wmlunits,wmlxgettext}
130%{__sed} -i '1s,/usr/bin/env python2$,%{__python},' \
131 data/tools/{expand-terrain-macros.py,journeylifter,rmtrans/rmtrans.py,scoutDefault.py,trackplacer,wesnoth/wmldata.py,wesnoth/wmlgrammar.py,wesnoth/wmliterator.py,wesnoth/wmlparser.py,wesnoth/wmlparser2.py,wesnoth/wmltools.py,wmlflip,wmlvalidator}
2bf53405 132
dad9a32e 133%build
d7602b85 134install -d build
135cd build
e2caf64a
JB
136# override *FLAGS to remove -DNDEBUG (wesnoth depends on asserts)
137CFLAGS="%{rpmcflags}"
138CXXFLAGS="%{rpmcxxflags}"
139%cmake .. \
140 -DENABLE_STRICT_COMPILATION=OFF \
d7602b85 141 -DBINDIR="%{_bindir}" \
142 -DMANDIR="%{_mandir}" \
eb718a6d 143 -DLOCALEDIR="%{_localedir}" \
e2caf64a
JB
144 %{!?with_server:-DENABLE_SERVER=OFF} \
145 %{?with_server:-DENABLE_CAMPAIGN_SERVER=ON} \
146 %{!?with_fribidi:-DENABLE_FRIBIDI=OFF}
d7602b85 147
dad9a32e 148%{__make}
149
150%install
151rm -rf $RPM_BUILD_ROOT
47449d91
KM
152install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/var/run/wesnothd,/etc/rc.d/init.d,/etc/sysconfig} \
153 $RPM_BUILD_ROOT{%{systemdtmpfilesdir},%{_docdir}/%{name}-%{version}} \
758a0e57 154 $RPM_BUILD_ROOT%{systemdunitdir}
dad9a32e 155
d7602b85 156%{__make} -C build install \
dad9a32e 157 DESTDIR=$RPM_BUILD_ROOT
158
d22c6766 159%if %{with server}
eb718a6d
ER
160cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/wesnothd
161cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
47449d91 162cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wesnoth
758a0e57 163cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/wesnothd.service
d22c6766 164%endif
dad9a32e 165
47449d91
KM
166%{__mv} $RPM_BUILD_ROOT%{_docdir}/html $RPM_BUILD_ROOT%{_docdir}/%{name}
167
2bf53405
JB
168# unify
169%{__mv} $RPM_BUILD_ROOT%{_localedir}/{ca_ES@valencia,ca@valencia}
170%{__mv} $RPM_BUILD_ROOT%{_localedir}/{nb_NO,nb}
171%{__mv} $RPM_BUILD_ROOT%{_localedir}/{fur_IT,fur}
172%{__mv} $RPM_BUILD_ROOT%{_mandir}/{ca_ES@valencia,ca@valencia}
c12ea96c 173
d94078df 174# unsupported(?)
eb718a6d 175%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ang@latin
eb718a6d 176%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/racv
62daf2b6 177%{__rm} -r $RPM_BUILD_ROOT%{_mandir}/sr@ijekavian
178%{__rm} -r $RPM_BUILD_ROOT%{_mandir}/sr@ijekavianlatin
c12ea96c
MB
179
180# the same as manuals from %{_mandir}/man?
729e3de3 181%{__rm} -r $RPM_BUILD_ROOT%{_mandir}/en_GB
c12ea96c 182
5105ea28 183%find_lang %{name} --all-name
184
dad9a32e 185%clean
186rm -rf $RPM_BUILD_ROOT
187
47449d91
KM
188%post
189%update_desktop_database
190%update_icon_cache hicolor
191
192%postun
193%update_desktop_database
194%update_icon_cache hicolor
195
40b36f90
JK
196%pre server
197%groupadd -P %{name}-server -g 178 wesnothd
198%useradd -P %{name}-server -u 178 -d /var/run/wesnothd -c "Wesnothd User" -g wesnothd wesnothd
199
3fdd0ea2 200%post server
201/sbin/chkconfig --add wesnothd
c12ea96c 202%service wesnothd restart
47449d91 203%systemd_post wesnothd.service
3fdd0ea2 204
205%preun server
206if [ "$1" = "0" ]; then
c12ea96c 207 %service wesnothd stop
f721f6e1 208 /sbin/chkconfig --del wesnothd
47449d91
KM
209fi
210%systemd_preun wesnothd.service
211
212%postun server
213if [ "$1" = "0" ]; then
40b36f90
JK
214 %userremove wesnothd
215 %groupremove wesnothd
3fdd0ea2 216fi
47449d91 217%systemd_reload
3fdd0ea2 218
5105ea28 219%files -f %{name}.lang
dad9a32e 220%defattr(644,root,root,755)
5dd60c45 221%doc README.md changelog.md
2bf53405 222%doc %{_docdir}/%{name}
dad9a32e 223%attr(755,root,root) %{_bindir}/wesnoth
0c6dc98e 224%{_mandir}/man6/wesnoth.6*
78fe2aaa 225%lang(ca) %{_mandir}/ca/man6/wesnoth.6*
e579b435 226%lang(de) %{_mandir}/de/man6/wesnoth.6*
83629e31 227%lang(es) %{_mandir}/es/man6/wesnoth.6*
bdc2942c 228%lang(fr) %{_mandir}/fr/man6/wesnoth.6*
e579b435 229%lang(hu) %{_mandir}/hu/man6/wesnoth.6*
83629e31 230%lang(it) %{_mandir}/it/man6/wesnoth.6*
47449d91 231%lang(ja) %{_mandir}/ja/man6/wesnoth.6*
7d4eb852 232%lang(lt) %{_mandir}/lt/man6/wesnoth.6*
47449d91 233%lang(pt_BR) %{_mandir}/pt_BR/man6/wesnoth.6*
83629e31 234%lang(ru) %{_mandir}/ru/man6/wesnoth.6*
47449d91 235%lang(tr) %{_mandir}/tr/man6/wesnoth.6*
83629e31 236%lang(zh_CN) %{_mandir}/zh_CN/man6/wesnoth.6*
237%lang(zh_TW) %{_mandir}/zh_TW/man6/wesnoth.6*
2bf53405 238%{_desktopdir}/wesnoth.desktop
47449d91
KM
239%{_iconsdir}/hicolor/*x*/apps/wesnoth-icon.png
240%{_datadir}/metainfo/wesnoth.appdata.xml
dad9a32e 241
242%if %{with server}
243%files server
244%defattr(644,root,root,755)
47449d91 245%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
d22c6766 246%attr(755,root,root) %{_bindir}/campaignd
dad9a32e 247%attr(755,root,root) %{_bindir}/wesnothd
3fdd0ea2 248%attr(754,root,root) /etc/rc.d/init.d/wesnothd
758a0e57 249%attr(644,root,root) %{systemdunitdir}/wesnothd.service
0c6dc98e 250%{_mandir}/man6/wesnothd.6*
78fe2aaa 251%lang(ca) %{_mandir}/ca/man6/wesnothd.6*
e579b435 252%lang(cs) %{_mandir}/cs/man6/wesnothd.6*
e579b435 253%lang(de) %{_mandir}/de/man6/wesnothd.6*
254%lang(es) %{_mandir}/es/man6/wesnothd.6*
d3cada04 255%lang(et) %{_mandir}/et/man6/wesnothd.6*
d18a93b2 256%lang(fi) %{_mandir}/fi/man6/wesnothd.6*
bdc2942c 257%lang(fr) %{_mandir}/fr/man6/wesnothd.6*
d16f534c 258%lang(gl) %{_mandir}/gl/man6/wesnothd.6*
e579b435 259%lang(hu) %{_mandir}/hu/man6/wesnothd.6*
944acd9d 260%lang(id) %{_mandir}/id/man6/wesnothd.6*
e579b435 261%lang(it) %{_mandir}/it/man6/wesnothd.6*
d7602b85 262%lang(ja) %{_mandir}/ja/man6/wesnothd.6*
d22c6766 263%lang(lt) %{_mandir}/lt/man6/wesnothd.6*
e579b435 264%lang(pl) %{_mandir}/pl/man6/wesnothd.6*
2bf53405 265%lang(pt) %{_mandir}/pt/man6/wesnothd.6*
d7602b85 266%lang(pt_BR) %{_mandir}/pt_BR/man6/wesnothd.6*
83629e31 267%lang(ru) %{_mandir}/ru/man6/wesnothd.6*
d7602b85 268%lang(sk) %{_mandir}/sk/man6/wesnothd.6*
83629e31 269%lang(sr) %{_mandir}/sr/man6/wesnothd.6*
270%lang(sr@latin) %{_mandir}/sr@latin/man6/wesnothd.6*
271%lang(tr) %{_mandir}/tr/man6/wesnothd.6*
2bf53405
JB
272%lang(uk) %{_mandir}/uk/man6/wesnothd.6*
273%lang(vi) %{_mandir}/vi/man6/wesnothd.6*
83629e31 274%lang(zh_CN) %{_mandir}/zh_CN/man6/wesnothd.6*
275%lang(zh_TW) %{_mandir}/zh_TW/man6/wesnothd.6*
40b36f90 276%attr(770,wesnothd,wesnothd) %dir /var/run/wesnothd
eb718a6d 277%{systemdtmpfilesdir}/%{name}.conf
dad9a32e 278%endif
279
eb718a6d
ER
280%files data
281%defattr(644,root,root,755)
282%{_datadir}/%{name}
This page took 0.12043 seconds and 4 git commands to generate.