[packages/lua52] - added default_lua bcond (to symlink bin/lib/includes/.pc to lua without suffix) - release 1

qboosh qboosh at pld-linux.org
Sat Sep 15 12:19:44 CEST 2012


commit 15193a2835c51a08563595be3dbd87e46b72874b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Sep 15 12:20:28 2012 +0200

    - added default_lua bcond (to symlink bin/lib/includes/.pc to lua without suffix)
    - release 1

 lua52.spec | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 56 insertions(+), 9 deletions(-)
---
diff --git a/lua52.spec b/lua52.spec
index 747b7e6..53720e7 100644
--- a/lua52.spec
+++ b/lua52.spec
@@ -1,12 +1,13 @@
 #
 # Conditional build:
-%bcond_with	luastatic        # build dietlibc-based static lua version (broken)
-
+%bcond_with	luastatic	# build dietlibc-based static lua version (broken)
+%bcond_with	default_lua	# build as default lua (symlinks to nil suffix)
+#
 Summary:	A simple lightweight powerful embeddable programming language
 Summary(pl.UTF-8):	Prosty, lekki ale potężny, osadzalny język programowania
 Name:		lua52
 Version:	5.2.1
-Release:	0.1
+Release:	1
 License:	MIT
 Group:		Development/Languages
 Source0:	http://www.lua.org/ftp/lua-%{version}.tar.gz
@@ -17,9 +18,10 @@ URL:		http://www.lua.org/
 BuildRequires:	readline-devel
 BuildRequires:	sed >= 4.0
 Requires:	%{name}-libs = %{version}-%{release}
+%if %{with default_lua}
 Provides:	lua = %{version}
-Obsoletes:	lua < 4.0.1
-Obsoletes:	lua51
+Obsoletes:	lua < %{version}
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -62,7 +64,10 @@ Summary:	Header files for Lua
 Summary(pl.UTF-8):	Pliki nagłówkowe dla Lua
 Group:		Development/Languages
 Requires:	%{name}-libs = %{version}-%{release}
+%if %{with default_lua}
 Provides:	lua-devel = %{version}
+Obsoletes:	lua-devel < %{version}
+%endif
 
 %description devel
 Header files needed to embed Lua in C/C++ programs and docs for the
@@ -77,7 +82,10 @@ Summary:	Static Lua libraries
 Summary(pl.UTF-8):	Biblioteki statyczne Lua
 Group:		Development/Languages
 Requires:	%{name}-devel = %{version}-%{release}
+%if %{with default_lua}
 Provides:	lua-static = %{version}
+Obsoletes:	lua-static < %{version}
+%endif
 
 %description static
 Static Lua libraries.
@@ -89,6 +97,10 @@ Biblioteki statyczne Lua.
 Summary:	Static Lua interpreter
 Summary(pl.UTF-8):	Statycznie skonsolidowany interpreter lua
 Group:		Development/Languages
+%if %{with default_lua}
+Provides:	lua-luastatic = %{version}
+Obsoletes:	lua-luastatic < %{version}
+%endif
 
 %description luastatic
 Static lua interpreter.
@@ -130,18 +142,28 @@ install -d $RPM_BUILD_ROOT%{_libdir}/lua}
 	INSTALL_MAN=$RPM_BUILD_ROOT%{_mandir}/man1 \
 	INSTALL_CMOD=$RPM_BUILD_ROOT%{_libdir}/lua/5.2
 
-# change name from lua to lua52
-for i in $RPM_BUILD_ROOT%{_bindir}/* ; do mv ${i}{,5.2} ; done
-mv $RPM_BUILD_ROOT%{_mandir}/man1/lua{,5.2}.1
-mv $RPM_BUILD_ROOT%{_mandir}/man1/luac{,5.2}.1
+# change name from lua to lua5.2
+for f in lua luac ; do
+	mv -f $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}5.2
+	mv -f $RPM_BUILD_ROOT%{_mandir}/man1/${f}.1 $RPM_BUILD_ROOT%{_mandir}/man1/${f}5.2.1
+%if %{with default_lua}
+	ln -sf ${f}5.2 $RPM_BUILD_ROOT%{_bindir}/${f}
+	echo ".so ${f}5.2.1" >$RPM_BUILD_ROOT%{_mandir}/man1/${f}.1
+%endif
+done
 mv $RPM_BUILD_ROOT%{_libdir}/liblua{,5.2}.a
 
+# install shared library
 install src/liblua.so.5.2 $RPM_BUILD_ROOT%{_libdir}
 ln -s liblua.so.5.2 $RPM_BUILD_ROOT%{_libdir}/liblua5.2.so
 
 %if %{with luastatic}
 install lua.static $RPM_BUILD_ROOT%{_bindir}/lua5.2.static
 install luac.static $RPM_BUILD_ROOT%{_bindir}/luac5.2.static
+%if %{with default_lua}
+ln -sf lua5.2.static $RPM_BUILD_ROOT%{_bindir}/lua.static
+ln -sf luac5.2.static $RPM_BUILD_ROOT%{_bindir}/luac.static
+%endif
 %endif
 
 # create pkgconfig file
@@ -161,6 +183,13 @@ Cflags: -I${includedir}
 Libs: -L${libdir} -llua5.2 -ldl -lm
 EOF
 
+%if %{with default_lua}
+ln -sf liblua5.2.so $RPM_BUILD_ROOT%{_libdir}/liblua.so
+ln -sf liblua5.2.a $RPM_BUILD_ROOT%{_libdir}/liblua.a
+ln -sf lua5.2 $RPM_BUILD_ROOT%{_includedir}/lua
+ln -sf lua5.2.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/lua.pc
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -173,6 +202,12 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/luac5.2
 %{_mandir}/man1/lua5.2.1*
 %{_mandir}/man1/luac5.2.1*
+%if %{with default_lua}
+%attr(755,root,root) %{_bindir}/lua
+%attr(755,root,root) %{_bindir}/luac
+%{_mandir}/man1/lua.1*
+%{_mandir}/man1/luac.1*
+%endif
 
 %files libs
 %defattr(644,root,root,755)
@@ -189,14 +224,26 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/liblua5.2.so
 %{_includedir}/lua5.2
 %{_pkgconfigdir}/lua5.2.pc
+%if %{with default_lua}
+%attr(755,root,root) %{_libdir}/liblua.so
+%{_includedir}/lua
+%{_pkgconfigdir}/lua.pc
+%endif
 
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/liblua5.2.a
+%if %{with default_lua}
+%{_libdir}/liblua.a
+%endif
 
 %if %{with luastatic}
 %files luastatic
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/lua5.2.static
 %attr(755,root,root) %{_bindir}/luac5.2.static
+%if %{with default_lua}
+%attr(755,root,root) %{_bindir}/lua.static
+%attr(755,root,root) %{_bindir}/luac.static
+%endif
 %endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lua52.git/commitdiff/15193a2835c51a08563595be3dbd87e46b72874b



More information about the pld-cvs-commit mailing list