Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

[SOLVED]postfix-mta-sts-resolver-1.4.0 - ebuild

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
freke
Veteran
Veteran
Posts: 1136
Joined: Thu Jan 23, 2003 3:17 pm
Location: Somewhere in Denmark
Contact:
Contact freke
Website

[SOLVED]postfix-mta-sts-resolver-1.4.0 - ebuild

  • Quote

Post by freke » Tue Nov 28, 2023 7:03 pm

At last decided I wanted to try and make an ebuild for this, as I kept forgetting about it everytime I updated python...

Does this look somewhat sane? (worksforme™)

Code: Select all

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
PYPI_NO_NORMALIZE=1
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 pypi

DESCRIPTION="Daemon which provides TLS client policy for Postfix via socketmap, according to domain MTA-STS policy."
HOMEPAGE="https://github.com/Snawoot/postfix-mta-sts-resolver https://pypi.org/project/postfix-mta-sts-resolver/"
SRC_URI="https://github.com/Snawoot/postfix-mta-sts-resolver/releases/download/v${PV}/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64"
IUSE="uvloop"

DOCS="README.md"

RDEPEND="
        ${PYTHON_DEPS}
        >=dev-python/aiodns-1.1.1[${PYTHON_USEDEP}]
        >=dev-python/aiohttp-3.4.4[${PYTHON_USEDEP}]
        >=dev-python/pyyaml-3.12[${PYTHON_USEDEP}]
        >=dev-python/pycares-4.0.0[${PYTHON_USEDEP}]
        >=dev-python/attrs-17.3.0[${PYTHON_USEDEP}]
        >=dev-python/charset-normalizer-2.0[${PYTHON_USEDEP}]
        <dev-python/charset-normalizer-4.0[${PYTHON_USEDEP}]
        >=dev-python/multidict-4.5[${PYTHON_USEDEP}]
        <dev-python/multidict-7.0[${PYTHON_USEDEP}]
        >=dev-python/async-timeout-4.0.0[${PYTHON_USEDEP}]
        <dev-python/async-timeout-5.0[${PYTHON_USEDEP}]
        >=dev-python/yarl-1.0[${PYTHON_USEDEP}]
        <dev-python/yarl-2.0[${PYTHON_USEDEP}]
        >=dev-python/frozenlist-1.1.1[${PYTHON_USEDEP}]
        >=dev-python/aiosignal-1.1.2[${PYTHON_USEDEP}]
        >=dev-python/cffi-1.5.0[${PYTHON_USEDEP}]
        >=dev-python/idna-2.0[${PYTHON_USEDEP}]
        dev-python/pycparser[${PYTHON_USEDEP}]
        uvloop? (
                dev-python/uvloop[${PYTHON_USEDEP}]
        )
        "
DEPEND="${RDEPEND}"
The RDEPENDs are what is listed when I installed it via

Code: Select all

python3 -m pip install postfix-mta-sts-resolver --break-system-packages
Last edited by freke on Wed Nov 29, 2023 7:46 am, edited 1 time in total.
Top
grknight
Retired Dev
Retired Dev
Posts: 2560
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Tue Nov 28, 2023 7:14 pm

I believe the direct dependencies can be cut down by what is in the setup.py file:

Code: Select all

      install_requires=[
          'aiodns>=1.1.1',
          'aiohttp>=3.4.4',
          'PyYAML>=3.12',
      ],
Optionally adding support for these:

Code: Select all

      extras_require={
          'sqlite': 'aiosqlite>=0.10.0',
          'redis': 'redis>=4.2.0rc1',
          'postgres': 'asyncpg>=0.27',
          'uvloop': 'uvloop>=0.11.0',
      },
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Tue Nov 28, 2023 7:25 pm

Based information from github, the dependencies can be as following:
So RDEPEND can be

Code: Select all

RDEPEND="
        ${PYTHON_DEPS}
        dev-python/aiodns[${PYTHON_USEDEP}]
        dev-python/aiohttp[${PYTHON_USEDEP}]
        dev-python/pyyaml[${PYTHON_USEDEP}]
        postgres? (
                dev-python/asyncpg[${PYTHON_USEDEP}]  #only present in guru overlay
        )
        sqlite? (
                dev-python/aiosqlite[${PYTHON_USEDEP}]
        )
        redis? (
                dev-python/redis[${PYTHON_USEDEP}]
        )
        uvloop? (
                dev-python/uvloop[${PYTHON_USEDEP}]
        )
" 
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
freke
Veteran
Veteran
Posts: 1136
Joined: Thu Jan 23, 2003 3:17 pm
Location: Somewhere in Denmark
Contact:
Contact freke
Website

  • Quote

Post by freke » Tue Nov 28, 2023 7:31 pm

Thanks, you can tell it's my first time trying an ebuild for some python-stuff ;) - didn't know/think about to simply look at the setup.py...

Never used/tried any of the DBs - only used internal cache. Might give it a go :)
Top
freke
Veteran
Veteran
Posts: 1136
Joined: Thu Jan 23, 2003 3:17 pm
Location: Somewhere in Denmark
Contact:
Contact freke
Website

  • Quote

