Page MenuHomeFreeBSD

[NEW PORT] mail/py-pymailq: Postfix queue control python tool
ClosedPublic

Authored by loader on May 28 2017, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 30 2024, 5:10 AM
Unknown Object (File)
Apr 30 2024, 5:09 AM
Unknown Object (File)
Apr 30 2024, 5:08 AM
Unknown Object (File)
Apr 30 2024, 4:57 AM
Unknown Object (File)
Apr 29 2024, 9:56 PM
Unknown Object (File)
Jan 13 2024, 9:41 PM
Unknown Object (File)
Jan 4 2024, 7:43 PM
Unknown Object (File)
Nov 29 2023, 12:29 PM
Subscribers

Details

Reviewers
koobs
Summary

Proposed commit log message:

[NEW PORT] mail/py-pymailq: Postfix queue control python tool

The pymailq module makes it easy to view and control Postfix mails
queue. It provide several classes to store, view and interact with
mail queue using Postfix command line tools. This module is provided
for automation and monitoring developments.

WWW: https://github.com/outini/pymailq

Reviewed_by: koobs, mat
Approved by: koobs (ports)
Differential_Revision: D10976
Test Plan

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 9567
Build 10014: arc lint + arc unit

Event Timeline

koobs requested changes to this revision.May 29 2017, 4:12 AM

Revision SUMMARY should contain a verbatim proposed commit log message

mail/py-pymailq/Makefile
24

Upstream (README) says supports 2.7 and 3 (ambiguous).

USES=python should be as specific as possible. USES=python:2.7+ is better (more closely matches upstream version support declaration) here, and it's likely argumentless (not specifying version(s)) USES=python will be deprecated soon.

25

Add concurrent here it if works which explicitly declares and allows multiple concurrent Python versions of this package to be installed. If it doesn't try to fix it by making al installed files unique. If too hard, leave it out.

mail/py-pymailq/pkg-descr
7

Remove trailing slash unless it redirects there

This revision now requires changes to proceed.May 29 2017, 4:12 AM

TEST/QA confirmation/outputs should go in the TEST PLAN section of a revision

koobs edited the test plan for this revision. (Show Details)
loader edited edge metadata.
loader edited the test plan for this revision. (Show Details)

USE_PYTHON=concurrent

loader edited the test plan for this revision. (Show Details)
loader marked 3 inline comments as done.
mail/py-pymailq/Makefile
19–22

Targets should always be defined after all the variables are set, see section 13.1 of the porter's handbook. So this should go just before the post-install target.

loader edited the test plan for this revision. (Show Details)

define post-patch: target after variables

loader marked an inline comment as done.

I just noticed this port installs a man file:

man1/pqshell.1

I believe 'concurrent' doesn't handle (make unique) these files, so py27-pymailq and py36-pymailq would/will conflict

I just noticed this port installs a man file:

man1/pqshell.1

I believe 'concurrent' doesn't handle (make unique) these files, so py27-pymailq and py36-pymailq would/will conflict

I'm not sure if I should create a symlink for the man file like UNIQUE_DEFAULT_LINKS, I searched ports tree and found math/py-numpy
it creates a symlink man/man1/f2py.1 to the versioned copy.

Please let me know if I should revert the USE_PYTHON=concurrent change in this review, thanks.

I haven't tried it before with a man page and have stopped short of recommending to others using USE_PYTHON=concurrent + UNIQUE_* variables (from Mk/Uses/uniquefiles.mk) because I haven't considered any potential downsides for certain file classes. Having said that, if it works (man page lookup/rendering) and allows a port to be "concurrent enabled" then its probably worth doing.

I'll leave the choice up to you given we don't have a foundational recommendation to make in that regard, and if we did, the framework should probably handle it rather than on a per-port basis.

Decision aside, its worth trying if just to report back on the results so we can be clear on the current state for manual pages

You should be able to UNIQUE_{PREFIX,SUFFIX}_FILES+=<file> to add a certain file to the list to be 'made unique'

koobs requested changes to this revision.May 30 2017, 8:07 AM

Diff requires a change, either:

  1. Remove concurrent because man files are not processed by Uses/python.mk's use of Uses/uniquefiles.mk resulting on conflicts between multiple pyXY- versions
  2. Leave concurrent in, but make man file unique by adding it to list of files processed by uniquefiles.mk
This revision now requires changes to proceed.May 30 2017, 8:07 AM

Diff requires a change, either:

  1. Remove concurrent because man files are not processed by Uses/python.mk's use of Uses/uniquefiles.mk resulting on conflicts between multiple pyXY- versions
  2. Leave concurrent in, but make man file unique by adding it to list of files processed by uniquefiles.mk

