aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/20_packager/templates
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-05-17 13:35:43 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-05-17 19:32:16 +0300
commitb38e910899bad2d6ae2049b599dcdd525420c53d (patch)
treec6b277aafe1e6e278368dc5ca25a4acd624b20d2 /roles/jails/20_packager/templates
parentc1a39b7e43bed135cb1832b2b5da7c82bf7a4c78 (diff)
Fix postgres
Diffstat (limited to 'roles/jails/20_packager/templates')
-rw-r--r--roles/jails/20_packager/templates/etc_crontab5
-rw-r--r--roles/jails/20_packager/templates/usr_local_bin_build_packages.sh26
-rw-r--r--roles/jails/20_packager/templates/usr_local_etc_nginx_nginx.conf18
3 files changed, 49 insertions, 0 deletions
diff --git a/roles/jails/20_packager/templates/etc_crontab b/roles/jails/20_packager/templates/etc_crontab
new file mode 100644
index 0000000..ed18a07
--- /dev/null
+++ b/roles/jails/20_packager/templates/etc_crontab
@@ -0,0 +1,5 @@
+SHELL=/bin/sh
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+
+# Build packages every hour
+0 * * * * root /usr/local/bin/build-packages >> /var/log/build-packages.log 2>&1
diff --git a/roles/jails/20_packager/templates/usr_local_bin_build_packages.sh b/roles/jails/20_packager/templates/usr_local_bin_build_packages.sh
new file mode 100644
index 0000000..b4d5ea6
--- /dev/null
+++ b/roles/jails/20_packager/templates/usr_local_bin_build_packages.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Build all ports in /usr/local/my-ports, skip already-built packages.
+set -eu
+
+PORTS_DIR="/usr/local/my-ports"
+PKG_DIR="/usr/local/packages"
+
+for port_dir in "${PORTS_DIR}"/*/; do
+ [ -f "${port_dir}/Makefile" ] || continue
+
+ port_name=$(make -C "${port_dir}" -V PKGNAME)
+ pkg_file="${PKG_DIR}/All/${port_name}.pkg"
+
+ if [ -f "${pkg_file}" ]; then
+ echo "SKIP ${port_name} (already built)"
+ continue
+ fi
+
+ echo "BUILD ${port_name}"
+ make -C "${port_dir}" clean package PACKAGES="${PKG_DIR}" BATCH=yes
+ make -C "${port_dir}" clean
+done
+
+# Rebuild the repository catalog
+pkg repo "${PKG_DIR}"
+echo "Done."
diff --git a/roles/jails/20_packager/templates/usr_local_etc_nginx_nginx.conf b/roles/jails/20_packager/templates/usr_local_etc_nginx_nginx.conf
new file mode 100644
index 0000000..0d140ef
--- /dev/null
+++ b/roles/jails/20_packager/templates/usr_local_etc_nginx_nginx.conf
@@ -0,0 +1,18 @@
+worker_processes 1;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ sendfile on;
+
+ server {
+ listen 80;
+ server_name _;
+ root /usr/local/packages;
+ autoindex on;
+ }
+}