pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Import honk 0.9.8 as wip/honk
Module Name: pkgsrc-wip
Committed By: nikita <nikita%NetBSD.org@localhost>
Pushed By: nikita
Date: Mon Nov 21 21:39:17 2022 +0100
Changeset: 4e30116f9c06c3302a0c40861db77021d56ec052
Added Files:
honk/DESCR
honk/Makefile
honk/PLIST
honk/distinfo
honk/files/README.pkgsrc
honk/files/honk.sh
Log Message:
Import honk 0.9.8 as wip/honk
Needs rc script testing for merge.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4e30116f9c06c3302a0c40861db77021d56ec052
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
honk/DESCR | 0
honk/Makefile | 90 ++++++++++++++++++++++++++++++++++++++++++++++++
honk/PLIST | 40 +++++++++++++++++++++
honk/distinfo | 5 +++
honk/files/README.pkgsrc | 83 ++++++++++++++++++++++++++++++++++++++++++++
honk/files/honk.sh | 31 +++++++++++++++++
6 files changed, 249 insertions(+)
diffs:
diff --git a/honk/DESCR b/honk/DESCR
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/honk/Makefile b/honk/Makefile
new file mode 100644
index 0000000000..a42e0f2872
--- /dev/null
+++ b/honk/Makefile
@@ -0,0 +1,90 @@
+# $NetBSD$
+
+DISTNAME= honk-0.9.8
+MASTER_SITES= https://humungus.tedunangst.com/r/honk/d/
+EXTRACT_SUFX= .tgz
+CATEGORIES= www
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://humungus.tedunangst.com/r/honk
+COMMENT= ActivityPub server with minimal setup and support costs
+LICENSE= isc
+USE_TOOLS+= pax
+
+DEPENDS+= sqlite3-[0-9]*:../../databases/sqlite3
+
+.include "../../mk/bsd.prefs.mk"
+
+EGDIR= ${PREFIX}/share/examples/${PKGBASE}
+DOCDIR= ${PREFIX}/share/doc/${PKGBASE}
+
+RCD_SCRIPTS= honk
+FILES_SUBST+= HONK_DATA=${HONK_DATA}
+FILES_SUBST+= EGDIR=${EGDIR}
+
+SUBST_CLASSES+= readme
+SUBST_MESSAGE.readme= replacing paths in pkgsrc README file
+SUBST_STAGE.readme= pre-configure
+SUBST_FILES.readme= README.pkgsrc
+SUBST_SED.readme= -e 's,@PREFIX@,${PREFIX},g'
+SUBST_SED.readme+= -e 's,@HONK_DATA@,${HONK_DATA},g'
+
+BUILD_DEFS+= VARBASE
+HONK_USER?= honk
+HONK_GROUP?= honk
+HONK_DATA?= ${VARBASE}/chroot/honk
+
+PKG_GROUPS+= ${HONK_GROUP}
+PKG_USERS+= ${HONK_USER}:${HONK_GROUP}
+
+MAKE_ENV+= "CGO_ENABLED=1"
+
+# ERROR: bin/autobonker: is not a Position Independent Executable
+# ERROR: bin/gettoken: is not a Position Independent Executable
+# ERROR: bin/saytheday: is not a Position Independent Executable
+# ERROR: bin/sprayandpray: is not a Position Independent Executable
+# ERROR: bin/wonkawonk: is not a Position Independent Executable
+# ERROR: bin/youvegothonks: is not a Position Independent Executable
+# Same for RELRO.
+.for bin in autobonker gettoken saytheday sprayandpray wonkawonk youvegothonks
+CHECK_PIE_SKIP+= bin/${bin}
+CHECK_RELRO_SKIP+= bin/${bin}
+.endfor
+
+post-extract:
+ ${CP} ${FILESDIR}/README.pkgsrc ${WRKSRC}/README.pkgsrc
+
+# figure out why regular go build does not work here.
+do-build:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} make all
+ cd ${WRKSRC}/toys && ${SETENV} ${MAKE_ENV} make all
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/honk ${DESTDIR}${PREFIX}/bin/
+.for bin in autobonker saytheday sprayandpray youvegothonks gettoken wonkawonk
+ ${INSTALL_PROGRAM} ${WRKSRC}/toys/${bin} ${DESTDIR}${PREFIX}/bin
+.endfor
+.for page in 1 3 5 7 8
+ ${MKDIR} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man${page}
+.endfor
+ ${MKDIR} ${DESTDIR}/${EGDIR}
+ ${MKDIR} ${DESTDIR}/${DOCDIR}
+.for page in 1 3 5 8
+ ${INSTALL_MAN} ${WRKSRC}/docs/honk.${page} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man${page}
+.endfor
+ # activitypub.7, hfcs.1, intro.1, vim.3 are potential collision candidates.
+ ${INSTALL_MAN} ${WRKSRC}/docs/activitypub.7 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man7/honk_actitiypub.7
+ ${INSTALL_MAN} ${WRKSRC}/docs/hfcs.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/honk_hfcs.1
+ ${INSTALL_MAN} ${WRKSRC}/docs/intro.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/honk_intro.1
+ ${INSTALL_MAN} ${WRKSRC}/docs/vim.3 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3/honk_vim.3
+ ${MKDIR} ${DESTDIR}/${DOCDIR}/toys
+ ${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${DOCDIR}/README
+ ${INSTALL_DATA} ${WRKSRC}/toys/README ${DESTDIR}${DOCDIR}/toys/README
+ cd ${WRKSRC} && ${PAX} -rw views ${DESTDIR}/${EGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/schema.sql ${DESTDIR}/${EGDIR}/schema.sql
+ ${INSTALL_DATA} ${WRKSRC}/README.pkgsrc ${DESTDIR}${DOCDIR}/README.pkgsrc
+
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../lang/go/go-module.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/honk/PLIST b/honk/PLIST
new file mode 100644
index 0000000000..d3b0b971fe
--- /dev/null
+++ b/honk/PLIST
@@ -0,0 +1,40 @@
+@comment $NetBSD$
+bin/autobonker
+bin/gettoken
+bin/honk
+bin/saytheday
+bin/sprayandpray
+bin/wonkawonk
+bin/youvegothonks
+man/man1/honk.1
+man/man1/honk_hfcs.1
+man/man1/honk_intro.1
+man/man3/honk.3
+man/man3/honk_vim.3
+man/man5/honk.5
+man/man7/honk_actitiypub.7
+man/man8/honk.8
+share/doc/honk/README
+share/doc/honk/README.pkgsrc
+share/doc/honk/toys/README
+share/examples/honk/schema.sql
+share/examples/honk/views/about.html
+share/examples/honk/views/account.html
+share/examples/honk/views/chatter.html
+share/examples/honk/views/combos.html
+share/examples/honk/views/funzone.html
+share/examples/honk/views/header.html
+share/examples/honk/views/hfcs.html
+share/examples/honk/views/honk.html
+share/examples/honk/views/honkers.html
+share/examples/honk/views/honkform.html
+share/examples/honk/views/honkfrags.html
+share/examples/honk/views/honkpage.html
+share/examples/honk/views/honkpage.js
+share/examples/honk/views/login.html
+share/examples/honk/views/msg.html
+share/examples/honk/views/onts.html
+share/examples/honk/views/pleroma.css
+share/examples/honk/views/style.css
+share/examples/honk/views/wonk.js
+share/examples/honk/views/xzone.html
diff --git a/honk/distinfo b/honk/distinfo
new file mode 100644
index 0000000000..ddd360c8a3
--- /dev/null
+++ b/honk/distinfo
@@ -0,0 +1,5 @@
+$NetBSD$
+
+BLAKE2s (honk-0.9.8.tgz) = c83fe0a5c93d88f6d13264242048c4682b534cf0c66423bf28714f33827cbfe1
+SHA512 (honk-0.9.8.tgz) = f32be393698eb3b3ae72d223814eee2a15af3e892ab4b9140314da3ce96d4b4582a8b73c3fa5adede34a4d9d9b2cfc8d7dbb933d516eba8e3820d125c217a354
+Size (honk-0.9.8.tgz) = 511957 bytes
diff --git a/honk/files/README.pkgsrc b/honk/files/README.pkgsrc
new file mode 100644
index 0000000000..75275d22b7
--- /dev/null
+++ b/honk/files/README.pkgsrc
@@ -0,0 +1,83 @@
+$NetBSD$
+
+Adapted from OpenBSD ports, probably needs some further adjustments.
+
+Initial configuration
+=====================
+
+honk expects to be fronted by a TLS terminating reverse proxy.
+Make sure to pass the Host header for nginx(8)
+ proxy_set_header Host $http_host;
+
+Setup
+=====
+
+Please see @PREFIX@/share/doc/honk
+
+honk(8)
+-------
+
+honk# doas -su _honk
+honk$ umask 077; cd @HONK_DATA@ && honk init
+listenaddr: localhost:31337
+servername: honk.example.com
+honk$ touch @HONK_DATA@/savedinbox.json
+honk$ exit
+
+add to /etc.rc.conf:
+honk=YES
+if pkg rc.d file was symlinked into /etc/rc.d:
+/etc/rc.d/honk start
+
+Honk at https://honk.example.com
+
+Customization
+=============
+
+Site CSS may be overridden by creating a views/local.css file in the
+@HONK_DATA@/honk directory. Site JS may similarly be included by creating
+views/local.js. A restart is required after changes.
+
+e.g. add this snippet to open all links in honks in new tabs.
+
+function adjusttargets() {
+ var els = document.querySelectorAll("p.content a")
+ for (var i = 0; i < els.length; i++) {
+ var e = els[i]
+ e.target = "_blank"
+ }
+}
+document.addEventListener('DOMContentLoaded', adjusttargets, false);
+
+Maintenance
+===========
+
+The cleanup [days] command exists to purge old external data, by default 30
+days. This removes unreferenced, unsaved posts and attachments. It does not
+remove any original content.
+
+honk# crontab -eu _honk
+
+# crontab(5)
+MAILTO=root
+@daily @PREFIX@/bin/honk cleanup
+
+Database Upgrade
+================
+
+If you are upgrading from a version before 0.9.7, you will need to upgrade
+the database format:
+
+Stop the old honk process.
+# /etc/rc.d/honk stop
+
+Backup the database.
+honk# doas -su _honk
+honk$ umask 077; cd @HONK_DATA@ && honk backup `date +backup-%F`
+
+Perform the upgrade with the upgrade command.
+honk$ honk upgrade
+honk$ exit
+
+Restart.
+# /etc/rc.d/honk start
diff --git a/honk/files/honk.sh b/honk/files/honk.sh
new file mode 100644
index 0000000000..7a7491711b
--- /dev/null
+++ b/honk/files/honk.sh
@@ -0,0 +1,31 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: honk
+# REQUIRE: NETWORKING DAEMON
+# KEYWORD: chrootdir
+
+if @TEST@ -f @SYSCONFBASE@/rc.subr; then
+ . @SYSCONFBASE@/rc.subr
+fi
+
+name="honk"
+rcvar=${name}
+command="@PREFIX@/bin/honk"
+command_args="start"
+
+start_precmd="honk_precmd"
+
+honk_precmd()
+{
+ if ! @TEST@ -d @HONK_DATA@; then
+ @MKDIR@ -m 0755 @HONK_DATA@
+ fi
+ if ! @TEST@ -d @HONK_DATA@/views; then
+ @CP@ -R @EGDIR@/views @HONK_DATA@
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index