]> git.pld-linux.org Git - packages/openttd.git/blob - openttd.spec
9c0366267f7dc0bd90aa360f31ebd9621048493c
[packages/openttd.git] / openttd.spec
1 #
2 # Conditional build:
3 %bcond_without  home_etc        # without home_etc support
4 #
5 Summary:        An open source reimplementation of the Microprose game "Transport Tycoon Deluxe"
6 Summary(pl.UTF-8):      Otwarta reimplementacja gry Transport Tycoon Deluxe
7 Name:           openttd
8 Version:        1.5.2
9 Release:        4
10 License:        GPL v2+
11 Group:          X11/Applications/Games
12 Source0:        http://us.binaries.openttd.org/binaries/releases/%{version}/%{name}-%{version}-source.tar.xz
13 # Source0-md5:  46ac4a9441cca5f5908dc6a069f78e20
14 Source1:        %{name}.desktop
15 Source2:        %{name}-server.desktop
16 Patch0:         %{name}-home_etc.patch
17 Patch1:         %{name}-libiconv.patch
18 URL:            http://www.openttd.org/
19 BuildRequires:  SDL-devel
20 BuildRequires:  fontconfig-devel
21 BuildRequires:  freetype-devel
22 BuildRequires:  grfcodec >= 6.0.2
23 %{?with_home_etc:BuildRequires: home-etc-devel}
24 BuildRequires:  libicu-devel
25 BuildRequires:  libpng-devel
26 BuildRequires:  libstdc++-devel
27 BuildRequires:  lzo-devel
28 BuildRequires:  pkgconfig
29 BuildRequires:  sed >= 4.0
30 BuildRequires:  xz-devel
31 BuildRequires:  zlib-devel
32 Requires:       %{name}-data = %{version}-%{release}
33 Suggests:       %{name}-ai
34 Suggests:       %{name}-opengfx
35 Suggests:       %{name}-openmsx
36 Suggests:       %{name}-opensfx
37 Suggests:       TiMidity++
38 Provides:       %{name}-binary = %{version}-%{release}
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %description
42 OpenTTD is modeled after the original Transport Tycoon game by Chris
43 Sawyer and enhances the game experience dramatically. Many features
44 were inspired by TTDPatch while others are original.
45
46 It requires the original Transport Tycoon Deluxe data files.
47
48 %description -l pl.UTF-8
49 OpenTTD powstał na bazie gry Transport Tycoon stworzonej przez Chrisa
50 Sawyera, jego grywalność jest jednak dużo większa. Wiele rzeczy
51 zostało zainspirowanych przez TTDPatch, dużo jest jednak oryginalnych
52 pomysłów.
53
54 Do uruchomienia wymagane są pliki danych z Transport Tycoon Deluxe.
55
56 %package data
57 Summary:        OpenTTD data files
58 Summary(pl.UTF-8):      Pliki danych OpenTTD
59 Group:          X11/Applications/Games
60
61 %description data
62 OpenTTD data files.
63
64 %description data -l pl.UTF-8
65 Pliki danych OpenTTD.
66
67 %package server
68 Summary:        OpenTTD dedicated server
69 Summary(pl.UTF-8):      Dedykowany serwer OpenTTD
70 Group:          X11/Applications/Games
71 Requires:       %{name}-data = %{version}-%{release}
72 Provides:       %{name}-binary = %{version}-%{release}
73
74 %description server
75 This package contains OpenTTD dedicated server. Note that
76 graphics-enabled OpenTTD client also has this functionality.
77
78 %description server -l pl.UTF-8
79 Ten pakiet zawiera dedykowany serwer OpenTTD. Należy zwrócić uwagę, że
80 graficzny klient OpenTTD również zawiera taką funkcjonalność.
81
82 %prep
83 %setup -q
84 %{?with_home_etc:%patch0 -p1}
85 %patch1 -p1
86
87 # Let's pldize
88 find src/lang/ -type f -exec %{__sed} -i 's/:Unix/:PLD Linux/' \{\} \;
89
90 %build
91
92 # dedicated
93 ./configure \
94         CC="%{__cc}" \
95         CXX="%{__cxx}" \
96         CFLAGS="%{rpmcxxflags}" \
97         LDFLAGS="%{rpmldflags}" \
98         --cc-host="%{__cc}" \
99         --cc-build="%{__cc}" \
100         --cxx-host="%{__cxx}" \
101         --cxx-build="%{__cxx}" \
102         --disable-strip \
103         --prefix-dir="%{_prefix}" \
104         --binary-dir=bin \
105         --data-dir=share/openttd \
106         --icon-dir=share/pixmaps \
107         --install-dir=$RPM_BUILD_ROOT \
108         --os=UNIX \
109         --enable-dedicated \
110         --without-allegro \
111         --without-sdl \
112         --with-zlib \
113         --without-png \
114         --without-freetype \
115         --without-fontconfig \
116         --without-libtimidity
117
118 %{__make} \
119         MANUAL_CONFIG=1 \
120         INSTALL=1 \
121         VERBOSE=1
122
123 mv bin/openttd{,-dedicated}
124
125 # client
126 rm -f Makefile.config
127 %{__make} clean
128 ./configure \
129         CC="%{__cc}" \
130         CXX="%{__cxx}" \
131         CFLAGS="%{rpmcxxflags} $(sdl-config --cflags) -I/usr/include/freetype2" \
132         LDFLAGS="%{rpmldflags}" \
133         --cc-host="%{__cc}" \
134         --cc-build="%{__cc}" \
135         --cxx-host="%{__cxx}" \
136         --cxx-build="%{__cxx}" \
137         --disable-strip \
138         --prefix-dir="%{_prefix}" \
139         --binary-dir=bin \
140         --data-dir=share/openttd \
141         --icon-dir=share/pixmaps \
142         --install-dir=$RPM_BUILD_ROOT \
143         --os=UNIX \
144         --without-allegro \
145         --with-sdl \
146         --with-zlib \
147         --with-png \
148         --with-freetype \
149         --with-fontconfig \
150         --without-libtimidity \
151         --with-iconv \
152         --with-midi=%{_bindir}/timidity
153
154 %{__make} \
155         MANUAL_CONFIG=1 \
156         INSTALL=1 \
157         VERBOSE=1
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161
162 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_mandir}/man6,%{_pixmapsdir}}
163 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/{ai/library,scenario/heightmap}
164
165 %{__make} install \
166         INSTALL_DIR=$RPM_BUILD_ROOT \
167         INSTALL=1 \
168         VERBOSE=1 \
169         PREFIX="/" \
170
171 install bin/openttd-dedicated $RPM_BUILD_ROOT%{_bindir}
172 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
173 install %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}
174 install docs/openttd.6 $RPM_BUILD_ROOT%{_mandir}/man6
175 install media/openttd.256.png $RPM_BUILD_ROOT%{_pixmapsdir}/openttd.png
176
177 %clean
178 rm -rf $RPM_BUILD_ROOT
179
180 %post
181 %update_icon_cache hicolor
182
183 %postun
184 %update_icon_cache hicolor
185
186 %files
187 %defattr(644,root,root,755)
188 %doc changelog.txt known-bugs.txt readme.txt docs/multiplayer.txt
189 %attr(755,root,root) %{_bindir}/%{name}
190 %{_desktopdir}/%{name}.desktop
191 %{_mandir}/man6/openttd.*
192 %{_iconsdir}/*/*/*/openttd.png
193
194 %files data
195 %defattr(644,root,root,755)
196 %doc bin/scripts
197 %{_datadir}/%{name}
198 %{_pixmapsdir}/openttd.*
199
200 %files server
201 %defattr(644,root,root,755)
202 %attr(755,root,root) %{_bindir}/%{name}-dedicated
203 %{_desktopdir}/%{name}-server.desktop
This page took 0.081556 seconds and 2 git commands to generate.