]> git.pld-linux.org Git - packages/libmpack.git/blame - libmpack.spec
update BR
[packages/libmpack.git] / libmpack.spec
CommitLineData
d7f79747
ER
1#
2# Conditional build:
3%bcond_without lua # build without tests
4
5%define __lua /usr/bin/lua5.1
6#define luaver %(%{__lua} -e "print(string.sub(_VERSION, 5))")
7%define luaver 5.1
8%define lualibdir %{_libdir}/lua/%{luaver}
9%define luapkgdir %{_datadir}/lua/%{luaver}
10
6e3d7976
ER
11Summary: Simple implementation of msgpack in C
12Name: libmpack
13Version: 1.0.2
14Release: 0.1
15License: MIT
16Group: Development/Libraries
17Source0: https://github.com/tarruda/libmpack/archive/%{version}/%{name}-%{version}.tar.gz
18# Source0-md5: a6320e37991bb56520d4670419edb43c
d7f79747 19Patch0: https://github.com/tarruda/libmpack/pull/8.diff
d5c2316e 20# Patch0-md5: 91f4f18a5b74713465b392b3fe20d07a
d7f79747
ER
21Patch1: https://github.com/tarruda/libmpack/commit/0cc47f7e859b7124cf46483a6e59ed973bbe5e42.diff
22# Patch1-md5: af5612df21a914fe0d06944196cfd274
23Patch2: lua.patch
6e3d7976
ER
24URL: https://github.com/tarruda/libmpack/
25BuildRequires: libtool
a1ef408a 26BuildRequires: pkgconfig
d7f79747 27%if %{with lua}
a1ef408a
ER
28BuildRequires: lua51
29BuildRequires: lua51-devel >= %{luaver}
d7f79747 30%endif
6e3d7976
ER
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34libmpack is a small binary serialization/RPC library that implements
35both the msgpack and msgpack-rpc specifications.
36
37Differences from mspack-c:
38 - Callback-based API to simplify (de)serialization directly to/from
39 application-specific objects.
40 - C89 compatible code
41 - No allocation performed by the library, but helpers to simplify
42 dynamic allocation if the application needs it.
43 - Non-backtracking, incremental/iterative parse/serialization API
44
d5c2316e
ER
45%package devel
46Summary: Header files for %{name} library
47Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
48Group: Development/Libraries
49Requires: %{name} = %{version}-%{release}
50
51%description devel
52Header files for %{name} library.
53
d7f79747
ER
54%package -n lua-mpack
55Summary: Lua binding to libmpack
56Group: Development/Languages
57# does not link with libmpack.so
58#Requires: %{name} = %{version}-%{release}
59
60%description -n lua-mpack
61Lua binding to libmpack.
62
6e3d7976
ER
63%prep
64%setup -q
d5c2316e 65%patch0 -p1
d7f79747
ER
66%patch1 -p1
67%patch2 -p1
6e3d7976
ER
68
69%build
70%{__make} config=release \
71 CC="%{__cc}" \
72 PREFIX=%{_prefix} \
73 CFLAGS="%{rpmcflags}" \
d5c2316e 74 LDFLAGS="%{rpmldflags}" \
6e3d7976
ER
75 LIBDIR=%{_libdir} \
76 VERBOSE=1
77
d7f79747
ER
78%if %{with lua}
79%{__make} -C binding/lua \
80 CC="%{__cc}" \
81 USE_SYSTEM_LUA=yes
82%endif
83
6e3d7976
ER
84%install
85rm -rf $RPM_BUILD_ROOT
d5c2316e
ER
86%{__make} install \
87 PREFIX=%{_prefix} \
88 LIBDIR=%{_libdir} \
89 DESTDIR=$RPM_BUILD_ROOT
6e3d7976 90
d7f79747
ER
91%if %{with lua}
92%{__make} -C binding/lua install \
93 USE_SYSTEM_LUA=yes \
94 DESTDIR=$RPM_BUILD_ROOT
95%endif
96
d5c2316e
ER
97%{__rm} $RPM_BUILD_ROOT%{_libdir}/libmpack.a
98%{__rm} $RPM_BUILD_ROOT%{_libdir}/libmpack.la
6e3d7976
ER
99
100%clean
101rm -rf $RPM_BUILD_ROOT
102
d5c2316e
ER
103%post -p /sbin/ldconfig
104%postun -p /sbin/ldconfig
105
6e3d7976
ER
106%files
107%defattr(644,root,root,755)
108%doc README.md LICENSE-MIT
d5c2316e
ER
109%attr(755,root,root) %{_libdir}/libmpack.so.*.*.*
110%ghost %{_libdir}/libmpack.so.0
111
112%files devel
113%defattr(644,root,root,755)
114%{_libdir}/libmpack.so
115%{_includedir}/mpack.h
116%{_pkgconfigdir}/mpack.pc
d7f79747
ER
117
118%files -n lua-mpack
119%defattr(644,root,root,755)
120%attr(755,root,root) %{lualibdir}/mpack.so
This page took 0.104098 seconds and 4 git commands to generate.