improve distribution
This commit is contained in:
@@ -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
|
||||
}
|
||||
11
distribution/pypi/build.sh
Executable file
11
distribution/pypi/build.sh
Executable file
@@ -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
|
||||
16
distribution/pypi/distribute.sh
Executable file
16
distribution/pypi/distribute.sh
Executable file
@@ -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}
|
||||
14
pyquarantine/misc/systemd/pyquarantine-milter.service
Normal file
14
pyquarantine/misc/systemd/pyquarantine-milter.service
Normal file
@@ -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
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
10
setup.py
10
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"
|
||||
]
|
||||
)
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user