Bug 1877006 - Review Request: smf-spf - Mail filter for Sender Policy Framework verification
Summary: Review Request: smf-spf - Mail filter for Sender Policy Framework verification
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/jcbf/smf-spf/
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-08 17:14 UTC by Jordi Sanfeliu
Modified: 2023-07-13 15:16 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-13 15:16:46 UTC
Type: ---
Embargoed:
ppisar: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 5383892 to 6141088 (370 bytes, patch)
2023-07-04 15:14 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6141088 to 6141151 (394 bytes, patch)
2023-07-04 15:53 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6141151 to 6141267 (1.75 KB, patch)
2023-07-04 17:00 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6141267 to 6149097 (494 bytes, patch)
2023-07-07 07:53 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6149097 to 6161483 (2.57 KB, patch)
2023-07-11 14:04 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6161483 to 6164027 (1.98 KB, patch)
2023-07-12 09:37 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6164027 to 6164195 (343 bytes, patch)
2023-07-12 10:37 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6164195 to 6169035 (693 bytes, patch)
2023-07-13 10:42 UTC, Fedora Review Service
no flags Details | Diff

Description Jordi Sanfeliu 2020-09-08 17:14:05 UTC
Spec URL: http://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: http://ftp.fibranet.cat/smf-spf/smf-spf-2.4.3-1.el8.src.rpm
Description: smf-spf is a lightweight, fast and reliable Sendmail milter that implements the Sender Policy Framework technology with the help of the libspf2 library. It checks SPF records to make sure that e-mail messages are authorized by the domain that it is coming from. It's an alternative for the spfmilter, spf-milter, and milter-spiff milters.
Fedora Account System Username: mikaku

Comment 1 Robert-André Mauchin 🐧 2020-09-10 17:05:54 UTC
 All these things have been obsolete for years:

# Do a systemd-based build from F-15; otherwise, a sysvinit-based build
%global use_systemd %([ "(" 0%{?fedora} -gt 14 ")" -o "(" 0%{?rhel} -gt 6 ")" ] && echo 1 || echo 0)

# This macro only defined by default around Fedora 10 time
%{!?_initddir:%global _initddir %{_initrddir}}

# With systemd, the run directory is /run; otherwise it's /var/run
%if %{use_systemd}
%global rundir /run
%else
%global rundir %{_localstatedir}/run
%endif


F15? F10? Older than my nephew. Don't include them.

 - Source must either be an url or you need to add a comment explaining how the archive got generated:

Source0:	%{name}-%{version}.tar.gz

 - Not needed:

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)

Group:		System Environment/Daemons

rm -rf %{buildroot}

%clean
rm -rf %{buildroot}


%defattr(-,root,root,-)


 - Use the System scriptlets, see: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd

BuildRequires:	systemd-units
Requires(post):	systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units

[…]

%post
if [ $1 -eq 1 ]; then
	# Initial installation 
%if %{use_systemd}
	/bin/systemctl daemon-reload &>/dev/null || :
%else
	/sbin/chkconfig --add smf-spf || :
%endif
fi

%preun
if [ $1 -eq 0 ]; then
	# Package removal, not upgrade
%if %{use_systemd}
	/bin/systemctl --no-reload disable smf-spf.service &>/dev/null || :
	/bin/systemctl stop smf-spf.service &>/dev/null || :
%else
	%{_initddir}/smf-spf stop &>/dev/null || :
	/sbin/chkconfig --del smf-spf || :
%endif
fi

%postun
%if %{use_systemd}
/bin/systemctl daemon-reload &>/dev/null || :
%endif
if [ $1 -ge 1 ]; then
	# Package upgrade, not uninstall
%if %{use_systemd}
	/bin/systemctl try-restart smf-spf.service &>/dev/null || :
%else
	%{_initddir}/smf-spf condrestart &>/dev/null || :
%endif
fi

→

BuildRequires:	systemd-rpm-macros

[…]

%post
%systemd_post smf-spf.service

%preun
%systemd_preun smf-spf.service

%postun
%systemd_postun_with_restart smf-spf.service


 - COPYING must be installed with %license, not %doc:

%doc ChangeLog readme README.rpm
license COPYING

 - make %{?_smp_mflags} OPTFLAGS="%{optflags}" 

→ 

%set_build_flags

 - Add the comment regarding the patches above each PatchX line

 - Requires(pre):	/usr/bin/getent, /usr/sbin/groupadd, /usr/sbin/useradd, /usr/sbin/usermod → Requires(pre): shadow-utils

 - One BR per line would be nice:

BuildRequires:	libspf2-devel >= 1.2.5
BuildRequires:	sendmail-milter-devel >= 8.12

%make_build

 - Explicitly BR gcc

