diff --git a/acct-group/gemini/gemini-0.ebuild b/acct-group/gemini/gemini-0.ebuild index 35028819ce..3e86329d82 100644 --- a/acct-group/gemini/gemini-0.ebuild +++ b/acct-group/gemini/gemini-0.ebuild @@ -1,10 +1,10 @@ -# Copyright 2020 Gentoo Authors +# Copyright 2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 inherit acct-group -KEYWORDS="~amd64" +KEYWORDS="~amd64 ~x86" ACCT_GROUP_ID=-1 diff --git a/acct-user/gemini/gemini-0.ebuild b/acct-user/gemini/gemini-0.ebuild index 390a1e4fe7..19617da46a 100644 --- a/acct-user/gemini/gemini-0.ebuild +++ b/acct-user/gemini/gemini-0.ebuild @@ -1,4 +1,4 @@ -# Copyright 2020 Gentoo Authors +# Copyright 2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -6,7 +6,7 @@ EAPI=7 inherit acct-user DESCRIPTION="User for gemini daemon" -KEYWORDS="~amd64" +KEYWORDS="~amd64 ~x86" ACCT_USER_ID=-1 ACCT_USER_GROUPS=( gemini ) diff --git a/net-misc/gmid/Manifest b/net-misc/gmid/Manifest new file mode 100644 index 0000000000..00cf99da9a --- /dev/null +++ b/net-misc/gmid/Manifest @@ -0,0 +1 @@ +DIST gmid-1.6.tar.gz 59402 BLAKE2B 1a13ae3f598a406e7920ad3a4f73cb230d70fe3bf4a1017d8d196ab80fdc0ffcf339ad79c64de93dc69d06e294132d714ad8ea1a5248dc69377e8d088f772d6c SHA512 cf118ac3b067b23d480006bccf36218ab0bf91d778092855a01706782fb0c68252157615d92d143d29deb8331422ef1263228b9eb53dd30e64a480b17c48af7a diff --git a/net-misc/gmid/files/gmid.confd b/net-misc/gmid/files/gmid.confd new file mode 100644 index 0000000000..62027f6a49 --- /dev/null +++ b/net-misc/gmid/files/gmid.confd @@ -0,0 +1,13 @@ +# /etc/conf.d/gmid + +# Configuration file +#GMID_CONFIGFILE="/etc/gmid/gmid.conf" + +# PID file +#GMID_PIDFILE="/var/run/gmid.pid" + +# User to run gmid as +#GMID_USER="gemini" + +# Group to run gmid as +#GMID_GROUP="gemini" diff --git a/net-misc/gmid/files/gmid.initd b/net-misc/gmid/files/gmid.initd new file mode 100644 index 0000000000..dfe3b0009b --- /dev/null +++ b/net-misc/gmid/files/gmid.initd @@ -0,0 +1,53 @@ +#!/sbin/openrc-run +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="configtest" +extra_started_commands="reload" + +description="Simple and secure Gemini server" +description_configtest="Run gmid's internal config check." +description_reload="Reload the gmid configuration without losing connections." + +GMID_CONFIGFILE=${GMID_CONFIGFILE:-/etc/gmid/gmid.conf} + +command="/usr/bin/gmid" +command_args="-c \"${GMID_CONFIGFILE}\"" +pidfile=${GMID_PIDFILE:-/var/run/gmid.pid} +user=${GMID_USER:-gemini} +group=${GMID_GROUP:-gemini} + +depend() { + need net + use dns logger netmount +} + +start_pre() { + if [ "${RC_CMD}" != "restart" ]; then + configtest || return 1 + fi +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + configtest || return 1 + fi +} + +stop_post() { + rm -f ${pidfile} +} + +reload() { + configtest || return 1 + ebegin "Refreshing gmid's configuration" + start-stop-daemon --signal SIGHUP --pidfile "${pidfile}" + eend $? "Failed to reload gmid" +} + +configtest() { + ebegin "Checking gmid's configuration" + ${command} -c "${GMID_CONFIGFILE}" -n + + eend $? "failed, please correct errors in the config file" +} diff --git a/net-misc/gmid/gmid-1.6.ebuild b/net-misc/gmid/gmid-1.6.ebuild new file mode 100644 index 0000000000..da3b22779b --- /dev/null +++ b/net-misc/gmid/gmid-1.6.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="simple and secure Gemini server" +HOMEPAGE="https://www.omarpolo.com/pages/gmid.html" + +if [[ ${PV} == "9999" ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://git.omarpolo.com/${PN}" +else + SRC_URI="https://git.omarpolo.com/${PN}/snapshot/${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="ISC" +SLOT="0" +IUSE="libressl" + +DEPEND="acct-user/gemini + dev-libs/libevent + !libressl? ( dev-libs/libretls ) + libressl? ( dev-libs/libressl )" +BDEPEND="sys-devel/flex + virtual/yacc" +RDEPEND="${DEPEND}" + +DOCS=( README.md ChangeLog ) + +src_prepare() { + default + + # QA Notice: command not found + # remove `etags` from the "all" target + sed \ + -e "s/^\(all: .*\) TAGS \(.*\)$/\1 \2/" \ + -i Makefile || die +} + +src_configure() { + # note: not an autoconf configure script + ./configure \ + CC="$(tc-getCC)" \ + PREFIX="${EPREFIX}"/usr/share \ + BINDIR="${EPREFIX}"/usr/bin \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS} -ltls -lssl -lcrypto -levent" || die +} + +src_install() { + default + + newinitd "${FILESDIR}"/gmid.initd gmid + newconfd "${FILESDIR}"/gmid.confd gmid +} + +pkg_postinst() { + einfo "This gemini server can be run as a user with zero configuration.\n" + einfo "In order to use it with the init service you will need to generate a" + einfo "self-signed TLS certificate and key and set up the configuration" + einfo "file (see man 1 gmid for details)." +} diff --git a/net-misc/gmid/gmid-9999.ebuild b/net-misc/gmid/gmid-9999.ebuild new file mode 100644 index 0000000000..da3b22779b --- /dev/null +++ b/net-misc/gmid/gmid-9999.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="simple and secure Gemini server" +HOMEPAGE="https://www.omarpolo.com/pages/gmid.html" + +if [[ ${PV} == "9999" ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://git.omarpolo.com/${PN}" +else + SRC_URI="https://git.omarpolo.com/${PN}/snapshot/${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="ISC" +SLOT="0" +IUSE="libressl" + +DEPEND="acct-user/gemini + dev-libs/libevent + !libressl? ( dev-libs/libretls ) + libressl? ( dev-libs/libressl )" +BDEPEND="sys-devel/flex + virtual/yacc" +RDEPEND="${DEPEND}" + +DOCS=( README.md ChangeLog ) + +src_prepare() { + default + + # QA Notice: command not found + # remove `etags` from the "all" target + sed \ + -e "s/^\(all: .*\) TAGS \(.*\)$/\1 \2/" \ + -i Makefile || die +} + +src_configure() { + # note: not an autoconf configure script + ./configure \ + CC="$(tc-getCC)" \ + PREFIX="${EPREFIX}"/usr/share \ + BINDIR="${EPREFIX}"/usr/bin \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS} -ltls -lssl -lcrypto -levent" || die +} + +src_install() { + default + + newinitd "${FILESDIR}"/gmid.initd gmid + newconfd "${FILESDIR}"/gmid.confd gmid +} + +pkg_postinst() { + einfo "This gemini server can be run as a user with zero configuration.\n" + einfo "In order to use it with the init service you will need to generate a" + einfo "self-signed TLS certificate and key and set up the configuration" + einfo "file (see man 1 gmid for details)." +} diff --git a/net-misc/gmid/metadata.xml b/net-misc/gmid/metadata.xml new file mode 100644 index 0000000000..2f806f8479 --- /dev/null +++ b/net-misc/gmid/metadata.xml @@ -0,0 +1,15 @@ + + + + + + Omar Polo + op@omarpolo.com + + https://git.omarpolo.com/gmid/tree/ChangeLog + + + cyber@sysrq.in + Anna + +