diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..b9bdec1 --- /dev/null +++ b/_multibuild @@ -0,0 +1,5 @@ + +lua51 +lua52 +lua53 + diff --git a/lua51-toluapp.changes b/lua-toluapp.changes similarity index 88% rename from lua51-toluapp.changes rename to lua-toluapp.changes index 2a1c72a..57a772d 100644 --- a/lua51-toluapp.changes +++ b/lua-toluapp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 14 11:39:07 UTC 2017 - tchvatal@suse.com + +- Switch to mutlibuild approach for lua modules building +- Make all the develpacakges to conflict with each other + ------------------------------------------------------------------- Tue Jul 11 09:30:42 UTC 2017 - tchvatal@suse.com diff --git a/lua51-toluapp.spec b/lua-toluapp.spec similarity index 74% rename from lua51-toluapp.spec rename to lua-toluapp.spec index b0bc4c9..73dbba3 100644 --- a/lua51-toluapp.spec +++ b/lua-toluapp.spec @@ -1,5 +1,5 @@ # -# spec file for package lua51-toluapp +# spec file for package lua-toluapp # # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # @@ -16,24 +16,27 @@ # -%define lua_major_version 5.1 -%define lua_suffix 5_1 -Name: lua51-toluapp +%define flavor @BUILD_FLAVOR@ +%define mod_name toluapp +Name: %{flavor}-%{mod_name} Version: 1.0.93 Release: 0 Summary: C/C++ with Lua Integration Tool License: MIT +# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines" Group: Development/Languages/Lua Url: https://github.com/LuaDist/toluapp Source: https://github.com/LuaDist/toluapp/archive/%{version}/toluapp-%{version}.tar.gz -Patch: toluapp-libdir.patch +Patch0: toluapp-libdir.patch Patch1: toluapp-versioned-shared-lib.patch Patch2: toluapp-build-compare.patch +BuildRequires: %{flavor}-devel BuildRequires: gcc-c++ -BuildRequires: lua51-devel -BuildRequires: pkg-config +BuildRequires: pkgconfig BuildRequires: scons >= 2.3.0 -BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if "%{flavor}" == "" +ExclusiveArch: do_not_build +%endif %description tolua++ is an extended version of tolua, a tool to integrate C/C++ code with @@ -41,24 +44,20 @@ Lua. tolua++ includes new features oriented to c++ such as: * support for std::string as a basic type (this can be turned off by a command line option) * support for class templates -as well as other features and bugfixes. -%package -n toluapp-%{lua_major_version} +%package -n toluapp-%{lua_version} Summary: C/C++ with Lua Integration Tool +# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines" Group: Development/Languages/Lua -Requires(preun): update-alternatives -Requires(post): update-alternatives -# 99.1: just make sure it's big enough -Provides: tolua++ = %{version}-99.1 -Obsoletes: tolua++ < %{version}-99.1 +Requires(post): update-alternatives +Requires(postun): update-alternatives -%description -n toluapp-%{lua_major_version} +%description -n toluapp-%{lua_version} tolua++ is an extended version of tolua, a tool to integrate C/C++ code with Lua. tolua++ includes new features oriented to c++ such as: * support for std::string as a basic type (this can be turned off by a command line option) * support for class templates -as well as other features and bugfixes. %package -n libtolua++-%{lua_suffix}-1 Summary: Runtime libraries for tolua++ @@ -70,17 +69,19 @@ This package provides shared libraries for tolua++. %package -n libtolua++-%{lua_suffix}-devel Summary: Development headers for tolua++ Group: Development/Libraries/C and C++ -Requires: toluapp-%{lua_major_version} +Requires: toluapp-%{lua_version} +Conflicts: otherproviders(toluapp-devel) +Provides: toluapp-devel = %{version} %description -n libtolua++-%{lua_suffix}-devel This package provides development headers for tolua++. %prep %setup -q -n toluapp-%{version} -%patch -p1 +%patch0 -p1 %patch1 -p1 %patch2 -p1 -sed -i "s/@SUFFIX@/%{lua_major_version}/" SConstruct +sed -i "s/@SUFFIX@/%{lua_version}/" SConstruct %build cat <<'EOF' > config_linux.py @@ -102,7 +103,7 @@ scons %{?_smp_mflags} \ %install CCFLAGS="%{optflags} -fPIC -I%{lua_incdir}" \ LIBS="-llua -lm -ldl" \ -scons %{?_smp_flags} \ +scons %{?_smp_mflags} \ prefix="%{buildroot}%{_prefix}" \ libdir="%{buildroot}%{_libdir}" \ shared=1 \ @@ -121,7 +122,7 @@ Name: tolua++ Description: C/C++ with Lua Integration Tool Version: %{version} -Libs: -ltolua++-%{lua_major_version} +Libs: -ltolua++-%{lua_version} Cflags: -I%{_includedir} EOF @@ -131,36 +132,31 @@ touch %{buildroot}%{_sysconfdir}/alternatives/tolua++ ln -sf %{_sysconfdir}/alternatives/tolua++ %{buildroot}%{_bindir}/tolua++ %post -n libtolua++-%{lua_suffix}-1 -p /sbin/ldconfig - %postun -n libtolua++-%{lua_suffix}-1 -p /sbin/ldconfig - -%post -n toluapp-%{lua_major_version} +%post -n toluapp-%{lua_version} /sbin/ldconfig -%{_sbindir}/update-alternatives --install %{_bindir}/tolua++ tolua++ %{_bindir}/toluapp-%{lua_major_version} 10 +%{_sbindir}/update-alternatives --install %{_bindir}/tolua++ tolua++ %{_bindir}/toluapp-%{lua_version} 10 -%preun -n toluapp-%{lua_major_version} +%post -n toluapp-%{lua_version} if [ "$1" = 0 ] ; then - %{_sbindir}/update-alternatives --remove tolua++ %{_bindir}/toluapp-%{lua_major_version} + %{_sbindir}/update-alternatives --remove tolua++ %{_bindir}/toluapp-%{lua_version} fi -%postun -n toluapp-%{lua_major_version} -p /sbin/ldconfig +%postun -n toluapp-%{lua_version} -p /sbin/ldconfig -%files -n toluapp-%{lua_major_version} -%defattr(-,root,root) +%files -n toluapp-%{lua_version} %doc COPYRIGHT README %ghost %{_sysconfdir}/alternatives/tolua++ %{_bindir}/tolua++ -%{_bindir}/toluapp-%{lua_major_version} +%{_bindir}/toluapp-%{lua_version} %files -n libtolua++-%{lua_suffix}-devel -%defattr(-,root,root) %{_includedir}/tolua++.h -%{_libdir}/libtolua++-%{lua_major_version}.so +%{_libdir}/libtolua++-%{lua_version}.so %{_libdir}/pkgconfig/tolua++.pc %files -n libtolua++-%{lua_suffix}-1 -%defattr(-,root,root) -%{_libdir}/libtolua++-%{lua_major_version}.so.1 -%{_libdir}/libtolua++-%{lua_major_version}.so.%{version} +%{_libdir}/libtolua++-%{lua_version}.so.1 +%{_libdir}/libtolua++-%{lua_version}.so.%{version} %changelog