Support for CentOS 7/8

Bug #1851804 reported by Karen Millen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkimpy-milter
Incomplete
Medium
Unassigned

Bug Description

Hello,

I've got several servers split between CentOS 7 and CentOS 8. Since the opendkim project is dead, I tried dkimpy-milter.

-= CentOS 7 =-

In CentOS 7, there are no official packages, but its possible to install dkimpy-milter via pip3, I had to perform the following commands to get it installed:

yum install python3 python3-devel sendmail-devel
pip3 install dkimpy_milter

The above procedure causes three problems, it downloads and installs too many dependencies, but at least most of them can be removed after the installation is complete (like the devel packages). The second problem is that the package does not have a RHEL/CentOS friendly file structure, so files are installed under /usr/local. The third problem is that there is no systemd service.

-= CentOS 8 =-

In CentOS 8, things are worse. There is no sendmail-devel package to offer the required header files, or at least I haven't found a way to make dkimpy-milter install via pip3.

I've opened this bug report to request "upstream" help for creating RPM packages that are friendly to Fedora/RHEL/CentOS. Maybe they could be submitted to the EPEL repository.

Any help would be appreciated.

Thank you.

Revision history for this message
Karen Millen (karen8) wrote :

Minor mistake, for CentOS 8, we need to install the sendmail-milter-devel package available in the PowerTools repo, which is disabled by default. The rest is the same.

Revision history for this message
Scott Kitterman (kitterman) wrote :

I'll be glad to assist.

The next release will have options if you install using setup.py (not directly from pip, unfortunately) that allow you to specify installation locations of files. That should make some of this easier.

The reason why you need the devel packages is that pymilter [1] and pynacl [2] (if you want to do ed25519 signatures) are compiled extensions to python. If those were installed via yum (I don't know if they are available), then the extra dependency problem would go away.

The other dependencies: authres, dkimpy, and dnspython or DNS are pure python and don't need to be compiled.

Since I'm not a Fedora/RHEL/CentOS user, I'm not familiar with the file system layout. It's my understanding though that for software installed without the package manager (e.g. yum), /usr/local is appropriate (it's what the Python installers all do by default).

If you would let me know where things go, then I can make sure it's possible to specify the relevant locations. In particular, that should solve the lack of a systemd service file. There is one provided and it is installed, probably just not in the correct location.

If you would check and see which of the dependencies listed above are already in the distribution repositories and the package names, I could come up with Fedora/RHEL/CentOS friendly installation instructions similar to that already provided for Debian in the package README.

[1] https://pypi.org/project/pymilter/
[2] https://pypi.org/project/PyNaCl/

Changed in dkimpy-milter:
importance: Undecided → Medium
milestone: none → future
status: New → Incomplete
Revision history for this message
Karen Millen (karen8) wrote :

First of all, thank you for the prompt and full response.

About the dependencies, here is what I've found so far:

python3-dns (from BaseOS repo, I think this is dnspython but I could be mistaken)
python3-pynacl (from epel-playground repo)
python3-pymilter (from epel repo)

so we are missing: authres and dkimpy (as pure python packages)

About the files, there is a simple allocation:

/usr/local/bin = /usr/bin
/usr/local/etc/ = /etc
/usr/local/lib/systemd/system = /usr/lib/systemd/system/

Overall it seems straight forward to create an RPM file with rpmbuild. There is also a tool that converts a python setup.py into an SPEC file that is used to build RPM files, maybe it could be of some use:
https://github.com/fedora-python/pyp2rpm

How RPM packages are made: the spec file:
https://fedoramagazine.org/how-rpm-packages-are-made-the-spec-file/

I'll investigate some more and report back.

Revision history for this message
Scott Kitterman (kitterman) wrote :

If you install python3-pynacl and python3-pymilter with yum, then that would avoid the need to install all the devel packages assuming that, as is the case on Debian, pip will recognize dependencies as satisfied by system packages. In that case, you'd do:

yum install python3 python3-pynacl python3-pymilter
pip3 install dkimpy_milter

In git master you can currently specify:

        ('sysconfigdir=', 'e', 'Specify system configuration directory. [/usr/local/etc]'),
        ('sbindir=', 's', 'Specify system binary directory. [/usr/local/sbin]'),
        ('bindir=', 'b', 'Specify binary directory. [/usr/loca/bin]'),
        ('rundir=', 'r', 'Specify run state directory. [/run]'),

I'd have to add the systemd unit location, but that's not hard. It looks like it's possible to pass arguments via pip, so it should be possible to get everything in the right place when installing via pip.

Revision history for this message
Scott Kitterman (kitterman) wrote :

This version is released now, so have a look and see if it you can use the new expand command to update the paths to where you want them.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.