1 %define realname tolua++
2 Summary: Extended version of tolua, a tool to integrate C/C++ code with Lua - MinGW32 cross version
3 Summary(pl.UTF-8): Rozszerzona wersja tolua, narzędzia integrującego kod C/C++ z Lua - wersja skrośna dla MinGW32
4 Name: crossmingw32-%{realname}
8 Group: Development/Tools
9 Source0: http://www.codenix.com/~tolua/%{realname}-%{version}.tar.bz2
10 # Source0-md5: 8785100f7c9d9253cb47b530d97a32f6
11 URL: http://www.codenix.com/~tolua/
12 BuildRequires: crossmingw32-gcc
13 BuildRequires: crossmingw32-lua50 >= 5.0
14 BuildRequires: crossmingw32-w32api
16 Requires: crossmingw32-runtime
17 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19 %define no_install_post_strip 1
21 %define target i386-mingw32
22 %define target_platform i386-pc-mingw32
24 %define _sysprefix /usr
25 %define _prefix %{_sysprefix}/%{target}
26 %define _libdir %{_prefix}/lib
27 %define _pkgconfigdir %{_prefix}/lib/pkgconfig
28 %define _dlldir /usr/share/wine/windows/system
29 %define __cc %{target}-gcc
30 %define __cxx %{target}-g++
31 %define __pkgconfig_provides %{nil}
32 %define __pkgconfig_requires %{nil}
34 %define _ssp_cflags %{nil}
36 # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
39 # -z options are invalid for mingw linker, most of -f options are Linux-specific
40 %define filterout_ld -Wl,-z,.*
41 %define filterout_c -f[-a-z0-9=]*
44 tolua++ is an extension of tolua, a tool to integrate C/C++ code with
45 Lua. tolua++ includes new features oriented to c++, such as class
48 tolua is a tool that greatly simplifies the integration of C/C++ code
49 with Lua. Based on a "cleaned" header file, tolua automatically
50 generates the binding code to access C/C++ features from Lua. Using
51 Lua-5.0 API and tag method facilities, the current version
52 automatically maps C/C++ constants, external variables, functions,
53 namespace, classes, and methods to Lua. It also provides facilities to
56 %description -l pl.UTF-8
57 tolua++ jest rozszerzeniem tolua, narzędzia integrującego kod C/C++ z
58 Lua. tolua++ zawiera nowe, zorientowane na c++ cechy takie jak wzorce
61 tolua jest narzędziem które znacznie upraszcza integracje kodu C/C++ z
62 Lua. Bazując na "oczyszczonych" plikach nagłówkowych tolua
63 automatycznie generuje kod umożliwiający Lua dostęp do struktur i
64 funkcji C/C++. Dzięki użyciu API Lua 5.0, bieżąca wersja automatycznie
65 mapuje stałe, zewnętrzne zmienne, funkcje, przestrzenie nazw, klasy i
66 metody z C/C++ do Lua. Umożliwia również tworzenie modułów Lua.
69 Summary: Static tolua++ library - cross MinGW32 version
70 Summary(pl.UTF-8): Statyczna biblioteka tolua++ - wersja skrośna MinGW32
71 Group: Development/Libraries
72 Requires: %{name} = %{version}-%{release}
75 Static tolua++ library - cross MinGW32 version.
77 %description static -l pl.UTF-8
78 Statyczna biblioteka tolua++ - wersja skrośna MinGW32.
81 Summary: %{realname} - DLL library for Windows
82 Summary(pl.UTF-8): %{realname} - biblioteka DLL dla Windows
83 Group: Applications/Emulators
84 Requires: crossmingw32-lua50-dll >= 5.0
87 %{realname} - DLL library for Windows.
89 %description dll -l pl.UTF-8
90 %{realname} - biblioteka DLL dla Windows.
93 %setup -q -n %{realname}-%{version}
96 AR=%{target}-ar ; export AR
97 RANLIB=%{target}-ranlib ; export RANLIB
99 for i in src/lib/tolua_{event,is,map,push,to}.c
100 do %{__cc} %{rpmcflags} $i -c -I%{_includedir}/lua50 -Iinclude
104 $AR rcu libtolua++.a *.o
109 --shared *.o -llualib50 -llua50 -lm -o tolua++.dll \
110 -Wl,--enable-auto-image-base -Wl,--out-implib,libtolua++.dll.a
113 %{target}-strip *.dll
114 %{target}-strip -g -R.comment -R.note *.a
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_dlldir}}
121 install include/tolua++.h $RPM_BUILD_ROOT%{_includedir}
122 install *.a $RPM_BUILD_ROOT%{_libdir}
123 install *.dll $RPM_BUILD_ROOT%{_dlldir}
126 rm -rf $RPM_BUILD_ROOT
129 %defattr(644,root,root,755)
130 %{_includedir}/tolua++.h
131 %{_libdir}/libtolua++.dll.a
134 %defattr(644,root,root,755)
135 %{_libdir}/libtolua++.a
138 %defattr(644,root,root,755)
139 %{_dlldir}/tolua++.dll