diff --git a/metadata/md5-cache/www-apps/inpxer-0.2.5 b/metadata/md5-cache/www-apps/inpxer-0.2.5 new file mode 100644 index 0000000..36fdc28 --- /dev/null +++ b/metadata/md5-cache/www-apps/inpxer-0.2.5 @@ -0,0 +1,13 @@ +BDEPEND=>=dev-lang/go-1.20:= app-arch/unzip +DEFINED_PHASES=compile install prepare test unpack +DESCRIPTION=OPDS and web server for .inpx libraries with full-text search +EAPI=8 +HOMEPAGE=https://github.com/shemanaev/inpxer +INHERIT=go-module +KEYWORDS=~amd64 +LICENSE=MIT +RESTRICT=strip +SLOT=0 +SRC_URI=https://github.com/shemanaev/inpxer/archive/v0.2.5.tar.gz -> inpxer-0.2.5.tar.gz +_eclasses_=multiprocessing e644caa6eb7ce7e5ab0864383ac13ad9 toolchain-funcs 948855ec7ad9f11351edf9066708dfa9 multilib 7e1347c006a76bb812f3a9f663b79991 flag-o-matic fa33e3696fe4689dda7e9affe92e2c94 go-env 90efbc8636d2f02d9654183330e84cf7 go-module 83fd3ed1657cfc316c93d6a37018290d +_md5_=b4ea44fc838b4ba7630c22ff85e423c2 diff --git a/www-apps/inpxer/Manifest b/www-apps/inpxer/Manifest new file mode 100644 index 0000000..365bca1 --- /dev/null +++ b/www-apps/inpxer/Manifest @@ -0,0 +1 @@ +DIST inpxer-0.2.5.tar.gz 485529 BLAKE2B d15f1aacbb00cedaf3b605a9125ce82c65e535cf4417b6562a3e7de8384e039dd551572a6c3b6b2c6d078a3b00f71df8254f101fd00c9831779ccaa422d75a38 SHA512 dbf1f5e50c3ec2291698293ef37bcb31a7e912832fd5a4bdad4e7a2db92d85592fdbb813ea85c151e53e5bf4d39219ec38f285b091f1d6a8fd986900dd04c175 diff --git a/www-apps/inpxer/files/01-config-placement-0.2.5.patch b/www-apps/inpxer/files/01-config-placement-0.2.5.patch new file mode 100644 index 0000000..72263c7 --- /dev/null +++ b/www-apps/inpxer/files/01-config-placement-0.2.5.patch @@ -0,0 +1,11 @@ +--- a/internal/config/config.go 2024-09-16 02:47:23.666714944 +0300 ++++ b/internal/config/config.go 2024-09-16 02:47:50.696715919 +0300 +@@ -8,7 +8,7 @@ + "github.com/pelletier/go-toml/v2" + ) + +-const configFilename = "inpxer.toml" ++const configFilename = "/etc/inpxer/inpxer.toml" + + type MyConfig struct { + Language string `toml:"language"` diff --git a/www-apps/inpxer/files/inpxer-example.toml b/www-apps/inpxer/files/inpxer-example.toml new file mode 100644 index 0000000..863ec8a --- /dev/null +++ b/www-apps/inpxer/files/inpxer-example.toml @@ -0,0 +1,30 @@ +# language used for interface and indexing +language = "en" # en, ru +# title displayed on web and in OPDS catalog +title = "My library" +# format for author's name. possible values: +# - short: Fyodor Dostoevsky +# - initials: F. M. Dostoevsky +# - full: Fyodor Mikhailovich Dostoevsky +author_name_format = "short" +# where to store index +# WARNING: keep in mind that this folder will be deleted during indexing, +# don't point it to an existing location (and definitely don't set it equal to library_path) +index_path = "/data/index" +# where is you books stored +library_path = "/data/library" +# host:port to listen on +listen = ":8080" +# fully qualified url to server. required for OPDS (OpenSearch) +full_url = "http://localhost:8080" + +# format converters. can be as many as you want +#[[converters]] +## source file extension +#from = "fb2" +## target file extension +#to = "epub" +## converter executable +#command = "fb2epub" +## converter arguments. {from} becomes source file path, {to} - output file path, {to_dir} - output directory (for fb2converter) +#arguments = "{from} {to}" diff --git a/www-apps/inpxer/files/inpxer.initd-1 b/www-apps/inpxer/files/inpxer.initd-1 new file mode 100644 index 0000000..a3a8c61 --- /dev/null +++ b/www-apps/inpxer/files/inpxer.initd-1 @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 2016-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="Web server for .inpx libraries" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/sbin/inpxer" +command_args="${command_args:-serve}" +command_background="true" +command_user="${user}:${group}" +output_log="/var/log/inpxer/${RC_SVCNAME}.log" +error_log="/var/log/inpxer/${RC_SVCNAME}.log" + +depend() { + after net +} + +start_pre() { + checkpath -q -d -m 0755 -o ${user}:${group} /var/log/inpxer +} diff --git a/www-apps/inpxer/files/inpxer.logrotate b/www-apps/inpxer/files/inpxer.logrotate new file mode 100644 index 0000000..2440e4e --- /dev/null +++ b/www-apps/inpxer/files/inpxer.logrotate @@ -0,0 +1,9 @@ +/var/log/inpxer/inpxer.log { + weekly + rotate 10 + copytruncate + compress + delaycompress + notifempty + missingok +} diff --git a/www-apps/inpxer/inpxer-0.2.5.ebuild b/www-apps/inpxer/inpxer-0.2.5.ebuild new file mode 100644 index 0000000..542950d --- /dev/null +++ b/www-apps/inpxer/inpxer-0.2.5.ebuild @@ -0,0 +1,59 @@ +# 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() { + ./"${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} +} diff --git a/www-apps/inpxer/metadata.xml b/www-apps/inpxer/metadata.xml new file mode 100644 index 0000000..85338e9 --- /dev/null +++ b/www-apps/inpxer/metadata.xml @@ -0,0 +1,13 @@ + + + + + root@cppmm.net.ru + Anton Kropachev + + + shemanaev/inpxer + https://github.com/shemanaev/inpxer/issues + https://github.com/shemanaev/inpxer/blob/master/README.md + +