3 %bcond_with luastatic # build dietlibc-based static lua version (broken)
5 Summary: A simple lightweight powerful embeddable programming language
6 Summary(pl.UTF-8): Prosty, lekki ale potężny, osadzalny język programowania
11 Group: Development/Languages
12 Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz
13 # Source0-md5: 2e115fe26e435e33b0d5c022e4490567
15 Source2: lua-c++.pc.in
16 Patch0: %{name}-link.patch
17 Patch1: debian_make.patch
18 URL: http://www.lua.org/
19 %{?with_luastatic:BuildRequires: dietlibc-static}
20 BuildRequires: libstdc++-devel
21 BuildRequires: readline-devel
22 BuildRequires: sed >= 4.0
23 Requires: %{name}-libs = %{version}-%{release}
24 Provides: lua = %{version}
25 Obsoletes: lua < 4.0.1
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 Lua is a powerful, light-weight programming language designed for
30 extending applications. It is also frequently used as a
31 general-purpose, stand-alone language. It combines simple procedural
32 syntax (similar to Pascal) with powerful data description constructs
33 based on associative arrays and extensible semantics. Lua is
34 dynamically typed, interpreted from bytecodes, and has automatic
35 memory management with garbage collection, making it ideal for
36 configuration, scripting, and rapid prototyping.
38 This version has compiled in support for dynamic libraries in baselib.
40 %description -l pl.UTF-8
41 Lua to język programowania o dużych możliwościach ale lekki,
42 przeznaczony do rozszerzania aplikacji. Jest też często używany jako
43 samodzielny język ogólnego przeznaczenia. Łączy prostą proceduralną
44 składnię (podobną do Pascala) z potężnymi konstrukcjami opisu danych
45 bazującymi na tablicach asocjacyjnych i rozszerzalnej składni. Lua ma
46 dynamiczny system typów, interpretowany z bytecodu i automatyczne
47 zarządzanie pamięcią z odśmiecaczem, co czyni go idealnym do
48 konfiguracji, skryptów i szybkich prototypów.
50 Ta wersja ma wkompilowaną obsługę ładowania dynamicznych bibliotek.
53 Summary: Lua 5.1.x shared library
54 Summary(pl.UTF-8): Biblioteka współdzielona Lua 5.1.x
56 # Provide old SONAME to avoid rebuilds
58 Provides: liblua.so.5.1()(64bit)
60 Provides: liblua.so.5.1
64 Lua 5.1.x shared library.
66 %description libs -l pl.UTF-8
67 Biblioteka współdzielona Lua 5.1.x.
70 Summary: Header files for Lua
71 Summary(pl.UTF-8): Pliki nagłówkowe dla Lua
72 Group: Development/Languages
73 Requires: %{name}-libs = %{version}-%{release}
74 Provides: lua-devel = %{version}
77 Header files needed to embed Lua in C/C++ programs and docs for the
80 %description devel -l pl.UTF-8
81 Pliki nagłówkowe potrzebne do włączenia Lua do programów w C/C++ oraz
82 dokumentacja samego języka.
85 Summary: Static Lua libraries
86 Summary(pl.UTF-8): Biblioteki statyczne Lua
87 Group: Development/Languages
88 Requires: %{name}-devel = %{version}-%{release}
89 Provides: lua-static = %{version}
94 %description static -l pl.UTF-8
95 Biblioteki statyczne Lua.
98 Summary: Lua 5.1.x shared library with C++ exceptions support
99 Summary(pl.UTF-8): Biblioteka współdzielona Lua 5.1.x z obsługą wyjątków C++
101 Requires: %{name}-libs = %{version}-%{release}
102 Obsoletes: lua-libs-c++
104 %description c++-libs
105 Lua 5.1.x shared library with C++ exceptions support.
107 %description c++-libs -l pl.UTF-8
108 Biblioteka współdzielona Lua 5.1.x z obsługą wyjątków C++.
111 Summary: Development files for Lua 5.1.x C++ library
112 Summary(pl.UTF-8): Pliki programistyczne biblioteki C++ Lua 5.1.x
113 Group: Development/Libraries
114 Requires: %{name}-c++-libs = %{version}-%{release}
115 Requires: %{name}-devel = %{version}-%{release}
116 Requires: libstdc++-devel
118 %description c++-devel
119 Development files for Lua 5.1.x C++ library.
121 %description c++-devel -l pl.UTF-8
122 Pliki programistyczne biblioteki C++ Lua 5.1.x.
125 Summary: Static Lua 5.1.x C++ library
126 Summary(pl.UTF-8): Statyczna biblioteka C++ Lua 5.1.x
127 Group: Development/Libraries
128 Requires: %{name}-c++-devel = %{version}-%{release}
130 %description c++-static
131 Static Lua 5.1.x C++ library.
133 %description c++-static -l pl.UTF-8
134 Statyczna biblioteka C++ Lua 5.1.x.
137 Summary: Static Lua interpreter
138 Summary(pl.UTF-8): Statycznie skonsolidowany interpreter lua
139 Group: Development/Languages
141 %description luastatic
142 Static lua interpreter.
144 %description luastatic -l pl.UTF-8
145 Statycznie skonsolidowany interpreter lua.
148 %setup -q -n lua-%{version}
151 sed -r -i 's|(#define LUA_ROOT.*)%{_prefix}/local/|\1%{_prefix}/|g' src/luaconf.h
152 sed -r -i 's|(#define LUA_CDIR.*)lib/|\1%{_lib}/|g' src/luaconf.h
154 cp -p %{SOURCE1} %{SOURCE2} .
157 %if %{with luastatic}
161 CFLAGS="%{rpmcflags} -Wall -fPIC -Os -DPIC -D_GNU_SOURCE -DLUA_USE_POSIX"
162 mv src/lua lua.static
163 mv src/luac luac.static
167 %{__make} debian_linux \
171 CFLAGS="%{rpmcflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX" \
172 CXXFLAGS="%{rpmcxxflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX"
175 rm -rf $RPM_BUILD_ROOT
176 install -d $RPM_BUILD_ROOT{%{_libdir}/lua/5.1,%{_datadir}/lua/5.1,%{_pkgconfigdir}}
178 %{__make} debian_install \
179 INSTALL_TOP=$RPM_BUILD_ROOT%{_prefix} \
180 INSTALL_INC=$RPM_BUILD_ROOT%{_includedir}/lua51 \
181 INSTALL_LIB=$RPM_BUILD_ROOT%{_libdir} \
182 INSTALL_MAN=$RPM_BUILD_ROOT%{_mandir}/man1 \
183 INSTALL_CMOD=$RPM_BUILD_ROOT%{_libdir}/lua/5.1
186 chmod +x $RPM_BUILD_ROOT%{_libdir}/lib*.so*
188 %if %{with luastatic}
189 install -p lua.static $RPM_BUILD_ROOT%{_bindir}/lua51.static
190 install -p luac.static $RPM_BUILD_ROOT%{_bindir}/luac51.static
193 # alias to old pld names
194 ln -s liblua5.1.so $RPM_BUILD_ROOT%{_libdir}/liblua51.so
195 ln -s liblua5.1.a $RPM_BUILD_ROOT%{_libdir}/liblua51.a
196 ln -s lua5.1.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/lua51.pc
197 ln -s liblua5.1.so.0 $RPM_BUILD_ROOT%{_libdir}/liblua.so.5.1
199 # we have pkgconfig files, rm .la
200 %{__rm} $RPM_BUILD_ROOT%{_libdir}/liblua5.1.la
201 %{__rm} $RPM_BUILD_ROOT%{_libdir}/liblua5.1-c++.la
203 # create pkgconfig files
204 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1.pc <<EOF
209 exec_prefix=%{_exec_prefix}
211 includedir=%{_includedir}/lua51
212 interpreter=%{_bindir}/lua5.1
213 compiler=%{_bindir}/luac5.1
218 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1-c++.pc <<EOF
223 exec_prefix=%{_exec_prefix}
225 includedir=%{_includedir}/lua51
226 interpreter=%{_bindir}/lua5.1
227 compiler=%{_bindir}/luac5.1
233 rm -rf $RPM_BUILD_ROOT
235 %post libs -p /sbin/ldconfig
236 %postun libs -p /sbin/ldconfig
238 %post c++-libs -p /sbin/ldconfig
239 %postun c++-libs -p /sbin/ldconfig
241 %triggerpostun libs -- %{name}-libs < 5.1.5-1.2
242 # restore symlink which ldconfig removed (it was ghost of old package)
243 ln -s liblua5.1.so.0 %{_libdir}/liblua.so.5.1 || :
246 %defattr(644,root,root,755)
247 %attr(755,root,root) %{_bindir}/lua5.1
248 %attr(755,root,root) %{_bindir}/luac5.1
249 %{_mandir}/man1/lua5.1.1*
250 %{_mandir}/man1/luac5.1.1*
253 %defattr(644,root,root,755)
254 %doc COPYRIGHT HISTORY README
255 %attr(755,root,root) %{_libdir}/liblua5.1.so.*.*.*
256 %attr(755,root,root) %ghost %{_libdir}/liblua5.1.so.0
257 # PLD/upstream compatibility symlink
258 %attr(755,root,root) %{_libdir}/liblua.so.5.1
265 %defattr(644,root,root,755)
266 %doc doc/*.{html,css,gif} test
267 %attr(755,root,root) %{_libdir}/liblua5.1.so
268 # PLD backward compatibility symlink
269 %attr(755,root,root) %{_libdir}/liblua51.so
271 %{_pkgconfigdir}/lua5.1.pc
272 # PLD backward compatibility symlink
273 %{_pkgconfigdir}/lua51.pc
276 %defattr(644,root,root,755)
277 %{_libdir}/liblua5.1.a
278 # PLD backward compatibility symlink
279 %{_libdir}/liblua51.a
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{_libdir}/liblua5.1-c++.so.*.*.*
284 %attr(755,root,root) %ghost %{_libdir}/liblua5.1-c++.so.0
287 %defattr(644,root,root,755)
288 %attr(755,root,root) %{_libdir}/liblua5.1-c++.so
289 %{_pkgconfigdir}/lua5.1-c++.pc
292 %defattr(644,root,root,755)
293 %{_libdir}/liblua5.1-c++.a
295 %if %{with luastatic}
297 %defattr(644,root,root,755)
298 %attr(755,root,root) %{_bindir}/lua.static
299 %attr(755,root,root) %{_bindir}/luac.static