public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anna Vyalkova" <cybertailor@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-misc/gmid/, net-misc/gmid/files/
Date: Mon, 29 Mar 2021 18:40:20 +0000 (UTC)	[thread overview]
Message-ID: <1617043181.391278d559abf05ee79afa855fd04e0b28373d3c.cybertailor@gentoo> (raw)

commit:     391278d559abf05ee79afa855fd04e0b28373d3c
Author:     Anna Vyalkova <cyber <AT> sysrq <DOT> in>
AuthorDate: Mon Mar 29 18:33:01 2021 +0000
Commit:     Anna Vyalkova <cybertailor <AT> gmail <DOT> com>
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>op@omarpolo.com</email>
+		</maintainer>
+		<changelog>https://git.omarpolo.com/gmid/tree/ChangeLog</changelog>
+	</upstream>
+	<maintainer type="person">
+		<email>cyber@sysrq.in</email>
+		<name>Anna</name>
+	</maintainer>
+</pkgmetadata>


             reply	other threads:[~2021-03-29 18:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 18:40 Anna Vyalkova [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-03  8:36 [gentoo-commits] repo/proj/guru:dev commit in: net-misc/gmid/, net-misc/gmid/files/ Anna Vyalkova
2024-06-30  4:10 Anna Vyalkova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1617043181.391278d559abf05ee79afa855fd04e0b28373d3c.cybertailor@gentoo \
    --to=cybertailor@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox