Rename OpenRC init script and confd file and add Gentoo ebuild
This commit is contained in:
@@ -51,8 +51,8 @@ systemctl daemon-reload
|
||||
systemctl enable ddns-service
|
||||
|
||||
# OpenRC setup
|
||||
wget -O /etc/init.d/ddns-service https://git.ccc-rheintal.ch/spacefreak/ddns-service/raw/branch/master/files/ddns-service-openrc.init.d
|
||||
wget -O /etc/conf.d/ddns-service https://git.ccc-rheintal.ch/spacefreak/ddns-service/raw/branch/master/files/ddns-service-openrc.conf.d
|
||||
wget -O /etc/init.d/ddns-service https://git.ccc-rheintal.ch/spacefreak/ddns-service/raw/branch/master/files/ddns-service-openrc.initd
|
||||
wget -O /etc/conf.d/ddns-service https://git.ccc-rheintal.ch/spacefreak/ddns-service/raw/branch/master/files/ddns-service-openrc.confd
|
||||
rc-update add ddns-service default
|
||||
```
|
||||
|
||||
|
||||
71
files/ddns-service-9999.ebuild
Normal file
71
files/ddns-service-9999.ebuild
Normal file
@@ -0,0 +1,71 @@
|
||||
# Copyright 2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
PYTHON_COMPAT=( python3_{11..13})
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
|
||||
SCM=""
|
||||
if [ "${PV#9999}" != "${PV}" ] ; then
|
||||
SCM="git-r3"
|
||||
EGIT_REPO_URI="https://git.ccc-rheintal.ch/spacefreak/${PN}"
|
||||
EGIT_BRANCH="master"
|
||||
fi
|
||||
|
||||
inherit ${SCM} distutils-r1 systemd
|
||||
|
||||
DESCRIPTION=""
|
||||
HOMEPAGE="https://git.ccc-rheintal.ch/spacefreak/ddns-service/"
|
||||
if [ "${PV#9999}" != "${PV}" ] ; then
|
||||
SRC_URI=""
|
||||
KEYWORDS=""
|
||||
# Needed for tests
|
||||
S="${WORKDIR}/${PN}"
|
||||
EGIT_CHECKOUT_DIR="${S}"
|
||||
else
|
||||
SRC_URI="https://git-ccc-rheintal.ch/spacefreak/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="amd64 x86"
|
||||
fi
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
IUSE="+mysql systemd"
|
||||
|
||||
DEPEND="acct-user/ddns
|
||||
dev-python/dns-manager[${PYTHON_USEDEP}]
|
||||
dev-python/peewee[${PYTHON_USEDEP}]
|
||||
dev-python/argon2-cffi[${PYTHON_USEDEP}]
|
||||
mysql? ( dev-python/pymysql[${PYTHON_USEDEP}] )"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
python_install_all() {
|
||||
use systemd && systemd_dounit files/${PN}.service
|
||||
newinitd files/${PN}-openrc.initd ${PN}
|
||||
newconfd files/${PN}-openrc.confd ${PN}
|
||||
|
||||
dodoc files/config.example.toml
|
||||
|
||||
keepdir /var/log/${PN}
|
||||
fowners ddns:ddns /var/log/${PN}
|
||||
|
||||
diropts -m750
|
||||
|
||||
keepdir /var/lib/${PN}
|
||||
fowners ddns:ddns /var/lib/${PN}
|
||||
|
||||
dodir /etc/${PN}
|
||||
|
||||
insopts -m640
|
||||
insinto /etc/${PN}
|
||||
newins files/config.example.toml config.toml
|
||||
fowners root:ddns /etc/${PN}/config.toml
|
||||
fowners ddns:root /etc/${PN}
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "You will need to setup your /etc/ddns-service/config.toml file before"
|
||||
elog "running ddns-service for the first time."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user