summaryrefslogtreecommitdiffstats
path: root/lua.spec
diff options
context:
space:
mode:
Diffstat (limited to 'lua.spec')
-rw-r--r--lua.spec81
1 files changed, 70 insertions, 11 deletions
diff --git a/lua.spec b/lua.spec
index 644d720..d526747 100644
--- a/lua.spec
+++ b/lua.spec
@@ -1,7 +1,14 @@
-%global major_version 5.2
+%global major_version 5.3
+# 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.2
+%global bootstrap_version %{bootstrap_major_version}.3
+
Name: lua
-Version: %{major_version}.3
+Version: %{major_version}.0
Release: 1%{?dist}
Summary: Powerful light-weight programming language
Group: Development/Languages
@@ -10,13 +17,21 @@ URL: http://www.lua.org/
Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz
# copied from doc/readme.html on 2014-07-18
Source1: mit.txt
-Patch0: %{name}-5.2.2-autotoolize.patch
-Patch1: %{name}-5.2.2-idsize.patch
-Patch2: %{name}-5.2.2-luac-shared-link-fix.patch
+%if 0%{?bootstrap}
+Source2: http://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz
+%endif
+Patch0: %{name}-5.3.0-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.2.2-configure-compat-module.patch
-# http://www.lua.org/bugs.html
-Patch5: lua-5.2.3-ephemeronfix.patch
+Patch4: %{name}-5.3.0-configure-compat-module.patch
+%if 0%{?bootstrap}
+Patch5: %{name}-5.2.3-autotoolize.patch
+Patch6: %{name}-5.2.2-idsize.patch
+Patch7: %{name}-5.2.2-luac-shared-link-fix.patch
+Patch8: %{name}-5.2.2-configure-compat-module.patch
+%endif
+
BuildRequires: automake autoconf libtool readline-devel ncurses-devel
Provides: lua(abi) = %{major_version}
@@ -49,7 +64,7 @@ This package contains the static version of liblua for %{name}.
%prep
-%setup -q
+%setup -q -a 2
cp %{SOURCE1} .
mv src/luaconf.h src/luaconf.h.template.in
%patch0 -p1 -E -z .autoxxx
@@ -57,9 +72,20 @@ mv src/luaconf.h src/luaconf.h.template.in
%patch2 -p1 -z .luac-shared
%patch3 -p1 -z .configure-linux
%patch4 -p1 -z .configure-compat-all
-%patch5 -p1 -b .ephemeronfix
autoreconf -i
+%if 0%{?bootstrap}
+cd lua-%{bootstrap_version}/
+mv src/luaconf.h src/luaconf.h.template.in
+%patch5 -p1 -b .autoxxx
+%patch6 -p1 -b .idsize
+%patch7 -p1 -b .luac-shared
+%patch3 -p1 -z .configure-linux
+%patch8 -p1 -z .configure-compat-all
+autoreconf -i
+cd ..
+%endif
+
%build
%configure --with-readline --with-compat-module
@@ -72,6 +98,19 @@ sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
# only one which needs this and otherwise we get License troubles
make %{?_smp_mflags} LIBS="-lm -ldl" 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"
+popd
+%endif
%install
make install DESTDIR=$RPM_BUILD_ROOT
@@ -79,14 +118,30 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{major_version}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version}
+%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
%files
%{!?_licensedir:%global license %%doc}
%license mit.txt
+
%doc README doc/*.html doc/*.css doc/*.gif doc/*.png
%{_bindir}/lua
%{_bindir}/luac
-%{_libdir}/liblua-5.2.so
+%{_libdir}/liblua-%{major_version}.so
+%if 0%{?bootstrap}
+%{_libdir}/liblua-%{bootstrap_major_version}.so
+%dir %{_libdir}/lua/%{bootstrap_major_version}
+%dir %{_datadir}/lua/%{bootstrap_major_version}
+%endif
%{_mandir}/man1/lua*.1*
%dir %{_libdir}/lua
%dir %{_libdir}/lua/%{major_version}
@@ -104,6 +159,10 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version}
%changelog
+* Thu Jan 15 2015 Tom Callaway <spot@fedoraproject.org> - 5.3.0-1
+- update to 5.3.0
+- add bootstrapping glue
+
* Wed Dec 10 2014 Tom Callaway <spot@fedoraproject.org> - 5.2.3-1
- update to 5.2.3