1 |
commit: 91a6bc0640cb54786f2d9fab86fb5cf2b842380e |
2 |
Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in> |
3 |
AuthorDate: Thu Dec 1 12:07:49 2022 +0000 |
4 |
Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in> |
5 |
CommitDate: Fri Dec 2 06:13:09 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=91a6bc06 |
7 |
|
8 |
www-apps/honk: new package, add 0.9.8 |
9 |
|
10 |
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in> |
11 |
|
12 |
www-apps/honk/Manifest | 1 + |
13 |
www-apps/honk/files/honk | 56 ++++++++++++++++++++++++++++++++++++++++ |
14 |
www-apps/honk/files/honk.service | 20 ++++++++++++++ |
15 |
www-apps/honk/honk-0.9.8.ebuild | 47 +++++++++++++++++++++++++++++++++ |
16 |
www-apps/honk/metadata.xml | 15 +++++++++++ |
17 |
5 files changed, 139 insertions(+) |
18 |
|
19 |
diff --git a/www-apps/honk/Manifest b/www-apps/honk/Manifest |
20 |
new file mode 100644 |
21 |
index 000000000..e2eebfd7d |
22 |
--- /dev/null |
23 |
+++ b/www-apps/honk/Manifest |
24 |
@@ -0,0 +1 @@ |
25 |
+DIST honk-0.9.8.tgz 511957 BLAKE2B c07e4141be790d58170da6eb759486889b6c74d70b946e89b1598b2c1868175df1cb9f41649a34067f2ca6f3bddc77d4cc22a241761460b2487bf866b7d40650 SHA512 f32be393698eb3b3ae72d223814eee2a15af3e892ab4b9140314da3ce96d4b4582a8b73c3fa5adede34a4d9d9b2cfc8d7dbb933d516eba8e3820d125c217a354 |
26 |
|
27 |
diff --git a/www-apps/honk/files/honk b/www-apps/honk/files/honk |
28 |
new file mode 100644 |
29 |
index 000000000..c542d1067 |
30 |
--- /dev/null |
31 |
+++ b/www-apps/honk/files/honk |
32 |
@@ -0,0 +1,56 @@ |
33 |
+#!/sbin/openrc-run |
34 |
+# shellcheck shell=sh |
35 |
+# Copyright 2022 Gentoo Authors |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+extra_stopped_commands="init" |
39 |
+extra_started_commands="upgrade" |
40 |
+description_init="Create the database" |
41 |
+description_upgrade="Upgrade the server" |
42 |
+ |
43 |
+name="Honk ActivityPub server" |
44 |
+command="/usr/bin/honk" |
45 |
+command_args="-datadir /var/lib/honk -viewdir /usr/share/honk -log /var/log/honk.log" |
46 |
+command_user="honk:honk" |
47 |
+command_background=yes |
48 |
+pidfile="/run/honk.pid" |
49 |
+ |
50 |
+depend() { |
51 |
+ need net |
52 |
+} |
53 |
+ |
54 |
+fix_log_perms() { |
55 |
+ checkpath -fo honk:honk /var/log/honk.log |
56 |
+} |
57 |
+ |
58 |
+check_db() { |
59 |
+ if [ ! -f /var/lib/honk/honk.db ]; then |
60 |
+ eerror "Please run 'rc-service honk init' before the first start" |
61 |
+ return 1 |
62 |
+ fi |
63 |
+ |
64 |
+ return 0 |
65 |
+} |
66 |
+ |
67 |
+start_pre() { |
68 |
+ fix_log_perms || return 1 |
69 |
+ check_db || return 1 |
70 |
+ |
71 |
+ start-stop-daemon --exec "${command}" --user "${command_user}" \ |
72 |
+ -- ${command_args} cleanup |
73 |
+} |
74 |
+ |
75 |
+init() { |
76 |
+ fix_log_perms || return 1 |
77 |
+ |
78 |
+ start-stop-daemon --exec "${command}" --user "${command_user}" \ |
79 |
+ -- ${command_args} init |
80 |
+} |
81 |
+ |
82 |
+upgrade() { |
83 |
+ fix_log_perms || return 1 |
84 |
+ check_db || return 1 |
85 |
+ |
86 |
+ start-stop-daemon --exec "${command}" --user "${command_user}" \ |
87 |
+ -- ${command_args} upgrade |
88 |
+} |
89 |
|
90 |
diff --git a/www-apps/honk/files/honk.service b/www-apps/honk/files/honk.service |
91 |
new file mode 100644 |
92 |
index 000000000..897d8f3b4 |
93 |
--- /dev/null |
94 |
+++ b/www-apps/honk/files/honk.service |
95 |
@@ -0,0 +1,20 @@ |
96 |
+[Unit] |
97 |
+Description="Honk ActivityPub server" |
98 |
+After=syslog.target network.target |
99 |
+Requires=network.target |
100 |
+ |
101 |
+[Service] |
102 |
+Restart=always |
103 |
+RestartSec=30 |
104 |
+ExecStart=/usr/bin/honk -datadir /var/lib/honk -viewdir /usr/share/honk |
105 |
+NoNewPrivileges=yes |
106 |
+ProtectKernelLogs=true |
107 |
+ProtectKernelModules=true |
108 |
+ProtectKernelTunables=true |
109 |
+ProtectControlGroups=true |
110 |
+ReadWritePaths=/var/lib/honk |
111 |
+User=honk |
112 |
+Group=honk |
113 |
+ |
114 |
+[Install] |
115 |
+WantedBy=default.target |
116 |
|
117 |
diff --git a/www-apps/honk/honk-0.9.8.ebuild b/www-apps/honk/honk-0.9.8.ebuild |
118 |
new file mode 100644 |
119 |
index 000000000..db8476cde |
120 |
--- /dev/null |
121 |
+++ b/www-apps/honk/honk-0.9.8.ebuild |
122 |
@@ -0,0 +1,47 @@ |
123 |
+# Copyright 2022 Gentoo Authors |
124 |
+# Distributed under the terms of the GNU General Public License v2 |
125 |
+ |
126 |
+EAPI=8 |
127 |
+ |
128 |
+inherit go-module systemd |
129 |
+ |
130 |
+DESCRIPTION="ActivityPub server with minimal setup and support costs" |
131 |
+HOMEPAGE="https://humungus.tedunangst.com/r/honk" |
132 |
+SRC_URI="https://humungus.tedunangst.com/r/${PN}/d/${P}.tgz" |
133 |
+ |
134 |
+LICENSE="BSD BSD-2 ISC MIT" |
135 |
+SLOT="0" |
136 |
+KEYWORDS="~amd64" |
137 |
+ |
138 |
+DEPEND="dev-db/sqlite:3" |
139 |
+RDEPEND=" |
140 |
+ ${DEPEND} |
141 |
+ acct-user/honk |
142 |
+" |
143 |
+ |
144 |
+DOCS=( README docs/{changelog,ping}.txt docs/{intro.1,vim.3} ) |
145 |
+ |
146 |
+src_install() { |
147 |
+ dobin honk |
148 |
+ doman docs/activitypub.7 docs/hfcs.1 docs/honk.{1,3,5,8} |
149 |
+ einstalldocs |
150 |
+ |
151 |
+ doinitd "${FILESDIR}"/honk |
152 |
+ systemd_dounit "${FILESDIR}"/honk.service |
153 |
+ |
154 |
+ insinto /usr/share/honk |
155 |
+ doins -r views |
156 |
+ |
157 |
+ diropts --owner honk --group honk |
158 |
+ keepdir /var/lib/honk |
159 |
+} |
160 |
+ |
161 |
+pkg_postinst() { |
162 |
+ if [[ -z ${REPLACING_VERSIONS} ]]; then |
163 |
+ einfo "To finish the installation, please run:" |
164 |
+ einfo " # rc-service honk init" |
165 |
+ else |
166 |
+ einfo "To finish the upgrade, please run:" |
167 |
+ einfo " # rc-service honk upgrade" |
168 |
+ fi |
169 |
+} |
170 |
|
171 |
diff --git a/www-apps/honk/metadata.xml b/www-apps/honk/metadata.xml |
172 |
new file mode 100644 |
173 |
index 000000000..cf502567a |
174 |
--- /dev/null |
175 |
+++ b/www-apps/honk/metadata.xml |
176 |
@@ -0,0 +1,15 @@ |
177 |
+<?xml version="1.0" encoding="UTF-8"?> |
178 |
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> |
179 |
+<pkgmetadata> |
180 |
+ <maintainer type="person"> |
181 |
+ <email>cyber+gentoo@×××××.in</email> |
182 |
+ <name>Anna</name> |
183 |
+ </maintainer> |
184 |
+ <upstream> |
185 |
+ <doc>https://humungus.tedunangst.com/r/honk/m</doc> |
186 |
+ <maintainer> |
187 |
+ <name>Ted Unangst</name> |
188 |
+ <email>tedu@××××××××××.com</email> |
189 |
+ </maintainer> |
190 |
+ </upstream> |
191 |
+</pkgmetadata> |