diff --git a/distribution/gentoo/mail-filter/pyquarantine/pyquarantine-9999.ebuild b/distribution/gentoo/mail-filter/pyquarantine/pyquarantine-9999.ebuild new file mode 100644 index 0000000..02d6005 --- /dev/null +++ b/distribution/gentoo/mail-filter/pyquarantine/pyquarantine-9999.ebuild @@ -0,0 +1,52 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{8,9} ) +DISTUTILS_USE_SETUPTOOLS=rdepend + +SCM="" +if [ "${PV#9999}" != "${PV}" ] ; then + SCM="git-r3" + EGIT_REPO_URI="https://github.com/spacefreak86/${PN}" +fi + +inherit ${SCM} distutils-r1 systemd + +DESCRIPTION="A pymilter based sendmail/postfix pre-queue filter." +HOMEPAGE="https://github.com/spacefreak86/pyquarantine" +if [ "${PV#9999}" != "${PV}" ] ; then + SRC_URI="" + KEYWORDS="" + # Needed for tests + S="${WORKDIR}/${PN}" + EGIT_CHECKOUT_DIR="${S}" +else + SRC_URI="https://github.com/spacefreak86/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="amd64 x86" +fi + +LICENSE="GPL-3" +SLOT="0" +IUSE="lxml systemd" + +RDEPEND=" + dev-python/beautifulsoup[${PYTHON_USEDEP}] + dev-python/jsonschema[${PYTHON_USEDEP}] + lxml? ( dev-python/lxml[${PYTHON_USEDEP}] ) + dev-python/netaddr[${PYTHON_USEDEP}] + dev-python/peewee[${PYTHON_USEDEP}] + dev-python/pymilter[${PYTHON_USEDEP}]" + +python_install_all() { + distutils-r1_python_install_all + + dodir /etc/${PN} + insinto /etc/${PN} + doins pyquarantine/docs/pyquarantine.conf.example + doins -r pyquarantine/docs/templates + + use systemd && systemd_dounit ${PN}/misc/${PN}-milter.service + newinitd ${PN}/misc/openrc/${PN}-milter.initd ${PN}-milter + newconfd ${PN}/misc/openrc/${PN}-milter.confd ${PN}-milter +} diff --git a/distribution/pypi/build.sh b/distribution/pypi/build.sh new file mode 100755 index 0000000..365d429 --- /dev/null +++ b/distribution/pypi/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +PYTHON=$(which python) + +script_dir=$(dirname "$(readlink -f -- "$BASH_SOURCE")") +pkg_dir=$(realpath "${script_dir}"/../..) + +cd "${pkg_dir}" +${PYTHON} setup.py clean +${PYTHON} setup.py sdist bdist_wheel diff --git a/distribution/pypi/distribute.sh b/distribution/pypi/distribute.sh new file mode 100755 index 0000000..d937b3d --- /dev/null +++ b/distribution/pypi/distribute.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +TWINE=$(which twine) + +script_dir=$(dirname "$(readlink -f -- "$BASH_SOURCE")") +pkg_dir=$(realpath "${script_dir}/../..") + +cd "${pkg_dir}/dist" +msg="Select version to distribute (cancel with CTRL+C):" +echo "${msg}" +select version in $(find . -maxdepth 1 -type f -name "pyinotifyd-*.*.*.tar.gz" -printf "%f\n" | sed "s#\.tar\.gz##g"); do + [ -n "${version}" ] && break + echo -e "\ninvalid choice\n\n${msg}" +done +${TWINE} upload "${version}"{.tar.gz,-*.whl} diff --git a/pyquarantine/docs/pyquarantine.conf.example b/pyquarantine/misc/pyquarantine.conf.example similarity index 100% rename from pyquarantine/docs/pyquarantine.conf.example rename to pyquarantine/misc/pyquarantine.conf.example diff --git a/pyquarantine/misc/systemd/pyquarantine-milter.service b/pyquarantine/misc/systemd/pyquarantine-milter.service new file mode 100644 index 0000000..f8636d8 --- /dev/null +++ b/pyquarantine/misc/systemd/pyquarantine-milter.service @@ -0,0 +1,14 @@ +[Unit] +Description=pyquarantine-milter +After=network.target + +[Service] +Type=simple +EnvironmentFile=/etc/conf.d/pyquarantine-milter +ExecStart=/usr/bin/pyquarantine-milter $MILTER_OPTS +User=mail +Group=mail +TimeoutStopSec=300 + +[Install] +WantedBy=multi-user.target diff --git a/pyquarantine/docs/templates/disclaimer_html.template b/pyquarantine/misc/templates/disclaimer_html.template similarity index 100% rename from pyquarantine/docs/templates/disclaimer_html.template rename to pyquarantine/misc/templates/disclaimer_html.template diff --git a/pyquarantine/docs/templates/disclaimer_text.template b/pyquarantine/misc/templates/disclaimer_text.template similarity index 100% rename from pyquarantine/docs/templates/disclaimer_text.template rename to pyquarantine/misc/templates/disclaimer_text.template diff --git a/pyquarantine/docs/templates/notification.template b/pyquarantine/misc/templates/notification.template similarity index 100% rename from pyquarantine/docs/templates/notification.template rename to pyquarantine/misc/templates/notification.template diff --git a/pyquarantine/docs/templates/removed.png b/pyquarantine/misc/templates/removed.png similarity index 100% rename from pyquarantine/docs/templates/removed.png rename to pyquarantine/misc/templates/removed.png diff --git a/setup.py b/setup.py index a27fe09..b1ccb6a 100644 --- a/setup.py +++ b/setup.py @@ -36,15 +36,15 @@ setup(name = "pyquarantine", ( "/etc/pyquarantine", [ - "pyquarantine/docs/pyquarantine.conf.example" + "pyquarantine/misc/pyquarantine.conf.example" ] ), ( "/etc/pyquarantine/templates", [ - "pyquarantine/docs/templates/disclaimer_html.template", - "pyquarantine/docs/templates/disclaimer_text.template", - "pyquarantine/docs/templates/notification.template", - "pyquarantine/docs/templates/removed.png" + "pyquarantine/misc/templates/disclaimer_html.template", + "pyquarantine/misc/templates/disclaimer_text.template", + "pyquarantine/misc/templates/notification.template", + "pyquarantine/misc/templates/removed.png" ] ) ],