summaryrefslogtreecommitdiffstats
path: root/lua.spec
diff options
context:
space:
mode:
authorTom Callaway <spot@fedoraproject.org>2013-05-14 16:40:40 -0400
committerTom Callaway <spot@fedoraproject.org>2013-05-14 16:40:40 -0400
commit44f7aeefd6bcd5cee9e83fb10b16d84b2c5bc771 (patch)
treebffa98c2985193401f855382961906911ad87d29 /lua.spec
parent8e864b6dbb289d92c00b00b0770ffc4f60b5fc82 (diff)
downloadlua-44f7aeefd6bcd5cee9e83fb10b16d84b2c5bc771.tar.gz
lua-44f7aeefd6bcd5cee9e83fb10b16d84b2c5bc771.tar.xz
lua-44f7aeefd6bcd5cee9e83fb10b16d84b2c5bc771.zip
lua 5.2
Diffstat (limited to 'lua.spec')
-rw-r--r--lua.spec112
1 files changed, 83 insertions, 29 deletions
diff --git a/lua.spec b/lua.spec
index c5961a8..693e571 100644
--- a/lua.spec
+++ b/lua.spec
@@ -1,19 +1,29 @@
+%global legacy_major_version 5.1
+%global legacy_version %{legacy_major_version}.4
+%global major_version 5.2
+
Name: lua
-Version: 5.1.4
-Release: 12%{?dist}
+Version: %{major_version}.2
+Release: 1%{?dist}
Summary: Powerful light-weight programming language
Group: Development/Languages
License: MIT
URL: http://www.lua.org/
Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz
-Patch0: lua-5.1.4-autotoolize.patch
-Patch1: lua-5.1.4-lunatic.patch
-Patch2: lua-5.1.4-idsize.patch
-Patch3: lua-5.1.4-2.patch
+Source1: http://www.lua.org/ftp/lua-%{legacy_version}.tar.gz
+Patch0: %{name}-%{version}-autotoolize.patch
+Patch1: %{name}-%{version}-idsize.patch
+Patch2: %{name}-%{version}-luac-shared-link-fix.patch
+Patch3: %{name}-%{version}-configure-compat-module.patch
+Patch4: %{name}-%{version}-configure-linux.patch
+# Legacy patches for compat-lua-libs
+Patch10: lua-5.1.4-autotoolize.patch
+Patch11: lua-5.1.4-lunatic.patch
+Patch12: lua-5.1.4-idsize.patch
+Patch13: lua-5.1.4-2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: readline-devel ncurses-devel
-Provides: lua = 5.1
-Provides: lua(abi) = 5.1
+BuildRequires: automake autoconf libtool readline-devel ncurses-devel
+Provides: lua(abi) = %{major_version}
%description
Lua is a powerful light-weight programming language designed for
@@ -25,11 +35,10 @@ is dynamically typed, interpreted from bytecodes, and has automatic
memory management with garbage collection, making it ideal for
configuration, scripting, and rapid prototyping.
-
%package devel
Summary: Development files for %{name}
Group: System Environment/Libraries
-Requires: %{name} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
@@ -38,56 +47,89 @@ This package contains development files for %{name}.
%package static
Summary: Static library for %{name}
Group: System Environment/Libraries
-Requires: %{name} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
%description static
This package contains the static version of liblua for %{name}.
+%package -n compat-lua-libs
+Version: %{legacy_version}
+Summary: Powerful light-weight programming language (compat version)
+Provides: lua(abi) = %{legacy_version}
+Provides: lua = %{legacy_version}
+
+%description -n compat-lua-libs
+This package contains a compatibility version of lua (%{legacy_version}).
%prep
-%setup -q
+%setup -q -a 1
+mv src/luaconf.h src/luaconf.h.template.in
%patch0 -p1 -E -z .autoxxx
-%patch1 -p0 -z .lunatic
-%patch2 -p1 -z .idsize
-%patch3 -p0 -d src -z .bugfix2
+%patch1 -p1 -z .idsize
+%patch2 -p1 -z .luac-shared
+%patch3 -p1 -z .compat-module
+%patch4 -p1 -z .configure-linux
+autoreconf -i
+
+# legacy
+pushd lua-%{legacy_version}
+%patch10 -p1 -E -z .legacy-autoxxx
+%patch11 -p0 -z .legacy-lunatic
+%patch12 -p1 -z .legacy-idsize
+%patch13 -p0 -d src -z .legacy-bugfix2
# fix perms on auto files
chmod u+x autogen.sh config.guess config.sub configure depcomp install-sh missing
-
+popd
%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" luac_LDADD="liblua.la -lm -ldl"
-# also remove readline from lua.pc
-sed -i 's/-lreadline -lncurses //g' etc/lua.pc
+# legacy
+pushd lua-%{legacy_version}
+%configure --with-readline
+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
+# 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
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/*.la
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/5.1
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/5.1
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{major_version}
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version}
+# legacy
+pushd lua-%{legacy_version}
+cp -a ./src/.libs/liblua-%{legacy_major_version}.so $RPM_BUILD_ROOT%{_libdir}/
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{legacy_major_version}
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{legacy_major_version}
+popd
%clean
rm -rf $RPM_BUILD_ROOT
-
%files
%defattr(-,root,root,-)
-%doc COPYRIGHT HISTORY README doc/*.html doc/*.css doc/*.gif doc/*.png
-%{_bindir}/lua*
-%{_libdir}/liblua-*.so
+%doc README doc/*.html doc/*.css doc/*.gif doc/*.png
+%{_bindir}/lua
+%{_bindir}/luac
+%{_libdir}/liblua-5.2.so
%{_mandir}/man1/lua*.1*
%dir %{_libdir}/lua
-%dir %{_libdir}/lua/5.1
+%dir %{_libdir}/lua/%{major_version}
%dir %{_datadir}/lua
-%dir %{_datadir}/lua/5.1
-
+%dir %{_datadir}/lua/%{major_version}
%files devel
%defattr(-,root,root,-)
@@ -100,7 +142,19 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%{_libdir}/*.a
+%files -n compat-lua-libs
+%doc lua-%{legacy_version}/README
+%{_libdir}/liblua-5.1.so
+%dir %{_libdir}/lua
+%dir %{_libdir}/lua/%{legacy_major_version}
+%dir %{_datadir}/lua
+%dir %{_datadir}/lua/%{legacy_major_version}
+
%changelog
+* Thu Apr 11 2013 Tom Callaway <spot@fedoraproject.org> - 5.2.2-1
+- update to 5.2.2
+- incorporate Aaron Faanes's changes
+
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.4-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild