2017-07-07 15:14:29 +02:00
|
|
|
#
|
2017-07-10 13:03:59 +02:00
|
|
|
# spec file for package lua53
|
2017-07-07 15:14:29 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%define major_version 5.3
|
2017-07-10 13:03:59 +02:00
|
|
|
%define libname liblua5_3-5
|
|
|
|
Name: lua53
|
2017-07-07 15:16:30 +02:00
|
|
|
Version: 5.3.4
|
2017-07-07 15:14:29 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Small Embeddable Language with Procedural Syntax
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Languages/Other
|
|
|
|
Url: http://www.lua.org
|
|
|
|
Source: http://www.lua.org/ftp/lua-%{version}.tar.gz
|
2017-07-10 13:33:09 +02:00
|
|
|
Source99: baselibs.conf
|
2017-07-07 15:41:38 +02:00
|
|
|
# PATCH-FIX-SUSE tweak the buildsystem to produce what is needed for SUSE
|
|
|
|
Patch0: lua-build-system.patch
|
2017-07-10 13:03:59 +02:00
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRequires: pkgconfig
|
2017-07-07 15:14:29 +02:00
|
|
|
BuildRequires: readline-devel
|
2017-07-10 13:33:09 +02:00
|
|
|
BuildRequires: lua-macros
|
2017-07-10 13:03:59 +02:00
|
|
|
Provides: lua = %{version}
|
2017-07-07 15:14:29 +02:00
|
|
|
Provides: Lua(API) = %{major_version}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but is also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
Lua combines procedural syntax (similar to Pascal) with
|
|
|
|
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 suitable for configuration,
|
|
|
|
scripting, and rapid prototyping. Lua is implemented as a small library
|
|
|
|
of C functions, written in ANSI C.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for lua
|
|
|
|
Group: Development/Libraries/C and C++
|
2017-07-10 13:03:59 +02:00
|
|
|
Requires: %{libname} = %{version}
|
2017-07-07 15:14:29 +02:00
|
|
|
Requires: %{name} = %{version}
|
2017-07-10 13:33:09 +02:00
|
|
|
Requires: lua-macros
|
2017-07-10 13:03:59 +02:00
|
|
|
Provides: lua-devel = %{version}
|
2017-07-07 15:14:29 +02:00
|
|
|
Provides: Lua(devel) = %{major_version}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but is also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
This package contains files needed for embedding lua into your
|
|
|
|
application.
|
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
%package -n %{libname}
|
2017-07-07 15:14:29 +02:00
|
|
|
Summary: The Lua integration library
|
|
|
|
Group: System/Libraries
|
|
|
|
Provides: %{name}-libs = %{version}
|
|
|
|
Obsoletes: %{name}-libs < %{version}
|
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
%description -n %{libname}
|
2017-07-07 15:14:29 +02:00
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but is also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
Lua combines procedural syntax (similar to Pascal) with
|
|
|
|
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 suitable for configuration,
|
|
|
|
scripting, and rapid prototyping. Lua is implemented as a small library
|
|
|
|
of C functions, written in ANSI C.
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentation for Lua, a small embeddable language
|
|
|
|
Group: Documentation/HTML
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
Lua is a programming language originally designed for extending
|
|
|
|
applications, but is also frequently used as a general-purpose,
|
|
|
|
stand-alone language.
|
|
|
|
|
|
|
|
Lua combines procedural syntax (similar to Pascal) with
|
|
|
|
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 suitable for configuration,
|
|
|
|
scripting, and rapid prototyping. Lua is implemented as a small library
|
|
|
|
of C functions, written in ANSI C.
|
|
|
|
|
|
|
|
%prep
|
2017-07-10 13:03:59 +02:00
|
|
|
%setup -q -n lua-%{version}
|
2017-07-07 15:41:38 +02:00
|
|
|
%autopatch -p1
|
2017-07-10 13:08:32 +02:00
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
# manpage
|
|
|
|
cat doc/lua.1 | sed 's/TH LUA 1/TH LUA5.3 1/' > doc/lua5.3.1
|
|
|
|
cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC5.3 1/' > doc/luac5.3.1
|
|
|
|
|
2017-07-07 15:14:29 +02:00
|
|
|
%build
|
|
|
|
sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h
|
2017-07-10 13:03:59 +02:00
|
|
|
export LIBTOOL="libtool --quiet"
|
2017-07-07 15:41:38 +02:00
|
|
|
make %{?_smp_mflags} -C src \
|
|
|
|
CC="cc" \
|
|
|
|
MYCFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE -fPIC -DLUA_USE_LINUX -DLUA_COMPAT_MODULE" \
|
|
|
|
MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" \
|
2017-07-10 13:03:59 +02:00
|
|
|
V=%{major_version} \
|
2017-07-07 15:41:38 +02:00
|
|
|
all
|
2017-07-07 15:14:29 +02:00
|
|
|
|
|
|
|
%install
|
2017-07-07 15:41:38 +02:00
|
|
|
make install \
|
2017-07-10 13:03:59 +02:00
|
|
|
V=%{major_version} \
|
2017-07-07 15:41:38 +02:00
|
|
|
INSTALL_TOP="%{buildroot}%{_prefix}" \
|
2017-07-10 13:03:59 +02:00
|
|
|
INSTALL_LIB="%{buildroot}%{_libdir}"
|
2017-07-07 15:14:29 +02:00
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
find %{buildroot} -type f -name "*.la" -delete -print
|
|
|
|
|
2017-07-07 15:14:29 +02:00
|
|
|
# create pkg-config file
|
2017-07-10 13:03:59 +02:00
|
|
|
cat > lua%{major_version}.pc <<-EOF
|
2017-07-07 15:14:29 +02:00
|
|
|
prefix=%{_prefix}
|
|
|
|
exec_prefix=%{_prefix}
|
|
|
|
libdir=%{_libdir}
|
2017-07-10 13:03:59 +02:00
|
|
|
includedir=%{_prefix}}/include%{major_version}
|
2017-07-07 15:14:29 +02:00
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
Name: Lua %{major_version}
|
2017-07-07 15:14:29 +02:00
|
|
|
Description: An Extensible Extension Language
|
|
|
|
Version: %{version}
|
2017-07-10 13:03:59 +02:00
|
|
|
Libs: -llua%{major_version} -lm
|
2017-07-07 15:14:29 +02:00
|
|
|
Cflags:
|
|
|
|
EOF
|
2017-07-10 13:03:59 +02:00
|
|
|
install -D -m 644 lua%{major_version}.pc %{buildroot}/%{_libdir}/pkgconfig/lua%{major_version}.pc
|
|
|
|
|
|
|
|
# update-alternatives
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
|
|
|
for file in lua luac ; do
|
|
|
|
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}"
|
|
|
|
ln -sf "%{_sysconfdir}/alternatives/${file}" "%{buildroot}%{_bindir}/${file}"
|
|
|
|
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1%{ext_man}"
|
|
|
|
ln -sf "%{_sysconfdir}/alternatives/${file}.1%{ext_man}" "%{buildroot}%{_mandir}/man1/${file}.1%{ext_man}"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Compat link with older unprefixed library and with soname 0 from deb/etc
|
|
|
|
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.%{major_version}
|
|
|
|
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.0
|
|
|
|
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua.so.%{major_version}
|
|
|
|
# Library devel alternatives
|
|
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/liblua.so
|
|
|
|
ln -sf %{_sysconfdir}/alternatives/liblua.so %{buildroot}%{_libdir}/liblua.so
|
|
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/lua.pc
|
|
|
|
ln -sf %{_sysconfdir}/alternatives/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
|
|
|
|
|
2017-07-07 15:14:29 +02:00
|
|
|
|
|
|
|
%check
|
|
|
|
cd src
|
2017-07-10 13:03:59 +02:00
|
|
|
LD_LIBRARY_PATH=`pwd` ./lua%{major_version} -e 'print(0)' > /dev/null
|
|
|
|
|
|
|
|
%post -n %{libname} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libname} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%post
|
|
|
|
%{_sbindir}/update-alternatives --install \
|
|
|
|
%{_bindir}/lua lua %{_bindir}/lua%{major_version} 53 \
|
|
|
|
--slave %{_bindir}/luac luac %{_bindir}/luac%{major_version} \
|
|
|
|
--slave %{_mandir}/man1/lua.1%{ext_man} lua.1%{ext_man} %{_mandir}/man1/lua%{major_version}.1%{ext_man} \
|
|
|
|
--slave %{_mandir}/man1/luac.1%{ext_man} luac.1%{ext_man} %{_mandir}/man1/luac%{major_version}.1%{ext_man}
|
|
|
|
|
|
|
|
%postun
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
%{_sbindir}/update-alternatives --remove lua %{_bindir}/lua%{major_version}
|
|
|
|
fi
|
2017-07-07 15:14:29 +02:00
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
%post devel
|
|
|
|
%{_sbindir}/update-alternatives --install \
|
|
|
|
%{_libdir}/liblua.so liblua.so %{_libdir}/liblua%{major_version}.so 53 \
|
|
|
|
--slave %{_libdir}/pkgconfig/lua.pc lua.pc %{_libdir}/pkgconfig/lua%{major_version}.pc
|
2017-07-07 15:14:29 +02:00
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
%postun devel
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
%{_sbindir}/update-alternatives --remove liblua.so %{_libdir}/liblua%{major_version}.so
|
|
|
|
fi
|
2017-07-07 15:14:29 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%doc README
|
|
|
|
%dir %{_libdir}/lua
|
|
|
|
%dir %{_libdir}/lua/%{major_version}
|
|
|
|
%dir %{_datadir}/lua
|
|
|
|
%dir %{_datadir}/lua/%{major_version}
|
|
|
|
%{_bindir}/lua%{major_version}
|
|
|
|
%{_bindir}/luac%{major_version}
|
2017-07-10 13:03:59 +02:00
|
|
|
%{_mandir}/man1/lua%{major_version}.1%{ext_man}
|
|
|
|
%{_mandir}/man1/luac%{major_version}.1%{ext_man}
|
|
|
|
# alternatives
|
|
|
|
%{_bindir}/lua
|
|
|
|
%{_bindir}/luac
|
|
|
|
%{_mandir}/man1/lua.1%{ext_man}
|
|
|
|
%{_mandir}/man1/luac.1%{ext_man}
|
2017-07-07 15:14:29 +02:00
|
|
|
%ghost %{_sysconfdir}/alternatives/lua
|
|
|
|
%ghost %{_sysconfdir}/alternatives/luac
|
2017-07-10 13:03:59 +02:00
|
|
|
%ghost %{_sysconfdir}/alternatives/lua.1%{ext_man}
|
|
|
|
%ghost %{_sysconfdir}/alternatives/luac.1%{ext_man}
|
2017-07-07 15:14:29 +02:00
|
|
|
|
2017-07-10 13:03:59 +02:00
|
|
|
%files -n %{libname}
|
|
|
|
%{_libdir}/liblua%{major_version}.so.*
|
|
|
|
%{_libdir}/liblua.so.*
|
2017-07-07 15:14:29 +02:00
|
|
|
|
|
|
|
%files devel
|
2017-07-10 13:03:59 +02:00
|
|
|
%dir %{_includedir}/lua%{major_version}
|
|
|
|
%{_includedir}/lua%{major_version}/lauxlib.h
|
|
|
|
%{_includedir}/lua%{major_version}/lua.h
|
|
|
|
%{_includedir}/lua%{major_version}/lua.hpp
|
|
|
|
%{_includedir}/lua%{major_version}/luaconf.h
|
|
|
|
%{_includedir}/lua%{major_version}/lualib.h
|
|
|
|
%{_libdir}/liblua%{major_version}.a
|
|
|
|
%{_libdir}/liblua%{major_version}.so
|
|
|
|
%{_libdir}/pkgconfig/lua%{major_version}.pc
|
|
|
|
# alternatives
|
2017-07-07 15:14:29 +02:00
|
|
|
%{_libdir}/liblua.so
|
|
|
|
%{_libdir}/pkgconfig/lua.pc
|
2017-07-10 13:03:59 +02:00
|
|
|
%ghost %{_sysconfdir}/alternatives/liblua.so
|
|
|
|
%ghost %{_sysconfdir}/alternatives/lua.pc
|
2017-07-07 15:14:29 +02:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%doc doc/*
|
|
|
|
|
|
|
|
%changelog
|