]> git.pld-linux.org Git - SPECS.git/blob - lua51.spec
SPECS updated Sat 31 Jul 20:26:02 CEST 2021
[SPECS.git] / lua51.spec
1 #
2 # Conditional build:
3 %bcond_with     luastatic       # build dietlibc-based static lua version (broken)
4 %bcond_with     default_lua     # build as default lua (symlinks to nil suffix)
5 #
6 Summary:        A simple lightweight powerful embeddable programming language
7 Summary(pl.UTF-8):      Prosty, lekki ale potężny, osadzalny język programowania
8 Name:           lua51
9 Version:        5.1.5
10 Release:        7
11 License:        MIT
12 Group:          Development/Languages
13 Source0:        http://www.lua.org/ftp/lua-%{version}.tar.gz
14 # Source0-md5:  2e115fe26e435e33b0d5c022e4490567
15 Source1:        lua.pc.in
16 Source2:        lua-c++.pc.in
17 Patch0:         %{name}-link.patch
18 Patch1:         debian_make.patch
19 URL:            http://www.lua.org/
20 %{?with_luastatic:BuildRequires:       dietlibc-static}
21 BuildRequires:  libstdc++-devel
22 BuildRequires:  readline-devel
23 BuildRequires:  sed >= 4.0
24 Requires:       %{name}-libs = %{version}-%{release}
25 %if %{with default_lua}
26 Provides:       lua = %{version}
27 Obsoletes:      lua < %{version}
28 %endif
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 Lua is a powerful, light-weight programming language designed for
33 extending applications. It is also frequently used as a
34 general-purpose, stand-alone language. It combines simple procedural
35 syntax (similar to Pascal) with powerful data description constructs
36 based on associative arrays and extensible semantics. Lua is
37 dynamically typed, interpreted from bytecodes, and has automatic
38 memory management with garbage collection, making it ideal for
39 configuration, scripting, and rapid prototyping.
40
41 This version has compiled in support for dynamic libraries in baselib.
42
43 %description -l pl.UTF-8
44 Lua to język programowania o dużych możliwościach ale lekki,
45 przeznaczony do rozszerzania aplikacji. Jest też często używany jako
46 samodzielny język ogólnego przeznaczenia. Łączy prostą proceduralną
47 składnię (podobną do Pascala) z potężnymi konstrukcjami opisu danych
48 bazującymi na tablicach asocjacyjnych i rozszerzalnej składni. Lua ma
49 dynamiczny system typów, interpretowany z bytecodu i automatyczne
50 zarządzanie pamięcią z odśmiecaczem, co czyni go idealnym do
51 konfiguracji, skryptów i szybkich prototypów.
52
53 Ta wersja ma wkompilowaną obsługę ładowania dynamicznych bibliotek.
54
55 %package libs
56 Summary:        Lua 5.1.x shared library
57 Summary(pl.UTF-8):      Biblioteka współdzielona Lua 5.1.x
58 Group:          Libraries
59 # Provide old SONAME to avoid rebuilds
60 %ifarch %{x8664}
61 Provides:       liblua.so.5.1()(64bit)
62 %else
63 Provides:       liblua.so.5.1
64 %endif
65
66 %description libs
67 Lua 5.1.x shared library.
68
69 %description libs -l pl.UTF-8
70 Biblioteka współdzielona Lua 5.1.x.
71
72 %package devel
73 Summary:        Header files for Lua
74 Summary(pl.UTF-8):      Pliki nagłówkowe dla Lua
75 Group:          Development/Languages
76 Requires:       %{name}-libs = %{version}-%{release}
77 %if %{with default_lua}
78 Provides:       lua-devel = %{version}
79 Obsoletes:      lua-devel < %{version}
80 %endif
81
82 %description devel
83 Header files needed to embed Lua in C/C++ programs and docs for the
84 language.
85
86 %description devel -l pl.UTF-8
87 Pliki nagłówkowe potrzebne do włączenia Lua do programów w C/C++ oraz
88 dokumentacja samego języka.
89
90 %package static
91 Summary:        Static Lua libraries
92 Summary(pl.UTF-8):      Biblioteki statyczne Lua
93 Group:          Development/Languages
94 Requires:       %{name}-devel = %{version}-%{release}
95 %if %{with default_lua}
96 Provides:       lua-static = %{version}
97 Obsoletes:      lua-static < %{version}
98 %endif
99
100 %description static
101 Static Lua libraries.
102
103 %description static -l pl.UTF-8
104 Biblioteki statyczne Lua.
105
106 %package c++-libs
107 Summary:        Lua 5.1.x shared library with C++ exceptions support
108 Summary(pl.UTF-8):      Biblioteka współdzielona Lua 5.1.x z obsługą wyjątków C++
109 Group:          Libraries
110 Requires:       %{name}-libs = %{version}-%{release}
111 Obsoletes:      lua-libs-c++
112
113 %description c++-libs
114 Lua 5.1.x shared library with C++ exceptions support.
115
116 %description c++-libs -l pl.UTF-8
117 Biblioteka współdzielona Lua 5.1.x z obsługą wyjątków C++.
118
119 %package c++-devel
120 Summary:        Development files for Lua 5.1.x C++ library
121 Summary(pl.UTF-8):      Pliki programistyczne biblioteki C++ Lua 5.1.x
122 Group:          Development/Libraries
123 Requires:       %{name}-c++-libs = %{version}-%{release}
124 Requires:       %{name}-devel = %{version}-%{release}
125 Requires:       libstdc++-devel
126
127 %description c++-devel
128 Development files for Lua 5.1.x C++ library.
129
130 %description c++-devel -l pl.UTF-8
131 Pliki programistyczne biblioteki C++ Lua 5.1.x.
132
133 %package c++-static
134 Summary:        Static Lua 5.1.x C++ library
135 Summary(pl.UTF-8):      Statyczna biblioteka C++ Lua 5.1.x
136 Group:          Development/Libraries
137 Requires:       %{name}-c++-devel = %{version}-%{release}
138
139 %description c++-static
140 Static Lua 5.1.x C++ library.
141
142 %description c++-static -l pl.UTF-8
143 Statyczna biblioteka C++ Lua 5.1.x.
144
145 %package luastatic
146 Summary:        Static Lua interpreter
147 Summary(pl.UTF-8):      Statycznie skonsolidowany interpreter lua
148 Group:          Development/Languages
149 %if %{with default_lua}
150 Provides:       lua-luastatic = %{version}
151 Obsoletes:      lua-luastatic < %{version}
152 %endif
153
154 %description luastatic
155 Static lua interpreter.
156
157 %description luastatic -l pl.UTF-8
158 Statycznie skonsolidowany interpreter lua.
159
160 %prep
161 %setup -q -n lua-%{version}
162 %patch0 -p1
163 %patch1 -p1
164 sed -r -i 's|(#define LUA_ROOT.*)%{_prefix}/local/|\1%{_prefix}/|g' src/luaconf.h
165 sed -r -i 's|(#define LUA_CDIR.*)lib/|\1%{_lib}/|g' src/luaconf.h
166
167 cp -p %{SOURCE1} %{SOURCE2} .
168
169 %build
170 %if %{with luastatic}
171 %{__make} all \
172         PLAT=posix \
173         CC="diet %{__cc}" \
174         CFLAGS="%{rpmcflags} -Wall -fPIC -Os -DPIC -D_GNU_SOURCE -DLUA_USE_POSIX"
175
176 %{__mv} src/lua lua.static
177 %{__mv} src/luac luac.static
178
179 %{__make} clean
180 %endif
181
182 %{__make} debian_linux \
183         RPATH=%{_libdir} \
184         CC="%{__cc}" \
185         CXX="%{__cxx}" \
186         CFLAGS="%{rpmcflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX" \
187         CXXFLAGS="%{rpmcxxflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX"
188
189 %install
190 rm -rf $RPM_BUILD_ROOT
191 install -d $RPM_BUILD_ROOT{%{_libdir}/lua/5.1,%{_datadir}/lua/5.1,%{_pkgconfigdir}}
192
193 %{__make} debian_install \
194         INSTALL_TOP=$RPM_BUILD_ROOT%{_prefix} \
195         INSTALL_INC=$RPM_BUILD_ROOT%{_includedir}/lua5.1 \
196         INSTALL_LIB=$RPM_BUILD_ROOT%{_libdir} \
197         INSTALL_MAN=$RPM_BUILD_ROOT%{_mandir}/man1 \
198         INSTALL_CMOD=$RPM_BUILD_ROOT%{_libdir}/lua/5.1
199
200 # generate autodeps
201 chmod +x $RPM_BUILD_ROOT%{_libdir}/lib*.so*
202
203 %if %{with luastatic}
204 install -p lua.static $RPM_BUILD_ROOT%{_bindir}/lua5.1.static
205 install -p luac.static $RPM_BUILD_ROOT%{_bindir}/luac5.1.static
206 %endif
207
208 # alias to old pld names
209 ln -s liblua5.1.so $RPM_BUILD_ROOT%{_libdir}/liblua51.so
210 ln -s liblua5.1.a $RPM_BUILD_ROOT%{_libdir}/liblua51.a
211 ln -s lua5.1.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/lua51.pc
212 ln -s liblua5.1.so.0.0.0 $RPM_BUILD_ROOT%{_libdir}/liblua.so.5.1
213
214 # we have pkgconfig files, rm .la
215 %{__rm} $RPM_BUILD_ROOT%{_libdir}/liblua5.1.la
216 %{__rm} $RPM_BUILD_ROOT%{_libdir}/liblua5.1-c++.la
217
218 # create pkgconfig files
219 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1.pc <<EOF
220 major_version=5.1
221 version=%{version}
222
223 prefix=%{_prefix}
224 exec_prefix=%{_exec_prefix}
225 libdir=%{_libdir}
226 includedir=%{_includedir}/lua5.1
227 interpreter=%{_bindir}/lua5.1
228 compiler=%{_bindir}/luac5.1
229
230 $(cat lua.pc.in)
231 EOF
232
233 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1-c++.pc <<EOF
234 major_version=5.1
235 version=%{version}
236
237 prefix=%{_prefix}
238 exec_prefix=%{_exec_prefix}
239 libdir=%{_libdir}
240 includedir=%{_includedir}/lua5.1
241 interpreter=%{_bindir}/lua5.1
242 compiler=%{_bindir}/luac5.1
243
244 $(cat lua-c++.pc.in)
245 EOF
246
247 %if %{with default_lua}
248 for f in lua luac ; do
249         ln -sf ${f}5.1 $RPM_BUILD_ROOT%{_bindir}/${f}
250         echo ".so ${f}5.1.1" >$RPM_BUILD_ROOT%{_mandir}/man1/${f}.1
251 %if %{with luastatic}
252         ln -sf ${f}5.1.static $RPM_BUILD_ROOT%{_bindir}/${f}.static
253 %endif
254 done
255 ln -sf liblua5.1.so $RPM_BUILD_ROOT%{_libdir}/liblua.so
256 ln -sf liblua5.1.a $RPM_BUILD_ROOT%{_libdir}/liblua.a
257 ln -sf lua5.1 $RPM_BUILD_ROOT%{_includedir}/lua
258 ln -sf lua5.1.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/lua.pc
259 %endif
260
261 %clean
262 rm -rf $RPM_BUILD_ROOT
263
264 %post   libs -p /sbin/ldconfig
265 %postun libs -p /sbin/ldconfig
266
267 %post   c++-libs -p /sbin/ldconfig
268 %postun c++-libs -p /sbin/ldconfig
269
270 %triggerpostun libs -- %{name}-libs < 5.1.5-1.2
271 # restore symlink which ldconfig removed (it was ghost of old package)
272 ln -s liblua5.1.so.0.0.0 %{_libdir}/liblua.so.5.1 || :
273
274 %files
275 %defattr(644,root,root,755)
276 %attr(755,root,root) %{_bindir}/lua5.1
277 %attr(755,root,root) %{_bindir}/luac5.1
278 %{_mandir}/man1/lua5.1.1*
279 %{_mandir}/man1/luac5.1.1*
280 %if %{with default_lua}
281 %attr(755,root,root) %{_bindir}/lua
282 %attr(755,root,root) %{_bindir}/luac
283 %{_mandir}/man1/lua.1*
284 %{_mandir}/man1/luac.1*
285 %endif
286
287 %files libs
288 %defattr(644,root,root,755)
289 %doc COPYRIGHT HISTORY README
290 %attr(755,root,root) %{_libdir}/liblua5.1.so.*.*.*
291 %attr(755,root,root) %ghost %{_libdir}/liblua5.1.so.0
292 # PLD/upstream compatibility symlink
293 %attr(755,root,root) %{_libdir}/liblua.so.5.1
294 %dir %{_libdir}/lua
295 %{_libdir}/lua/5.1
296 %dir %{_datadir}/lua
297 %{_datadir}/lua/5.1
298
299 %files devel
300 %defattr(644,root,root,755)
301 %doc doc/*.{html,css,gif} test
302 %attr(755,root,root) %{_libdir}/liblua5.1.so
303 # PLD backward compatibility symlink
304 %attr(755,root,root) %{_libdir}/liblua51.so
305 %{_includedir}/lua5.1
306 %{_pkgconfigdir}/lua5.1.pc
307 # PLD backward compatibility symlink
308 %{_pkgconfigdir}/lua51.pc
309 %if %{with default_lua}
310 %attr(755,root,root) %{_libdir}/liblua.so
311 %{_includedir}/lua
312 %{_pkgconfigdir}/lua.pc
313 %endif
314
315 %files static
316 %defattr(644,root,root,755)
317 %{_libdir}/liblua5.1.a
318 # PLD backward compatibility symlink
319 %{_libdir}/liblua51.a
320 %if %{with default_lua}
321 %{_libdir}/liblua.a
322 %endif
323
324 %files c++-libs
325 %defattr(644,root,root,755)
326 %attr(755,root,root) %{_libdir}/liblua5.1-c++.so.*.*.*
327 %attr(755,root,root) %ghost %{_libdir}/liblua5.1-c++.so.0
328
329 %files c++-devel
330 %defattr(644,root,root,755)
331 %attr(755,root,root) %{_libdir}/liblua5.1-c++.so
332 %{_pkgconfigdir}/lua5.1-c++.pc
333
334 %files c++-static
335 %defattr(644,root,root,755)
336 %{_libdir}/liblua5.1-c++.a
337
338 %if %{with luastatic}
339 %files luastatic
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_bindir}/lua5.1.static
342 %attr(755,root,root) %{_bindir}/luac5.1.static
343 %if %{with default_lua}
344 %attr(755,root,root) %{_bindir}/lua.static
345 %attr(755,root,root) %{_bindir}/luac.static
346 %endif
347 %endif
This page took 0.493573 seconds and 3 git commands to generate.