SHA256
1
0
forked from pool/lua-toluapp

- Switch to mutlibuild approach for lua modules building

- Make all the develpacakges to conflict with each other

- Fix build with namespaced lua

- Remove version and timestamp from generated files
  toluapp-build-compare.patch

- rename the library to libtolua++-5.1
- libtolua++-5_1-devel should require toluapp-5.1,
  which will require the library
- fix build on openSUSE without lua-5.1.pc

- Don't version pkgconfig file
- Delete toluapp-versioned-include.patch
  * still have packages rely on tolua++.h

- previous upstream http://www.codenix.com/~tolua/ dead
  now use https://github.com/LuaDist/toluapp as source

- build with versioned includes/sharedlibs.
- add pkgconfig file
- use update-alternatives to provides tolua++

- build against lua51-devel for openSUSE > 12.1 until tolua++ 
  isn't ported to lua 5.2

- don't buildrequire tolua

- initial version (1.0.93)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-toluapp?expand=0&rev=2
This commit is contained in:
Tomáš Chvátal 2017-07-14 11:44:49 +00:00 committed by Git OBS Bridge
parent 541245c313
commit 80a4d42f7e
3 changed files with 44 additions and 37 deletions

5
_multibuild Normal file
View File

@ -0,0 +1,5 @@
<multibuild>
<package>lua51</package>
<package>lua52</package>
<package>lua53</package>
</multibuild>

View File

@ -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

View File

@ -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