%define _libexecdir %_prefix/libexec Name: gromox Version: 1.1.43.566b624e 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: %name-%version.tar.xz 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: xz BuildRequires: group(gromox) BuildRequires: pkgconfig(gumbo) BuildRequires: pkgconfig(jsoncpp) BuildRequires: pkgconfig(libHX) >= 3 BuildRequires: pkgconfig(libcrypto) BuildRequires: pkgconfig(libpff) BuildRequires: pkgconfig(libssl) BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(zlib) BuildRequires: user(gromox) Requires: php-cli >= 7.4 Requires: php-mysql Requires: php-soap Requires: w3m Requires(pre): user(gromox) Requires(pre): group(gromox) %{?systemd_ordering} %if 0%{?suse_version} && 0%{?suse_version} < 1550 %define pamdir /%_lib/security %else %define pamdir %_libdir/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 for example ships such a ready-to-run installation of Gromox. %prep %autosetup -p1 %build autoreconf -fi %configure CFLAGS="%optflags -Og" CXXFLAGS="%optflags -Og" %make_build %install b="%buildroot" %make_install 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 /run/gromox \ /usr/lib/sysctl.d; do mkdir -p "$b/$i" done cat <<-EOF >"$b/usr/lib/sysctl.d/50-gromox.conf" # privdrop mechanism not optimal yet fs.suid_dumpable=2 EOF find "$b" -type f -name "*.la" -delete rm -fv "$b/%_libdir"/*.so %if "%pamdir" != "%_libdir/security" mkdir -p "$b/%pamdir" mv "$b/%_libdir/security"/* "$b/%pamdir/" %endif mkdir -p "$b/%_sysconfdir/%name" "$b/%_datadir/%name" mkdir -p "$b/%_sysusersdir" "$b/%_tmpfilesdir" ln -s "%_datadir/gromox/tmpfiles-gromox.conf" "$b/%_tmpfilesdir/gromox.conf" perl -i -lpe 's{Type=simple}{Type=simple\nRestart=on-failure}' "$b/%_unitdir"/*.service %fdupes %buildroot/%_prefix %global services gromox-adaptor.service 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 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 /usr/bin/systemctl try-restart php-fpm.service || : %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*/ %_prefix/lib/sysctl.d/ %_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/ %attr(0770,gromox,gromox) %ghost /run/gromox/ %if 0%{?suse_version} >= 1500 && 0%{?suse_version} < 1550 %dir %_libexecdir %endif %license LICENSE.txt %doc doc/changelog.rst %changelog