SHA256
1
0
forked from pool/lua53

- Add patch lua-build-system.patch for all the builsystem changes

- Drop patches merged to the above:
  * lua-5.3.3-prefix.patch
  * lua-5.3.3-shared.patch
- Drop not really needed lua-5.3.3-visible.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua53?expand=0&rev=5
This commit is contained in:
Tomáš Chvátal
2017-07-07 13:41:38 +00:00
committed by Git OBS Bridge
parent 9cb944279a
commit 0b47406e81
6 changed files with 184 additions and 178 deletions

View File

@@ -17,7 +17,7 @@
%define major_version 5.3
%define libsuf 5_3
%define libname liblua5_3
Name: lua
Version: 5.3.4
Release: 0
@@ -28,21 +28,11 @@ Url: http://www.lua.org
Source: http://www.lua.org/ftp/lua-%{version}.tar.gz
Source1: macros.lua
Source2: baselibs.conf
# PATCH-FIX-UPSTREAM change prefix to /usr/
Patch: lua-5.3.3-prefix.patch
# PATCH-FIX-UPSTREAM shared library support
Patch1: lua-5.3.3-shared.patch
# PATCH-FIX-UPSTREAM make luaU_dump, luaP_opmodes and luaP_opnames visible
# to luac
Patch2: lua-5.3.3-visible.patch
# PATCH-FIX-SUSE tweak the buildsystem to produce what is needed for SUSE
Patch0: lua-build-system.patch
BuildRequires: pkg-config
BuildRequires: readline-devel
BuildRequires: update-alternatives
Requires(pre): update-alternatives
# As other packages install files into /usr/share/lua/lua_version, they ought to require lua = lua_version (which is only major_version)
# in order to facilitate this, we provide the corresponding symbol here.
Provides: Lua(API) = %{major_version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Lua is a programming language originally designed for extending
@@ -60,7 +50,7 @@ of C functions, written in ANSI C.
Summary: Development files for lua
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: liblua%{libsuf} = %{version}
Requires: %libname = %{version}
Provides: Lua(devel) = %{major_version}
Conflicts: otherproviders(Lua(devel))
@@ -72,13 +62,13 @@ stand-alone language.
This package contains files needed for embedding lua into your
application.
%package -n liblua%{libsuf}
%package -n %libname
Summary: The Lua integration library
Group: System/Libraries
Provides: %{name}-libs = %{version}
Obsoletes: %{name}-libs < %{version}
%description -n liblua%{libsuf}
%description -n %libname
Lua is a programming language originally designed for extending
applications, but is also frequently used as a general-purpose,
stand-alone language.
@@ -93,9 +83,7 @@ of C functions, written in ANSI C.
%package doc
Summary: Documentation for Lua, a small embeddable language
Group: Documentation/HTML
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description doc
Lua is a programming language originally designed for extending
@@ -111,26 +99,23 @@ of C functions, written in ANSI C.
%prep
%setup -q
%patch -p1
%patch1 -p1
%patch2 -p1
%autopatch -p1
%build
sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h
make %{?_smp_mflags} -C src CC="gcc" MYCFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE -fPIC -DLUA_USE_LINUX -DLUA_COMPAT_MODULE" MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" V=%{major_version} all
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" \
V=%{major_version}
all
%install
make install INSTALL_TOP="%{buildroot}%{_prefix}" INSTALL_LIB="%{buildroot}%{_libdir}" INSTALL_CMOD=%{buildroot}%{_libdir}/lua/%{major_version} INSTALL_MAN="%{buildroot}%{_mandir}/man1"
# update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for file in lua luac ; do
mv "%{buildroot}%{_bindir}/${file}" "%{buildroot}%{_bindir}/${file}%{major_version}"
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}"
ln -sf "%{_sysconfdir}/alternatives/${file}" "%{buildroot}%{_bindir}/${file}"
mv "%{buildroot}%{_mandir}/man1/${file}.1" "%{buildroot}%{_mandir}/man1/${file}%{major_version}.1"
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1.gz"
ln -sf "%{_sysconfdir}/alternatives/${file}.1.gz" "%{buildroot}%{_mandir}/man1/${file}.1.gz"
done
make install \
INSTALL_TOP="%{buildroot}%{_prefix}" \
INSTALL_LIB="%{buildroot}%{_libdir}" \
INSTALL_CMOD=%{buildroot}%{_libdir}/lua/%{major_version} \
INSTALL_MAN="%{buildroot}%{_mandir}/man1"
install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.lua
# create pkg-config file
@@ -152,21 +137,9 @@ install -D -m 644 lua.pc %{buildroot}/%{_libdir}/pkgconfig/lua.pc
cd src
LD_LIBRARY_PATH=`pwd` ./lua -e 'print(0)' > /dev/null
%post
%{_sbindir}/update-alternatives --install \
%{_bindir}/lua lua %{_bindir}/lua%{major_version} 15 \
--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
%post -n %libname -p /sbin/ldconfig
%preun
if [ "$1" = 0 ] ; then
%{_sbindir}/update-alternatives --remove lua %{_bindir}/lua%{major_version}
fi
%post -n liblua%{libsuf} -p /sbin/ldconfig
%postun -n liblua%{libsuf} -p /sbin/ldconfig
%postun -n %libname -p /sbin/ldconfig
%files
%defattr(-,root,root)
@@ -179,16 +152,12 @@ fi
%{_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
%files -n liblua%{libsuf}
%files -n %libname
%defattr(-,root,root)
%{_libdir}/liblua.so.%{major_version}