3 %bcond_with luastatic # build dietlibc-based static lua version (broken)
4 %bcond_with default_lua # build as default lua (symlinks to nil suffix)
6 Summary: A simple lightweight powerful embeddable programming language
7 Summary(pl.UTF-8): Prosty, lekki ale potężny, osadzalny język programowania
12 Group: Development/Languages
13 Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz
14 # Source0-md5: 2e115fe26e435e33b0d5c022e4490567
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}
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
41 This version has compiled in support for dynamic libraries in baselib.
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.
53 Ta wersja ma wkompilowaną obsługę ładowania dynamicznych bibliotek.
56 Summary: Lua 5.1.x shared library
57 Summary(pl.UTF-8): Biblioteka współdzielona Lua 5.1.x
59 # Provide old SONAME to avoid rebuilds
61 Provides: liblua.so.5.1()(64bit)
63 Provides: liblua.so.5.1
67 Lua 5.1.x shared library.
69 %description libs -l pl.UTF-8
70 Biblioteka współdzielona Lua 5.1.x.
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}
83 Header files needed to embed Lua in C/C++ programs and docs for the
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.
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}
101 Static Lua libraries.
103 %description static -l pl.UTF-8
104 Biblioteki statyczne Lua.
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++
110 Requires: %{name}-libs = %{version}-%{release}
111 Obsoletes: lua-libs-c++
113 %description c++-libs
114 Lua 5.1.x shared library with C++ exceptions support.
116 %description c++-libs -l pl.UTF-8
117 Biblioteka współdzielona Lua 5.1.x z obsługą wyjątków C++.
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
127 %description c++-devel
128 Development files for Lua 5.1.x C++ library.
130 %description c++-devel -l pl.UTF-8
131 Pliki programistyczne biblioteki C++ Lua 5.1.x.
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}
139 %description c++-static
140 Static Lua 5.1.x C++ library.
142 %description c++-static -l pl.UTF-8
143 Statyczna biblioteka C++ Lua 5.1.x.
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}
154 %description luastatic
155 Static lua interpreter.
157 %description luastatic -l pl.UTF-8
158 Statycznie skonsolidowany interpreter lua.
161 %setup -q -n lua-%{version}
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
167 cp -p %{SOURCE1} %{SOURCE2} .
170 %if %{with luastatic}
174 CFLAGS="%{rpmcflags} -Wall -fPIC -Os -DPIC -D_GNU_SOURCE -DLUA_USE_POSIX"
176 %{__mv} src/lua lua.static
177 %{__mv} src/luac luac.static
182 %{__make} debian_linux \
186 CFLAGS="%{rpmcflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX" \
187 CXXFLAGS="%{rpmcxxflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX"
190 rm -rf $RPM_BUILD_ROOT
191 install -d $RPM_BUILD_ROOT{%{_libdir}/lua/5.1,%{_datadir}/lua/5.1,%{_pkgconfigdir}}
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
201 chmod +x $RPM_BUILD_ROOT%{_libdir}/lib*.so*
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
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
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
218 # create pkgconfig files
219 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1.pc <<EOF
224 exec_prefix=%{_exec_prefix}
226 includedir=%{_includedir}/lua5.1
227 interpreter=%{_bindir}/lua5.1
228 compiler=%{_bindir}/luac5.1
233 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1-c++.pc <<EOF
238 exec_prefix=%{_exec_prefix}
240 includedir=%{_includedir}/lua5.1
241 interpreter=%{_bindir}/lua5.1
242 compiler=%{_bindir}/luac5.1
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
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
262 rm -rf $RPM_BUILD_ROOT
264 %post libs -p /sbin/ldconfig
265 %postun libs -p /sbin/ldconfig
267 %post c++-libs -p /sbin/ldconfig
268 %postun c++-libs -p /sbin/ldconfig
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 || :
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*
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
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
312 %{_pkgconfigdir}/lua.pc
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}
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
330 %defattr(644,root,root,755)
331 %attr(755,root,root) %{_libdir}/liblua5.1-c++.so
332 %{_pkgconfigdir}/lua5.1-c++.pc
335 %defattr(644,root,root,755)
336 %{_libdir}/liblua5.1-c++.a
338 %if %{with 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