2012-01-07 15:58:03 +01:00
|
|
|
#
|
|
|
|
# spec file for package lua51
|
|
|
|
#
|
2015-08-05 21:58:57 +02:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2012-01-07 15:58:03 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2015-09-05 07:48:20 +02:00
|
|
|
%define major_version 5.1
|
|
|
|
%define lib_suffix 5_1
|
2012-01-07 15:58:03 +01:00
|
|
|
Name: lua51
|
2012-09-17 13:58:35 +02:00
|
|
|
Version: 5.1.5
|
2012-02-16 16:19:31 +01:00
|
|
|
Release: 0
|
2012-01-07 15:58:03 +01:00
|
|
|
Summary: Small Embeddable Language with Simple Procedural Syntax
|
2012-02-16 16:19:31 +01:00
|
|
|
License: MIT
|
2015-09-05 07:48:20 +02:00
|
|
|
Group: Development/Languages/Lua
|
2012-01-07 15:58:03 +01:00
|
|
|
Url: http://www.lua.org
|
2013-05-16 16:14:08 +02:00
|
|
|
Source: http://www.lua.org/ftp/lua-%{version}.tar.gz
|
2012-01-07 15:58:03 +01:00
|
|
|
Source1: macros.lua
|
|
|
|
Source2: baselibs.conf
|
|
|
|
Patch0: %{name}-%{version}-shared.diff
|
|
|
|
Patch1: %{name}-%{version}-module-path.diff
|
|
|
|
Patch3: %{name}-%{version}-libdir.diff
|
2013-10-23 19:23:40 +02:00
|
|
|
Patch4: %{name}-%{version}-pkgconfig.patch
|
2015-09-05 07:48:20 +02:00
|
|
|
BuildRequires: pkg-config
|
|
|
|
BuildRequires: readline-devel
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(preun): update-alternatives
|
|
|
|
Provides: Lua(API) = %{major_version}
|
2012-01-07 15:58:03 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
Lua combines simple procedural syntax (similar to Pascal) with powerful
|
|
|
|
data description constructs based on associative arrays and extensible
|
|
|
|
semantics. Lua is dynamically typed, interpreted from byte codes, and
|
|
|
|
has automatic memory management, making it ideal for configuration,
|
|
|
|
scripting, and rapid prototyping. Lua is implemented as a small library
|
|
|
|
of C functions, written in ANSI C, and the implementation goals are
|
|
|
|
simplicity, efficiency, portability, and low embedding cost.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for lua
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: %{name} = %{version}
|
2015-09-05 07:48:20 +02:00
|
|
|
Requires: liblua%{lib_suffix} = %{version}
|
|
|
|
Provides: Lua(devel) = %{major_version}
|
|
|
|
Obsoletes: otherproviders(Lua(devel))
|
2012-01-07 15:58:03 +01:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
This package contains files needed for embedding lua into your
|
|
|
|
application.
|
|
|
|
|
2015-09-05 07:48:20 +02:00
|
|
|
%package -n liblua%{lib_suffix}
|
2015-08-05 21:58:57 +02:00
|
|
|
Summary: The Lua integration library
|
2012-01-07 15:58:03 +01:00
|
|
|
Group: System/Libraries
|
2012-04-12 09:39:50 +02:00
|
|
|
Provides: %{name}-libs = %{version}
|
|
|
|
Obsoletes: %{name}-libs <= %{version}
|
2012-01-07 15:58:03 +01:00
|
|
|
|
2015-09-05 07:48:20 +02:00
|
|
|
%description -n liblua%{lib_suffix}
|
2012-01-07 15:58:03 +01:00
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
Lua combines simple procedural syntax (similar to Pascal) with powerful
|
|
|
|
data description constructs based on associative arrays and extensible
|
|
|
|
semantics. Lua is dynamically typed, interpreted from byte codes, and
|
|
|
|
has automatic memory management, making it ideal for configuration,
|
|
|
|
scripting, and rapid prototyping. Lua is implemented as a small library
|
|
|
|
of C functions, written in ANSI C, and the implementation goals are
|
|
|
|
simplicity, efficiency, portability, and low embedding cost.
|
|
|
|
|
|
|
|
%package doc
|
2015-08-05 21:58:57 +02:00
|
|
|
Summary: Documentation for Lua, a small embeddable language
|
|
|
|
Group: Documentation/HTML
|
2012-01-07 15:58:03 +01:00
|
|
|
%if 0%{?suse_version} >= 1120
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
Lua combines simple procedural syntax (similar to Pascal) with powerful
|
|
|
|
data description constructs based on associative arrays and extensible
|
|
|
|
semantics. Lua is dynamically typed, interpreted from byte codes, and
|
|
|
|
has automatic memory management, making it ideal for configuration,
|
|
|
|
scripting, and rapid prototyping. Lua is implemented as a small library
|
|
|
|
of C functions, written in ANSI C, and the implementation goals are
|
|
|
|
simplicity, efficiency, portability, and low embedding cost.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n lua-%{version}
|
|
|
|
%patch0 -b .shared
|
|
|
|
%patch1 -p1
|
|
|
|
%patch3 -p1
|
2013-10-23 19:23:40 +02:00
|
|
|
%patch4 -p1
|
2012-01-07 15:58:03 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
sed -i 's:LUA_ROOT2 "LIBDIR/lua/%{major_version}/":LUA_ROOT2 \"%{_lib}/lua/%{major_version}/":' src/luaconf.h
|
2015-09-05 07:48:20 +02:00
|
|
|
make %{?_smp_mflags} -C src CC="gcc" MYCFLAGS="%{optflags} -fPIC -DLUA_USE_LINUX" MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" V=%{major_version} all
|
2012-01-07 15:58:03 +01:00
|
|
|
|
|
|
|
%install
|
2014-05-02 11:10:50 +02:00
|
|
|
make install INSTALL_TOP="%{buildroot}%{_prefix}" INSTALL_LIB="%{buildroot}%{_libdir}" INSTALL_CMOD=%{buildroot}%{_libdir}/lua/%{major_version} INSTALL_MAN="%{buildroot}%{_mandir}/man1"
|
2015-09-05 07:48:20 +02:00
|
|
|
find %{buildroot} -name "*.a" -delete -print
|
|
|
|
install -D -m644 etc/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua-%{major_version}.pc
|
2014-09-12 11:17:52 +02:00
|
|
|
# update-alternatives
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
2012-01-07 15:58:03 +01:00
|
|
|
for file in lua luac ; do
|
|
|
|
mv "%{buildroot}%{_bindir}/${file}" "%{buildroot}%{_bindir}/${file}%{major_version}"
|
2014-09-12 11:17:52 +02:00
|
|
|
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}"
|
|
|
|
ln -sf "%{_sysconfdir}/alternatives/${file}" "%{buildroot}%{_bindir}/${file}"
|
2012-01-07 15:58:03 +01:00
|
|
|
mv "%{buildroot}%{_mandir}/man1/${file}.1" "%{buildroot}%{_mandir}/man1/${file}%{major_version}.1"
|
2014-09-12 11:17:52 +02:00
|
|
|
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1.gz"
|
|
|
|
ln -sf "%{_sysconfdir}/alternatives/${file}.1.gz" "%{buildroot}%{_mandir}/man1/${file}.1.gz"
|
2012-01-07 15:58:03 +01:00
|
|
|
done
|
2014-05-02 11:10:50 +02:00
|
|
|
install -d -m 0755 %{buildroot}%{_libdir}/lua/%{major_version}
|
|
|
|
install -d -m 0755 %{buildroot}%{_datadir}/lua/%{major_version}
|
2015-09-05 07:48:20 +02:00
|
|
|
install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.lua-%{major_version}
|
2012-01-07 15:58:03 +01:00
|
|
|
|
2014-05-02 11:10:50 +02:00
|
|
|
# Debian/Ubuntu/SteamOS/Arch Linux compatibility
|
|
|
|
ln -s %{_libdir}/liblua.so.%{major_version} %{buildroot}%{_libdir}/liblua%{major_version}.so.0
|
|
|
|
ln -s %{_libdir}/liblua.so %{buildroot}%{_libdir}/liblua5.1.so
|
2012-01-07 15:58:03 +01:00
|
|
|
|
|
|
|
%post
|
2015-09-05 07:48:20 +02:00
|
|
|
%{_sbindir}/update-alternatives --install \
|
|
|
|
%{_bindir}/lua lua %{_bindir}/lua%{major_version} 30 \
|
2012-01-07 15:58:03 +01:00
|
|
|
--slave %{_bindir}/luac luac %{_bindir}/luac%{major_version} \
|
|
|
|
--slave %{_mandir}/man1/lua.1.gz lua.1.gz %{_mandir}/man1/lua%{major_version}.1.gz \
|
|
|
|
--slave %{_mandir}/man1/luac.1.gz luac.1.gz %{_mandir}/man1/luac%{major_version}.1.gz
|
|
|
|
|
|
|
|
%preun
|
|
|
|
if [ "$1" = 0 ] ; then
|
2015-09-05 07:48:20 +02:00
|
|
|
%{_sbindir}/update-alternatives --remove lua %{_bindir}/lua%{major_version}
|
2012-01-07 15:58:03 +01:00
|
|
|
fi
|
|
|
|
|
2015-09-05 07:48:20 +02:00
|
|
|
%post -n liblua%{lib_suffix} -p /sbin/ldconfig
|
2012-01-07 15:58:03 +01:00
|
|
|
|
2015-09-05 07:48:20 +02:00
|
|
|
%postun -n liblua%{lib_suffix} -p /sbin/ldconfig
|
2012-01-07 15:58:03 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc COPYRIGHT HISTORY README
|
2014-09-12 11:17:52 +02:00
|
|
|
%{_bindir}/lua%{major_version}
|
|
|
|
%{_bindir}/luac%{major_version}
|
|
|
|
%{_mandir}/man1/lua%{major_version}.1.gz
|
|
|
|
%{_mandir}/man1/luac%{major_version}.1.gz
|
|
|
|
%{_bindir}/lua
|
|
|
|
%{_bindir}/luac
|
|
|
|
%{_mandir}/man1/lua.1.gz
|
|
|
|
%{_mandir}/man1/luac.1.gz
|
|
|
|
%ghost %{_sysconfdir}/alternatives/lua
|
|
|
|
%ghost %{_sysconfdir}/alternatives/luac
|
|
|
|
%ghost %{_sysconfdir}/alternatives/lua.1.gz
|
|
|
|
%ghost %{_sysconfdir}/alternatives/luac.1.gz
|
2012-01-07 15:58:03 +01:00
|
|
|
%dir %{_libdir}/lua
|
|
|
|
%dir %{_libdir}/lua/%{major_version}
|
|
|
|
%dir %{_datadir}/lua
|
|
|
|
%dir %{_datadir}/lua/%{major_version}
|
|
|
|
|
2015-09-05 07:48:20 +02:00
|
|
|
%files -n liblua%{lib_suffix}
|
2012-01-07 15:58:03 +01:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/liblua.so.%{major_version}
|
2014-05-02 11:10:50 +02:00
|
|
|
%{_libdir}/liblua%{major_version}.so.0
|
2012-01-07 15:58:03 +01:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
2015-09-05 07:48:20 +02:00
|
|
|
%{_sysconfdir}/rpm/macros.lua-%{major_version}
|
2012-01-07 15:58:03 +01:00
|
|
|
%{_includedir}/lauxlib.h
|
|
|
|
%{_includedir}/lua.h
|
|
|
|
%{_includedir}/lua.hpp
|
|
|
|
%{_includedir}/luaconf.h
|
|
|
|
%{_includedir}/lualib.h
|
2015-09-05 07:48:20 +02:00
|
|
|
%{_libdir}/pkgconfig/lua-%{major_version}.pc
|
2012-01-07 15:58:03 +01:00
|
|
|
%{_libdir}/liblua.so
|
2014-05-02 11:10:50 +02:00
|
|
|
%{_libdir}/liblua5.1.so
|
2012-01-07 15:58:03 +01:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc doc/*
|
|
|
|
|
|
|
|
%changelog
|