2023-01-14 00:48:44 +01:00
|
|
|
#
|
|
|
|
# spec file for package grommunio-index
|
|
|
|
#
|
2024-06-07 14:34:11 +02:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2023-01-14 00:48:44 +01:00
|
|
|
#
|
|
|
|
# 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 https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2023-01-14 00:48:35 +01:00
|
|
|
|
|
|
|
Name: grommunio-index
|
2024-06-07 14:34:11 +02:00
|
|
|
Version: 1.0.6.f40d25b
|
2023-01-14 00:48:35 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Generator for grommunio-web search indexes
|
|
|
|
License: AGPL-3.0-or-later
|
|
|
|
Group: Productivity/Networking/Email/Servers
|
|
|
|
URL: https://grommunio.com/
|
|
|
|
Source: %name-%version.tar.xz
|
|
|
|
BuildRequires: cmake
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} < 1550
|
|
|
|
BuildRequires: gcc11-c++
|
|
|
|
%else
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
%endif
|
2024-06-07 14:34:11 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: libmysqlclient-devel >= 5.6
|
|
|
|
%else
|
|
|
|
BuildRequires: mariadb-devel >= 5.6
|
|
|
|
%endif
|
2023-01-14 00:48:35 +01:00
|
|
|
BuildRequires: libexmdbpp-devel >= 1.8.0
|
|
|
|
BuildRequires: libexmdbpp0 >= 1.8.0
|
2024-06-07 14:34:11 +02:00
|
|
|
BuildRequires: pkgconfig(libHX) >= 3.27
|
2023-01-14 00:48:44 +01:00
|
|
|
BuildRequires: pkgconfig(sqlite3)
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
2023-01-14 00:48:35 +01:00
|
|
|
Requires: libexmdbpp0 >= 1.8.0
|
2024-06-07 14:34:11 +02:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
BuildRequires: sysuser-tools
|
|
|
|
%sysusers_requires
|
|
|
|
%else
|
|
|
|
Requires(pre): %_sbindir/groupadd
|
|
|
|
Requires(pre): %_sbindir/useradd
|
|
|
|
%endif
|
|
|
|
Requires(pre): group(groweb)
|
|
|
|
Requires(pre): group(gromoxcf)
|
|
|
|
Requires: group(gromoxcf)
|
|
|
|
Requires: group(groweb)
|
|
|
|
Requires: user(groindex)
|
2023-01-14 00:48:35 +01:00
|
|
|
%define services grommunio-index.service grommunio-index.timer
|
|
|
|
|
|
|
|
%description
|
|
|
|
A C++17 program for the generation of grommunio-web fulltext search indexes.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
%build
|
2024-06-07 14:34:11 +02:00
|
|
|
>user.pre
|
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
%sysusers_generate_pre %_sourcedir/system-user-groindex.conf user system-user-groindex.conf
|
|
|
|
%endif
|
|
|
|
|
|
|
|
pushd .
|
2023-01-14 00:48:35 +01:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} < 1550
|
|
|
|
%cmake -DCMAKE_CXX_COMPILER=%_bindir/g++-11
|
|
|
|
%else
|
|
|
|
%cmake
|
|
|
|
%endif
|
|
|
|
%cmake_build
|
2024-06-07 14:34:11 +02:00
|
|
|
popd
|
2023-01-14 00:48:35 +01:00
|
|
|
|
|
|
|
%install
|
2024-06-07 14:34:11 +02:00
|
|
|
pushd .
|
2023-01-14 00:48:35 +01:00
|
|
|
%cmake_install
|
2024-06-07 14:34:11 +02:00
|
|
|
popd
|
2023-01-14 00:48:35 +01:00
|
|
|
mkdir -p "%buildroot/%_datadir/%name"
|
|
|
|
|
2024-06-07 14:34:11 +02:00
|
|
|
%pre -f user.pre
|
|
|
|
%if 0%{?rhel} || 0%{?fedora_version}
|
|
|
|
getent group groindex >/dev/null || %_sbindir/groupadd -r groindex
|
|
|
|
getent passwd groindex >/dev/null || %_sbindir/useradd -g groindex -s /bin/false \
|
|
|
|
-r -c "user for %name" -d / groindex
|
|
|
|
usermod groindex -aG groweb
|
|
|
|
usermod groindex -aG gromoxcf
|
|
|
|
%endif
|
|
|
|
%if 0%{?service_add_pre:1}
|
2023-01-14 00:48:35 +01:00
|
|
|
%service_add_pre %services
|
2024-06-07 14:34:11 +02:00
|
|
|
%endif
|
2023-01-14 00:48:35 +01:00
|
|
|
|
|
|
|
%post
|
2024-06-07 14:34:11 +02:00
|
|
|
find /var/lib/grommunio-web/sqlite-index/ -mindepth 1 "(" -type d -o -type f ")" -exec chmod g+w,o-w {} + || :
|
|
|
|
find /var/lib/grommunio-web/sqlite-index/ -mindepth 1 "(" -type d -o -type f ")" -exec chgrp -h groweb {} + || :
|
|
|
|
%if 0%{?service_add_post:1}
|
2023-01-14 00:48:35 +01:00
|
|
|
%service_add_post %services
|
2024-06-07 14:34:11 +02:00
|
|
|
%else
|
|
|
|
%systemd_post %services
|
|
|
|
%endif
|
2023-01-14 00:48:35 +01:00
|
|
|
|
|
|
|
%preun
|
2024-06-07 14:34:11 +02:00
|
|
|
%if 0%{?service_del_preun:1}
|
2023-01-14 00:48:35 +01:00
|
|
|
%service_del_preun %services
|
2024-06-07 14:34:11 +02:00
|
|
|
%else
|
|
|
|
%systemd_preun %services
|
|
|
|
%endif
|
2023-01-14 00:48:35 +01:00
|
|
|
|
|
|
|
%postun
|
2024-06-07 14:34:11 +02:00
|
|
|
%if 0%{?service_del_postun:1}
|
2023-01-14 00:48:35 +01:00
|
|
|
%service_del_postun %services
|
2024-06-07 14:34:11 +02:00
|
|
|
%else
|
|
|
|
%systemd_postun_with_restart %services
|
|
|
|
%endif
|
2023-01-14 00:48:35 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%_bindir/grommunio-index*
|
|
|
|
%_datadir/%name/
|
2024-06-07 14:34:11 +02:00
|
|
|
%_sysusersdir/*.conf
|
2023-01-14 00:48:35 +01:00
|
|
|
%_unitdir/*
|
|
|
|
%license LICENSE.txt
|
|
|
|
|
|
|
|
%changelog
|