Post by freke » Wed Nov 29, 2023 7:19 am

fedeliallalinea wrote:Based information from github, the dependencies can be as following:
So RDEPEND can be

Code: Select all

RDEPEND="
        ${PYTHON_DEPS}
        dev-python/aiodns[${PYTHON_USEDEP}]
        dev-python/aiohttp[${PYTHON_USEDEP}]
        dev-python/pyyaml[${PYTHON_USEDEP}]
        postgres? (
                dev-python/asyncpg[${PYTHON_USEDEP}]  #only present in guru overlay
        )
        sqlite? (
                dev-python/aiosqlite[${PYTHON_USEDEP}]
        )
        redis? (
                dev-python/redis[${PYTHON_USEDEP}]
        )
        uvloop? (
                dev-python/uvloop[${PYTHON_USEDEP}]
        )
" 
Thanks, only tried sqlite for now and got that working fine - not going to test postgres (don't have a server running), but will give redis a test-drive, too as I have a redis-server running for rspamd.
Top
freke
Veteran
Veteran
Posts: 1136
Joined: Thu Jan 23, 2003 3:17 pm
Location: Somewhere in Denmark
Contact:
Contact freke
Website

  • Quote

Post by freke » Wed Dec 06, 2023 2:52 pm

Code: Select all

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
PYPI_NO_NORMALIZE=1
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 pypi

DESCRIPTION="Daemon which provides TLS client policy for Postfix via socketmap, according to domain MTA-STS policy"
HOMEPAGE="https://github.com/Snawoot/postfix-mta-sts-resolver https://pypi.org/project/postfix-mta-sts-resolver/"
SRC_URI="https://github.com/Snawoot/postfix-mta-sts-resolver/releases/download/v${PV}/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="uvloop sqlite redis postgres"

DOCS="README.md"

RDEPEND="
        ${PYTHON_DEPS}
        dev-python/aiodns[${PYTHON_USEDEP}]
        dev-python/aiohttp[${PYTHON_USEDEP}]
        dev-python/pyyaml[${PYTHON_USEDEP}]
        postgres? (
                dev-python/asyncpg[${PYTHON_USEDEP}]
        )
        sqlite? (
                dev-python/aiosqlite[${PYTHON_USEDEP}]
        )
        redis? (
                dev-python/redis[${PYTHON_USEDEP}]
        )
        uvloop? (
                dev-python/uvloop[${PYTHON_USEDEP}]
        )
"
DEPEND="${RDEPEND}"

distutils_enable_tests pytest
Haven't tested test (requires x-org which I'm not going to do on my servers) nor postgres as I don't have that running either; sqlite and redis seems to work fine with appropiate config.
I created these for running with openrc

Code: Select all

# /etc/conf.d/mta-sts

# Configuration file
MTASTS_CONFIGFILE="/etc/mta-sts-daemon.yml"

# PID file
MTASTS_PIDFILE="/run/mta-sts.pid"

# Options to mta-sts-daemon
MTASTS_OPTS="-l /var/log/mta-sts.log -v debug"

Code: Select all

#!/sbin/openrc-run
# Copyright 2015-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

depend() {
        use net
        before postfix
}

command="/usr/bin/mta-sts-daemon"
command_args="${MTASTS_OPTS} -c \"${MTASTS_CONFIGFILE}\" -p \"${MTASTS_PIDFILE}\" &"

pidfile="${MTASTS_PIDFILE}"

required_files="${MTASTS_CONFIGFILE}"

description="Postfix MTA-STS resolver"
Which *works* but I don't like the & in the init-file (mta-sts-daemon doesn't detach) - it keeps the start-stop-daemon process running
Top
grknight
Retired Dev
Retired Dev
Posts: 2560
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Wed Dec 06, 2023 3:46 pm

freke wrote:

Code: Select all

#!/sbin/openrc-run
# Copyright 2015-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

depend() {
        use net
        before postfix
}

command="/usr/bin/mta-sts-daemon"
command_args="${MTASTS_OPTS} -c "${MTASTS_CONFIGFILE}" -p "${MTASTS_PIDFILE}" &"

pidfile="${MTASTS_PIDFILE}"

required_files="${MTASTS_CONFIGFILE}"

description="Postfix MTA-STS resolver"
Which *works* but I don't like the & in the init-file (mta-sts-daemon doesn't detach) - it keeps the start-stop-daemon process running
Instead of the &, use command_background="yes" and drop the -p option to let the supervisor control the pidfile.
Top
freke
Veteran
Veteran
Posts: 1136
Joined: Thu Jan 23, 2003 3:17 pm
Location: Somewhere in Denmark
Contact:
Contact freke
Website

  • Quote

Post by freke » Wed Dec 06, 2023 7:09 pm

grknight wrote:Instead of the &, use command_background="yes" and drop the -p option to let the supervisor control the pidfile.
Thanks - works like a charm :)
Top
Post Reply

8 posts • Page 1 of 1

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic