From 632a66b658fc980fb350c52947de4cadd42a3b6f Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Fri, 22 Jul 2022 13:29:30 -0400 Subject: [PATCH 1/2] New package: meilisearch-0.29.0 --- srcpkgs/meilisearch/files/meilisearch/log/run | 1 + srcpkgs/meilisearch/files/meilisearch/run | 5 ++++ srcpkgs/meilisearch/template | 25 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 120000 srcpkgs/meilisearch/files/meilisearch/log/run create mode 100755 srcpkgs/meilisearch/files/meilisearch/run create mode 100644 srcpkgs/meilisearch/template diff --git a/srcpkgs/meilisearch/files/meilisearch/log/run b/srcpkgs/meilisearch/files/meilisearch/log/run new file mode 120000 index 000000000000..3a5b4a586051 --- /dev/null +++ b/srcpkgs/meilisearch/files/meilisearch/log/run @@ -0,0 +1 @@ +/usr/bin/vlogger \ No newline at end of file diff --git a/srcpkgs/meilisearch/files/meilisearch/run b/srcpkgs/meilisearch/files/meilisearch/run new file mode 100755 index 000000000000..04c2ac0ac5e0 --- /dev/null +++ b/srcpkgs/meilisearch/files/meilisearch/run @@ -0,0 +1,5 @@ +#!/bin/sh +exec 2>&1 +[ -r ./conf ] && . ./conf +cd /var/lib/meilisearch +exec chpst -u _meilisearch:_meilisearch meilisearch ${OPTS:=--no-analytics} diff --git a/srcpkgs/meilisearch/template b/srcpkgs/meilisearch/template new file mode 100644 index 000000000000..06c224e84e6b --- /dev/null +++ b/srcpkgs/meilisearch/template @@ -0,0 +1,25 @@ +# Template file for 'meilisearch' +pkgname=meilisearch +version=0.29.0 +revision=1 +build_style=cargo +short_desc="Powerful, fast, open-source, easy to use and deploy search engine" +maintainer="Joel Beckmeyer " +license="MIT" +homepage="https://www.meilisearch.com" +distfiles="https://github.com/meilisearch/meilisearch/archive/refs/tags/v${version}.tar.gz" +checksum=45ce5ba49984258763d7cc4fd33ba407fcbeb2dcb5c36b23e6c8dbb3e1684bde + +system_accounts="_meilisearch" +synapse_homedir="/var/lib/meilisearch" +make_dirs="/var/lib/meilisearch 0700 _meilisearch _meilisearch" + +do_install() { + if [ "$CROSS_BUILD" ]; then + vbin "target/${XBPS_CROSS_RUST_TARGET}/release/meilisearch" + else + vbin "target/${XBPS_RUST_TARGET}/release/meilisearch" + fi + vsv meilisearch + vlicense LICENSE +} From 5a72b1104c80e73851d38a1e12bfe292679457e0 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Mon, 27 Jun 2022 11:39:02 -0400 Subject: [PATCH 2/2] New package: akkoma-3.2.3 --- srcpkgs/akkoma/INSTALL | 7 ++ srcpkgs/akkoma/files/akkoma/finish | 2 + srcpkgs/akkoma/files/akkoma/log/run | 1 + srcpkgs/akkoma/files/akkoma/run | 3 + srcpkgs/akkoma/patches/append_flags.patch | 19 +++++ srcpkgs/akkoma/patches/config.patch | 20 +++++ .../akkoma/patches/include_system_erts.patch | 14 ++++ srcpkgs/akkoma/template | 75 +++++++++++++++++++ srcpkgs/akkoma/update | 2 + 9 files changed, 143 insertions(+) create mode 100644 srcpkgs/akkoma/INSTALL create mode 100755 srcpkgs/akkoma/files/akkoma/finish create mode 120000 srcpkgs/akkoma/files/akkoma/log/run create mode 100755 srcpkgs/akkoma/files/akkoma/run create mode 100644 srcpkgs/akkoma/patches/append_flags.patch create mode 100644 srcpkgs/akkoma/patches/config.patch create mode 100644 srcpkgs/akkoma/patches/include_system_erts.patch create mode 100644 srcpkgs/akkoma/template create mode 100644 srcpkgs/akkoma/update diff --git a/srcpkgs/akkoma/INSTALL b/srcpkgs/akkoma/INSTALL new file mode 100644 index 000000000000..90b2456396e6 --- /dev/null +++ b/srcpkgs/akkoma/INSTALL @@ -0,0 +1,7 @@ +if [ "${UPDATE}" = "no" ] && [ "${ACTION}" = "post" ]; then + if [ ! -e /etc/akkoma/COOKIE ]; then + dd if=/dev/urandom bs=40 count=1 | base64 > /etc/akkoma/COOKIE + fi + chmod 600 /etc/akkoma/COOKIE + chown _akkoma:_akkoma /etc/akkoma/COOKIE +fi diff --git a/srcpkgs/akkoma/files/akkoma/finish b/srcpkgs/akkoma/files/akkoma/finish new file mode 100755 index 000000000000..d7c930355f9a --- /dev/null +++ b/srcpkgs/akkoma/files/akkoma/finish @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -u _akkoma:_akkoma akkoma stop diff --git a/srcpkgs/akkoma/files/akkoma/log/run b/srcpkgs/akkoma/files/akkoma/log/run new file mode 120000 index 000000000000..3a5b4a586051 --- /dev/null +++ b/srcpkgs/akkoma/files/akkoma/log/run @@ -0,0 +1 @@ +/usr/bin/vlogger \ No newline at end of file diff --git a/srcpkgs/akkoma/files/akkoma/run b/srcpkgs/akkoma/files/akkoma/run new file mode 100755 index 000000000000..8f618070c078 --- /dev/null +++ b/srcpkgs/akkoma/files/akkoma/run @@ -0,0 +1,3 @@ +#!/bin/sh +chpst -u _akkoma:_akkoma akkoma_ctl migrate +exec chpst -u _akkoma:_akkoma akkoma start diff --git a/srcpkgs/akkoma/patches/append_flags.patch b/srcpkgs/akkoma/patches/append_flags.patch new file mode 100644 index 000000000000..23acb9804830 --- /dev/null +++ b/srcpkgs/akkoma/patches/append_flags.patch @@ -0,0 +1,19 @@ +diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile +index 03d6380..bfc9f5f 100644 +--- a/deps/crypt/c_src/Makefile ++++ b/deps/crypt/c_src/Makefile +@@ -24,12 +24,12 @@ else ifeq ($(UNAME_SYS), Linux) + CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes + LDFLAGS ?= -lcrypt + else +- CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes \ ++ CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes \ + -pedantic -fwrapv -D_FORTIFY_SOURCE=2 \ + -fstack-protector-strong -Wformat -Werror=format-security \ + -fno-strict-aliasing -Wconversion -Wshadow -Wpointer-arith \ + -Wcast-qual +- LDFLAGS ?= -lpthread -lcrypt -Wl,-z,relro,-z,now -Wl,-z,noexecstack ++ LDFLAGS += -lpthread -lcrypt -Wl,-z,relro,-z,now -Wl,-z,noexecstack + endif + else ifneq (,$(wildcard /usr/lib/libcrypt.*)) + CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes diff --git a/srcpkgs/akkoma/patches/config.patch b/srcpkgs/akkoma/patches/config.patch new file mode 100644 index 000000000000..bfbd4c1cecc4 --- /dev/null +++ b/srcpkgs/akkoma/patches/config.patch @@ -0,0 +1,20 @@ +diff --git a/config/config.exs b/config/config.exs +index b50c910..9cf622b 100644 +--- a/config/config.exs ++++ b/config/config.exs +@@ -852,6 +852,8 @@ + {Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]} + ] + ++config :tzdata, :data_dir, "/var/lib/akkoma/elixir_tzdata_data" ++ + # Import environment specific config. This must remain at the bottom + # of this file so it overrides the configuration defined above. + import_config "#{Mix.env()}.exs" +diff --git a/config/prod.secret.exs b/config/prod.secret.exs +new file mode 100644 +index 0000000..23fd9f1 +--- /dev/null ++++ b/config/prod.secret.exs +@@ -0,0 +1 @@ ++import Mix.Config diff --git a/srcpkgs/akkoma/patches/include_system_erts.patch b/srcpkgs/akkoma/patches/include_system_erts.patch new file mode 100644 index 000000000000..4e0d4a7e9961 --- /dev/null +++ b/srcpkgs/akkoma/patches/include_system_erts.patch @@ -0,0 +1,14 @@ +diff --git a/mix.exs b/mix.exs +index db2f1f0..115817c 100644 +--- a/mix.exs ++++ b/mix.exs +@@ -38,7 +38,8 @@ def project do + include_executables_for: [:unix], + applications: [ex_syslogger: :load, syslog: :load, eldap: :transient], + steps: [:assemble, &put_otp_version/1, ©_files/1, ©_nginx_config/1], +- config_providers: [{Pleroma.Config.ReleaseRuntimeProvider, []}] ++ config_providers: [{Pleroma.Config.ReleaseRuntimeProvider, []}], ++ include_erts: "/usr/lib/erlang/erts-13.0.4" + ] + ] + ] diff --git a/srcpkgs/akkoma/template b/srcpkgs/akkoma/template new file mode 100644 index 000000000000..3afcc2f1e0ed --- /dev/null +++ b/srcpkgs/akkoma/template @@ -0,0 +1,75 @@ +# Template file for 'akkoma' +pkgname=akkoma +version=3.2.3 +revision=1 +wrksrc="akkoma" +hostmakedepends="cmake elixir rebar3 git" +makedepends="file-devel erlang" +short_desc="Social networking software compatible with other Fediverse software" +maintainer="Joel Beckmeyer " +license="AGPL-3.0-only,CC-BY-4.0,CC-BY-SA-4.0,custom:Unsplash" +homepage="https://akkoma.dev/AkkomaGang/akkoma" +distfiles="https://akkoma.dev/AkkomaGang/akkoma/archive/v${version}.tar.gz" +checksum=61a77235733a260308bbb6196121ae4df9379efcb52d8c107be85696647ecd39 + +system_accounts="_akkoma" +_akkoma_homedir="/var/lib/akkoma" + +make_dirs="/var/lib/akkoma 0700 _akkoma _akkoma + /etc/akkoma 0755 _akkoma _akkoma + /etc/akkoma/static 0755 _akkoma _akkoma" + +export MIX_ENV=prod +export MIX_REBAR3=/usr/bin/rebar3 + +if [ "$CROSS_BUILD" ]; then + # fixes linking syslog dependency + LDFLAGS+=" -L${XBPS_CROSS_BASE}/usr/lib/erlang/usr/lib" +fi + +post_extract() { + mix local.hex --force + mix deps.get --only prod +} + +do_configure() { + if [ "$CROSS_BUILD" ]; then + # fixes building fast_html + _erts_path="$(cd ${XBPS_CROSS_BASE}/usr/lib/erlang/erts-* && pwd)" + vsed -i "s,ERLANG_PATH =.*,ERLANG_PATH = ${_erts_path}," deps/fast_html/Makefile + # additional adjustment to include target erts instead of host erts + vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs + fi +} + +do_build() { + # without the DEBUG flag, mix gives unhelpful errors for diagnosing c library + # issues + DEBUG=1 mix release +} + +do_install() { + vlicense COPYING + vlicense AGPL-3 + + cd _build/prod/rel/pleroma + vmkdir usr/lib/akkoma + vcopy erts-* usr/lib/akkoma + vcopy lib usr/lib/akkoma + # the Erlang Distribution cookie needs to be unique to each installation + rm -f releases/COOKIE + vcopy releases usr/lib/akkoma + ln -sf /etc/akkoma/COOKIE ${DESTDIR}/usr/lib/akkoma/releases + + # make entrypoint look in standard location instead of cwd + vsed -i 's,^RELEASE_ROOT=.*,RELEASE_ROOT="/usr/lib/akkoma",' bin/pleroma + vcopy bin usr/lib/akkoma + + vmkdir usr/bin + ln -sf /usr/lib/akkoma/bin/pleroma ${DESTDIR}/usr/bin/akkoma + ln -sf /usr/lib/akkoma/bin/pleroma_ctl ${DESTDIR}/usr/bin/akkoma_ctl + + vsconf installation/akkoma.nginx + + vsv akkoma +} diff --git a/srcpkgs/akkoma/update b/srcpkgs/akkoma/update new file mode 100644 index 000000000000..998e8e187e1d --- /dev/null +++ b/srcpkgs/akkoma/update @@ -0,0 +1,2 @@ +site="https://akkoma.dev/AkkomaGang/akkoma/tags" +pkgname="v"