forked from ceph-dovecot/dovecot-ceph-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dovecot-ceph-plugin-opensuse.spec
154 lines (127 loc) · 4.42 KB
/
dovecot-ceph-plugin-opensuse.spec
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#
# spec file for package dovecot-ceph-plugins
#
# Copyright (c) 2017 Tallence AG and the authors
#
# This is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software
# Foundation. See file COPYING.
%{!?librados_version: %define librados_version 10.2.5}
%{!?dovecot_min_version: %define dovecot_min_version 2.2.21}
# openSUSE Tumbleweed
%if 0%{?suse_version} > 1500
%{!?dovecot_devel: %define dovecot_devel dovecot23-devel}
%{!?libjansson_devel: %define libjansson_devel libjansson-devel}
%{!?pkg_config: %define pkg_config pkg-config}
%else
%if 0%{?sle_version}
# openSUSE Leap 42.3 and SLE 12 SP3
%if 0%{?sle_version} == 120300
%{!?dovecot_devel: %define dovecot_devel dovecot22-devel}
%{!?libjansson_devel: %define libjansson_devel libjansson-devel}
%{!?pkg_config: %define pkg_config pkg-config}
%else
%{!?dovecot_devel: %define dovecot_devel dovecot23-devel}
%{!?libjansson_devel: %define libjansson_devel libjansson-devel}
%{!?pkg_config: %define pkg_config pkg-config}
%endif
%else
%if 0%{?centos_ver} == 7
%{!?dovecot_devel: %define dovecot_devel dovecot22u-devel}
%{!?libjansson_devel: %define libjansson_devel jansson-devel}
%{!?pkg_config: %define pkg_config pkgconfig}
%endif
%endif
%endif
Name: dovecot-ceph-plugin
Summary: Dovecot Ceph RADOS plugins
Version: 0.0.9
Release: 0%{?dist}
URL: https://github.com/ceph-dovecot/dovecot-ceph-plugin
Group: Productivity/Networking/Email/Servers
License: LGPL-2.1
Source: %{name}-%{version}.tar.gz
Provides: dovecot-ceph-plugins = %{version}-%{release}
Requires: librmb0 >= %{version}-%{release}
Requires: librados2 >= %{librados_version}
Conflicts: otherproviders(dovecot-ceph-plugins)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: %{dovecot_devel} >= %{dovecot_min_version}
BuildRequires: librados-devel >= %{librados_version}
BuildRequires: %{libjansson_devel} >= 2.9
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: %{pkg_config}
%description
Dovecot is an IMAP and POP3 server for Linux and UNIX-like systems,
written primarily with security in mind. Although it is written in C,
it uses several coding techniques to avoid most of the common pitfalls.
Dovecot can work with standard mbox and maildir formats and is fully
compatible with UW-IMAP and Courier IMAP servers as well as mail
clients accessing the mailboxes directly.
This package holds the files needed for RADOS support.
%package -n librmb0
Summary: RADOS mailbox library
Group: System/Libraries
%description -n librmb0
Library with generic abstraction to store emails in RADOS
%package -n librmb-devel
Summary: RADOS mailbox headers
Requires: librmb0 >= %{version}-%{release}
Group: Development/Libraries/C and C++
%description -n librmb-devel
This package contains libraries and headers needed to develop programs
that use rados mailbox library.
%package -n rmb-tools
Summary: RADOS mailbox tools
Requires: librmb0 >= %{version}-%{release}
Group: Productivity/Networking/Email/Servers
%description -n rmb-tools
This package contains useful tools to manage RADOS mailbox setups.
%prep
%setup -q
%build
export CFLAGS="%{optflags}"
export CFLAGS="$CFLAGS -fpic -DPIC"
export LIBS="-pie"
./autogen.sh
%configure \
--prefix=%{_prefix} \
--with-dovecot=%{_libdir}dovecot
%{__make}
%install
%{__rm} -rf %{buildroot}
mkdir -p %{buildroot}%{_libdir}/
make install DESTDIR=%{buildroot}
install -m 0644 -D COPYING-LGPL2.1 %{buildroot}%{_docdir}/dovecot-ceph-plugin/COPYING
# clean up unused files
find %{buildroot}%{_libdir}/ -type f -name \*.la -delete
find %{buildroot}%{_libdir}/dovecot/ -type f -name \*.a -delete
%clean
%{__rm} -rf %{buildroot}
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%defattr(-,root,root)
%dir %{_docdir}/dovecot-ceph-plugin
%doc %{_docdir}/dovecot-ceph-plugin/COPYING
%dir %{_libdir}/dovecot
%{_libdir}/dovecot/lib*.so*
%files -n librmb0
%defattr(-,root,root)
%{_libdir}/librmb.so.*
%post -n librmb0 -p /sbin/ldconfig
%postun -n librmb0 -p /sbin/ldconfig
%files -n librmb-devel
%defattr(-,root,root)
%dir %{_includedir}/dovecot-ceph-plugin
%{_includedir}/dovecot-ceph-plugin/*.h
%{_libdir}/librmb.so
%files -n rmb-tools
%defattr(-,root,root)
%{_bindir}/rmb
/usr/share/man/man1/rmb.1.gz
%changelog