Jan Engelhardt
687beea213
OBS-URL: https://build.opensuse.org/package/show/server:mail/gromox?expand=0&rev=6
173 lines
5.0 KiB
RPMSpec
173 lines
5.0 KiB
RPMSpec
|
|
|
|
%define _libexecdir %_prefix/libexec
|
|
|
|
Name: gromox
|
|
Version: 1.16
|
|
Release: 0
|
|
Summary: Groupware server backend with RPC, IMAP,POP3, PHP-MAPI support
|
|
License: AGPL-3.0-or-later AND GPL-2.0-only AND GPL-3.0-or-later
|
|
Group: Productivity/Networking/Email/Servers
|
|
URL: https://grommunio.com/
|
|
Source: https://github.com/grommunio/gromox/releases/download/gromox-%version/gromox-%version.tar.zst
|
|
Source2: https://github.com/grommunio/gromox/releases/download/gromox-%version/gromox-%version.tar.asc
|
|
Source9: %name-rpmlintrc
|
|
BuildRequires: automake >= 1.11
|
|
BuildRequires: fdupes
|
|
BuildRequires: gcc-c++
|
|
%if 0%{?suse_version}
|
|
BuildRequires: libmysqlclient-devel >= 5.6
|
|
%else
|
|
BuildRequires: mysql-devel >= 5.6
|
|
%endif
|
|
BuildRequires: libtool >= 2
|
|
BuildRequires: make
|
|
BuildRequires: openldap2-devel
|
|
BuildRequires: pam-devel
|
|
BuildRequires: pkg-config
|
|
%if 0%{?suse_version} >= 1550
|
|
BuildRequires: php8-devel
|
|
%else
|
|
BuildRequires: php-devel >= 7
|
|
%endif
|
|
BuildRequires: zstd
|
|
BuildRequires: group(gromox)
|
|
BuildRequires: pkgconfig(gumbo)
|
|
BuildRequires: pkgconfig(jsoncpp)
|
|
BuildRequires: pkgconfig(libHX) >= 4.0
|
|
BuildRequires: pkgconfig(libcrypto)
|
|
BuildRequires: pkgconfig(libpff)
|
|
BuildRequires: pkgconfig(libssl)
|
|
BuildRequires: pkgconfig(sqlite3)
|
|
BuildRequires: pkgconfig(zlib)
|
|
BuildRequires: user(gromox)
|
|
Requires: php-cli >= 7.4
|
|
%if 0%{?suse_version}
|
|
Requires: php-mysql
|
|
%else
|
|
Requires: php-mysqlnd
|
|
%endif
|
|
Requires: php-soap
|
|
Requires: w3m
|
|
Requires(pre): user(gromox)
|
|
Requires(pre): group(gromox)
|
|
%{?systemd_ordering}
|
|
%if !0%{?_pamdir:1}
|
|
%define _pamdir /%_lib/security
|
|
%endif
|
|
|
|
%description
|
|
Gromox is the central groupware server component of grommunio. It is
|
|
capable of serving as a replacement for Microsoft Exchange and
|
|
compatibles. Connectivity options include RPC/HTTP (Outlook
|
|
Anywhere), MAPI/HTTP, IMAP, POP3, an SMTP-speaking LDA, and a PHP
|
|
module with a Z-MAPI function subset.
|
|
|
|
Gromox relies on other components to provide a sensibly complete mail
|
|
system, such as Postfix as a mail transfer agent, and grommunio-admin
|
|
for user management. A webmail client interface is available with
|
|
grommunio-web. The grommunio appliance ships these essentials and has a
|
|
ready-to-run installation of Gromox.
|
|
|
|
%prep
|
|
%setup -Tcq
|
|
tar --use=zstd --strip=1 -xf "%{S:0}"
|
|
|
|
%build
|
|
autoreconf -fi
|
|
%configure
|
|
%make_build
|
|
|
|
%install
|
|
b="%buildroot"
|
|
%make_install
|
|
%if "%_pamdir" != "%_libdir/security"
|
|
# libtool gets confused if pamlibdir is not below prefix;
|
|
# as such we are not using `make install pamlibdir=...`
|
|
mkdir -pv "$b/%_pamdir"
|
|
mv "$b/%_libdir/security"/* "$b/%_pamdir/"
|
|
%endif
|
|
# done in system-user-gromox (which exists for ease of building for multiple distros)
|
|
rm -fv "%buildroot/%_sysusersdir/sysusers-gromox.conf"
|
|
for i in /var/lib/gromox /var/lib/gromox/domain \
|
|
/var/lib/gromox/queue /var/lib/gromox/queue/clone \
|
|
/var/lib/gromox/queue/mess /var/lib/gromox/queue/save \
|
|
/var/lib/gromox/queue/cache /var/lib/gromox/queue/insulation \
|
|
/var/lib/gromox/queue/timer /var/lib/gromox/user \
|
|
/var/log/gromox; do
|
|
mkdir -p "$b/$i"
|
|
done
|
|
|
|
find "$b" -type f -name "*.la" -delete
|
|
rm -fv "$b/%_libdir"/*.so
|
|
|
|
mkdir -p "$b/%_sysconfdir/%name" "$b/%_datadir/%name"
|
|
%fdupes %buildroot/%_prefix
|
|
|
|
%global services gromox-delivery.service gromox-delivery-queue.service gromox-event.service gromox-http.service gromox-imap.service gromox-midb.service gromox-pop3.service gromox-timer.service gromox-zcore.service
|
|
|
|
%pre
|
|
%if 0%{?service_add_pre:1}
|
|
%service_add_pre %services
|
|
%endif
|
|
|
|
%post
|
|
/sbin/ldconfig
|
|
%tmpfiles_create tmpfiles-gromox.conf
|
|
%if 0%{?service_add_post:1}
|
|
%service_add_post %services
|
|
%else
|
|
%systemd_post %services
|
|
%endif
|
|
if ! test -x /usr/bin/systemctl; then
|
|
exit 0
|
|
fi
|
|
# saslauthd re-opens pam_gromox.so everytime, however
|
|
# libgromox_common.so stays resident because of STB_UNIQUE symbols,
|
|
# therefore saslauthd can run into the problem that a new version of
|
|
# the pam module will be combined with a too old version of gromox
|
|
# libs. No good solution in sight..
|
|
/usr/bin/systemctl try-restart grommunio-chat.service php-fpm.service saslauthd.service 2>/dev/null || :
|
|
|
|
%preun
|
|
%if 0%{?service_del_preun:1}
|
|
%service_del_preun %services
|
|
%else
|
|
%systemd_preun %services
|
|
%endif
|
|
|
|
%postun
|
|
%if 0%{?service_del_postun:1}
|
|
%service_del_postun %services
|
|
%else
|
|
%systemd_postun_with_restart %services
|
|
%endif
|
|
/sbin/ldconfig
|
|
|
|
%files
|
|
%_sysconfdir/php*
|
|
# Somehow need to give grommunio-admin-api write permissions.
|
|
# RPM probably does not do ACL well (if at all).
|
|
# Services use ProtectSystem=, so it's ok to have g+w for grommunio-admin-api.
|
|
# pam.cfg needs to be readable by all
|
|
%attr(0771,root,gromox) %dir %_sysconfdir/%name/
|
|
%_sbindir/gromox-*
|
|
%_libdir/*.so.*
|
|
%_libdir/%name/
|
|
%_libdir/php*/
|
|
%_libexecdir/%name/
|
|
%_pamdir/
|
|
%_datadir/%name/
|
|
%_mandir/man*/*.[0-9]*
|
|
%_tmpfilesdir/*.conf
|
|
%_unitdir/*
|
|
%attr(0770,gromox,gromox) /var/lib/gromox/
|
|
%attr(0770,gromox,gromox) /var/log/gromox/
|
|
%if 0%{?suse_version} >= 1500 && 0%{?suse_version} < 1550
|
|
%dir %_libexecdir
|
|
%endif
|
|
%license LICENSE.txt
|
|
%doc doc/changelog.rst
|
|
|
|
%changelog
|