www-apps/whoogle-search: POSIX-ify openrc script

Also resolve shellcheck and pkgcheck comments

Closes: https://bugs.gentoo.org/917079
Signed-off-by: Bailey Kasin <baileykasin@gmail.com>
This commit is contained in:
Bailey Kasin
2023-11-11 06:55:49 +00:00
parent 6fd32bcd21
commit ecdc853e58
4 changed files with 42 additions and 37 deletions

View File

@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# Environment variables for whoogle # Environment variables for whoogle
source "/etc/default/whoogle" . "/etc/default/whoogle"
export ADDRESS=${BIND_ADDRESS:-0.0.0.0} export ADDRESS=${BIND_ADDRESS:-0.0.0.0}
export PORT=${LISTEN_PORT:-5000} export PORT=${LISTEN_PORT:-5000}
@@ -23,7 +23,7 @@ depend() {
start_pre() { start_pre() {
checkpath -fo whoogle:whoogle "/var/log/whoogle.log" checkpath -fo whoogle:whoogle "/var/log/whoogle.log"
echo "Whoogle is running on: ${BIND_ADDRESS}:${LISTEN_PORT}" echo "Whoogle is running on: ${BIND_ADDRESS}:${LISTEN_PORT}"
cd /opt/whoogle-search cd /opt/whoogle-search || exit 1
} }
stop_post() { stop_post() {

View File

@@ -5,4 +5,7 @@
<email>baileykasin@gmail.com</email> <email>baileykasin@gmail.com</email>
<name>Bailey Kasin</name> <name>Bailey Kasin</name>
</maintainer> </maintainer>
<upstream>
<remote-id type="github">benbusby/whoogle-search</remote-id>
</upstream>
</pkgmetadata> </pkgmetadata>

View File

@@ -20,29 +20,30 @@ RDEPEND="
dev-python/beautifulsoup4[${PYTHON_USEDEP}] dev-python/beautifulsoup4[${PYTHON_USEDEP}]
dev-python/cryptography[${PYTHON_USEDEP}] dev-python/cryptography[${PYTHON_USEDEP}]
dev-python/flask[${PYTHON_USEDEP}] dev-python/flask[${PYTHON_USEDEP}]
dev-python/python-dotenv[${PYTHON_USEDEP}] dev-python/python-dotenv[${PYTHON_USEDEP}]
dev-python/defusedxml[${PYTHON_USEDEP}] dev-python/defusedxml[${PYTHON_USEDEP}]
dev-python/waitress[${PYTHON_USEDEP}] dev-python/waitress[${PYTHON_USEDEP}]
app-arch/brotli[${PYTHON_USEDEP},python] app-arch/brotli[${PYTHON_USEDEP},python]
net-libs/stem net-libs/stem
acct-user/whoogle acct-user/whoogle
acct-group/whoogle acct-group/whoogle
" "
src_install() { src_install() {
rm -r .github docs test .dockerignore .gitignore .replit docker-compose.yml Dockerfile heroku.yml MANIFEST.in README.md requirements.txt rm -r .github docs test .dockerignore .gitignore .replit \
mkdir -p "${ED}/opt/whoogle-search" || die docker-compose.yml Dockerfile heroku.yml MANIFEST.in README.md \
insinto /opt/whoogle-search requirements.txt
doins -r ./* mkdir -p "${ED}/opt/whoogle-search" || die
fperms -R 0755 /opt/whoogle-search insinto /opt/whoogle-search
doins -r ./*
fperms -R 0755 /opt/whoogle-search
fowners -R whoogle:whoogle /opt/whoogle-search fowners -R whoogle:whoogle /opt/whoogle-search
insinto /etc/default/ insinto /etc/default/
doins ${FILESDIR}/whoogle doins "${FILESDIR}/whoogle"
insinto /usr/lib/sysusers.d/ insinto /usr/lib/sysusers.d/
doins ${FILESDIR}/whoogle.conf doins "${FILESDIR}/whoogle.conf"
newinitd "${FILESDIR}"/whoogle.initd whoogle newinitd "${FILESDIR}"/whoogle.initd whoogle
systemd_dounit ${FILESDIR}/whoogle.service systemd_dounit "${FILESDIR}/whoogle.service"
} }

View File

@@ -20,30 +20,31 @@ RDEPEND="
dev-python/beautifulsoup4[${PYTHON_USEDEP}] dev-python/beautifulsoup4[${PYTHON_USEDEP}]
dev-python/cryptography[${PYTHON_USEDEP}] dev-python/cryptography[${PYTHON_USEDEP}]
dev-python/flask[${PYTHON_USEDEP}] dev-python/flask[${PYTHON_USEDEP}]
dev-python/python-dotenv[${PYTHON_USEDEP}] dev-python/python-dotenv[${PYTHON_USEDEP}]
dev-python/defusedxml[${PYTHON_USEDEP}] dev-python/defusedxml[${PYTHON_USEDEP}]
dev-python/waitress[${PYTHON_USEDEP}] dev-python/waitress[${PYTHON_USEDEP}]
dev-python/validators[${PYTHON_USEDEP}] dev-python/validators[${PYTHON_USEDEP}]
app-arch/brotli[${PYTHON_USEDEP},python] app-arch/brotli[${PYTHON_USEDEP},python]
net-libs/stem net-libs/stem
acct-user/whoogle acct-user/whoogle
acct-group/whoogle acct-group/whoogle
" "
src_install() { src_install() {
rm -r .github docs test .dockerignore .gitignore .replit docker-compose.yml Dockerfile heroku.yml MANIFEST.in README.md requirements.txt rm -r .github docs test .dockerignore .gitignore .replit \
mkdir -p "${ED}/opt/whoogle-search" || die docker-compose.yml Dockerfile heroku.yml MANIFEST.in README.md \
insinto /opt/whoogle-search requirements.txt
doins -r ./* mkdir -p "${ED}/opt/whoogle-search" || die
fperms -R 0755 /opt/whoogle-search insinto /opt/whoogle-search
doins -r ./*
fperms -R 0755 /opt/whoogle-search
fowners -R whoogle:whoogle /opt/whoogle-search fowners -R whoogle:whoogle /opt/whoogle-search
insinto /etc/default/ insinto /etc/default/
doins ${FILESDIR}/whoogle doins "${FILESDIR}/whoogle"
insinto /usr/lib/sysusers.d/ insinto /usr/lib/sysusers.d/
doins ${FILESDIR}/whoogle.conf doins "${FILESDIR}/whoogle.conf"
newinitd "${FILESDIR}"/whoogle.initd whoogle newinitd "${FILESDIR}"/whoogle.initd whoogle
systemd_dounit ${FILESDIR}/whoogle.service systemd_dounit "${FILESDIR}/whoogle.service"
} }