]> git.pld-linux.org Git - packages/lua51.git/blob - lua51.spec
- added missing debian_make patch found on carme
[packages/lua51.git] / lua51.spec
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
6 Summary(pl.UTF-8):      Prosty, lekki ale potężny, osadzalny język programowania
7 Name:           lua51
8 Version:        5.1.5
9 Release:        2
10 License:        MIT
11 Group:          Development/Languages
12 Source0:        http://www.lua.org/ftp/lua-%{version}.tar.gz
13 # Source0-md5:  2e115fe26e435e33b0d5c022e4490567
14 Source1:        lua.pc.in
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)
27
28 %description
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.
37
38 This version has compiled in support for dynamic libraries in baselib.
39
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.
49
50 Ta wersja ma wkompilowaną obsługę ładowania dynamicznych bibliotek.
51
52 %package libs
53 Summary:        Lua 5.1.x shared library
54 Summary(pl.UTF-8):      Biblioteka współdzielona Lua 5.1.x
55 Group:          Libraries
56 # Provide old SONAME to avoid rebuilds
57 %ifarch %{x8664}
58 Provides:       liblua.so.5.1()(64bit)
59 %else
60 Provides:       liblua.so.5.1
61 %endif
62
63 %description libs
64 Lua 5.1.x shared library.
65
66 %description libs -l pl.UTF-8
67 Biblioteka współdzielona Lua 5.1.x.
68
69 %package devel
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}
75
76 %description devel
77 Header files needed to embed Lua in C/C++ programs and docs for the
78 language.
79
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.
83
84 %package static
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}
90
91 %description static
92 Static Lua libraries.
93
94 %description static -l pl.UTF-8
95 Biblioteki statyczne Lua.
96
97 %package c++-libs
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++
100 Group:          Libraries
101 Requires:       %{name}-libs = %{version}-%{release}
102 Obsoletes:      lua-libs-c++
103
104 %description c++-libs
105 Lua 5.1.x shared library with C++ exceptions support.
106
107 %description c++-libs -l pl.UTF-8
108 Biblioteka współdzielona Lua 5.1.x z obsługą wyjątków C++.
109
110 %package c++-devel
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
117
118 %description c++-devel
119 Development files for Lua 5.1.x C++ library.
120
121 %description c++-devel -l pl.UTF-8
122 Pliki programistyczne biblioteki C++ Lua 5.1.x.
123
124 %package c++-static
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}
129
130 %description c++-static
131 Static Lua 5.1.x C++ library.
132
133 %description c++-static -l pl.UTF-8
134 Statyczna biblioteka C++ Lua 5.1.x.
135
136 %package luastatic
137 Summary:        Static Lua interpreter
138 Summary(pl.UTF-8):      Statycznie skonsolidowany interpreter lua
139 Group:          Development/Languages
140
141 %description luastatic
142 Static lua interpreter.
143
144 %description luastatic -l pl.UTF-8
145 Statycznie skonsolidowany interpreter lua.
146
147 %prep
148 %setup -q -n lua-%{version}
149 %patch0 -p1
150 %patch1 -p1
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
153
154 cp -p %{SOURCE1} %{SOURCE2} .
155
156 %build
157 %if %{with luastatic}
158 %{__make} all \
159         PLAT=posix \
160         CC="diet %{__cc}" \
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
164 %{__make} clean
165 %endif
166
167 %{__make} debian_linux \
168         RPATH=%{_libdir} \
169         CC="%{__cc}" \
170         CXX="%{__cxx}" \
171         CFLAGS="%{rpmcflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX" \
172         CXXFLAGS="%{rpmcxxflags} -Wall -fPIC -DPIC -D_GNU_SOURCE -DLUA_USE_LINUX"
173
174 %install
175 rm -rf $RPM_BUILD_ROOT
176 install -d $RPM_BUILD_ROOT{%{_libdir}/lua/5.1,%{_datadir}/lua/5.1,%{_pkgconfigdir}}
177
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
184
185 # generate autodeps
186 chmod +x $RPM_BUILD_ROOT%{_libdir}/lib*.so*
187
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
191 %endif
192
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
198
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
202
203 # create pkgconfig files
204 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1.pc <<EOF
205 major_version=5.1
206 version=%{version}
207
208 prefix=%{_prefix}
209 exec_prefix=%{_exec_prefix}
210 libdir=%{_libdir}
211 includedir=%{_includedir}/lua51
212 interpreter=%{_bindir}/lua5.1
213 compiler=%{_bindir}/luac5.1
214
215 $(cat lua.pc.in)
216 EOF
217
218 cat > $RPM_BUILD_ROOT%{_pkgconfigdir}/lua5.1-c++.pc <<EOF
219 major_version=5.1
220 version=%{version}
221
222 prefix=%{_prefix}
223 exec_prefix=%{_exec_prefix}
224 libdir=%{_libdir}
225 includedir=%{_includedir}/lua51
226 interpreter=%{_bindir}/lua5.1
227 compiler=%{_bindir}/luac5.1
228
229 $(cat lua-c++.pc.in)
230 EOF
231
232 %clean
233 rm -rf $RPM_BUILD_ROOT
234
235 %post   libs -p /sbin/ldconfig
236 %postun libs -p /sbin/ldconfig
237
238 %post   c++-libs -p /sbin/ldconfig
239 %postun c++-libs -p /sbin/ldconfig
240
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 || :
244
245 %files
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*
251
252 %files libs
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
259 %dir %{_libdir}/lua
260 %{_libdir}/lua/5.1
261 %dir %{_datadir}/lua
262 %{_datadir}/lua/5.1
263
264 %files devel
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
270 %{_includedir}/lua51
271 %{_pkgconfigdir}/lua5.1.pc
272 # PLD backward compatibility symlink
273 %{_pkgconfigdir}/lua51.pc
274
275 %files static
276 %defattr(644,root,root,755)
277 %{_libdir}/liblua5.1.a
278 # PLD backward compatibility symlink
279 %{_libdir}/liblua51.a
280
281 %files c++-libs
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
285
286 %files c++-devel
287 %defattr(644,root,root,755)
288 %attr(755,root,root) %{_libdir}/liblua5.1-c++.so
289 %{_pkgconfigdir}/lua5.1-c++.pc
290
291 %files c++-static
292 %defattr(644,root,root,755)
293 %{_libdir}/liblua5.1-c++.a
294
295 %if %{with luastatic}
296 %files luastatic
297 %defattr(644,root,root,755)
298 %attr(755,root,root) %{_bindir}/lua.static
299 %attr(755,root,root) %{_bindir}/luac.static
300 %endif
This page took 0.070903 seconds and 3 git commands to generate.