3 %bcond_without lua # build without tests
5 %define __lua /usr/bin/lua5.1
6 #define luaver %(%{__lua} -e "print(string.sub(_VERSION, 5))")
8 %define lualibdir %{_libdir}/lua/%{luaver}
9 %define luapkgdir %{_datadir}/lua/%{luaver}
11 Summary: Simple implementation of msgpack in C
16 Group: Development/Libraries
17 Source0: https://github.com/tarruda/libmpack/archive/%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5: 7d855d6f989686fae713c10f202f5a1b
20 URL: https://github.com/tarruda/libmpack/
21 BuildRequires: libtool
22 BuildRequires: pkgconfig
25 BuildRequires: lua51-devel >= %{luaver}
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 libmpack is a small binary serialization/RPC library that implements
31 both the msgpack and msgpack-rpc specifications.
33 Differences from mspack-c:
34 - Callback-based API to simplify (de)serialization directly to/from
35 application-specific objects.
37 - No allocation performed by the library, but helpers to simplify
38 dynamic allocation if the application needs it.
39 - Non-backtracking, incremental/iterative parse/serialization API
42 Summary: Header files for %{name} library
43 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
44 Group: Development/Libraries
45 Requires: %{name} = %{version}-%{release}
48 Header files for %{name} library.
51 Summary: Lua binding to libmpack
52 Group: Development/Languages
53 # does not link with libmpack.so
54 #Requires: %{name} = %{version}-%{release}
56 %description -n lua-mpack
57 Lua binding to libmpack.
64 %{__make} config=release \
67 CFLAGS="%{rpmcflags}" \
68 LDFLAGS="%{rpmldflags}" \
73 CFLAGS="%{rpmcflags}" \
74 %{__make} -C binding/lua \
80 rm -rf $RPM_BUILD_ROOT
84 DESTDIR=$RPM_BUILD_ROOT
87 %{__make} -C binding/lua install \
89 DESTDIR=$RPM_BUILD_ROOT
92 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libmpack.a
93 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libmpack.la
96 rm -rf $RPM_BUILD_ROOT
98 %post -p /sbin/ldconfig
99 %postun -p /sbin/ldconfig
102 %defattr(644,root,root,755)
103 %doc README.md LICENSE-MIT
104 %attr(755,root,root) %{_libdir}/libmpack.so.*.*.*
105 %ghost %{_libdir}/libmpack.so.0
108 %defattr(644,root,root,755)
109 %{_libdir}/libmpack.so
110 %{_includedir}/mpack.h
111 %{_pkgconfigdir}/mpack.pc
114 %defattr(644,root,root,755)
115 %attr(755,root,root) %{lualibdir}/mpack.so