diff --git a/README.md b/README.md
index 7c95998e..b7967fa1 100644
--- a/README.md
+++ b/README.md
@@ -79,6 +79,11 @@ If you are using CentOS make sure you also have the following package installed:
./configure --with-dovecot=/home/user/workspace/core
make install
+## Packages
+
+Packages of the latest tagged versions for different versions of openSUSE, SLES and CentOS 7
+can be downloaded from the [Open Build Service](https://download.opensuse.org/repositories/home:/dalgaaf:/dovecot-ceph-plugin/).
+
## Thanks
diff --git a/rpm/dovecot-ceph-plugin.spec b/rpm/dovecot-ceph-plugin.spec
index 2b3ac822..7e607a04 100644
--- a/rpm/dovecot-ceph-plugin.spec
+++ b/rpm/dovecot-ceph-plugin.spec
@@ -1,5 +1,5 @@
#
-# spec file for package dovecot22-rados-plugins
+# spec file for package dovecot-ceph-plugin
#
# Copyright (c) 2017-2018 Tallence AG and the authors
#
@@ -8,8 +8,33 @@
# License version 2.1, as published by the Free Software
# Foundation. See file COPYING.
-%{!?dovecot_devel: %define dovecot_devel dovecot22-devel}
%{!?librados_version: %define librados_version 10.2.5}
+%{!?dovecot_min_version: %define dovecot_version 2.2.21}
+
+%if 0%{?suse_version} || 0%{?sle_version}
+ %{!?libjansson_devel: %define libjansson_devel libjansson-devel}
+ %{!?pkg_config: %define pkg_config pkg-config}
+%endif
+
+# openSUSE Tumbleweed
+%if 0%{?suse_version} > 1500
+ %{!?dovecot_devel: %define dovecot_devel dovecot23-devel}
+%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}
+ %else
+ %{!?dovecot_devel: %define dovecot_devel dovecot23-devel}
+ %endif
+ %else
+ %if 0%{?centos_version} == 700
+ %{!?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
@@ -18,19 +43,21 @@ Release: 0%{?dist}
URL: https://github.com/ceph-dovecot/dovecot-ceph-plugin
Group: Productivity/Networking/Email/Servers
License: LGPL-2.1
-Source: %{name}_%{version}-%{release}.tar.gz
+Source: %{name}-%{version}.tar.xz
Provides: dovecot-ceph-plugin = %{version}-%{release}
Requires: librmb0 >= %{version}-%{release}
+Requires: librados2 >= %{librados_version}
Conflicts: otherproviders(dovecot-ceph-plugin)
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: %dovecot_devel
-BuildRequires: librados-devel >= %librados_version
-BuildRequires: libjansson-devel >= 2.9
-BuildRequires: gcc-c++
-BuildRequires: libtool
-BuildRequires: pkg-config
+
+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,
@@ -79,7 +106,10 @@ export LIBS="-pie"
%{__make}
%install
-%makeinstall
+%{__rm} -rf %{buildroot}
+mkdir -p %{buildroot}%{_libdir}/
+%make_install
+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
@@ -95,6 +125,8 @@ find %{buildroot}%{_libdir}/dovecot/ -type f -name \*.a -delete
%files
%defattr(-,root,root)
+%dir %{_docdir}/dovecot-ceph-plugin
+%doc %{_docdir}/dovecot-ceph-plugin/COPYING
%dir %{_libdir}/dovecot
%{_libdir}/dovecot/lib*.so*
@@ -108,13 +140,13 @@ find %{buildroot}%{_libdir}/dovecot/ -type f -name \*.a -delete
%files -n librmb-devel
%defattr(-,root,root)
-%{_includedir}/*
+%dir %{_includedir}/dovecot-ceph-plugin
+%{_includedir}/dovecot-ceph-plugin/*.h
%{_libdir}/librmb.so
%files -n rmb-tools
%defattr(-,root,root)
-%attr(0755, root, root) %{_bindir}/rmb
-%doc %{_mandir}/man1/rmb.1*
+%{_bindir}/rmb
+/usr/share/man/man1/rmb.1.gz
%changelog
-