|
@@ -1,26 +1,69 @@
|
|
|
-%define name lua
|
|
|
-%define version 5.1.4
|
|
|
-%define release 8%{?_dist_release}
|
|
|
-
|
|
|
-Summary: Lua is a powerful, light-weight programming language designed for extending applications.
|
|
|
-Summary(ja): アプリケーション拡張向けに設計された強力かつ軽量なプログラミング言語
|
|
|
-Name: %{name}
|
|
|
-Version: %{version}
|
|
|
-Release: %{release}
|
|
|
-
|
|
|
-License: MIT
|
|
|
-Group: Development/Languages
|
|
|
-URL: http://www.lua.org/
|
|
|
-
|
|
|
-Source0: http://www.lua.org/ftp/%{name}-%{version}.tar.gz
|
|
|
-Patch0: lua-5.1.4-autotoolize.patch
|
|
|
-
|
|
|
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
-BuildRequires: readline-devel
|
|
|
-BuildRequires: ncurses-devel
|
|
|
-# apt-get remove readline-devel
|
|
|
-
|
|
|
-Provides: lua = 5.1
|
|
|
+# No tests yet for 5.3.5
|
|
|
+%global test_version 5.4.0
|
|
|
+# If you are incrementing major_version, enable bootstrapping and adjust accordingly.
|
|
|
+# Version should be the latest prior build. If you don't do this, RPM will break and
|
|
|
+# everything will grind to a halt.
|
|
|
+%global bootstrap 1
|
|
|
+%global bootstrap_major_version 5.3
|
|
|
+%global bootstrap_version %{bootstrap_major_version}.5
|
|
|
+
|
|
|
+# Place rpm-macros into proper location.
|
|
|
+%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
|
|
|
+
|
|
|
+Summary: Lua is a powerful, light-weight programming language designed for extending applications.
|
|
|
+Summary(ja): アプリケーション拡張向けに設計された強力かつ軽量なプログラミング言語
|
|
|
+Name: lua
|
|
|
+Version: 5.4.0
|
|
|
+Release: 1%{?_dist_release}
|
|
|
+Group: programming
|
|
|
+Vendor: Project Vine
|
|
|
+Distribution: Vine Linux
|
|
|
+
|
|
|
+License: MIT
|
|
|
+URL: https://www.lua.org/
|
|
|
+Source0: https://www.lua.org/ftp/%{name}-%{version}.tar.gz
|
|
|
+# copied from doc/readme.html on 2014-07-18
|
|
|
+Source1: mit.txt
|
|
|
+%if 0%{?bootstrap}
|
|
|
+Source2: http://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz
|
|
|
+%endif
|
|
|
+Source3: http://www.lua.org/tests/lua-%{test_version}-tests.tar.gz
|
|
|
+# multilib
|
|
|
+Source4: luaconf.h
|
|
|
+# rpm-macro
|
|
|
+Source1000: macros.lua
|
|
|
+# rpm-generator
|
|
|
+Source1001: lua.attr
|
|
|
+Patch0: %{name}-5.4.0-beta-autotoolize.patch
|
|
|
+Patch1: %{name}-5.3.0-idsize.patch
|
|
|
+#Patch2: %%{name}-5.3.0-luac-shared-link-fix.patch
|
|
|
+Patch3: %{name}-5.2.2-configure-linux.patch
|
|
|
+Patch4: %{name}-5.3.0-configure-compat-module.patch
|
|
|
+%if 0%{?bootstrap}
|
|
|
+Patch5: %{name}-5.3.0-autotoolize.patch
|
|
|
+Patch6: %{name}-5.3.5-luac-shared-link-fix.patch
|
|
|
+%endif
|
|
|
+Patch7: %{name}-5.4.0-CVE-2020-15889.patch
|
|
|
+Patch8: %{name}-5.4.0-CVE-2020-15945.patch
|
|
|
+# https://www.lua.org/bugs.html
|
|
|
+# Bug 1 is CVE-2020-15889
|
|
|
+Patch9: %{name}-5.4.0-bug2.patch
|
|
|
+Patch10: %{name}-5.4.0-bug3.patch
|
|
|
+Patch11: %{name}-5.4.0-bug4.patch
|
|
|
+Patch12: %{name}-5.4.0-bug5.patch
|
|
|
+Patch13: %{name}-5.4.0-bug6.patch
|
|
|
+Patch14: %{name}-5.4.0-bug7.patch
|
|
|
+Patch15: %{name}-5.4.0-bug8.patch
|
|
|
+
|
|
|
+Patch1000: CVE-2020-24342.patch
|
|
|
+
|
|
|
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
+BuildRequires: readline-devel
|
|
|
+BuildRequires: ncurses-devel
|
|
|
+
|
|
|
+Requires: lua-libs = %{version}-%{release}
|
|
|
+# Normally, this is the same as version, but... not always.
|
|
|
+%global major_version %(echo %{version} | cut -d . -f1,2)
|
|
|
|
|
|
%description
|
|
|
Lua is an extension programming language designed to support
|
|
@@ -42,71 +85,184 @@ Lua は、コンフィギュレーションが必要なあらゆるプログラ
|
|
|
Lua は、クリーンな C (つまり、ANSI C と C++ の共通のサブセット) で
|
|
|
書かれたライブラリとして実装されています。
|
|
|
|
|
|
-%package devel
|
|
|
-Summary: Libraries and include files for Lua.
|
|
|
-Summary(ja): Lua の開発用ファイル
|
|
|
-Group: Development/Libraries
|
|
|
-Requires: %{name} = %{version}-%{release}
|
|
|
-Requires: ncurses-devel
|
|
|
-Requires: pkgconfig
|
|
|
+
|
|
|
+%package libs
|
|
|
+Summary: Libraries for %{name}
|
|
|
+Summary(ja): Lua の共有ライブラリ
|
|
|
+Provides: lua(abi) = %{major_version}
|
|
|
+
|
|
|
+%description libs
|
|
|
+This package contains the shared libraries for %{name}.
|
|
|
+
|
|
|
+
|
|
|
+%package devel
|
|
|
+Summary: Libraries and include files for Lua.
|
|
|
+Summary(ja): Lua の開発用ファイル
|
|
|
+Group: programming
|
|
|
+Requires: %{name} = %{version}-%{release}
|
|
|
+Requires: ncurses-devel
|
|
|
+Requires: pkgconfig
|
|
|
|
|
|
%description devel
|
|
|
Libraries and include files for Lua.
|
|
|
|
|
|
-%package static
|
|
|
-Summary: Static library for Lua
|
|
|
-Summary(ja): Lua の静的ライブラリ
|
|
|
-Group: Development/Libraries
|
|
|
-Requires: %{name}-devel = %{version}-%{release}
|
|
|
+
|
|
|
+%package static
|
|
|
+Summary: Static library for Lua
|
|
|
+Summary(ja): Lua の静的ライブラリ
|
|
|
+Group: programming
|
|
|
+Requires: %{name}-devel = %{version}-%{release}
|
|
|
|
|
|
%description static
|
|
|
This package contains the static version of liblua for %{name}.
|
|
|
|
|
|
|
|
|
%prep
|
|
|
-%setup -q
|
|
|
-%patch0 -p1 -E
|
|
|
-# fix perms on auto files
|
|
|
-chmod u+x \
|
|
|
- autogen.sh config.guess config.sub configure depcomp install-sh missing
|
|
|
+%if 0%{?bootstrap}
|
|
|
+%setup -q -a 2 -a 3 -n %{name}-%{version}
|
|
|
+%else
|
|
|
+%setup -q -a 3
|
|
|
+%endif
|
|
|
+cp %{SOURCE1} .
|
|
|
+mv src/luaconf.h src/luaconf.h.template.in
|
|
|
+%patch0 -p1 -E -z .autoxxx
|
|
|
+%patch1 -p1 -z .idsize
|
|
|
+#%% patch2 -p1 -z .luac-shared
|
|
|
+%patch3 -p1 -z .configure-linux
|
|
|
+%patch4 -p1 -z .configure-compat-all
|
|
|
+%patch7 -p1 -b .CVE-2020-15889
|
|
|
+%patch8 -p1 -b .CVE-2020-15945
|
|
|
+%patch9 -p1 -b .bug2
|
|
|
+%patch10 -p1 -b .bug3
|
|
|
+%patch11 -p1 -b .bug4
|
|
|
+%patch12 -p1 -b .bug5
|
|
|
+%patch13 -p1 -b .bug6
|
|
|
+%patch14 -p1 -b .bug7
|
|
|
+%patch15 -p1 -b .bug8
|
|
|
+pushd src
|
|
|
+%patch1000 -p1 -b .CVE-2020-24342
|
|
|
+popd
|
|
|
+
|
|
|
+# Put proper version in configure.ac, patch0 hardcodes 5.3.0
|
|
|
+sed -i 's|5.3.0|%{version}|g' configure.ac
|
|
|
+autoreconf -ifv
|
|
|
+
|
|
|
+%if 0%{?bootstrap}
|
|
|
+cd lua-%{bootstrap_version}/
|
|
|
+mv src/luaconf.h src/luaconf.h.template.in
|
|
|
+%patch5 -p1 -b .autoxxx
|
|
|
+%patch1 -p1 -b .idsize
|
|
|
+%patch3 -p1 -z .configure-linux
|
|
|
+%patch4 -p1 -z .configure-compat-all
|
|
|
+%patch6 -p1 -b .luac-shared-link-fix
|
|
|
+autoreconf -i
|
|
|
+cd ..
|
|
|
+%endif
|
|
|
+
|
|
|
|
|
|
%build
|
|
|
-%configure --with-readline
|
|
|
+%configure --with-readline --with-compat-module
|
|
|
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
|
|
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
|
|
+# Autotools give me a headache sometimes.
|
|
|
+sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
|
|
|
+
|
|
|
+# hack so that only /usr/bin/lua gets linked with readline as it is the
|
|
|
+# only one which needs this and otherwise we get License troubles
|
|
|
+make %{?_smp_mflags} LIBS="-lm -ldl"
|
|
|
+# only /usr/bin/lua links with readline now #luac_LDADD="liblua.la -lm -ldl"
|
|
|
+
|
|
|
+%if 0%{?bootstrap}
|
|
|
+pushd lua-%{bootstrap_version}
|
|
|
+%configure --with-readline --with-compat-module
|
|
|
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
|
|
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
|
|
+# Autotools give me a headache sometimes.
|
|
|
+sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
|
|
|
+
|
|
|
# hack so that only /usr/bin/lua gets linked with readline as it is the
|
|
|
# only one which needs this and otherwise we get License troubles
|
|
|
make %{?_smp_mflags} LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl"
|
|
|
-# also remove readline from lua.pc
|
|
|
-sed -i 's/-lreadline -lncurses //g' etc/lua.pc
|
|
|
+popd
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
%install
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT
|
|
|
-rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
|
|
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/5.1
|
|
|
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/5.1
|
|
|
+rm $RPM_BUILD_ROOT%{_libdir}/*.la
|
|
|
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{major_version}
|
|
|
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version}
|
|
|
+
|
|
|
+# Rename luaconf.h to luaconf-<arch>.h to avoid file conflicts on
|
|
|
+# multilib systems and install luaconf.h wrapper
|
|
|
+mv %{buildroot}%{_includedir}/luaconf.h %{buildroot}%{_includedir}/luaconf-%{_arch}.h
|
|
|
+install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/luaconf.h
|
|
|
+
|
|
|
+%if 0%{?bootstrap}
|
|
|
+pushd lua-%{bootstrap_version}
|
|
|
+mkdir $RPM_BUILD_ROOT/installdir
|
|
|
+make install DESTDIR=$RPM_BUILD_ROOT/installdir
|
|
|
+cp -a $RPM_BUILD_ROOT/installdir/%{_libdir}/liblua-%{bootstrap_major_version}.so $RPM_BUILD_ROOT%{_libdir}/
|
|
|
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{bootstrap_major_version}
|
|
|
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{bootstrap_major_version}
|
|
|
+rm -rf $RPM_BUILD_ROOT/installdir
|
|
|
+popd
|
|
|
+%endif
|
|
|
+
|
|
|
+# Install rpm-macro and requires generator
|
|
|
+install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
|
|
|
+install -Dpm 0644 %{SOURCE1001} $RPM_BUILD_ROOT/%{_fileattrsdir}/lua.attr
|
|
|
+
|
|
|
+
|
|
|
+%check
|
|
|
+cd ./lua-%{test_version}-tests/
|
|
|
+
|
|
|
+# Dont skip the fully portable or ram-hungry tests:
|
|
|
+# sed -i.orig -e '
|
|
|
+# /attrib.lua/d;
|
|
|
+# /files.lua/d;
|
|
|
+# /db.lua/d;
|
|
|
+# /errors.lua/d;
|
|
|
+# ' all.lua
|
|
|
+# LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua all.lua
|
|
|
+# Removing tests that fail under mock/koji
|
|
|
+sed -i.orig -e '
|
|
|
+ /db.lua/d;
|
|
|
+ /errors.lua/d;
|
|
|
+ ' all.lua
|
|
|
+LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua -e"_U=true" all.lua
|
|
|
|
|
|
|
|
|
%clean
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
-%post -p /sbin/ldconfig
|
|
|
|
|
|
+%post -p /sbin/ldconfig
|
|
|
%postun -p /sbin/ldconfig
|
|
|
|
|
|
|
|
|
%files
|
|
|
%defattr(-,root,root,-)
|
|
|
-%doc COPYRIGHT HISTORY README doc/*.html doc/*.gif
|
|
|
-%{_bindir}/lua*
|
|
|
-%{_libdir}/liblua-*.so
|
|
|
+%{!?_licensedir:%global license %%doc}
|
|
|
+%license mit.txt
|
|
|
+%doc README doc/*.html doc/*.css doc/*.gif doc/*.png
|
|
|
+%{_bindir}/lua
|
|
|
+%{_bindir}/luac
|
|
|
%{_mandir}/man1/lua*.1*
|
|
|
+
|
|
|
+%files libs
|
|
|
%dir %{_libdir}/lua
|
|
|
-%dir %{_libdir}/lua/5.1
|
|
|
+%dir %{_libdir}/lua/%{major_version}
|
|
|
+%{_libdir}/liblua-%{major_version}.so
|
|
|
%dir %{_datadir}/lua
|
|
|
-%dir %{_datadir}/lua/5.1
|
|
|
+%dir %{_datadir}/lua/%{major_version}
|
|
|
+
|
|
|
+%if 0%{?bootstrap}
|
|
|
+%dir %{_libdir}/lua/%{bootstrap_major_version}
|
|
|
+%{_libdir}/liblua-%{bootstrap_major_version}.so
|
|
|
+%dir %{_datadir}/lua/%{bootstrap_major_version}
|
|
|
+%endif
|
|
|
|
|
|
%files devel
|
|
|
%defattr(-,root,root,-)
|
|
@@ -114,6 +270,9 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
%{_includedir}/l*.hpp
|
|
|
%{_libdir}/liblua.so
|
|
|
%{_libdir}/pkgconfig/*.pc
|
|
|
+%dir %{macrosdir}
|
|
|
+%{macrosdir}/macros.lua
|
|
|
+%{_fileattrsdir}/lua.attr
|
|
|
|
|
|
%files static
|
|
|
%defattr(-,root,root,-)
|
|
@@ -121,6 +280,9 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Fri Aug 21 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.4.0-1
|
|
|
+- new upstream release.
|
|
|
+
|
|
|
* Sat Aug 31 2019 Toshiaki Ara <ara_t@384.jp> 5.1.4-8
|
|
|
- rebuild with readline-8.0 and ncurses-6.1
|
|
|
|