]> git.pld-linux.org Git - packages/libmpack.git/blob - libmpack.spec
Pass our cflags to remove -Werror
[packages/libmpack.git] / libmpack.spec
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
11 Summary:        Simple implementation of msgpack in C
12 Name:           libmpack
13 Version:        1.0.3
14 Release:        2
15 License:        MIT
16 Group:          Development/Libraries
17 Source0:        https://github.com/tarruda/libmpack/archive/%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5:  7d855d6f989686fae713c10f202f5a1b
19 Patch0:         lua.patch
20 URL:            https://github.com/tarruda/libmpack/
21 BuildRequires:  libtool
22 BuildRequires:  pkgconfig
23 %if %{with lua}
24 BuildRequires:  lua51
25 BuildRequires:  lua51-devel >= %{luaver}
26 %endif
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 libmpack is a small binary serialization/RPC library that implements
31 both the msgpack and msgpack-rpc specifications.
32
33 Differences from mspack-c:
34  - Callback-based API to simplify (de)serialization directly to/from
35    application-specific objects.
36  - C89 compatible code
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
40
41 %package devel
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}
46
47 %description devel
48 Header files for %{name} library.
49
50 %package -n lua-mpack
51 Summary:        Lua binding to libmpack
52 Group:          Development/Languages
53 # does not link with libmpack.so
54 #Requires:      %{name} = %{version}-%{release}
55
56 %description -n lua-mpack
57 Lua binding to libmpack.
58
59 %prep
60 %setup -q
61 %patch0 -p1
62
63 %build
64 %{__make} config=release \
65         CC="%{__cc}" \
66         PREFIX=%{_prefix} \
67         CFLAGS="%{rpmcflags}" \
68         LDFLAGS="%{rpmldflags}" \
69         LIBDIR=%{_libdir} \
70         VERBOSE=1
71
72 %if %{with lua}
73 CFLAGS="%{rpmcflags}" \
74 %{__make} -C binding/lua \
75         CC="%{__cc}" \
76         USE_SYSTEM_LUA=yes
77 %endif
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81 %{__make} install \
82         PREFIX=%{_prefix} \
83         LIBDIR=%{_libdir} \
84         DESTDIR=$RPM_BUILD_ROOT
85
86 %if %{with lua}
87 %{__make} -C binding/lua install \
88         USE_SYSTEM_LUA=yes \
89         DESTDIR=$RPM_BUILD_ROOT
90 %endif
91
92 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libmpack.a
93 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libmpack.la
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %post   -p /sbin/ldconfig
99 %postun -p /sbin/ldconfig
100
101 %files
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
106
107 %files devel
108 %defattr(644,root,root,755)
109 %{_libdir}/libmpack.so
110 %{_includedir}/mpack.h
111 %{_pkgconfigdir}/mpack.pc
112
113 %files -n lua-mpack
114 %defattr(644,root,root,755)
115 %attr(755,root,root) %{lualibdir}/mpack.so
This page took 0.064886 seconds and 3 git commands to generate.