]>
Commit | Line | Data |
---|---|---|
5da707c7 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with luastatic # build dietlibc-based static lua version (broken) | |
4 | # | |
5 | Summary: A simple lightweight powerful embeddable programming language | |
9b8d4c7a | 6 | Summary(pl.UTF-8): Prosty, lekki ale potężny, osadzalny język programowania |
5da707c7 | 7 | Name: lua51 |
3ee31ddd | 8 | Version: 5.1.4 |
99d6186b | 9 | Release: 2 |
5da707c7 JB |
10 | License: MIT |
11 | Group: Development/Languages | |
12 | Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz | |
3ee31ddd | 13 | # Source0-md5: d0870f2de55d59c1c8419f36e8fac150 |
5da707c7 JB |
14 | Patch0: %{name}-link.patch |
15 | URL: http://www.lua.org/ | |
257b28c0 | 16 | %{?with_luastatic:BuildRequires: dietlibc-static} |
5da707c7 | 17 | BuildRequires: readline-devel |
4b12c2e8 | 18 | BuildRequires: sed >= 4.0 |
5da707c7 JB |
19 | Requires: %{name}-libs = %{version}-%{release} |
20 | Provides: lua = %{version} | |
21 | Obsoletes: lua < 4.0.1 | |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
25 | Lua is a powerful, light-weight programming language designed for | |
26 | extending applications. It is also frequently used as a | |
27 | general-purpose, stand-alone language. It combines simple procedural | |
28 | syntax (similar to Pascal) with powerful data description constructs | |
29 | based on associative arrays and extensible semantics. Lua is | |
30 | dynamically typed, interpreted from bytecodes, and has automatic | |
31 | memory management with garbage collection, making it ideal for | |
32 | configuration, scripting, and rapid prototyping. | |
33 | ||
34 | This version has compiled in support for dynamic libraries in baselib. | |
35 | ||
1eb22612 JR |
36 | %description -l pl.UTF-8 |
37 | Lua to język programowania o dużych możliwościach ale lekki, | |
38 | przeznaczony do rozszerzania aplikacji. Jest też często używany jako | |
39 | samodzielny język ogólnego przeznaczenia. Łączy prostą proceduralną | |
40 | składnię (podobną do Pascala) z potężnymi konstrukcjami opisu danych | |
41 | bazującymi na tablicach asocjacyjnych i rozszerzalnej składni. Lua ma | |
42 | dynamiczny system typów, interpretowany z bytecodu i automatyczne | |
43 | zarządzanie pamięcią z odśmiecaczem, co czyni go idealnym do | |
44 | konfiguracji, skryptów i szybkich prototypów. | |
5da707c7 | 45 | |
1eb22612 | 46 | Ta wersja ma wkompilowaną obsługę ładowania dynamicznych bibliotek. |
5da707c7 JB |
47 | |
48 | %package libs | |
49 | Summary: lua 5.1.x libraries | |
9b8d4c7a | 50 | Summary(pl.UTF-8): Biblioteki lua 5.1.x |
5da707c7 JB |
51 | Group: Development/Languages |
52 | ||
53 | %description libs | |
54 | lua 5.1.x libraries. | |
55 | ||
1eb22612 | 56 | %description libs -l pl.UTF-8 |
5da707c7 JB |
57 | Biblioteki lua 5.1.x. |
58 | ||
59 | %package devel | |
60 | Summary: Header files for Lua | |
9b8d4c7a | 61 | Summary(pl.UTF-8): Pliki nagłówkowe dla Lua |
5da707c7 JB |
62 | Group: Development/Languages |
63 | Requires: %{name}-libs = %{version}-%{release} | |
64 | Provides: lua-devel = %{version} | |
65 | ||
66 | %description devel | |
67 | Header files needed to embed Lua in C/C++ programs and docs for the | |
68 | language. | |
69 | ||
1eb22612 JR |
70 | %description devel -l pl.UTF-8 |
71 | Pliki nagłówkowe potrzebne do włączenia Lua do programów w C/C++ oraz | |
72 | dokumentacja samego języka. | |
5da707c7 JB |
73 | |
74 | %package static | |
75 | Summary: Static Lua libraries | |
9b8d4c7a | 76 | Summary(pl.UTF-8): Biblioteki statyczne Lua |
5da707c7 JB |
77 | Group: Development/Languages |
78 | Requires: %{name}-devel = %{version}-%{release} | |
79 | Provides: lua-static = %{version} | |
80 | ||
81 | %description static | |
82 | Static Lua libraries. | |
83 | ||
1eb22612 | 84 | %description static -l pl.UTF-8 |
5da707c7 JB |
85 | Biblioteki statyczne Lua. |
86 | ||
87 | %package luastatic | |
4b12c2e8 | 88 | Summary: Static Lua interpreter |
9b8d4c7a | 89 | Summary(pl.UTF-8): Statycznie skonsolidowany interpreter lua |
5da707c7 JB |
90 | Group: Development/Languages |
91 | ||
92 | %description luastatic | |
93 | Static lua interpreter. | |
94 | ||
1eb22612 | 95 | %description luastatic -l pl.UTF-8 |
5da707c7 JB |
96 | Statycznie skonsolidowany interpreter lua. |
97 | ||
98 | %prep | |
99 | %setup -q -n lua-%{version} | |
100 | %patch0 -p1 | |
4b12c2e8 | 101 | sed -r -i 's|(#define LUA_ROOT.*)%{_prefix}/local/|\1%{_prefix}/|g' src/luaconf.h |
37951791 | 102 | sed -r -i 's|(#define LUA_CDIR.*)lib/|\1%{_lib}/|g' src/luaconf.h |
5da707c7 JB |
103 | |
104 | %build | |
105 | %if %{with luastatic} | |
106 | %{__make} all \ | |
107 | PLAT=posix \ | |
257b28c0 JR |
108 | CC="diet %{__cc}" \ |
109 | CFLAGS="%{rpmcflags} -Wall -fPIC -Os -DPIC -D_GNU_SOURCE -DLUA_USE_POSIX" | |
5da707c7 JB |
110 | mv src/lua lua.static |
111 | mv src/luac luac.static | |
112 | %{__make} clean | |
113 | %endif | |
114 | ||
115 | %{__make} -j1 all \ | |
116 | PLAT=linux \ | |
117 | CC="%{__cc}" \ | |
118 | CFLAGS="%{rpmcflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX" | |
119 | ||
120 | #rm -f test/{lua,luac} | |
121 | ||
122 | %install | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | install -d $RPM_BUILD_ROOT%{_libdir}/lua} | |
125 | ||
126 | %{__make} install \ | |
127 | INSTALL_TOP=$RPM_BUILD_ROOT%{_prefix} \ | |
128 | INSTALL_INC=$RPM_BUILD_ROOT%{_includedir}/lua51 \ | |
129 | INSTALL_LIB=$RPM_BUILD_ROOT%{_libdir} \ | |
130 | INSTALL_MAN=$RPM_BUILD_ROOT%{_mandir}/man1 \ | |
131 | INSTALL_CMOD=$RPM_BUILD_ROOT%{_libdir}/lua/5.1 | |
132 | ||
133 | # change name from lua to lua51 | |
134 | for i in $RPM_BUILD_ROOT%{_bindir}/* ; do mv ${i}{,51} ; done | |
135 | mv $RPM_BUILD_ROOT%{_mandir}/man1/lua{,51}.1 | |
136 | mv $RPM_BUILD_ROOT%{_mandir}/man1/luac{,51}.1 | |
137 | mv $RPM_BUILD_ROOT%{_libdir}/liblua{,51}.a | |
138 | ||
139 | install src/liblua.so.5.1 $RPM_BUILD_ROOT%{_libdir} | |
140 | ln -s liblua.so.5.1 $RPM_BUILD_ROOT%{_libdir}/liblua51.so | |
141 | ||
142 | %if %{with luastatic} | |
143 | install lua.static $RPM_BUILD_ROOT%{_bindir}/lua51.static | |
144 | install luac.static $RPM_BUILD_ROOT%{_bindir}/luac51.static | |
145 | %endif | |
146 | ||
147 | # create pkgconfig file | |
148 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
149 | cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua51.pc <<'EOF' | |
150 | prefix=%{_prefix} | |
151 | exec_prefix=%{_exec_prefix} | |
152 | includedir=%{_includedir}/%{name} | |
153 | libdir=%{_libdir} | |
154 | interpreter=%{_bindir}/lua51 | |
155 | compiler=%{_bindir}/luac51 | |
156 | ||
157 | Name: Lua | |
158 | Description: An extension programming language | |
159 | Version: %{version} | |
160 | Cflags: -I%{_includedir}/%{name} | |
161 | Libs: -L%{_libdir} -llua51 -ldl -lm | |
162 | EOF | |
163 | ||
164 | %clean | |
165 | rm -rf $RPM_BUILD_ROOT | |
166 | ||
167 | %post libs -p /sbin/ldconfig | |
168 | %postun libs -p /sbin/ldconfig | |
169 | ||
170 | %files | |
171 | %defattr(644,root,root,755) | |
172 | %attr(755,root,root) %{_bindir}/lua51 | |
173 | %attr(755,root,root) %{_bindir}/luac51 | |
174 | %{_mandir}/man1/lua51.1* | |
175 | %{_mandir}/man1/luac51.1* | |
176 | ||
177 | %files libs | |
178 | %defattr(644,root,root,755) | |
179 | %doc COPYRIGHT HISTORY README | |
180 | %attr(755,root,root) %{_libdir}/liblua.so.*.* | |
181 | %dir %{_libdir}/lua | |
182 | %{_libdir}/lua/5.1 | |
183 | %dir %{_datadir}/lua | |
184 | %{_datadir}/lua/5.1 | |
185 | ||
186 | %files devel | |
187 | %defattr(644,root,root,755) | |
188 | %doc doc/*.{html,css,gif} test | |
189 | %attr(755,root,root) %{_libdir}/liblua51.so | |
190 | %{_includedir}/lua51 | |
191 | %{_pkgconfigdir}/lua51.pc | |
192 | ||
193 | %files static | |
194 | %defattr(644,root,root,755) | |
195 | %{_libdir}/liblua51.a | |
196 | ||
197 | %if %{with luastatic} | |
198 | %files luastatic | |
199 | %defattr(644,root,root,755) | |
200 | %attr(755,root,root) %{_bindir}/*.static | |
201 | %endif |