summaryrefslogtreecommitdiffstats
path: root/libmongocrypt.spec
blob: b11cacbd455d12be2405d4d8ef1c021263b0ae2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# remirepo/fedora spec file for libmongocrypt
#
# Copyright (c) 2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global gh_owner     mongodb
%global gh_project   libmongocrypt
%global libname      %{gh_project}
%global libver       1.0
%global soname       0

Name:      %{libname}
Summary:   The companion C library for client side encryption in drivers
Version:   1.0.3
Release:   1%{?dist}

# see kms-message/THIRD_PARTY_NOTICES
# kms-message/src/kms_b64.c is ISC
# everything else is ASL 2.0
License:   ASL 2.0 and ISC
URL:       https://github.com/%{gh_owner}/%{gh_project}

Source0:   https://github.com/%{gh_owner}/%{gh_project}/archive/%{version}.tar.gz

BuildRequires: cmake >= 3.5
BuildRequires: gcc
BuildRequires: gcc-c++
# pkg-config may pull compat-openssl10
BuildRequires: openssl-devel
BuildRequires: cmake(bson-1.0) >= 1.11
# for documentation
BuildRequires: doxygen


%description
%{summary}.


%package devel
Summary:    Header files and development libraries for %{name}
Requires:   %{name}%{?_isa} = %{version}-%{release}
Requires:   pkgconfig
Requires:   cmake-filesystem

%description devel
This package contains the header files and development libraries
for %{name}.


%prep
%autosetup -n %{gh_project}-%{version}%{?prever:-dev} -p1
echo "%{version}" >VERSION_CURRENT


%build
%cmake \
    -DCMAKE_C_FLAGS="%{optflags} -fPIC" \
    -DENABLE_SHARED_BSON:BOOL=ON \
    -DENABLE_STATIC:BOOL=OFF \
    .

%make_build

doxygen ./doc/Doxygen


%install
%make_install


%check
make test

if grep -r static %{buildroot}%{_libdir}/cmake; then
  : cmake configuration file contain reference to static library
  exit 1
fi


%files
%license LICENSE
%{_libdir}/libkms_message.so.%{soname}*
%{_libdir}/libmongocrypt.so.%{soname}*


%files devel
%doc *.md
%doc doc/html
%{_includedir}/kms_message
%{_includedir}/mongocrypt
%{_libdir}/libkms_message.so
%{_libdir}/libmongocrypt.so
%{_libdir}/cmake/kms_message
%{_libdir}/cmake/mongocrypt
%{_libdir}/pkgconfig/*.pc


%changelog
* Thu Feb 13 2020 Remi Collet <remi@remirepo.net> - 1.0.3-1
- update to 1.0.3
- drop patch merged upstream

* Wed Feb 12 2020 Remi Collet <remi@remirepo.net> - 1.0.2-1
- update to 1.0.2
- drop patches merged upstream
- install missing header using patch from
  https://github.com/mongodb/libmongocrypt/pull/90

* Sat Jan 18 2020 Remi Collet <remi@remirepo.net> - 1.0.1-2
- modernize spec from review #1792224
- add generated html documentation

* Fri Jan 17 2020 Remi Collet <remi@remirepo.net> - 1.0.1-1
- initial package
- fix installation layout using patch from
  https://github.com/mongodb/libmongocrypt/pull/87