Mmmm, I don't quite get all that. the pqshell.1 file is only installed if the current python is the default python, so, there is no way it can conflict.

Also, the uniquefiles USES is documented where everything is documented, in section 15.88. uniquefiles of the porter's handbook.

Hmm, I've only ever seen (or recall) unconditional man file installation and uniquefiles not processing those files by default. Perhaps something has changed since I last looked and someone added processing of man files.

If concurrent works, and two or more pyXY-foo's don't conflict and you're confident in the QA, by all means leave it in.

The review is otherwise accepted

Edit: Didn't realise I was replying to a comment by @mat not @loader.

This revision is now accepted and ready to land.May 31 2017, 3:51 AM

Decision aside, its worth trying if just to report back on the results so we can be clear on the current state for manual pages

Sure, here's the note about using concurrent manual pages
UNIQUE_SUFFIX_FILES= man/man1/pqshell.1

I noticed there are some extra steps for the man files,
they will be compressed and renamed in the ${TMPPLIST}
before reaching the move-uniquefiles-plist: taget.

...
775:move-uniquefiles <========= rename pqshell.1 to pqshell.1${UNIQUE_SUFFIX}
800:post-stage
850:compress-man <============= ${STAGEDIR}/${MANDIRS}/man/man1/pqshell.1${UNIQUE_SUFFIX}.gz
860:install-rc-script
870:install-ldconfig-file
880:install-license
890:install-desktop-entries
900:add-plist-info
910:add-plist-docs
920:add-plist-examples
930:add-plist-data
934:add-plist-pymod <========== s|^\(man/.*man[0-9]\)/\(.*\.[0-9]\)$$|\1/\2.gz| in ${TMPPLIST}
940:add-plist-post
950:move-uniquefiles-plist <=== pqshell.1.gz in ${TMPPLIST}, pqshell.1 in ${_UNIQUEPKGPLIST} not match, pqshell.1${UNIQUE_SUFFIX} won't be added in ${TMPPLIST}
995:stage-qa

okay, try to skip 850:compress-man and 934:add-plist-pymod

PORTNAME=	pymailq
PORTVERSION=	0.5.4
CATEGORIES=	mail python
MASTER_SITES=	CHEESESHOP
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

MAINTAINER=	loader@FreeBSD.org
COMMENT=	Postfix queue control python tool

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/LICENSE

RUN_DEPENDS=	postfix:mail/postfix

NO_ARCH=	yes
USES=		python:2.7+
USE_PYTHON=	autoplist distutils concurrent

PLIST_FILES+=	man/man1/pqshell.1
UNIQUE_SUFFIX_FILES=	man/man1/pqshell.1

compress-man:

post-patch:
	@${REINPLACE_CMD} -e 's,share/doc/pymailq,${DOCSDIR:S|${LOCALBASE}/||},' \
		-e "s|('share/man.*)||" ${WRKSRC}/setup.py
	@${REINPLACE_CMD} -e 's|/usr/sbin/postqueue|${LOCALBASE}/sbin/postqueue|' \
		${WRKSRC}/pymailq/store.py

post-install:
	${INSTALL_MAN} ${WRKSRC}/man/pqshell.1 ${STAGEDIR}${MANPREFIX}/man/man1/pqshell.1

.include <bsd.port.mk>

then I end up with some uncompressed man files:
/usr/local/man/man1/pqshell.1 -> pqshell.1-2.7
/usr/local/man/man1/pqshell.1-2.7
/usr/local/man/man1/pqshell.1-3.6

It would be much better if we could rename these man files to
/usr/local/man/man1/pqshell-2.7.1
/usr/local/man/man1/pqshell-3.6.1
and open them by running 'man pqshell-2.7' or 'man pqshell-3.6'

I haven't figured out how to do this with Mk/Uses/uniquefiles.mk yet ...

Thanks @koobs and @mat, I really appreciate your help.
I will commit it in the next few hours.

I haven't figured out how to do this with Mk/Uses/uniquefiles.mk yet ...

It may not be possible, might be a good idea tp open a PR about it.

@loader You're welcome, probably best to skip concurrent for the moment then in favour of adding it to python.mk as a first-case framework test instead

In D10976#227795, @mat wrote:

I haven't figured out how to do this with Mk/Uses/uniquefiles.mk yet ...

It may not be possible, might be a good idea tp open a PR about it.

Hi @mat,
Sure, I just opened a PR. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220214