diff --git a/opendmarc-1.4.0-ticket159-179.patch b/opendmarc-1.4.0-ticket159-179.patch new file mode 100644 index 0000000..66c7fc9 --- /dev/null +++ b/opendmarc-1.4.0-ticket159-179.patch @@ -0,0 +1,72 @@ +diff --color -Nur OpenDMARC-rel-opendmarc-1-4-0.orig/configure.ac OpenDMARC-rel-opendmarc-1-4-0/configure.ac +--- OpenDMARC-rel-opendmarc-1-4-0.orig/configure.ac 2021-04-25 10:35:04.260874195 -0700 ++++ OpenDMARC-rel-opendmarc-1-4-0/configure.ac 2021-04-25 10:32:44.443652511 -0700 +@@ -521,6 +521,7 @@ + reports/opendmarc-expire.8 + reports/opendmarc-import + reports/opendmarc-import.8 ++ reports/opendmarc-importstats + reports/opendmarc-importstats.8 + reports/opendmarc-params + reports/opendmarc-params.8 +diff --color -Nur OpenDMARC-rel-opendmarc-1-4-0.orig/reports/opendmarc-importstats OpenDMARC-rel-opendmarc-1-4-0/reports/opendmarc-importstats +--- OpenDMARC-rel-opendmarc-1-4-0.orig/reports/opendmarc-importstats 2021-01-28 09:35:29.000000000 -0800 ++++ OpenDMARC-rel-opendmarc-1-4-0/reports/opendmarc-importstats 1969-12-31 16:00:00.000000000 -0800 +@@ -1,26 +0,0 @@ +-#!/bin/sh +-## +-## Copyright (c) 2012, The Trusted Domain Project. All rights reserved. +-## +-## opendmarc-importstats -- import opendmarc output to MySQL +-## +-## This is intended to be used via a crontab. If import is successful, +-## this code exits quietly so there's no output. If it fails, it does +-## "ls -l" on the temporary file, so that cron generates mail to whever +-## ran the job. +- +-## setup +-statsdb="/var/tmp/dmarc.dat" +-# OPENDMARC_PASSWORD="password"; export OPENDMARC_PASSWORD +- +-if [ -s $statsdb ] +-then +- mv $statsdb ${statsdb}.OLD.$$ +- +- if opendmarc-import < ${statsdb}.OLD.$$ +- then +- rm ${statsdb}.OLD.$$ +- else +- ls -l ${statsdb}.OLD.$$ +- fi +-fi +diff --color -Nur OpenDMARC-rel-opendmarc-1-4-0.orig/reports/opendmarc-importstats.in OpenDMARC-rel-opendmarc-1-4-0/reports/opendmarc-importstats.in +--- OpenDMARC-rel-opendmarc-1-4-0.orig/reports/opendmarc-importstats.in 1969-12-31 16:00:00.000000000 -0800 ++++ OpenDMARC-rel-opendmarc-1-4-0/reports/opendmarc-importstats.in 2021-04-25 10:34:02.958776971 -0700 +@@ -0,0 +1,27 @@ ++#!/bin/sh ++## ++## Copyright (c) 2012, The Trusted Domain Project. All rights reserved. ++## ++## opendmarc-importstats -- import opendmarc output to MySQL ++## ++## This is intended to be used via a crontab. If import is successful, ++## this code exits quietly so there's no output. If it fails, it does ++## "ls -l" on the temporary file, so that cron generates mail to whever ++## ran the job. ++ ++## setup ++statsdb="`grep ^HistoryFile @sysconfdir@/opendmarc.conf | sed 's/^HistoryFile\s\+//'`" ++[ -z "$statsdb" ] && exit 0 ++# OPENDMARC_PASSWORD="password"; export OPENDMARC_PASSWORD ++ ++if [ -s "$statsdb" ] ++then ++ mv "$statsdb" "${statsdb}.OLD.$$" ++ ++ if @sbindir@/opendmarc-import < ${statsdb}.OLD.$$ ++ then ++ rm "${statsdb}.OLD.$$" ++ else ++ ls -l "${statsdb}.OLD.$$" ++ fi ++fi diff --git a/opendmarc.spec b/opendmarc.spec new file mode 100644 index 0000000..1fda676 --- /dev/null +++ b/opendmarc.spec @@ -0,0 +1,174 @@ +%global upname OpenDMARC +%global bigname OPENDMARC + +Summary: A Domain-based Message Authentication, Reporting & Conformance (DMARC) milter and library +Name: opendmarc +Version: 1.4.2 +Release: 1 +License: BSD and Sendmail +URL: http://www.trusteddomain.org/%{name}.html +Source0: https://github.com/trusteddomainproject/OpenDMARC/archive/refs/tags/rel-opendmarc-1-4-2.tar.gz +Patch01: opendmarc-1.4.0-ticket159-179.patch + + +Requires: lib%{name}%{?_isa} = %{version}-%{release} +BuildRequires: make +BuildRequires: openssl-devel, libtool, pkgconfig, libbsd, libbsd-devel +Requires(pre): shadow-utils +BuildRequires: libmilter +BuildRequires: libmilter-devel +BuildRequires: systemd +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: mariadb-connector-c-devel +BuildRequires: sendmail-milter-devel + +%description +%{upname} (Domain-based Message Authentication, Reporting & Conformance) +provides an open source library that implements the DMARC verification +service plus a milter-based filter application that can plug in to any +milter-aware MTA, including sendmail, Postfix, or any other MTA that supports +the milter protocol. + +The DMARC sender authentication system is still a draft standard, working +towards RFC status. + +The database schema required for some functions is provided in +%{_datadir}/%{name}/db. The rddmarc tools are provided in +%{_datadir}/%{name}/contrib/rddmarc. + +%package -n libopendmarc +Summary: An open source DMARC library + +%description -n libopendmarc +This package contains the library files required for running services built +using libopendmarc. + +%package -n libopendmarc-devel +Summary: Development files for libopendmarc +Requires: lib%{name}%{?_isa} = %{version}-%{release} + +%description -n lib%{name}-devel +This package contains the static libraries, headers, and other support files +required for developing applications against libopendmarc. + +%prep +%autosetup -p1 -n OpenDMARC-rel-opendmarc-1-4-2 + +%build +autoreconf -v -i +%configure --with-sql-backend --with-spf -with-spf2-include=%{_prefix}/include/spf2 +make DESTDIR=%{buildroot} %{?_smp_mflags} + +%install +make DESTDIR=%{buildroot} install %{?_smp_mflags} +mkdir -p %{buildroot}%{_sysconfdir} +install -d %{buildroot}%{_sysconfdir}/sysconfig +mkdir -p -m 0755 %{buildroot}%{_sysconfdir}/%{name} + +cat > %{buildroot}%{_sysconfdir}/sysconfig/%{name} << 'EOF' +# Set the necessary startup options +OPTIONS="-c %{_sysconfdir}/%{name}.conf" +EOF + +install -d -m 0755 %{buildroot}%{_unitdir} +cat > %{buildroot}%{_unitdir}/%{name}.service </dev/null || groupadd -r %{name} +getent passwd %{name} >/dev/null || \ + useradd -r -g %{name} -G mail -d %{_rundir}/%{name} -s /sbin/nologin \ + -c "%{upname} Milter" %{name} +exit 0 + +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + +%ldconfig_scriptlets -n libopendmarc + +%files +%license LICENSE LICENSE.Sendmail +%doc README RELEASE_NOTES +%config(noreplace) %{_sysconfdir}/%{name}.conf +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%{_datadir}/%{name} +%{_sbindir}/* +%{_mandir}/*/* +%dir %attr(-,%{name},%{name}) %{_localstatedir}/spool/%{name} +%dir %attr(710,%{name},mail) %{_rundir}/%{name} +%dir %attr(-,%{name},%{name}) %{_sysconfdir}/%{name} +%attr(0644,root,root) %{_unitdir}/%{name}.service + +%files -n libopendmarc +%{_libdir}/lib%{name}.so.* + +%files -n libopendmarc-devel +%doc lib%{name}/docs/*.html +%{_includedir}/%{name} +%{_libdir}/*.so + +%changelog +* Tue Oct 18 2022 openEuler Application - 1.4.2-1 +- DESC:Package init + diff --git a/opendmarc.yaml b/opendmarc.yaml new file mode 100644 index 0000000..bf8cc59 --- /dev/null +++ b/opendmarc.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: trusteddomainproject/OpenDMARC +tag_prefix: "^rel-opendmarc-" +separator: "-" diff --git a/rel-opendmarc-1-4-2.tar.gz b/rel-opendmarc-1-4-2.tar.gz new file mode 100644 index 0000000..a8a5501 Binary files /dev/null and b/rel-opendmarc-1-4-2.tar.gz differ