pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pleroma: update makefile and add patches



Module Name:	pkgsrc-wip
Committed By:	xorrvin <xorrvin%pm.me@localhost>
Pushed By:	xorrvin
Date:		Thu Jun 20 01:53:29 2024 +0200
Changeset:	59135ffa0d2c0b6c96a55db361eb41880a9eba24

Modified Files:
	pleroma/Makefile
	pleroma/distinfo
	pleroma/pleroma.mk
Added Files:
	pleroma/patches/patch-rel_env.sh.eex

Log Message:
pleroma: update makefile and add patches

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=59135ffa0d2c0b6c96a55db361eb41880a9eba24

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 pleroma/Makefile                     | 45 ++++++++++++++++++++++++++++++++----
 pleroma/distinfo                     |  3 ++-
 pleroma/patches/patch-rel_env.sh.eex | 14 +++++++++++
 pleroma/pleroma.mk                   |  6 ++---
 4 files changed, 59 insertions(+), 9 deletions(-)

diffs:
diff --git a/pleroma/Makefile b/pleroma/Makefile
index b1de01aa3e..7488e88346 100644
--- a/pleroma/Makefile
+++ b/pleroma/Makefile
@@ -29,6 +29,15 @@ DEPENDS+=	libvips-[0-9]*:../../graphics/libvips
 DEPENDS+=	file-[0-9]*:../../sysutils/file
 DEPENDS+=	${ERLANG_VERSION}:../../lang/erlang
 
+# These are outlined in official pleroma docs for NetBSD.
+# mksh can be replaced with ksh93
+DEPENDS+=	sudo-[0-9]*:../../security/sudo
+DEPENDS+=	mksh-[0-9]*:../../shells/mksh
+DEPENDS+=	postgresql15-client-[0-9]*:../../databases/postgresql15-client
+
+# NB: is it really needed?
+#DEPENDS+=	postgresql15-contrib-[0-9]*:../../databases/postgresql15-contrib
+
 USE_TOOLS+=	pax gmake find
 USE_LANGUAGES=	c c++
 TOOL_DEPENDS+=	cmake-[0-9]*:../../devel/cmake
@@ -37,6 +46,25 @@ TOOL_DEPENDS+=	rebar3-[0-9]*:../../devel/rebar3
 # this is crucial as hex downloads all stuff from the registry
 ALLOW_NETWORK_ACCESS=	yes
 
+# user and rc.d management
+#RCD_SCRIPTS=			pleroma
+PLEROMA_USER?=			pleroma
+PLEROMA_GROUP?=			pleroma
+PLEROMA_SHELL?=			${PREFIX}/bin/mksh
+PLEROMA_PREFIX?=		${PREFIX}/lib/pleroma
+PKG_GROUPS=			${PLEROMA_GROUP}
+PKG_USERS=			${PLEROMA_USER}:${PLEROMA_GROUP}
+PKG_GROUPS_VARS+=		PLEROMA_GROUP
+PKG_USERS_VARS+=		PLEROMA_USER
+PKG_GECOS.${PLEROMA_USER}=	Pleroma server user
+PKG_HOME.${PLEROMA_USER}=	${PLEROMA_PREFIX}
+PKG_SHELL.${PLEROMA_USER}=	${PLEROMA_SHELL}
+
+OWN_DIRS+=		${PLEROMA_PREFIX}
+OWN_DIRS+=		${PREFIX}/etc/pleroma
+OWN_DIRS_PERMS+=	${PLEROMA_PREFIX} ${PLEROMA_USER} ${PLEROMA_GROUP} 0700
+OWN_DIRS_PERMS+=	${PREFIX}/etc/pleroma ${PLEROMA_USER} ${PLEROMA_GROUP} 0700
+
 # fix bin script
 SUBST_CLASSES+=		binpath
 SUBST_STAGE.binpath=	pre-install
@@ -44,6 +72,13 @@ SUBST_MESSAGE.binpath=	Fixing pleroma script absolute path
 SUBST_FILES.binpath=	release/bin/pleroma
 SUBST_SED.binpath=	-e "s:^RELEASE_ROOT=.*:RELEASE_ROOT=${PREFIX}/lib/pleroma:g"
 
+# fix config path
+SUBST_CLASSES+=		confpath
+SUBST_STAGE.confpath=	pre-install
+SUBST_MESSAGE.confpath=	Fixing pleroma config file path
+SUBST_FILES.confpath=	release/releases/${PKGVERSION}/env.sh
+SUBST_SED.confpath=	-e "s:PLEROMA_CONF_REPLACE_ME:${PREFIX}/etc/pleroma/config.exs:g"
+
 # target makefile and make environment
 MAKE_FILE=	pleroma.mk
 MAKE_ENV+=	MIX_ENV="prod"
@@ -51,7 +86,9 @@ MAKE_ENV+=	MIX="${PREFIX}/bin/mix"
 MAKE_ENV+=	MIX_REBAR3="${PREFIX}/bin/rebar3"
 MAKE_ENV+=	VIX_COMPILATION_MODE="PLATFORM_PROVIDED_LIBVIPS"
 MAKE_ENV+=	TARGET_PREFIX="${DESTDIR}${PREFIX}"
-MAKE_ENV+=	PLEROMA_PREFIX="${DESTDIR}${PREFIX}/lib/pleroma"
+MAKE_ENV+=	PLEROMA_USER="${PLEROMA_USER}"
+MAKE_ENV+=	PLEROMA_GROUP="${PLEROMA_GROUP}"
+MAKE_ENV+=	PLEROMA_PREFIX="${DESTDIR}${PLEROMA_PREFIX}"
 
 # Elixir seems to be picky if it was compiled on the
 # system with another endianness:
@@ -69,9 +106,9 @@ pre-configure:
 	${RUN} ./check_endianness.sh :${ELIXIR_ENDIAN}
 	${RUN} ${CP} ./pleroma.mk ${WRKSRC}
 
-post-install:
-	${RUN} ${ECHO} "=> NOTE: This package doesn't install pleroma_ctl script as NetBSD is not yet a supported flavour."
-	${RUN} ${ECHO} "=> NOTE: If you require pleroma_ctl functionality, you have to do it yourself."
+
+#	${RUN} ${CHOWN} -R ${PLEROMA_USER}:${PLEROMA_GROUP} ${PLEROMA_PREFIX}
+#	${RUN} ${CHOWN} ${PLEROMA_USER}:${PLEROMA_GROUP} ${PREFIX}/bin/pleroma
 
 # needed for native erlang modules
 .include "../../lang/erlang/buildlink3.mk"
diff --git a/pleroma/distinfo b/pleroma/distinfo
index 26edb45a92..8d0754ed45 100644
--- a/pleroma/distinfo
+++ b/pleroma/distinfo
@@ -3,4 +3,5 @@ $NetBSD$
 BLAKE2s (pleroma-v2.6.3.tar.gz) = 61404ab883c7e5e5125e98bb315f456f8875b2f135bd399579256589245b7824
 SHA512 (pleroma-v2.6.3.tar.gz) = b10fdbf3bb17f69c2754adb7201085880380777a4f363a09a8926bb6d2f4ed60888680f6af053befca06aa0b319083e1111c6471df9c918df3ccaab98fadb83d
 Size (pleroma-v2.6.3.tar.gz) = 28128737 bytes
-SHA1 (patch-mix.exs) = 5c3ba889e716d6e2eee842329c2b50adeafba3c3
\ No newline at end of file
+SHA1 (patch-mix.exs) = 5c3ba889e716d6e2eee842329c2b50adeafba3c3
+SHA1 (patch-rel_env.sh.eex) = c631221042f4bdf78dac606037d12feabd00f1f0
\ No newline at end of file
diff --git a/pleroma/patches/patch-rel_env.sh.eex b/pleroma/patches/patch-rel_env.sh.eex
new file mode 100644
index 0000000000..c6b0de8922
--- /dev/null
+++ b/pleroma/patches/patch-rel_env.sh.eex
@@ -0,0 +1,14 @@
+$NetBSD$
+
+# Update runtime config and setup PLEROMA_CONFIG_PATH,
+# which will be replaced later during the build process
+
+--- rel/env.sh.eex.orig	2024-06-19 23:18:46.148902573 +0000
++++ rel/env.sh.eex
+@@ -10,3 +10,6 @@
+ # Set the release to work across nodes
+ export RELEASE_DISTRIBUTION="${RELEASE_DISTRIBUTION:-name}"
+ export RELEASE_NODE="${RELEASE_NODE:-<%= @release.name %>@127.0.0.1}"
++
++export LC_ALL="en_US.UTF-8"
++export PLEROMA_CONFIG_PATH="PLEROMA_CONF_REPLACE_ME"
diff --git a/pleroma/pleroma.mk b/pleroma/pleroma.mk
index 22a68a4c1a..cc61979eb0 100644
--- a/pleroma/pleroma.mk
+++ b/pleroma/pleroma.mk
@@ -47,13 +47,11 @@ install: release/.release-done
 	$(INSTALL_DIR) $(PLEROMA_PREFIX)
 	$(INSTALL_DATA) release/OTP_VERSION	$(PLEROMA_PREFIX)
 
+	$(INSTALL_DIR) $(PLEROMA_PREFIX)/etc/pleroma
+
 	$(INSTALL_DIR) release/bin $(TARGET_PREFIX)/bin
 	$(INSTALL_PROGRAM) $(wildcard release/bin/*) $(TARGET_PREFIX)/bin
 
-	$(INSTALL_DIR) $(PLEROMA_PREFIX)/$(ERTS_VERSION)
-	$(INSTALL_DIR) $(PLEROMA_PREFIX)/$(ERTS_VERSION)/bin
-	$(INSTALL_PROGRAM) $(wildcard release/$(ERTS_VERSION)/bin/*) $(PLEROMA_PREFIX)/$(ERTS_VERSION)/bin
-
 	$(INSTALL_DIR) $(PLEROMA_PREFIX)/lib
 	$(PAX) -rw -pp -s ':^release/lib::' release/lib $(PLEROMA_PREFIX)/lib
 


Home | Main Index | Thread Index | Old Index