Gentoo Archives: gentoo-commits

From: Anna Vyalkova <cybertailor@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-misc/gmid/, net-misc/gmid/files/
Date: Mon, 29 Mar 2021 18:40:26
Message-Id: 1617043181.391278d559abf05ee79afa855fd04e0b28373d3c.cybertailor@gentoo
1 commit: 391278d559abf05ee79afa855fd04e0b28373d3c
2 Author: Anna Vyalkova <cyber <AT> sysrq <DOT> in>
3 AuthorDate: Mon Mar 29 18:33:01 2021 +0000
4 Commit: Anna Vyalkova <cybertailor <AT> gmail <DOT> com>
5 CommitDate: Mon Mar 29 18:39:41 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=391278d5
7
8 net-misc/gmid: new package
9
10 Package-Manager: Portage-3.0.17, Repoman-3.0.2
11 Signed-off-by: Anna Vyalkova <cyber <AT> sysrq.in>
12
13 net-misc/gmid/Manifest | 1 +
14 net-misc/gmid/files/gmid.confd | 13 ++++++++
15 net-misc/gmid/files/gmid.initd | 53 ++++++++++++++++++++++++++++++++
16 net-misc/gmid/gmid-1.6.ebuild | 69 ++++++++++++++++++++++++++++++++++++++++++
17 net-misc/gmid/gmid-9999.ebuild | 69 ++++++++++++++++++++++++++++++++++++++++++
18 net-misc/gmid/metadata.xml | 15 +++++++++
19 6 files changed, 220 insertions(+)
20
21 diff --git a/net-misc/gmid/Manifest b/net-misc/gmid/Manifest
22 new file mode 100644
23 index 000000000..00cf99da9
24 --- /dev/null
25 +++ b/net-misc/gmid/Manifest
26 @@ -0,0 +1 @@
27 +DIST gmid-1.6.tar.gz 59402 BLAKE2B 1a13ae3f598a406e7920ad3a4f73cb230d70fe3bf4a1017d8d196ab80fdc0ffcf339ad79c64de93dc69d06e294132d714ad8ea1a5248dc69377e8d088f772d6c SHA512 cf118ac3b067b23d480006bccf36218ab0bf91d778092855a01706782fb0c68252157615d92d143d29deb8331422ef1263228b9eb53dd30e64a480b17c48af7a
28
29 diff --git a/net-misc/gmid/files/gmid.confd b/net-misc/gmid/files/gmid.confd
30 new file mode 100644
31 index 000000000..62027f6a4
32 --- /dev/null
33 +++ b/net-misc/gmid/files/gmid.confd
34 @@ -0,0 +1,13 @@
35 +# /etc/conf.d/gmid
36 +
37 +# Configuration file
38 +#GMID_CONFIGFILE="/etc/gmid/gmid.conf"
39 +
40 +# PID file
41 +#GMID_PIDFILE="/var/run/gmid.pid"
42 +
43 +# User to run gmid as
44 +#GMID_USER="gemini"
45 +
46 +# Group to run gmid as
47 +#GMID_GROUP="gemini"
48
49 diff --git a/net-misc/gmid/files/gmid.initd b/net-misc/gmid/files/gmid.initd
50 new file mode 100644
51 index 000000000..dfe3b0009
52 --- /dev/null
53 +++ b/net-misc/gmid/files/gmid.initd
54 @@ -0,0 +1,53 @@
55 +#!/sbin/openrc-run
56 +# Copyright 1999-2021 Gentoo Authors
57 +# Distributed under the terms of the GNU General Public License v2
58 +
59 +extra_commands="configtest"
60 +extra_started_commands="reload"
61 +
62 +description="Simple and secure Gemini server"
63 +description_configtest="Run gmid's internal config check."
64 +description_reload="Reload the gmid configuration without losing connections."
65 +
66 +GMID_CONFIGFILE=${GMID_CONFIGFILE:-/etc/gmid/gmid.conf}
67 +
68 +command="/usr/bin/gmid"
69 +command_args="-c \"${GMID_CONFIGFILE}\""
70 +pidfile=${GMID_PIDFILE:-/var/run/gmid.pid}
71 +user=${GMID_USER:-gemini}
72 +group=${GMID_GROUP:-gemini}
73 +
74 +depend() {
75 + need net
76 + use dns logger netmount
77 +}
78 +
79 +start_pre() {
80 + if [ "${RC_CMD}" != "restart" ]; then
81 + configtest || return 1
82 + fi
83 +}
84 +
85 +stop_pre() {
86 + if [ "${RC_CMD}" = "restart" ]; then
87 + configtest || return 1
88 + fi
89 +}
90 +
91 +stop_post() {
92 + rm -f ${pidfile}
93 +}
94 +
95 +reload() {
96 + configtest || return 1
97 + ebegin "Refreshing gmid's configuration"
98 + start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
99 + eend $? "Failed to reload gmid"
100 +}
101 +
102 +configtest() {
103 + ebegin "Checking gmid's configuration"
104 + ${command} -c "${GMID_CONFIGFILE}" -n
105 +
106 + eend $? "failed, please correct errors in the config file"
107 +}
108
109 diff --git a/net-misc/gmid/gmid-1.6.ebuild b/net-misc/gmid/gmid-1.6.ebuild
110 new file mode 100644
111 index 000000000..7f845df6f
112 --- /dev/null
113 +++ b/net-misc/gmid/gmid-1.6.ebuild
114 @@ -0,0 +1,69 @@
115 +# Copyright 1999-2021 Gentoo Authors
116 +# Distributed under the terms of the GNU General Public License v2
117 +
118 +EAPI=7
119 +
120 +inherit toolchain-funcs
121 +
122 +DESCRIPTION="simple and secure Gemini server"
123 +HOMEPAGE="
124 + gemini://gemini.omarpolo.com/pages/gmid.gmi
125 + https://www.omarpolo.com/pages/gmid.html
126 +"
127 +
128 +if [[ ${PV} == "9999" ]] ; then
129 + inherit git-r3
130 + EGIT_REPO_URI="https://git.omarpolo.com/${PN}"
131 + KEYWORDS=""
132 +else
133 + SRC_URI="https://git.omarpolo.com/${PN}/snapshot/${P}.tar.gz"
134 + KEYWORDS="~amd64 ~x86"
135 +fi
136 +
137 +LICENSE="ISC"
138 +SLOT="0"
139 +IUSE="libressl"
140 +
141 +DEPEND="acct-user/gemini
142 + dev-libs/libevent
143 + !libressl? ( dev-libs/libretls )
144 + libressl? ( dev-libs/libressl )"
145 +BDEPEND="sys-devel/flex
146 + virtual/yacc"
147 +RDEPEND="${DEPEND}"
148 +
149 +DOCS=( README.md ChangeLog )
150 +
151 +src_prepare() {
152 + default
153 +
154 + # QA Notice: command not found
155 + # remove `etags` from the "all" target
156 + sed \
157 + -e "s/^\(all: .*\) TAGS \(.*\)$/\1 \2/" \
158 + -i Makefile || die
159 +}
160 +
161 +src_configure() {
162 + # note: not an autoconf configure script
163 + ./configure \
164 + CC="$(tc-getCC)" \
165 + PREFIX="${EPREFIX}"/usr/share \
166 + BINDIR="${EPREFIX}"/usr/bin \
167 + CFLAGS="${CFLAGS}" \
168 + LDFLAGS="${LDFLAGS} -ltls -lssl -lcrypto -levent" || die
169 +}
170 +
171 +src_install() {
172 + default
173 +
174 + newinitd "${FILESDIR}"/gmid.initd gmid
175 + newconfd "${FILESDIR}"/gmid.confd gmid
176 +}
177 +
178 +pkg_postinst() {
179 + einfo "This gemini server can be run as a user with zero configuration.\n"
180 + einfo "In order to use it with the init service you will need to generate a"
181 + einfo "self-signed TLS certificate and key and set up the configuration"
182 + einfo "file (see man 1 gmid for details)."
183 +}
184
185 diff --git a/net-misc/gmid/gmid-9999.ebuild b/net-misc/gmid/gmid-9999.ebuild
186 new file mode 100644
187 index 000000000..7f845df6f
188 --- /dev/null
189 +++ b/net-misc/gmid/gmid-9999.ebuild
190 @@ -0,0 +1,69 @@
191 +# Copyright 1999-2021 Gentoo Authors
192 +# Distributed under the terms of the GNU General Public License v2
193 +
194 +EAPI=7
195 +
196 +inherit toolchain-funcs
197 +
198 +DESCRIPTION="simple and secure Gemini server"
199 +HOMEPAGE="
200 + gemini://gemini.omarpolo.com/pages/gmid.gmi
201 + https://www.omarpolo.com/pages/gmid.html
202 +"
203 +
204 +if [[ ${PV} == "9999" ]] ; then
205 + inherit git-r3
206 + EGIT_REPO_URI="https://git.omarpolo.com/${PN}"
207 + KEYWORDS=""
208 +else
209 + SRC_URI="https://git.omarpolo.com/${PN}/snapshot/${P}.tar.gz"
210 + KEYWORDS="~amd64 ~x86"
211 +fi
212 +
213 +LICENSE="ISC"
214 +SLOT="0"
215 +IUSE="libressl"
216 +
217 +DEPEND="acct-user/gemini
218 + dev-libs/libevent
219 + !libressl? ( dev-libs/libretls )
220 + libressl? ( dev-libs/libressl )"
221 +BDEPEND="sys-devel/flex
222 + virtual/yacc"
223 +RDEPEND="${DEPEND}"
224 +
225 +DOCS=( README.md ChangeLog )
226 +
227 +src_prepare() {
228 + default
229 +
230 + # QA Notice: command not found
231 + # remove `etags` from the "all" target
232 + sed \
233 + -e "s/^\(all: .*\) TAGS \(.*\)$/\1 \2/" \
234 + -i Makefile || die
235 +}
236 +
237 +src_configure() {
238 + # note: not an autoconf configure script
239 + ./configure \
240 + CC="$(tc-getCC)" \
241 + PREFIX="${EPREFIX}"/usr/share \
242 + BINDIR="${EPREFIX}"/usr/bin \
243 + CFLAGS="${CFLAGS}" \
244 + LDFLAGS="${LDFLAGS} -ltls -lssl -lcrypto -levent" || die
245 +}
246 +
247 +src_install() {
248 + default
249 +
250 + newinitd "${FILESDIR}"/gmid.initd gmid
251 + newconfd "${FILESDIR}"/gmid.confd gmid
252 +}
253 +
254 +pkg_postinst() {
255 + einfo "This gemini server can be run as a user with zero configuration.\n"
256 + einfo "In order to use it with the init service you will need to generate a"
257 + einfo "self-signed TLS certificate and key and set up the configuration"
258 + einfo "file (see man 1 gmid for details)."
259 +}
260
261 diff --git a/net-misc/gmid/metadata.xml b/net-misc/gmid/metadata.xml
262 new file mode 100644
263 index 000000000..2f806f847
264 --- /dev/null
265 +++ b/net-misc/gmid/metadata.xml
266 @@ -0,0 +1,15 @@
267 +<?xml version="1.0" encoding="UTF-8"?>
268 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
269 +<pkgmetadata>
270 + <upstream>
271 + <maintainer>
272 + <name>Omar Polo</name>
273 + <email>op@××××××××.com</email>
274 + </maintainer>
275 + <changelog>https://git.omarpolo.com/gmid/tree/ChangeLog</changelog>
276 + </upstream>
277 + <maintainer type="person">
278 + <email>cyber@×××××.in</email>
279 + <name>Anna</name>
280 + </maintainer>
281 +</pkgmetadata>