summaryrefslogtreecommitdiff
path: root/deskutils/readur/files
diff options
context:
space:
mode:
Diffstat (limited to 'deskutils/readur/files')
-rw-r--r--deskutils/readur/files/patch-powerpc64le20
-rw-r--r--deskutils/readur/files/patch-src_main.rs11
-rw-r--r--deskutils/readur/files/pkg-message.in17
-rw-r--r--deskutils/readur/files/readur.in36
4 files changed, 84 insertions, 0 deletions
diff --git a/deskutils/readur/files/patch-powerpc64le b/deskutils/readur/files/patch-powerpc64le
new file mode 100644
index 000000000000..c70aea7304f9
--- /dev/null
+++ b/deskutils/readur/files/patch-powerpc64le
@@ -0,0 +1,20 @@
+Obtained from: https://cgit.FreeBSD.org/ports/commit/?id=f08b67611f0b19c0ee8d9053ee4d22e09b03f2b1
+
+--- cargo-crates/aws-lc-sys-0.29.0/aws-lc/crypto/fipsmodule/cpucap/cpu_ppc64le.c.orig 2024-07-03 21:50:24 UTC
++++ cargo-crates/aws-lc-sys-0.29.0/aws-lc/crypto/fipsmodule/cpucap/cpu_ppc64le.c
+@@ -69,10 +69,15 @@ void OPENSSL_cpuid_setup(void) {
+
+ void OPENSSL_cpuid_setup(void) {
+ #if defined(AT_HWCAP2)
++#if defined(__linux__)
+ OPENSSL_ppc64le_hwcap2 = getauxval(AT_HWCAP2);
++#elif defined(__FreeBSD__)
++ elf_aux_info(AT_HWCAP2, &OPENSSL_ppc64le_hwcap2, sizeof(OPENSSL_ppc64le_hwcap2));
++#endif
+ #else
+ OPENSSL_ppc64le_hwcap2 = 0;
+ #endif
++
+ OPENSSL_cpucap_initialized = 1;
+
+ // OPENSSL_ppccap is a 64-bit hex string which may start with "0x".
diff --git a/deskutils/readur/files/patch-src_main.rs b/deskutils/readur/files/patch-src_main.rs
new file mode 100644
index 000000000000..e618d6c71c78
--- /dev/null
+++ b/deskutils/readur/files/patch-src_main.rs
@@ -0,0 +1,11 @@
+--- src/main.rs.orig 2025-07-13 01:04:13 UTC
++++ src/main.rs
+@@ -23,6 +23,8 @@ fn determine_static_files_path() -> std::path::PathBuf
+
+ // List of possible static file locations in order of preference
+ let possible_paths = vec![
++ // FreeBSD
++ PathBuf::from("%%WWWDIR%%"),
+ // Docker/production environment - frontend build copied to /app/frontend/dist
+ current_dir.join("frontend/dist"),
+ // Development environment - frontend build in local frontend/dist
diff --git a/deskutils/readur/files/pkg-message.in b/deskutils/readur/files/pkg-message.in
new file mode 100644
index 000000000000..881fa34be4aa
--- /dev/null
+++ b/deskutils/readur/files/pkg-message.in
@@ -0,0 +1,17 @@
+[
+{ type: install
+ message: <<EOM
+Readur is installed
+
+1) Configure it in %%PREFIX%%/etc/readur.env
+
+2) Enable it with
+
+ sysrc readur_enable=YES
+
+3) Start it with
+
+ service readur start
+EOM
+}
+]
diff --git a/deskutils/readur/files/readur.in b/deskutils/readur/files/readur.in
new file mode 100644
index 000000000000..123e4f12b588
--- /dev/null
+++ b/deskutils/readur/files/readur.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# PROVIDE: readur
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Configuration settings for readur in /etc/rc.conf
+#
+# readur_enable (bool): Enable readur. (Default=NO)
+# readur_env_file (str): Path containing the environment variables
+# to be used by readur. (Default: %%PREFIX%%/etc/readur.env)
+# readur_logfile (str): Log file used to store the readur's output. (Default: /var/log/readur.log)
+# readur_pidfile (str): File used by readur to store the process ID. (Default: /var/run/readur.pid)
+# readur_runas (str): User to run readur as. (Default: %%USER%%)
+
+. /etc/rc.subr
+
+name="readur"
+desc="Quick, painless, intuitive OCR platform"
+rcvar="readur_enable"
+
+load_rc_config $name
+
+: ${readur_enable:="NO"}
+: ${readur_env_file:="%%PREFIX%%/etc/readur.env"}
+: ${readur_logfile:="/var/log/readur.log"}
+: ${readur_pidfile:="/var/run/readur.pid"}
+: ${readur_runas:="%%USER%%"}
+
+readur_chdir="/var/db/readur"
+pidfile="${readur_pidfile}"
+procname="%%LOCALBASE%%/bin/readur"
+command="/usr/sbin/daemon"
+command_args="-o '${readur_logfile}' -p '${pidfile}' -u '${readur_runas}' -t '${desc}' -- '${procname}'"
+
+run_rc_command "$1"