634310f
%global         solib tolua++-5.1
634310f
634310f
Name:           compat-tolua++
634310f
Version:        1.0.93
73087c2
Release:        9%{?dist}
634310f
Summary:        lua-5.1 compatible version of tolua++ (C++ Lua integration)
634310f
Group:          Development/Tools
634310f
License:        MIT
634310f
# Upstream us defunct, so no URL
634310f
Source0:        tolua++-%{version}.tar.bz2
634310f
Patch0:         tolua++-1.0.93-lua51.patch
634310f
Patch1:         tolua++-1.0.93-lua-include-path.patch
6022981
BuildRequires:  gcc
634310f
BuildRequires:  scons
634310f
BuildRequires:  compat-lua-devel >= 5.1
634310f
634310f
%description
634310f
This is a lua-5.1 compatible version of tolua++.
634310f
634310f
tolua++ is an extended version of tolua, a tool to integrate C/C++ code with
634310f
Lua. tolua++ includes new features oriented to C++.
634310f
634310f
634310f
%package devel
634310f
Summary:        Development files for compat-tolua++
634310f
Group:          Development/Libraries
634310f
Requires:       %{name}%{?_isa} = %{version}-%{release}
634310f
Requires:       compat-lua-devel >= 5.1
634310f
# tolua++-devel and compat-tolua++ cannot be installed at the same time
634310f
Conflicts:      tolua++-devel
634310f
634310f
%description devel
634310f
Development files for compat-tolua++.
634310f
634310f
634310f
%prep
634310f
%setup -q -n tolua++-%{version}
634310f
%patch0 -p1 -b .lua51
634310f
%patch1 -p1
634310f
sed -i 's/\r//' doc/tolua++.html
634310f
634310f
634310f
%build
634310f
scons %{?_smp_mflags} -Q CCFLAGS="%{optflags} $(pkg-config --cflags lua-5.1)" tolua_lib=%{solib} LINKFLAGS="-Wl,-soname,lib%{solib}.so" shared=1
634310f
# Relink the tolua++ binary, there are 2 reasons for this:
634310f
# -Link it without the soname which we add to LINKFLAGS to build a shared lib
634310f
# -On non x86_64 link it against the pre-generated toluabind rather then the
634310f
#  bootstapped one as something goes wrong with the bootstrap on ARM, x86_32
634310f
#  (rhbz#1094103) and ppc (rhbz#704372) causing a segfault for unknown reasons.
634310f
%ifarch x86_64
634310f
gcc -o bin/tolua++ src/bin/tolua.o src/bin/toluabind.o -Llib -l%{solib} -llua-5.1 -ldl -lm
634310f
%else
634310f
gcc -o bin/tolua++ src/bin/tolua.o src/bin/toluabind_default.o -Llib -l%{solib} -llua-5.1 -ldl -lm
634310f
%endif
634310f
634310f
634310f
%install
634310f
mkdir -p $RPM_BUILD_ROOT%{_bindir}
634310f
mkdir -p $RPM_BUILD_ROOT%{_libdir}
634310f
mkdir -p $RPM_BUILD_ROOT%{_includedir}
634310f
install -m 755 bin/tolua++  $RPM_BUILD_ROOT%{_bindir}
634310f
install -m 755 lib/lib%{solib}.so $RPM_BUILD_ROOT%{_libdir}
634310f
ln -s lib%{solib}.so $RPM_BUILD_ROOT%{_libdir}/libtolua++.so
634310f
install -p -m 644 include/tolua++.h $RPM_BUILD_ROOT%{_includedir}
634310f
634310f
634310f
%post -p /sbin/ldconfig
634310f
%postun -p /sbin/ldconfig
634310f
634310f
634310f
%files
634310f
%doc README doc/*
634310f
%{_libdir}/lib%{solib}.so
634310f
634310f
634310f
%files devel
634310f
%{_bindir}/tolua++
634310f
%{_libdir}/libtolua++.so
634310f
%{_includedir}/tolua++.h
634310f
634310f
634310f
%changelog
73087c2
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.93-9
73087c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
73087c2
7385fba
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.93-8
7385fba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7385fba
ee30b27
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.93-7
ee30b27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
ee30b27
0ad62f3
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.93-6
0ad62f3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0ad62f3
85f5171
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.93-5
85f5171
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
85f5171
ff99d6a
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.93-4
ff99d6a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
ff99d6a
f1533ae
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.93-3
f1533ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f1533ae
634310f
* Mon Feb 23 2015 Hans de Goede <hdegoede@redhat.com> - 1.0.93-2
634310f
- Upstream is defunct, remove URLs pointing to it
634310f
- Minor specifile cleanups (rhbz#1195255)
634310f
634310f
* Mon Feb 23 2015 Hans de Goede <hdegoede@redhat.com> - 1.0.93-1
634310f
- First version of compat-tolua++, based on the f21 tolua++ package