diff --git a/additional/journalwrap b/additional/journalwrap new file mode 100755 index 0000000..fb73dd7 Binary files /dev/null and b/additional/journalwrap differ diff --git a/root/opt/mailstats/css/mailstats.css b/root/opt/mailstats/css/mailstats.css index 171d07e..a2a6c2d 100644 --- a/root/opt/mailstats/css/mailstats.css +++ b/root/opt/mailstats/css/mailstats.css @@ -291,7 +291,7 @@ p.cssvalid,p.htmlvalid {float:left;margin-right:20px} padding: 1em; border-radius: 6px; font-family: monospace, monospace; - font-size: 0.95em; + font-size: 0.75em; line-height: 1.4; overflow-x: auto; } diff --git a/root/opt/mailstats/html/ShowDetailedLogs.php b/root/opt/mailstats/html/ShowDetailedLogs.php index f8836b4..d2a6d20 100644 --- a/root/opt/mailstats/html/ShowDetailedLogs.php +++ b/root/opt/mailstats/html/ShowDetailedLogs.php @@ -94,7 +94,7 @@ if (!$pid || $pid < 1) { // Journal retrieval using C wrapper define('FFI_LIB', 'libjournalwrap.so'); // adjust if needed -define('WRAPPER_BIN', '/usr/local/bin/journalwrap'); // fallback executable path +define('WRAPPER_BIN', '/usr/bin/journalwrap'); // fallback executable path define('MAX_OUTPUT_BYTES', 2_000_000); // 2MB safety cap function getJournalByPidViaFFI(int $pid): ?string { diff --git a/smeserver-mailstats.spec b/smeserver-mailstats.spec index 418334b..008164b 100644 --- a/smeserver-mailstats.spec +++ b/smeserver-mailstats.spec @@ -13,6 +13,9 @@ License: GPL Group: SME/addon Source: %{name}-%{version}.tgz +%global _binaries_in_noarch_packages_terminate_build 0 +%global debug_package %{nil} + BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArchitectures: noarch Requires: smeserver-release => 9.0 @@ -35,6 +38,57 @@ AutoReqProv: no A script that via cron.d e-mails mail statistics to admin on a daily basis. See https://wiki.koozali.org/mailstats +%prep +%setup + +%build +perl createlinks + +%install +/bin/rm -rf $RPM_BUILD_ROOT +(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +chmod +x $RPM_BUILD_ROOT/usr/bin/runmailstats.sh + +#chmod 0640 $RPM_BUILD_ROOT/etc/mailstats/db.php +#ls -l /builddir/build/BUILDROOT/smeserver-mailstats-11.1-5.el8.sme.x86_64/etc/mailstats/ +#chown root:102 $RPM_BUILD_ROOT/etc/mailstats/db.php + +# Define the placeholder and generate the current date and time +now=$(date +"%Y-%m-%d %H:%M:%S") + +# Replace the placeholder in the Python program located at %{BUILDROOT}/usr/bin +sed -i "s|__BUILD_DATE_TIME__|$now|" $RPM_BUILD_ROOT/usr/bin/mailstats.py + +/bin/rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist --file '/etc/mailstats/db.php' 'attr(0640, root, apache)' $RPM_BUILD_ROOT | grep -v "\.pyc" | grep -v "\.pyo" > %{name}-%{version}-filelist + +install -Dpm 0755 journalwrap %{buildroot}%{_bindir}/journalwrap +#install -Dpm 0644 libjournalwrap.so %{buildroot}%{_libdir}/libjournalwrap.so + + +%pre +/usr/bin/pip3 install -q pymysql +/usr/bin/pip3 install -q numpy +/usr/bin/pip3 install -q pandas + +%clean +/bin/rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) +#%attr(0640, root, apache) %config(noreplace) /etc/mailstats/db.php +%{_bindir}/journalwrap + +#%{_libdir}/libjournalwrap.so + + +%post +/sbin/ldconfig +usermod -aG systemd-journal www + +%postun +/sbin/ldconfig + %changelog * Tue Sep 02 2025 Brian Read 11.1-5.sme - Speed up Journal access [SME: 13121] @@ -127,38 +181,4 @@ See https://wiki.koozali.org/mailstats - Add Update event to createlinks Unexpected failure string in log file: auth::auth_cvm_unix_local see [SME 7089] * Sat May 26 2012 Brian J read 1.0-1.sme -- Initial version - -%prep -%setup - -%build -perl createlinks - -%install -/bin/rm -rf $RPM_BUILD_ROOT -(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) -chmod +x $RPM_BUILD_ROOT/usr/bin/runmailstats.sh -#chmod 0640 $RPM_BUILD_ROOT/etc/mailstats/db.php -#ls -l /builddir/build/BUILDROOT/smeserver-mailstats-11.1-5.el8.sme.x86_64/etc/mailstats/ -#chown root:102 $RPM_BUILD_ROOT/etc/mailstats/db.php -# Define the placeholder and generate the current date and time -now=$(date +"%Y-%m-%d %H:%M:%S") - -# Replace the placeholder in the Python program located at %{BUILDROOT}/usr/bin -sed -i "s|__BUILD_DATE_TIME__|$now|" $RPM_BUILD_ROOT/usr/bin/mailstats.py - -/bin/rm -f %{name}-%{version}-filelist -/sbin/e-smith/genfilelist $RPM_BUILD_ROOT | grep -v "\.pyc" | grep -v "\.pyo" > %{name}-%{version}-filelist - -%pre -/usr/bin/pip3 install -q pymysql -/usr/bin/pip3 install -q numpy -/usr/bin/pip3 install -q pandas - -%clean -/bin/rm -rf $RPM_BUILD_ROOT - -%files -f %{name}-%{version}-filelist -%defattr(-,root,root) -%attr(0640, root, apache) %config(noreplace) /etc/mailstats/db.php +- Initial version \ No newline at end of file