File rubygem-schleuder.spec of Package rubygem-schleuder

#
# spec file for package rubygem-schleuder
#
# Copyright (c) 2022 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


#
# This file was generated with a gem2rpm.yml and not just plain gem2rpm.
# All sections marked as MANUAL, license headers, summaries and descriptions
# can be maintained in that file. Please consult this file before editing any
# of those fields
#

Name:           rubygem-schleuder
Version:        4.0.3
Release:        0
%define mod_name schleuder
%define mod_full_name %{mod_name}-%{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  ruby-macros >= 5
BuildRequires:  %{ruby >= 2.5.0}
BuildRequires:  %{rubygem gem2rpm}
BuildRequires:  update-alternatives
Url:            https://schleuder.org/
Source:         https://rubygems.org/gems/%{mod_full_name}.gem
Source1:        series
Source2:        gem2rpm.yml
# MANUAL
Patch0:  schleuder_keep_to_cc.patch
# /MANUAL
Summary:        Schleuder is an encrypting mailing list manager with
License:        GPL-3.0
Group:          Development/Languages/Ruby
PreReq:         update-alternatives

%description
Schleuder is a group's email-gateway: subscribers can exchange encrypted
emails among themselves, receive emails from non-subscribers and send emails
to non-subscribers via the list.
(Please note: For some platforms there's a better way of installing Schleuder
than `gem install`. See
<https://schleuder.org/schleuder/docs/server-admins.html#installation> for
details.).

%prep
%gem_unpack
%patch0 -p1
find -type f -print0 | xargs -0 touch -r %{S:0}
%gem_build

%build

%install
%gem_install \
  --symlink-binaries \
  --doc-files="README.md" \
  -f
# MANUAL
# database migration for SUSE specific patches
mkdir -p %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/db/migrate
cp %{_builddir}/%{mod_name}-%{version}/db/migrate/20210608124308_add_keep_incoming_cc.rb %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/db/migrate/20210608124308_add_keep_incoming_cc.rb
cp %{_builddir}/%{mod_name}-%{version}/db/migrate/20210608124309_add_keep_incoming_to.rb %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/db/migrate/20210608124309_add_keep_incoming_to.rb 
# Dirty hack as schleuder requires thor < 1 but gem_install does not correctly handle the ruby "~>" pessimistic version constraint
sed -i 's#%q<thor>.freeze, \["~> 0"\]#%q<thor>.freeze, \["~> 0", "< 1"\]#g' %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/specifications/%{mod_name}-%{version}.gemspec
# /MANUAL


%gem_packages

%changelog
openSUSE Build Service is sponsored by