diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
| commit | bfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch) | |
| tree | 0d7a74b4463ee387f9cf9368ceb1b757f694f72a /mail-filter/postsrsd | |
| parent | f716a9fe6455d39eef01e718aae68dae61c19704 (diff) | |
| download | baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip | |
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'mail-filter/postsrsd')
| -rw-r--r-- | mail-filter/postsrsd/Manifest | 2 | ||||
| -rw-r--r-- | mail-filter/postsrsd/files/postsrsd-2.0.11-sysconfdir.patch | 11 | ||||
| -rw-r--r-- | mail-filter/postsrsd/files/postsrsd-2.0.11.confd | 6 | ||||
| -rw-r--r-- | mail-filter/postsrsd/files/postsrsd-2.0.11.initd | 14 | ||||
| -rw-r--r-- | mail-filter/postsrsd/files/postsrsd.init-r2 | 31 | ||||
| -rw-r--r-- | mail-filter/postsrsd/metadata.xml | 18 | ||||
| -rw-r--r-- | mail-filter/postsrsd/postsrsd-1.12.ebuild | 40 | ||||
| -rw-r--r-- | mail-filter/postsrsd/postsrsd-2.0.11-r6.ebuild | 117 |
8 files changed, 239 insertions, 0 deletions
diff --git a/mail-filter/postsrsd/Manifest b/mail-filter/postsrsd/Manifest new file mode 100644 index 000000000000..41d9aa90a052 --- /dev/null +++ b/mail-filter/postsrsd/Manifest @@ -0,0 +1,2 @@ +DIST postsrsd-1.12.tar.gz 36860 BLAKE2B 9f760e010c791d993df83d1f55bd02f2f42fe336e4aef9aae87e62aab2ef86354d99ff1b9be2b2a24d33006fe0461887224dad11a03139e7ce24ab23a775d3ad SHA512 9b83d89f8ac26ba0477998c495b0566295e16ae62a661a9edaef430cbc2eea592fe178b3686d0ad0578a808d13c13d526ac44a2360fd6e715d701887086fa51a +DIST postsrsd-2.0.11.tar.gz 64995 BLAKE2B 5958dd3d45ad2181fb46b6bd086b95e6f952309dccacb889fd704994d822ce01f3487e2b8dfa19f7a8627ede58f8f619ae891da053d053cbc4b3a362759a23fe SHA512 d85be04decfcf38ac2aaa3435f804106faf37bd51914184f91ff2f130ff39ce4e1b73e9d0748dc57c940bdbc917dddcd25fc8777fcba65e864a1c6f0066c3995 diff --git a/mail-filter/postsrsd/files/postsrsd-2.0.11-sysconfdir.patch b/mail-filter/postsrsd/files/postsrsd-2.0.11-sysconfdir.patch new file mode 100644 index 000000000000..0c2d92fdda84 --- /dev/null +++ b/mail-filter/postsrsd/files/postsrsd-2.0.11-sysconfdir.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -362,7 +362,7 @@ + + install(TARGETS postsrsd RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.conf" +- DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME}" ++ DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}" + ) + if(INSTALL_SYSTEMD_SERVICE) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.service" diff --git a/mail-filter/postsrsd/files/postsrsd-2.0.11.confd b/mail-filter/postsrsd/files/postsrsd-2.0.11.confd new file mode 100644 index 000000000000..99bebd427a14 --- /dev/null +++ b/mail-filter/postsrsd/files/postsrsd-2.0.11.confd @@ -0,0 +1,6 @@ +# Default settings for PostSRSd + +# From the postsrsd-2.0.11 README file: +# "Most configuration options can no longer be configured with command +# line arguments, so you will have to set them in /etc/postsrsd.conf." +#POSTSRSD_OPTS="" diff --git a/mail-filter/postsrsd/files/postsrsd-2.0.11.initd b/mail-filter/postsrsd/files/postsrsd-2.0.11.initd new file mode 100644 index 000000000000..d394202e3bf1 --- /dev/null +++ b/mail-filter/postsrsd/files/postsrsd-2.0.11.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the modified BSD license + +description="Sender Rewriting Scheme daemon for Postfix" + +supervisor=supervise-daemon +command=/usr/sbin/postsrsd +command_args=${POSTSRSD_OPTS} + +depend() { + need net + before postfix +} diff --git a/mail-filter/postsrsd/files/postsrsd.init-r2 b/mail-filter/postsrsd/files/postsrsd.init-r2 new file mode 100644 index 000000000000..aff009dcfb2b --- /dev/null +++ b/mail-filter/postsrsd/files/postsrsd.init-r2 @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +# Copyright 2015-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +PIDFILE=/var/run/$SVCNAME.pid +SRS_DOMAIN="${SRS_DOMAIN:-`postconf -h mydomain || true`}" +SRS_EXCLUDE_DOMAINS="${SRS_EXCLUDE_DOMAINS:-''}" + +depend() { + need net +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --name $SVCNAME \ + --exec /usr/sbin/postsrsd \ + -- -f "$SRS_FORWARD_PORT" -r "$SRS_REVERSE_PORT" \ + -d "$SRS_DOMAIN" -s "$SRS_SECRET" -a "$SRS_SEPARATOR" \ + -u "$RUN_AS" -p "$PIDFILE" -c "$CHROOT" \ + -n "$SRS_HASHLENGTH" -N "$SRS_HASHMIN" -l "$SRS_LISTEN_ADDR" \ + -D -X"$SRS_EXCLUDE_DOMAINS" + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --name $SVCNAME + eend $? +} diff --git a/mail-filter/postsrsd/metadata.xml b/mail-filter/postsrsd/metadata.xml new file mode 100644 index 000000000000..5119295de6b1 --- /dev/null +++ b/mail-filter/postsrsd/metadata.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>ulm@gentoo.org</email> + </maintainer> + <use> + <flag name="redis"> + Add support for <pkg>dev-libs/hiredis</pkg> database backend + </flag> + <flag name="sqlite"> + Add support for <pkg>dev-db/sqlite</pkg> database backend + </flag> + </use> + <upstream> + <remote-id type="github">roehling/postsrsd</remote-id> + </upstream> +</pkgmetadata> diff --git a/mail-filter/postsrsd/postsrsd-1.12.ebuild b/mail-filter/postsrsd/postsrsd-1.12.ebuild new file mode 100644 index 000000000000..dbfadbbd705a --- /dev/null +++ b/mail-filter/postsrsd/postsrsd-1.12.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake systemd + +DESCRIPTION="Postfix Sender Rewriting Scheme daemon" +HOMEPAGE="https://github.com/roehling/postsrsd" +SRC_URI="https://github.com/roehling/postsrsd/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2+ || ( GPL-2 BSD )" +SLOT="0" +KEYWORDS="amd64 x86" + +BDEPEND="sys-apps/help2man" + +CHROOT_DIR="${EPREFIX}/var/lib/postsrsd" + +src_configure() { + local mycmakeargs=( + -DCHROOT_DIR="${CHROOT_DIR}" + + # This doesn't affect functionality on OpenRC, it just + # forces the build system to install the systemd units. + -DINIT_FLAVOR="systemd" + -DSYSD_UNIT_DIR="$(systemd_get_systemunitdir)" + + -DDOC_DIR="${EPREFIX}"/usr/share/doc/${PF} + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + + newinitd "${FILESDIR}"/postsrsd.init-r2 postsrsd + newconfd "${BUILD_DIR}"/postsrsd.default postsrsd + keepdir "${CHROOT_DIR}" +} diff --git a/mail-filter/postsrsd/postsrsd-2.0.11-r6.ebuild b/mail-filter/postsrsd/postsrsd-2.0.11-r6.ebuild new file mode 100644 index 000000000000..6684566b176d --- /dev/null +++ b/mail-filter/postsrsd/postsrsd-2.0.11-r6.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake eapi9-ver readme.gentoo-r1 systemd + +DESCRIPTION="Postfix Sender Rewriting Scheme daemon" +HOMEPAGE="https://github.com/roehling/postsrsd" +SRC_URI="https://github.com/roehling/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +# See REUSE.toml: GPL-3 (v3 only) for the main software, +# BSD for src/{sha1,srs2}.*, FSFAP for cmake/* +LICENSE="GPL-3 BSD FSFAP" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="redis sqlite test" +RESTRICT="!test? ( test )" + +RDEPEND="acct-user/postsrsd + dev-libs/confuse:= + redis? ( dev-libs/hiredis:= ) + sqlite? ( dev-db/sqlite:3 )" + +DEPEND="${RDEPEND} + test? ( dev-libs/check )" + +CHROOT_DIR="${EPREFIX}/var/lib/postsrsd" + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.11-sysconfdir.patch +) +DOCS=( README.rst CHANGELOG.rst ) + +src_configure() { + local mycmakeargs=( + -DBUILD_TESTING=$(usex test) + + -DPOSTSRSD_USER=postsrsd + -DPOSTSRSD_CHROOTDIR="${CHROOT_DIR}" + -DSYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" + -DSYSTEMD_SYSUSERSDIR="${EPREFIX}/usr/lib/sysusers.d" + + -DINSTALL_SYSTEMD_SERVICE=ON + # https://github.com/roehling/postsrsd/blob/main/doc/packaging.rst#third-party-dependencies + -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS + -DFETCHCONTENT_FULLY_DISCONNECTED=ON + # We don't want to run tests with sanitizers. They're + # unreliable under sandbox and don't run on all platforms + -DTESTS_WITH_ASAN=OFF + + # Do not generate the signing secret in src_install, as it would + # a) embed it in binary packages and b) overwrite existing secrets + # on every reinstall. Generate the secret in pkg_postinst instead. + -DGENERATE_SRS_SECRET=OFF + + # "Note that the Milter code is less tested and should be + # considered experimental for now and not ready for production." + -DWITH_MILTER=OFF + -DWITH_REDIS=$(usex redis) + -DWITH_SQLITE=$(usex sqlite) + ) + + cmake_src_configure +} + +src_install() { + diropts -o postsrsd -g root -m 0755 + keepdir "${CHROOT_DIR}" + + cmake_src_install + + newinitd "${FILESDIR}"/postsrsd-2.0.11.initd postsrsd + newconfd "${FILESDIR}"/postsrsd-2.0.11.confd postsrsd + + local DOC_CONTENTS="When updating from version 1.x: + \n\nNote that most configuration options can no longer be set from the + command line, therefore we cannot define them in OpenRC's conf.d file + either. You will have to set them in ${EPREFIX}/etc/postsrsd.conf + instead. + \n\nIn the config file, you must *at least* set the \"domains\" + variable, i.e. the local domain name. In most cases, using the output + of \"postconf -h mydomain\" should be okay. + \n\nAlso note that PostSRSd 2.x by default uses Unix domain sockets + instead of TCP sockets, so you must update \"sender_canonical_maps\" + and \"recipient_canonical_maps\" in ${EPREFIX}/etc/postfix/main.cf. + (Alternatively, you can update \"socketmap\" in postsrsd.conf.) + \n\nSince postsrsd will create its socket with file mode 0666, it is + recommended to place it in a directory with restricted permissions, + for example: + \n\n\t# mkdir /var/spool/postfix/postsrsd + \n\t# chown root:postfix /var/spool/postfix/postsrsd + \n\t# chmod 0770 /var/spool/postfix/postsrsd + \n\nand adjust \"{sender,recipient}_canonical_maps\" in main.cf + as well as \"socketmap\" in postsrsd.conf accordingly. + \n\nSee README.rst and the comments in postsrsd.conf for more detailed + information." + readme.gentoo_create_doc +} + +pkg_postinst() { + local f="${EROOT}/etc/postsrsd.secret" + + if [[ ! -s ${f} ]]; then + ebegin "Generate the SRS signing secret and install it in ${f}" + ( + umask 077 + set -o pipefail + rnd="$(dd if=/dev/urandom bs=18 count=1 status=none | base64)" \ + && printf "%s\n" "${rnd}" > "${f}" + ) + eend $? "Installing ${f} failed" + fi + + ver_replacing -lt 2.0.11-r6 && local FORCE_PRINT_ELOG=1 + readme.gentoo_print_elog +} |
