commit:     391278d559abf05ee79afa855fd04e0b28373d3c
Author:     Anna Vyalkova <cyber <AT> sysrq <DOT> in>
AuthorDate: Mon Mar 29 18:33:01 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Mon Mar 29 18:39:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=391278d5

net-misc/gmid: new package

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Anna Vyalkova <cyber <AT> sysrq.in>

 net-misc/gmid/Manifest         |  1 +
 net-misc/gmid/files/gmid.confd | 13 ++++++++
 net-misc/gmid/files/gmid.initd | 53 ++++++++++++++++++++++++++++++++
 net-misc/gmid/gmid-1.6.ebuild  | 69 ++++++++++++++++++++++++++++++++++++++++++
 net-misc/gmid/gmid-9999.ebuild | 69 ++++++++++++++++++++++++++++++++++++++++++
 net-misc/gmid/metadata.xml     | 15 +++++++++
 6 files changed, 220 insertions(+)

diff --git a/net-misc/gmid/Manifest b/net-misc/gmid/Manifest
new file mode 100644
index 000000000..00cf99da9
--- /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 000000000..62027f6a4
--- /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 000000000..dfe3b0009
--- /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 000000000..7f845df6f
--- /dev/null
+++ b/net-misc/gmid/gmid-1.6.ebuild
@@ -0,0 +1,69 @@
+# 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="
+       gemini://gemini.omarpolo.com/pages/gmid.gmi
+       https://www.omarpolo.com/pages/gmid.html
+"
+
+if [[ ${PV} == "9999" ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://git.omarpolo.com/${PN}";
+       KEYWORDS=""
+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 000000000..7f845df6f
--- /dev/null
+++ b/net-misc/gmid/gmid-9999.ebuild
@@ -0,0 +1,69 @@
+# 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="
+       gemini://gemini.omarpolo.com/pages/gmid.gmi
+       https://www.omarpolo.com/pages/gmid.html
+"
+
+if [[ ${PV} == "9999" ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://git.omarpolo.com/${PN}";
+       KEYWORDS=""
+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 000000000..2f806f847
--- /dev/null
+++ b/net-misc/gmid/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <upstream>
+               <maintainer>
+                       <name>Omar Polo</name>
+                       <email>[email protected]</email>
+               </maintainer>
+               
<changelog>https://git.omarpolo.com/gmid/tree/ChangeLog</changelog>
+       </upstream>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Anna</name>
+       </maintainer>
+</pkgmetadata>

Reply via email to