cppmm-overlay/www-apps/inpxer/inpxer-0.2.5.ebuild

61 lines
1.1 KiB
Bash

# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module
DESCRIPTION="OPDS and web server for .inpx libraries with full-text search"
HOMEPAGE="https://github.com/shemanaev/inpxer"
if [[ ${PV} == 9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/shemanaev/inpxer.git"
else
SRC_URI="
https://github.com/shemanaev/inpxer/archive/v${PV}.tar.gz -> ${P}.tar.gz
"
KEYWORDS="~amd64"
fi
# main pkg
LICENSE="MIT"
SLOT="0"
PATCHES=(
"${FILESDIR}"/01-config-placement-0.2.5.patch
)
src_unpack() {
if [[ ${PV} == 9999* ]]; then
git-r3_src_unpack
go-module_live_vendor
else
default
fi
}
src_prepare() {
[[ ${PV} != 9999* ]] && { ln -sv ../vendor ./ || die ; }
default
}
src_compile() {
go build . || die
./"${PN}" --help > "${PN}".1 || die
}
src_test() {
emake test-flags= test
}
src_install() {
dosbin "${PN}"
cp "${FILESDIR}"/inpxer-example.toml "${ED}"/etc/inpxer/inpxer.toml || die
doman "${PN}".1
newinitd "${FILESDIR}"/${PN}.initd-1 ${PN}
insinto /etc/logrotate.d
newins "${FILESDIR}"/${PN}.logrotate "${PN}"
keepdir /var/log/${PN}
}