Comment 2 Jordi Sanfeliu 2020-10-01 09:11:31 UTC
(In reply to Robert-André Mauchin 🐧 from comment #1)
>  All these things have been obsolete for years:
> 
> # Do a systemd-based build from F-15; otherwise, a sysvinit-based build
> %global use_systemd %([ "(" 0%{?fedora} -gt 14 ")" -o "(" 0%{?rhel} -gt 6
> ")" ] && echo 1 || echo 0)
> 
> # This macro only defined by default around Fedora 10 time
> %{!?_initddir:%global _initddir %{_initrddir}}
> 
> # With systemd, the run directory is /run; otherwise it's /var/run
> %if %{use_systemd}
> %global rundir /run
> %else
> %global rundir %{_localstatedir}/run
> %endif
> 
> 
> F15? F10? Older than my nephew. Don't include them.
LOL, sorry. Removed.



>  - Source must either be an url or you need to add a comment explaining how
> the archive got generated:
> 
> Source0:	%{name}-%{version}.tar.gz
Hmm ... if I put the line:
Source0:        https://github.com/jcbf/smf-spf/archive/v2.4.3.tar.gz

then I get the following message:

# rpmbuild -ba smf-spf.spec 
error: Bad source: /root/rpmbuild/SOURCES/v2.4.3.tar.gz: No such file or directory

How/where should I include the URL?



>  - Not needed:
> 
> BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
> 
> Group:		System Environment/Daemons
> 
> rm -rf %{buildroot}
> 
> %clean
> rm -rf %{buildroot}
> 
> 
> %defattr(-,root,root,-)
OK, removed.



>  - Use the System scriptlets, see:
OK, done.



>  - COPYING must be installed with %license, not %doc:
OK, done.



>  - make %{?_smp_mflags} OPTFLAGS="%{optflags}" 
> 
> → 
> 
> %set_build_flags
Sorry, I don't understand this.



>  - Add the comment regarding the patches above each PatchX line
OK, done.



>  - Requires(pre):	/usr/bin/getent, /usr/sbin/groupadd, /usr/sbin/useradd,
> /usr/sbin/usermod → Requires(pre): shadow-utils
OK, done.



>  - One BR per line would be nice:
> 
> BuildRequires:	libspf2-devel >= 1.2.5
> BuildRequires:	sendmail-milter-devel >= 8.12
OK, done.



> %make_build
> 
>  - Explicitly BR gcc
I don't understand this.


Refreshed files:
Spec URL: http://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: http://ftp.fibranet.cat/smf-spf/smf-spf-2.4.3-1.el8.src.rpm

Thank you very much.

Comment 3 Robert-André Mauchin 🐧 2020-10-05 19:24:57 UTC
>  - Source must either be an url or you need to add a comment explaining how
> the archive got generated:
> 
> Source0:	%{name}-%{version}.tar.gz
Hmm ... if I put the line:
Source0:        https://github.com/jcbf/smf-spf/archive/v2.4.3.tar.gz

then I get the following message:

# rpmbuild -ba smf-spf.spec 
error: Bad source: /root/rpmbuild/SOURCES/v2.4.3.tar.gz: No such file or directory

How/where should I include the URL?

First

Source0:        https://github.com/jcbf/smf-spf/archive/v%{version}/%{name}-%{version}.tar.gz


Then you should d/l with: spectool -g smf-spf.spec

It will d/l the source next to your SPEC.

Secondly, I never use rpmbuild anymore. I always use a chroot: 

fedpkg --release f34 mockbuild --mock-config fedora-rawhide-x86_64 

This avoid mixing the deps with your own system, and maybe miss deps.

Then you can check your build on Koji afterwards:

fedpkg  --release f34 scratch-build --srpm --fail-fast


>>  - make %{?_smp_mflags} OPTFLAGS="%{optflags}" 
>> 
>> → 
>> 
>> %set_build_flags
>Sorry, I don't understand this.


See your patch:

diff -ru smf-spf-2.4.3.orig/Makefile smf-spf-2.4.3/Makefile
--- smf-spf-2.4.3.orig/Makefile	2020-03-26 00:45:26.000000000 +0100
+++ smf-spf-2.4.3/Makefile	2020-06-15 11:03:57.339000000 +0200
@@ -7,10 +7,10 @@
 CONFDIR = /etc/mail/smfs
 USER = smfs
 GROUP = smfs
-CFLAGS = -O2 -D_REENTRANT -fomit-frame-pointer -I/usr/local/include 
+CFLAGS = -pthread $(OPTFLAGS)
 
 # Linux
-LDFLAGS = -lmilter -lpthread -L/usr/lib/libmilter -L/usr/local/lib -lspf2
+LDFLAGS = -lmilter -lpthread -lspf2
 
 # FreeBSD
 #LDFLAGS = -lmilter -pthread -L/usr/local/lib -lspf2
@@ -25,7 +25,6 @@
 
 smf-spf: smf-spf.o
 	$(CC) -o smf-spf smf-spf.o $(LDFLAGS)
-	strip smf-spf
 
 smf-spf.o: smf-spf.c
 	$(CC) $(CFLAGS) -c smf-spf.c


I don't think it is judicious to use $(OPTFLAGS) here, instead you can use the macro %set_build_flags to define CFLAGS and LDFLAGS at the same time to use with make afterwards:

%set_build_flags
%make_build

>> - Explicitly BR gcc
>I don't understand this.
 
For C and C++ programs, you must explicitly BuildRequires the compiler

BuildRequires:  gcc

Comment 4 Jordi Sanfeliu 2020-10-15 13:08:25 UTC
(In reply to Robert-André Mauchin 🐧 from comment #3)

> Source0:       
> https://github.com/jcbf/smf-spf/archive/v%{version}/%{name}-%{version}.tar.gz
> 
OK, done.



> See your patch:
> 
> diff -ru smf-spf-2.4.3.orig/Makefile smf-spf-2.4.3/Makefile
> --- smf-spf-2.4.3.orig/Makefile	2020-03-26 00:45:26.000000000 +0100
> +++ smf-spf-2.4.3/Makefile	2020-06-15 11:03:57.339000000 +0200
> @@ -7,10 +7,10 @@
>  CONFDIR = /etc/mail/smfs
>  USER = smfs
>  GROUP = smfs
> -CFLAGS = -O2 -D_REENTRANT -fomit-frame-pointer -I/usr/local/include 
> +CFLAGS = -pthread $(OPTFLAGS)
>  
>  # Linux
> -LDFLAGS = -lmilter -lpthread -L/usr/lib/libmilter -L/usr/local/lib -lspf2
> +LDFLAGS = -lmilter -lpthread -lspf2
>  
>  # FreeBSD
>  #LDFLAGS = -lmilter -pthread -L/usr/local/lib -lspf2
> @@ -25,7 +25,6 @@
>  
>  smf-spf: smf-spf.o
>  	$(CC) -o smf-spf smf-spf.o $(LDFLAGS)
> -	strip smf-spf
>  
>  smf-spf.o: smf-spf.c
>  	$(CC) $(CFLAGS) -c smf-spf.c
> 
> 
> I don't think it is judicious to use $(OPTFLAGS) here, instead you can use
> the macro %set_build_flags to define CFLAGS and LDFLAGS at the same time to
> use with make afterwards:
> 
> %set_build_flags
> %make_build
> 
> >> - Explicitly BR gcc
> >I don't understand this.
I've finally opted to keep the patch as is and continue including the OPTFLAGS. I've just changed
the build lines as you suggested and it builds well.



> For C and C++ programs, you must explicitly BuildRequires the compiler
> 
> BuildRequires:  gcc
OK, done



Refreshed files:
Spec URL: http://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: http://ftp.fibranet.cat/smf-spf/smf-spf-2.4.3-1.fc32.src.rpm

Thank you very much.

Comment 5 Robert-André Mauchin 🐧 2020-11-06 07:33:12 UTC
 - NOt needed:

BuildRequires:	systemd-units

Requires(post):	systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units

Use:

BuildRequires:	systemd-rpm-macros

 - Not needed, this is already taken care of by Requires(pre):	shadow-utils  :

Requires(pre):	/usr/bin/getent, /usr/sbin/groupadd, /usr/sbin/useradd, /usr/sbin/usermod


- %set_build_flags OPTFLAGS="%{optflags}"
%make_build

 %set_build_flags define otpflags so this is meaningless.

if you want to keep optflags like this just switch back to 

  %make_build OPTFLAGS="%{optflags}" 

also you need to define LDFLAGS similarly with %build_ldflags

 - Notify upstream about their obsoletet FSF address (don't patch it)


smf-spf.x86_64: E: incorrect-fsf-address /usr/share/licenses/smf-spf/COPYING


Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed



===== MUST items =====

Generic:
[ ]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[ ]: License field in the package spec file matches the actual license.
     Note: There is no build directory. Running licensecheck on vanilla
     upstream sources. Licenses found: "Unknown or generated", "*No
     copyright* Apache License 2.0", "Apache License 2.0". 21 files have
     unknown license. Detailed output of licensecheck in
     /home/bob/packaging/review/golang-nanomsg-mangos-3/review-golang-
     nanomsg-mangos-3/licensecheck.txt
[ ]: License file installed when any subpackage combination is installed.
[ ]: %build honors applicable compiler flags or justifies otherwise.
[ ]: Package contains no bundled libraries without FPC exception.
[ ]: Changelog in prescribed format.
[ ]: Sources contain only permissible code or content.
[ ]: Package contains desktop file if it is a GUI application.
[ ]: Development files must be in a -devel package
[ ]: Package uses nothing in %doc for runtime.
[ ]: Package consistently uses macros (instead of hard-coded directory
     names).
[ ]: Package is named according to the Package Naming Guidelines.
[ ]: Package does not generate any conflict.
[ ]: Package obeys FHS, except libexecdir and /usr/target.
[ ]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[ ]: Requires correct, justified where necessary.
[ ]: Spec file is legible and written in American English.
[ ]: Package contains systemd file(s) if in need.
[ ]: Useful -debuginfo package or justification otherwise.
[ ]: Package is not known to require an ExcludeArch tag.
[ ]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 184320 bytes in 64 files.
[ ]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[ ]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[ ]: Final provides and requires are sane (see attachments).
[ ]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in golang-
     nanomsg-mangos-3-devel
[ ]: Package functions as described.
[ ]: Latest version is packaged.
[ ]: Package does not include license text files separate from upstream.
[ ]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[ ]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[ ]: %check is present and all tests pass.
[ ]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: golang-nanomsg-mangos-3-3.1.3-1.fc34.x86_64.rpm
          golang-nanomsg-mangos-3-devel-3.1.3-1.fc34.noarch.rpm
          golang-nanomsg-mangos-3-debuginfo-3.1.3-1.fc34.x86_64.rpm
          golang-nanomsg-mangos-3-debugsource-3.1.3-1.fc34.x86_64.rpm
          golang-nanomsg-mangos-3-3.1.3-1.fc34.src.rpm
golang-nanomsg-mangos-3.x86_64: W: no-manual-page-for-binary macat
golang-nanomsg-mangos-3.x86_64: W: no-manual-page-for-binary perf
golang-nanomsg-mangos-3-devel.noarch: W: hidden-file-or-dir /usr/share/gocode/src/go.nanomsg.org/mangos/v3/.goipath
5 packages and 0 specfiles checked; 0 errors, 3 warnings.

Comment 6 Jordi Sanfeliu 2020-11-23 08:44:23 UTC
(In reply to Robert-André Mauchin 🐧 from comment #5)
>  - NOt needed:
> 
> BuildRequires:	systemd-units
> 
> Requires(post):	systemd-units
> Requires(preun): systemd-units
> Requires(postun): systemd-units
> 
> Use:
> 
> BuildRequires:	systemd-rpm-macros
OK, done. Thanks.



>  - Not needed, this is already taken care of by Requires(pre):	shadow-utils 
> :
> 
> Requires(pre):	/usr/bin/getent, /usr/sbin/groupadd, /usr/sbin/useradd,
> /usr/sbin/usermod
> 
OK, done. Thanks.



> - %set_build_flags OPTFLAGS="%{optflags}"
> %make_build
> 
>  %set_build_flags define otpflags so this is meaningless.
> 
> if you want to keep optflags like this just switch back to 
> 
>   %make_build OPTFLAGS="%{optflags}"
OK, done. Thanks.



> also you need to define LDFLAGS similarly with %build_ldflags
You mean I need to add the following line?
%set_build_ldflags LDFLAGS="%{ldflags}"



> 
>  - Notify upstream about their obsoletet FSF address (don't patch it)
> 
> 
> smf-spf.x86_64: E: incorrect-fsf-address /usr/share/licenses/smf-spf/COPYING
> 
Filed a PR: <https://github.com/jcbf/smf-spf/pull/87>
Waiting an answer from upstream.

Comment 7 Robert-André Mauchin 🐧 2021-01-02 12:58:09 UTC
(In reply to Jordi Sanfeliu from comment #6)
> (In reply to Robert-André Mauchin 🐧 from comment #5)
> > also you need to define LDFLAGS similarly with %build_ldflags
> You mean I need to add the following line?
> %set_build_ldflags LDFLAGS="%{ldflags}"
> 
No only if you choose to go  with  %make_build OPTFLAGS="%{optflags}" like this:

%make_build OPTFLAGS="%{optflags}"  LDFLAGS="%{build_ldflags}"

Comment 8 Jordi Sanfeliu 2021-01-21 08:48:26 UTC
(In reply to Robert-André Mauchin 🐧 from comment #7)
> No only if you choose to go  with  %make_build OPTFLAGS="%{optflags}" like
> this:
> 
> %make_build OPTFLAGS="%{optflags}"  LDFLAGS="%{build_ldflags}"

Do I really need to append it?
If I append the LDFLAGS="%{build_ldflags}" then I get a lot of errors and does not build.

The Makefile of that tool comes with some LDFLAGS set for different systems for portability reasons:

[...]

# Linux
LDFLAGS = -lmilter -lpthread -lspf2

# FreeBSD
#LDFLAGS = -lmilter -pthread -L/usr/local/lib -lspf2

# Solaris
#LDFLAGS = -lmilter -lpthread -lsocket -lnsl -lresolv -lspf2

[...]



- Find the latest .spec and SRPM versions here
Spec URL: http://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: http://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1-1.fc32.src.rpm



- On the other hand, my PR <https://github.com/jcbf/smf-spf/pull/87> was finally accepted and merged,
so now it has the correct COPYING file.

I'm just waiting a new release of the upstream to create the final SRPM.

Comment 9 Robert-André Mauchin 🐧 2021-01-21 12:04:00 UTC
(In reply to Jordi Sanfeliu from comment #8)
> (In reply to Robert-André Mauchin 🐧 from comment #7)
> > No only if you choose to go  with  %make_build OPTFLAGS="%{optflags}" like
> > this:
> > 
> > %make_build OPTFLAGS="%{optflags}"  LDFLAGS="%{build_ldflags}"
> 
> Do I really need to append it?
> If I append the LDFLAGS="%{build_ldflags}" then I get a lot of errors and
> does not build.
> 
> The Makefile of that tool comes with some LDFLAGS set for different systems
> for portability reasons:
> 
> [...]
> 
> # Linux
> LDFLAGS = -lmilter -lpthread -lspf2
> 
> # FreeBSD
> #LDFLAGS = -lmilter -pthread -L/usr/local/lib -lspf2
> 
> # Solaris
> #LDFLAGS = -lmilter -lpthread -lsocket -lnsl -lresolv -lspf2
> 
> [...]
> 
> 

You can pass them in the spec:

%make_build OPTFLAGS="%{optflags}" LDFLAGS="%{build_ldflags} -lmilter -lpthread -lspf2"

 - Remove %clean

 - Notify upstream that they are using an obsolete FSF address:

smf-spf.x86_64: E: incorrect-fsf-address /usr/share/licenses/smf-spf/COPYING


 - Use %{_tmpfilesdir} instead of %{_prefix}/lib/tmpfiles.d/


Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed



===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "GNU General Public License, Version
     2", "GNU General Public License v2.0 or later [obsolete FSF postal
     address (Mass Ave)]", "Expat License". 81 files have unknown license.
     Detailed output of licensecheck in /home/bob/packaging/review/smf-
     spf/review-smf-spf/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 3 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: No %config files under /usr.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: systemd_post is invoked in %post, systemd_preun in %preun, and
     systemd_postun in %postun for Systemd service files.
     Note: Systemd service file(s) in smf-spf
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[ ]: Files in /run, var/run and /var/lock uses tmpfiles.d when appropriate
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Fully versioned dependency in subpackages if applicable.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: There are rpmlint messages (see attachment).
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: smf-spf-2.5.1-1.fc33.x86_64.rpm
          smf-spf-debuginfo-2.5.1-1.fc33.x86_64.rpm
          smf-spf-debugsource-2.5.1-1.fc33.x86_64.rpm
          smf-spf-2.5.1-1.fc33.src.rpm
smf-spf.x86_64: W: spelling-error %description -l en_US milter -> molter, miler, miter
smf-spf.x86_64: W: spelling-error %description -l en_US spfmilter -> filterer
smf-spf.x86_64: W: spelling-error %description -l en_US milters -> molters, milers, miters
smf-spf.x86_64: W: no-url-tag
smf-spf.x86_64: W: non-standard-uid /run/smfs smfs
smf-spf.x86_64: W: non-standard-gid /run/smfs smfs
smf-spf.x86_64: E: non-standard-dir-perm /run/smfs 700
smf-spf.x86_64: E: incorrect-fsf-address /usr/share/licenses/smf-spf/COPYING
smf-spf.x86_64: W: no-manual-page-for-binary smf-spf
smf-spf-debuginfo.x86_64: W: no-url-tag
smf-spf-debugsource.x86_64: W: no-url-tag
smf-spf.src: W: spelling-error %description -l en_US milter -> molter, miler, miter
smf-spf.src: W: spelling-error %description -l en_US spfmilter -> filterer
smf-spf.src: W: spelling-error %description -l en_US milters -> molters, milers, miters
smf-spf.src: W: no-url-tag
smf-spf.src:58: E: hardcoded-library-path in %{_prefix}/lib/tmpfiles.d/smfs.conf
smf-spf.src:89: E: hardcoded-library-path in %{_prefix}/lib/tmpfiles.d/smfs.conf
4 packages and 0 specfiles checked; 4 errors, 13 warnings.

Comment 10 Jordi Sanfeliu 2021-02-19 11:49:06 UTC
(In reply to Robert-André Mauchin 🐧 from comment #9)
> You can pass them in the spec:
> 
> %make_build OPTFLAGS="%{optflags}" LDFLAGS="%{build_ldflags} -lmilter
> -lpthread -lspf2"
OK, done. Thanks!.


> 
>  - Remove %clean
OK, done. Thanks.


>  - Notify upstream that they are using an obsolete FSF address:
> 
> smf-spf.x86_64: E: incorrect-fsf-address /usr/share/licenses/smf-spf/COPYING
> 
Yes, as I already told you, I'm just waiting a new release from the upstream to create the final SRPM.


>  - Use %{_tmpfilesdir} instead of %{_prefix}/lib/tmpfiles.d/
OK, done. Thanks.


- Please, find the latest .spec and SRPM versions here
Spec URL: http://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: http://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1-1.fc32.src.rpm

Comment 11 Robert-André Mauchin 🐧 2021-02-20 02:01:35 UTC
Package approved.

Comment 12 Jordi Sanfeliu 2021-02-22 09:20:19 UTC
(In reply to Robert-André Mauchin 🐧 from comment #11)
> Package approved.

Great news! :-)

Thank you very much for your kind assistance.
Best wishes.

Comment 13 Mattia Verga 2022-02-21 09:56:56 UTC
Package never imported, resetting ticket status.
Jordi, are you still on this?

Comment 14 Jordi Sanfeliu 2022-02-21 10:19:28 UTC
(In reply to Mattia Verga from comment #13)
> Package never imported, resetting ticket status.
> Jordi, are you still on this?

Yes, I'm just waiting the upstream to release a new version with the COPYING file modified.
I opened an issue in GitHub to ask for a new version:

<https://github.com/jcbf/smf-spf/issues/92>

No news from the author so far, though.

Comment 15 Jordi Sanfeliu 2023-01-31 16:11:36 UTC
(In reply to Robert-André Mauchin 🐧 from comment #11)
> Package approved.

Hello,

I'm tired to wait upstream to release the new version, so I thought I'll go ahead with the latest commit 2.5.1+061e937.

I get the following message after requesting the distgit repository:

$ fedpkg request-repo smf-spf 1877006
Could not execute request_repo: The Bugzilla bug is not approved yet

The people on #fedora-devel at Libera.Chat kindly told me that the review is only valid for some time (3 months?).
So, can you please, re-approve this package?

Thanks.

Comment 16 Jordi Sanfeliu 2023-02-01 07:32:33 UTC
(In reply to Jordi Sanfeliu from comment #15)
> (In reply to Robert-André Mauchin 🐧 from comment #11)
> > Package approved.


- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1.061e937-1.fc36.src.rpm

Comment 17 Jakub Kadlčík 2023-02-01 07:41:07 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5383892
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/05383892-smf-spf/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

Comment 18 Jordi Sanfeliu 2023-02-14 10:25:55 UTC
$ fedpkg request-repo smf-spf 1877006
Could not execute request_repo: The Bugzilla bug is not approved yet

Anyone can give a push to this package?

Comment 19 Petr Pisar 2023-03-07 12:45:33 UTC
This package needs a new review. For requesting a repository the review approval is valid only for few weeks. When it took long, Mattia removed the approval on 2022-02-21.

Comment 20 Petr Pisar 2023-07-04 14:32:48 UTC
If you are still interested in this package, could you please update License tag to use an SPDX format <https://docs.fedoraproject.org/en-US/legal/allowed-licenses/> and update adding the smfs user and group with an sysusers approach <https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/#_dynamic_allocation>?

Comment 21 Jordi Sanfeliu 2023-07-04 15:08:51 UTC
Of course I am, and thank you very much for your assistance.

I've changed the string "GPLv2+" by "GPL-2.0-or-later" so I hope this will be enough.

- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1.061e937-1.fc38.src.rpm

Comment 22 Fedora Review Service 2023-07-04 15:14:32 UTC
Created attachment 1974021 [details]
The .spec file difference from Copr build 5383892 to 6141088

Comment 23 Fedora Review Service 2023-07-04 15:14:34 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6141088
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06141088-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 24 Jordi Sanfeliu 2023-07-04 15:49:02 UTC
It looks like the build failed because it was unable to download the source file:

WARNING: Cannot download url: https://github.com/jcbf/smf-spf/archive/v2.5.1.061e937/smf-spf-2.5.1.061e937.tar.gz

The upstream did not provide a release/package for the latest commit 061e937, and using a GitHub URL directly
to that commit doesn't work because the directory created does not match with the tags %{name}-%{version}.

So, I've changed the value of the Source0 tag so it will use the tar.gz file generated by me manually.

- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1.061e937-1.fc38.src.rpm

Comment 25 Fedora Review Service 2023-07-04 15:53:43 UTC
Created attachment 1974025 [details]
The .spec file difference from Copr build 6141088 to 6141151

Comment 26 Fedora Review Service 2023-07-04 15:53:45 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6141151
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06141151-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 27 Jordi Sanfeliu 2023-07-04 16:06:39 UTC
I'm unable to find out where it failed in the logs, I see some Warnings but they seem harmless.

Can you help me please?
Thanks.

Comment 28 Jordi Sanfeliu 2023-07-04 16:54:56 UTC
Oh!, I forgot to update adding the smfs user and group with an sysusers approach.
Let's see how it goes now.

- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1.061e937-1.fc38.src.rpm

Comment 29 Fedora Review Service 2023-07-04 17:00:55 UTC
Created attachment 1974030 [details]
The .spec file difference from Copr build 6141151 to 6141267

Comment 30 Fedora Review Service 2023-07-04 17:00:58 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6141267
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06141267-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 31 Jordi Sanfeliu 2023-07-05 07:30:47 UTC
Petr,

Do you know why the build failed?
I'm reading the logs but I cannot see where is the cause.

Comment 32 Petr Pisar 2023-07-07 07:24:07 UTC
> Build log:
> https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06141267-smf-spf/builder-live.log.gz

This one shows a failure in a fedora-review tool:

Running FedoraReview tool
Running: fedora-review --no-colors --prebuilt --rpm-spec --name smf-spf --mock-config /var/lib/copr-rpmbuild/results/configs/child.cfg

cmd: ['fedora-review', '--no-colors', '--prebuilt', '--rpm-spec', '--name', 'smf-spf', '--mock-config', '/var/lib/copr-rpmbuild/results/configs/child.cfg']
cwd: /var/lib/copr-rpmbuild/results
rc: 1
stdout: 
stderr: INFO: Processing local files: smf-spf
[...]
Unknown argument "-l" for command "repoquery". Add "--help" for more information about the arguments.
ERROR: Exception down the road... (logs in /var/lib/copr-rpmbuild/workspace/workdir-ikgaot8y/.cache/fedora-review.log)

This is not a failure of the build. The cause is DNF5 which replaced DNF4 in Fedora 39 and DNF5 does not support "dnf repoquery -l" invocation. You can file a bug against fedora-review tool.

However, the log also prints an rpmbuild warning:

RPM build warnings:
    %patchN is deprecated (3 usages found), use %patch N (or %patch -P N)

Please modernize the spec file to use the new syntax. Alternatively, there is %autosetup macro in place of %setup which unpacks sources and applies all patches in one step <https://rpm-software-management.github.io/rpm/manual/autosetup.html>.

> Copr build:
> https://copr.fedorainfracloud.org/coprs/build/6141267
> (failed)

This displays F39-only failure. <https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06141267-smf-spf/build.log.gz> reads this error:

error: lua script failed: [string "add_sysuser"]:16: invalid sysuser type: #Type
  3<        (%lua)
  2<      (%add_sysuser)
Provides: config(smf-spf) = 2.5.1.061e937-1.fc39 group(smfs) group(smfs) = ZyBzbWZz smf-spf = 2.5.1.061e937-1.fc39 smf-spf(x86-64) = 2.5.1.061e937-1.fc39 user(smfs) = dSBzbWZzIC0gIlNtYXJ0IFNlbmRtYWlsIEZpbHRlcnMiIC92YXIvbGliL3NtZnMgL3NiaW4vbm9sb2dpbgAA

Either the new user/group management is broken, or you did a mistake. I haven't yet debugged it. Though, this Lua error seems to be ignored by rpmbuild and is not a reason why Copr marked is as failed. The RPM build passed. However, you should address it.

I guess the reason for a COPR failure is in <https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06141267-smf-spf/backend.log.gz>:

[2023-07-04 17:00:50,524][  INFO][PID:3980572] Running command 'copr-repo --batched /var/lib/copr/public_html/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64 --add 06141267-smf-spf --no-appstream-metadata' as PID 4037301
[2023-07-04 17:00:51,411][  INFO][PID:3980572] Finished after 0 seconds with exit code 1 (copr-repo --batched /var/lib/copr/public_html/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64 --add 06141267-smf-spf --no-appstream-metadata)
stdout:

stderr:
Sub-command failed
Traceback (most recent call last):
  File "/usr/bin/copr-repo", line 462, in main
    main_try_lock(opts, batch)
  File "/usr/bin/copr-repo", line 414, in main_try_lock
    main_locked(opts, batch, opts.log)
  File "/usr/bin/copr-repo", line 368, in main_locked
    if not run_createrepo(opts):
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/copr-repo", line 215, in run_createrepo
    run_cmd(createrepo_cmd, check=True, logger=opts.log)
  File "/usr/lib/python3.11/site-packages/copr_backend/helpers.py", line 150, in run_cmd
    raise CommandException(exc_msg)
copr_backend.helpers.CommandException: Command '/usr/bin/createrepo_c /var/lib/copr/public_html/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64 --no-database --ignore-lock --local-sqlite --cachedir /tmp/ --workers 8 --update --skip-stat --recycle-pkglist --pkglist /var/lib/copr/public_html/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/.copr-createrepo-pkglist' failed, exit code '2

COPR were unable to create a YUM repository from your freshly built packages. Again, this not a build failure. This a failure after finishing the build somewhere in CORP infrastructure. You can  file a bug for COPR where appropriate.

Maybe you should try a scratch build in Fedora Koji "koji build --scratch f39-candidate smf-spf-2.5.1.061e937-1.fc38.src.rpm". This how Fedora packages are built without the failing COPR appendage.

Comment 33 Jordi Sanfeliu 2023-07-07 07:48:03 UTC
Thanks for your review Petr.

> This is not a failure of the build. The cause is DNF5 which replaced DNF4 in Fedora 39 and DNF5 does not support "dnf repoquery -l" invocation. You can file a bug against fedora-review tool.

Since this affects all builds in Rawhide (F39), by the time I file the bug someone will already did it.


> RPM build warnings:
>    %patchN is deprecated (3 usages found), use %patch N (or %patch -P N)

> Please modernize the spec file to use the new syntax. Alternatively, there is %autosetup macro in place of %setup which unpacks sources and applies all patches in one step <https://rpm-software-management.github.io/rpm/manual/autosetup.html>.

OK, done.


> This displays F39-only failure. <https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06141267-smf-spf/build.log.gz> reads this error:

> error: lua script failed: [string "add_sysuser"]:16: invalid sysuser type: #Type

Yes, I think I know what caused this.
I created the file 'smf-spf.sysusers' like this:

#Type Name   ID  GECOS                        Home directory  Shell
u     smfs   -   "Smart Sendmail Filters"     /var/lib/smfs   /sbin/nologin
g     smfs

Since I didn't know where to specify the GID of this user, I included the line with the Type 'g', and that's what Lua is probable failing to parse.
Now I have removed this line with the hope that the dynamic allocation will create a new group with the same name as the user.

- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1.061e937-1.fc38.src.rpm

Comment 34 Fedora Review Service 2023-07-07 07:53:31 UTC
Created attachment 1974408 [details]
The .spec file difference from Copr build 6141267 to 6149097

Comment 35 Fedora Review Service 2023-07-07 07:53:34 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6149097
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06149097-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 36 Jordi Sanfeliu 2023-07-07 08:04:46 UTC
> Maybe you should try a scratch build in Fedora Koji "koji build --scratch f39-candidate smf-spf-2.5.1.061e937-1.fc38.src.rpm". This how Fedora packages are built without the failing COPR appendage.

$ fedpkg clone smf-spf
Cloning into 'smf-spf'...
No such repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Could not execute clone: Failed to execute command.

$ fedpkg request-repo smf-spf 1877006
Could not execute request_repo: The Bugzilla bug is not approved yet


I'm unable to clone the smf-spf repository to start building packages with koji.
I think someone should approve this package first.

Comment 37 Petr Pisar 2023-07-11 08:32:43 UTC
FIX: Missing an Url tag in the spec file pointing to an upstream. Did you mean <https://github.com/jcbf/smf-spf>?
FIX: Source0 looks like a VCS snapshot. Put a URL you cloned it from into a comment above Source0 tag <https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_using_revision_control>. Or use a URL of the snapshot if the upstream VCS hosting system supports it.
FIX: Version does not follow a schema for snapshots <https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots>. Consider what would happen if you need to upgrade to a "051e937" snapshot of a 2.5.1-post release. In your current schema the new version would sort lower than the old version.

Summary verified from README.md. Ok.
Description is Ok.

Licenses found:
GPL-2.0 text: COPYING
MIT: .devcontainer/Dockerfile
BSD-3-like: tests/04-fixed-client-auth-fail.lua
GPL-3.0 text: LICENSE
GPL-2.0-or-later: smf-spf.c

License tag is Ok.

TODO: It looks like the tests come from The Trusted Domain Project which uses <https://github.com/trusteddomainproject/OpenDKIM/blob/master/LICENSE>. That license requires carrying the license text. However, I cannot see the license text anywhere in the source archive. You should clarify with the upstream an origin of the tests. If upstream confirms it, the upstream and you need to supply the missing license text.

FIX: Remove "rm -rf spf2" command from %prep. There is no such directory in the archive.
TODO: Use "install -m0644" instead of "cp -a" for copying the additional sources. A mode of the files is undefined. It depends on umask of the host which builds the package.

FIX: Remove a duplicate "BuildRequires: systemd-rpm-macros".
FIX: Remove "Requires(pre):  shadow-utils". A correct dependency is handled with "%{?sysusers_requires_compat}" macro.
FIX: Build-requires "coreutils" (smf-spf.spec:52).
FIX: Build-require "make" (smf-spf.spec:49).

FIX: The README.rpm is out-dated. "service", "chkconfig" commands are now replaced with systemctl. Recommendation to install dependencies like libspf2 and sendmail is pointless. These are handled with RPM run-time dependencies of this package. If sendmail-cf is required, then smf-spf or sendmail should run-require it.

FIX: The lua script still fails:
error: lua script failed: [string "add_sysuser"]:16: invalid sysuser type: #Type
  3<        (%lua)
  2<      (%add_sysuser)
Have you tried removing a first line with the comment from the file? At this step the file is interpreted by Lua script of rpmbuild to generated RPM Provides and it's possible that the script does not support comments.

$ rpmlint smf-spf.spec ../SRPMS/smf-spf-2.5.1.061e937-1.fc39.src.rpm ../RPMS/x86_64/smf-spf-*
======================================== rpmlint session starts =======================================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 5

smf-spf.x86_64: W: non-standard-uid /run/smfs smfs
smf-spf.x86_64: W: non-standard-gid /run/smfs smfs
smf-spf.x86_64: E: non-standard-dir-perm /run/smfs 700
smf-spf.x86_64: W: no-url-tag
smf-spf-debuginfo.x86_64: W: no-url-tag
smf-spf-debugsource.x86_64: W: no-url-tag
smf-spf.src: W: no-url-tag
smf-spf.x86_64: W: no-manual-page-for-binary smf-spf
smf-spf.spec:26: W: mixed-use-of-spaces-and-tabs (spaces: line 26, tab: line 1)
smf-spf.spec:26: W: mixed-use-of-spaces-and-tabs (spaces: line 26, tab: line 1)
smf-spf.spec: W: invalid-url Source0: smf-spf-2.5.1.061e937.tar.gz
smf-spf.spec: W: invalid-url Source0: smf-spf-2.5.1.061e937.tar.gz
smf-spf.x86_64: W: incoherent-version-in-changelog 2.5.1-1 ['2.5.1.061e937-1.fc39', '2.5.1.061e937-1']
smf-spf.x86_64: E: file-parent-ownership-mismatch Path "/run/smfs/smf-spf.sock" owned by "root" is stored in directory owned by "smfs"
======== 4 packages and 1 specfiles checked; 2 errors, 12 warnings, 2 badness; has taken 0.3 s ========
TODO: Replace tabs with spaced in the spec file to achieve uniformity.
FIX: Correct a version in the changelog entry.

$ rpm -q -lv -p ../RPMS/x86_64/smf-spf-2.5.1.061e937-1.fc39.x86_64.rpm 
drwxr-xr-x    2 root     root                        0 Jul  4 02:00 /etc/mail/smfs
-rw-r--r--    1 root     root                     4731 Jul  4 02:00 /etc/mail/smfs/smf-spf.conf
drwx------    2 smfs     smfs                        0 Jul  4 02:00 /run/smfs
-rw-r--r--    1 root     root                        0 Jul  4 02:00 /run/smfs/smf-spf.sock
drwxr-xr-x    2 root     root                        0 Jul  4 02:00 /usr/lib/.build-id
drwxr-xr-x    2 root     root                        0 Jul  4 02:00 /usr/lib/.build-id/63
lrwxrwxrwx    1 root     root                       28 Jul  4 02:00 /usr/lib/.build-id/63/871eac7cfe0ef118abbb75bb4b0be08fe978f8 -> ../../../../usr/sbin/smf-spf
-rw-r--r--    1 root     root                      213 Nov 19  2020 /usr/lib/systemd/system/smf-spf.service
-rw-r--r--    1 root     root                      145 Jul  4 02:00 /usr/lib/sysusers.d/smfs.conf
-rwxr-xr-x    1 root     root                    36992 Jul  4 02:00 /usr/sbin/smf-spf
drwxr-xr-x    2 root     root                        0 Jul  4 02:00 /usr/share/doc/smf-spf
-rw-r--r--    1 root     root                     2140 Apr 23  2022 /usr/share/doc/smf-spf/ChangeLog
-rw-r--r--    1 root     root                     2235 Nov 19  2020 /usr/share/doc/smf-spf/README.rpm
-rw-r--r--    1 root     root                     5201 Jul  4 02:00 /usr/share/doc/smf-spf/readme
drwxr-xr-x    2 root     root                        0 Jul  4 02:00 /usr/share/licenses/smf-spf
-rw-r--r--    1 root     root                    25383 Apr 23  2022 /usr/share/licenses/smf-spf/COPYING
FIX: smf-spf.sysusers declares /var/lib/smfs as a home directory, but that directory is not packaged. I think you should use "-" or "/run/smfs" instead. See sysusers.d(5) manual page.
FIX: /run/smfs directory disappears on reboot because /run is tmpfs. Use <https://docs.fedoraproject.org/en-US/packaging-guidelines/Tmpfiles.d/> for creating one with correct ownership and mode.

$ rpm -q --requires -p  ../RPMS/x86_64/smf-spf-2.5.1.061e937-1.fc39.x86_64.rpm | sort -f | uniq -c
      4 /bin/sh
      1 config(smf-spf) = 2.5.1.061e937-1.fc39
      1 libc.so.6()(64bit)
      1 libc.so.6(GLIBC_2.2.5)(64bit)
      1 libc.so.6(GLIBC_2.3)(64bit)
      1 libc.so.6(GLIBC_2.3.4)(64bit)
      1 libc.so.6(GLIBC_2.34)(64bit)
      1 libc.so.6(GLIBC_2.4)(64bit)
      1 libc.so.6(GLIBC_2.7)(64bit)
      1 libmilter.so.1.0()(64bit)
      1 libspf2.so.2()(64bit)
      1 rpmlib(CompressedFileNames) <= 3.0.4-1
      1 rpmlib(FileDigests) <= 4.6.0-1
      1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
      1 rpmlib(PayloadIsZstd) <= 5.4.18-1
      1 rtld(GNU_HASH)
      1 sendmail >= 8.12
      1 shadow-utils
TODO: Does this mail filter work only with sendmail? If it also works with postfix, the package should depend on "(sendmail or postfix)".

$ rpm -q --provides -p  ../RPMS/x86_64/smf-spf-2.5.1.061e937-1.fc39.x86_64.rpm | sort -f | uniq -c
      1 config(smf-spf) = 2.5.1.061e937-1.fc39
      1 group(smfs)
      1 smf-spf = 2.5.1.061e937-1.fc39
      1 smf-spf(x86-64) = 2.5.1.061e937-1.fc39
      1 user(smfs) = dSBzbWZzIC0gIlNtYXJ0IFNlbmRtYWlsIEZpbHRlcnMiIC92YXIvbGliL3NtZnMgL3NiaW4vbm9sb2dpbgAA
Binary provides are Ok.

$ resolvedeps rawhide  ../RPMS/x86_64/smf-spf-2.5.1.061e937-1.fc39.x86_64.rpm 
Binary dependencies are resolvable. Ok.

The package builds in F39 <https://koji.fedoraproject.org/koji/taskinfo?taskID=103209562>. Ok.

Otherwise, the package is in line with Fedora packaging guidelines.
Please correct the FIX items, consider fixing TODO items, and provide a new spec file.

Comment 38 Petr Pisar 2023-07-11 08:34:29 UTC
(In reply to Jordi Sanfeliu from comment #36)
> > Maybe you should try a scratch build in Fedora Koji "koji build --scratch f39-candidate smf-spf-2.5.1.061e937-1.fc38.src.rpm". This how Fedora packages are built without the failing COPR appendage.
> 
> $ fedpkg clone smf-spf
> Cloning into 'smf-spf'...
> No such repository
> fatal: Could not read from remote repository.
[...]
> I'm unable to clone the smf-spf repository to start building packages with
> koji.

You don't need any repository for building with koji. The "smf-spf-2.5.1.061e937-1.fc38.src.rpm" argument in my example is a local RPM package file.

Comment 39 Jordi Sanfeliu 2023-07-11 11:21:16 UTC
> FIX: Source0 looks like a VCS snapshot. Put a URL you cloned it from into a comment above Source0 tag <https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_using_revision_control>. Or use a URL of the snapshot if the upstream VCS hosting system supports it.

The problem here is that if I include an URL to download the source code directly from upstream VCS (GitHub in this case), the directory inside the .zip file is different than what the Version tag says:

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.IQOr91
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf 'smf-spf-2.5.1^20220423g061e937'
+ /usr/lib/rpm/rpmuncompress -x /root/rpmbuild/SOURCES/061e9371f761f70afd40af349f4037fe0460725c.zip
replace smf-spf-061e9371f761f70afd40af349f4037fe0460725c/.devcontainer/Dockerfile? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd 'smf-spf-2.5.1^20220423g061e937'
/var/tmp/rpm-tmp.IQOr91: line 40: cd: smf-spf-2.5.1^20220423g061e937: No such file or directory

How can I provide an upstream URL and tell to the specfile the exact name of the directory where the source code is?

Comment 40 Petr Pisar 2023-07-11 11:30:08 UTC
%autosetup has -n option to specify the top-level directory in the archive. See <https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_commit_revision>.

Comment 41 Jordi Sanfeliu 2023-07-11 13:29:43 UTC
(In reply to Petr Pisar from comment #40)
> %autosetup has -n option to specify the top-level directory in the archive.
> See
> <https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/
> #_commit_revision>.

Ah!, I was searching in this document but I was unable to find it.
Thank you very much.

Comment 42 Jordi Sanfeliu 2023-07-11 13:54:47 UTC
(In reply to Petr Pisar from comment #37)
> FIX: Missing an Url tag in the spec file pointing to an upstream. Did you
> mean <https://github.com/jcbf/smf-spf>?

Yes, done.


> FIX: Source0 looks like a VCS snapshot. Put a URL you cloned it from into a
> comment above Source0 tag
> <https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/
> #_using_revision_control>. Or use a URL of the snapshot if the upstream VCS
> hosting system supports it.

OK, done.


> FIX: Version does not follow a schema for snapshots
> <https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/
> #_snapshots>. Consider what would happen if you need to upgrade to a
> "051e937" snapshot of a 2.5.1-post release. In your current schema the new
> version would sort lower than the old version.

OK, done.


> TODO: It looks like the tests come from The Trusted Domain Project which
> uses <https://github.com/trusteddomainproject/OpenDKIM/blob/master/LICENSE>.
> That license requires carrying the license text. However, I cannot see the
> license text anywhere in the source archive. You should clarify with the
> upstream an origin of the tests. If upstream confirms it, the upstream and
> you need to supply the missing license text.

I'll talk with upstream author to clarify this license mess.


> FIX: Remove "rm -rf spf2" command from %prep. There is no such directory in
> the archive.

OK, done.


> TODO: Use "install -m0644" instead of "cp -a" for copying the additional
> sources. A mode of the files is undefined. It depends on umask of the host
> which builds the package.

OK, done


> FIX: Remove a duplicate "BuildRequires: systemd-rpm-macros".
> FIX: Remove "Requires(pre):  shadow-utils". A correct dependency is handled
> with "%{?sysusers_requires_compat}" macro.
> FIX: Build-requires "coreutils" (smf-spf.spec:52).
> FIX: Build-require "make" (smf-spf.spec:49).

OK, done.


> FIX: The README.rpm is out-dated. "service", "chkconfig" commands are now
> replaced with systemctl. Recommendation to install dependencies like libspf2
> and sendmail is pointless. These are handled with RPM run-time dependencies
> of this package. If sendmail-cf is required, then smf-spf or sendmail should
> run-require it.

OK, done.


> FIX: The lua script still fails:
> error: lua script failed: [string "add_sysuser"]:16: invalid sysuser type:
> #Type
>   3<        (%lua)
>   2<      (%add_sysuser)
> Have you tried removing a first line with the comment from the file? At this
> step the file is interpreted by Lua script of rpmbuild to generated RPM
> Provides and it's possible that the script does not support comments.

OK, done.


> FIX: smf-spf.sysusers declares /var/lib/smfs as a home directory, but that
> directory is not packaged. I think you should use "-" or "/run/smfs"
> instead. See sysusers.d(5) manual page.

OK, done.


> FIX: /run/smfs directory disappears on reboot because /run is tmpfs. Use
> <https://docs.fedoraproject.org/en-US/packaging-guidelines/Tmpfiles.d/> for
> creating one with correct ownership and mode.

OK, done.


> TODO: Does this mail filter work only with sendmail? If it also works with
> postfix, the package should depend on "(sendmail or postfix)".

OK, done.


- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1^20220423g061e937-1.fc38.src.rpm

Comment 43 Fedora Review Service 2023-07-11 14:04:10 UTC
Created attachment 1975172 [details]
The .spec file difference from Copr build 6149097 to 6161483

Comment 44 Fedora Review Service 2023-07-11 14:04:12 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6161483
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06161483-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 45 Petr Pisar 2023-07-12 09:03:55 UTC
Url and Source0 addresses are Ok.
Source0 archive (SHA-512: 5b7955dae6d19bea1290e2cfd700d150ad46e53325b5bac9305f6534623802daecd8aee0696cb47708934e2a8b8008a8536f0d65657cf1003a12a1423bfb4a3e) is original. Ok.
License verified from smf-spf.c, COPYING, .devcontainer/Dockerfile. Ok.

TODO: Are you sure sendmail is required at build time (smf-spf.spec:23)?

$ rpmlint smf-spf.spec ../SRPMS/smf-spf-2.5.1^20220423g061e937-1.fc39.src.rpm ../RPMS/x86_64/smf-spf-*
======================================== rpmlint session starts =======================================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 5

smf-spf.x86_64: W: non-standard-uid /run/smfs smfs
smf-spf.x86_64: W: non-standard-gid /run/smfs smfs
smf-spf.x86_64: E: non-standard-dir-perm /run/smfs 700
smf-spf.x86_64: W: no-manual-page-for-binary smf-spf
smf-spf.spec:54: W: macro-in-comment %{SOURCE4}
smf-spf.spec:54: W: macro-in-comment %{buildroot}
smf-spf.spec:54: W: macro-in-comment %{_sysusersdir}
smf-spf.spec:54: W: macro-in-comment %{SOURCE4}
smf-spf.spec:54: W: macro-in-comment %{buildroot}
smf-spf.spec:54: W: macro-in-comment %{_sysusersdir}
smf-spf.x86_64: W: incoherent-version-in-changelog 2.5.1-1 ['2.5.1^20220423g061e937-1.fc39', '2.5.1^20220423g061e937-1']
smf-spf.x86_64: E: file-parent-ownership-mismatch Path "/run/smfs/smf-spf.sock" owned by "root" is stored in directory owned by "smfs"
smf-spf.x86_64: W: empty-%pre
======== 4 packages and 1 specfiles checked; 2 errors, 11 warnings, 2 badness; has taken 0.3 s ========

FIX: Correct a version in the changelog entry. It must be '2.5.1^20220423g061e937-1'.

FIX: Add a tmpfiles configuration file for /run/smfs directory. You mention it in a comment at smf-spf.spec:52, but probably forget to install it.

FIX: The sysuser approach does not work for me. %pre script is empty as rpmlint warns and indeed after installing the package there is no smfs user and /run/smfs is owner by root. Also starting the service "fails" like this:
Jul 12 10:44:59 fedora-39 systemd[1]: Starting smf-spf.service - Sender Policy Framework milter...
Jul 12 10:44:59 fedora-39 smf-spf[3080]: starting smf-spf 2.5.2 listening on unix:/run/smfs/smf-spf.sock
Jul 12 10:44:59 fedora-39 smf-spf[3080]: getpwnam smfs: User does not exists
Jul 12 10:44:59 fedora-39 systemd[1]: smf-spf.service: Deactivated successfully.
Jul 12 10:44:59 fedora-39 systemd[1]: Started smf-spf.service - Sender Policy Framework milter.

If sysuser approach does not work, we should use manual scrips with useradd command.

The package builds in F39 (https://koji.fedoraproject.org/koji/taskinfo?taskID=103259442). Ok.

Comment 46 Jordi Sanfeliu 2023-07-12 09:31:52 UTC
(In reply to Petr Pisar from comment #45)
> TODO: Are you sure sendmail is required at build time (smf-spf.spec:23)?

No, it doesn't. It was a mistake.
Fixed.


> FIX: Correct a version in the changelog entry. It must be
> '2.5.1^20220423g061e937-1'.

OK, done.


> FIX: Add a tmpfiles configuration file for /run/smfs directory. You mention
> it in a comment at smf-spf.spec:52, but probably forget to install it.

I think I've fixed it.


> FIX: The sysuser approach does not work for me. %pre script is empty as
> rpmlint warns and indeed after installing the package there is no smfs user
> and /run/smfs is owner by root. Also starting the service "fails" like this:
> Jul 12 10:44:59 fedora-39 systemd[1]: Starting smf-spf.service - Sender
> Policy Framework milter...
> Jul 12 10:44:59 fedora-39 smf-spf[3080]: starting smf-spf 2.5.2 listening on
> unix:/run/smfs/smf-spf.sock
> Jul 12 10:44:59 fedora-39 smf-spf[3080]: getpwnam smfs: User does not exists
> Jul 12 10:44:59 fedora-39 systemd[1]: smf-spf.service: Deactivated
> successfully.
> Jul 12 10:44:59 fedora-39 systemd[1]: Started smf-spf.service - Sender
> Policy Framework milter.
> 
> If sysuser approach does not work, we should use manual scrips with useradd
> command.

I think I've fixed it.
Let's see how it goes this time.


- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1^20220423g061e937-1.fc38.src.rpm

Comment 47 Fedora Review Service 2023-07-12 09:37:53 UTC
Created attachment 1975330 [details]
The .spec file difference from Copr build 6161483 to 6164027

Comment 48 Fedora Review Service 2023-07-12 09:37:55 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6164027
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06164027-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 49 Petr Pisar 2023-07-12 10:21:53 UTC
$ rpmlint smf-spf.spec ../SRPMS/smf-spf-2.5.1^20220423g061e937-1.fc39.src.rpm ../RPMS/x86_64/smf-spf-*
======================================== rpmlint session starts =======================================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 5

smf-spf.x86_64: W: post-without-tmpfile-creation /usr/lib/tmpfiles.d/smfs.conf
smf-spf.x86_64: W: non-standard-uid /run/smfs smfs
smf-spf.x86_64: W: non-standard-gid /run/smfs smfs
smf-spf.x86_64: E: non-standard-dir-perm /run/smfs 700
smf-spf.x86_64: W: no-manual-page-for-binary smf-spf
smf-spf.x86_64: E: file-parent-ownership-mismatch Path "/run/smfs/smf-spf.sock" owned by "root" is stored in directory owned by "smfs"
========= 4 packages and 1 specfiles checked; 2 errors, 4 warnings, 2 badness; has taken 0.3 s ========
rpmlint is OK.

The package builds in F39 (https://koji.fedoraproject.org/koji/taskinfo?taskID=103262450). Ok.

/run/smfs is installed with a proper owner. Ok.
/run/smfs is created after a reboot with a proper owner. Ok.
smf-spf.service starts successfully. Ok.


After starting the daemon, RPM verification fails:

# ls -la /run/smfs/
total 0
drwx------.  2 smfs smfs  60 Jul 12 11:57 .
drwxr-xr-x. 25 root root 660 Jul 12 11:55 ..
srw-------.  1 smfs smfs   0 Jul 12 11:57 smf-spf.sock
(reverse-i-search)`ve': dnf5 --disablerepo=rawhide --enablerepo=f39-build remo^C sendmail
# rpm -V smf-spf
.M...UG..  g /run/smfs/smf-spf.sock

The reason is that the daemon deletes the socket and recreates it with a different ownership, mode and timestamp. Compare to the packaged data:

$ rpm -q -lv -p ../RPMS/x86_64/smf-spf-2.5.1^20220423g061e937-1.fc39.x86_64.rpm | grep smf-spf.sock
-rw-r--r--    1 root     root                        0 Jul 12 02:00 /run/smfs/smf-spf.sock

FIX: Package the socket file with %attr(0600,smfs,smfs).

Please correct this last issue.

Comment 50 Jordi Sanfeliu 2023-07-12 10:29:46 UTC
(In reply to Petr Pisar from comment #49)
> FIX: Package the socket file with %attr(0600,smfs,smfs).

OK, done.


- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1^20220423g061e937-1.fc38.src.rpm

(crossing fingers)

Comment 51 Fedora Review Service 2023-07-12 10:37:49 UTC
Created attachment 1975350 [details]
The .spec file difference from Copr build 6164027 to 6164195

Comment 52 Fedora Review Service 2023-07-12 10:37:52 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6164195
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06164195-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 53 Petr Pisar 2023-07-12 11:56:37 UTC
The %attr() macro must on the same line as the socket file. The way you wrote it does not have any effect:

$ rpm -qlvp  ../RPMS/x86_64/smf-spf-2.5.1^20220423g061e937-1.fc39.x86_64.rpm  | grep sock
-rw-r--r--    1 root     root                        0 Jul 12 02:00 /run/smfs/smf-spf.sock

Fix it like this:

-%ghost /run/smfs/smf-spf.sock
-%attr(0600,smfs,smfs)
+%ghost %attr(0600,smfs,smfs) /run/smfs/smf-spf.sock

Comment 54 Jordi Sanfeliu 2023-07-13 10:31:03 UTC
(In reply to Petr Pisar from comment #53)
> The %attr() macro must on the same line as the socket file. The way you
> wrote it does not have any effect:
> 
> $ rpm -qlvp  ../RPMS/x86_64/smf-spf-2.5.1^20220423g061e937-1.fc39.x86_64.rpm
> | grep sock
> -rw-r--r--    1 root     root                        0 Jul 12 02:00
> /run/smfs/smf-spf.sock
> 
> Fix it like this:
> 
> -%ghost /run/smfs/smf-spf.sock
> -%attr(0600,smfs,smfs)
> +%ghost %attr(0600,smfs,smfs) /run/smfs/smf-spf.sock

Oh, I'm sorry.
Now is fixed.

- Please, find the latest .spec and SRPM versions here
Spec URL: https://ftp.fibranet.cat/smf-spf/smf-spf.spec
SRPM URL: https://ftp.fibranet.cat/smf-spf/smf-spf-2.5.1^20220423g061e937-1.fc38.src.rpm

Comment 55 Fedora Review Service 2023-07-13 10:42:49 UTC
Created attachment 1975573 [details]
The .spec file difference from Copr build 6164195 to 6169035

Comment 56 Fedora Review Service 2023-07-13 10:42:52 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6169035
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1877006-smf-spf/fedora-rawhide-x86_64/06169035-smf-spf/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 57 Petr Pisar 2023-07-13 12:17:26 UTC
$ rpmlint smf-spf.spec ../SRPMS/smf-spf-2.5.1^20220423g061e937-1.fc39.src.rpm ../RPMS/x86_64/smf-spf-*
======================================== rpmlint session starts =======================================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 5

smf-spf.x86_64: W: post-without-tmpfile-creation /usr/lib/tmpfiles.d/smfs.conf
smf-spf.x86_64: W: non-standard-uid /run/smfs smfs
smf-spf.x86_64: W: non-standard-uid /run/smfs/smf-spf.sock smfs
smf-spf.x86_64: W: non-standard-gid /run/smfs smfs
smf-spf.x86_64: W: non-standard-gid /run/smfs/smf-spf.sock smfs
smf-spf.x86_64: E: non-standard-dir-perm /run/smfs 700
smf-spf.x86_64: E: non-readable /run/smfs/smf-spf.sock 600
smf-spf.x86_64: W: no-manual-page-for-binary smf-spf
========= 4 packages and 1 specfiles checked; 2 errors, 6 warnings, 2 badness; has taken 0.3 s ========
rpmlint is Ok.

The package builds in Fedora 39 (https://koji.fedoraproject.org/koji/taskinfo?taskID=103310187). Ok.

Verification of the installed package passes. Ok.

The package is APPROVED.

Comment 58 Fedora Admin user for bugzilla script actions 2023-07-13 13:51:34 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/smf-spf

Comment 59 Jordi Sanfeliu 2023-07-13 13:59:29 UTC
(In reply to Petr Pisar from comment #57)
> Verification of the installed package passes. Ok.
> 
> The package is APPROVED.

Thank you very much for patience and excellent assistance.


Note You need to log in before you can comment on or make changes to this bug.