summaryrefslogtreecommitdiff
path: root/hosts/fscusat/pkgs/archvsync
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/fscusat/pkgs/archvsync')
-rw-r--r--hosts/fscusat/pkgs/archvsync/Makefile.patch50
-rw-r--r--hosts/fscusat/pkgs/archvsync/common.patch26
-rw-r--r--hosts/fscusat/pkgs/archvsync/default.nix52
3 files changed, 128 insertions, 0 deletions
diff --git a/hosts/fscusat/pkgs/archvsync/Makefile.patch b/hosts/fscusat/pkgs/archvsync/Makefile.patch
new file mode 100644
index 0000000..e82ada4
--- /dev/null
+++ b/hosts/fscusat/pkgs/archvsync/Makefile.patch
@@ -0,0 +1,50 @@
+From f2ba21ba678907fac0d3d088ad09b0d140ba7740 Mon Sep 17 00:00:00 2001
+From: sinanmohd <sinan@sinanmohd.com>
+Date: Sat, 17 Feb 2024 11:37:23 +0530
+Subject: [PATCH] Makefile: nix port
+
+---
+ Makefile | 17 ++++++++---------
+ 1 file changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7a774b4..1efa053 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,9 +1,8 @@
+-include /usr/share/dpkg/pkg-info.mk
++bindir = ${OUT}/bin
++docdir = ${DOC}/share/doc/ftpsync
++mandir = ${MAN}/share/man
+
+-bindir = /usr/bin
+-docdir = /usr/share/doc/ftpsync
+ examplesdir = ${docdir}/examples
+-mandir = /usr/share/man
+ man1dir = ${mandir}/man1
+ man5dir = ${mandir}/man5
+
+@@ -41,15 +40,15 @@ install -D bin/runmirrors.$(1) $(2)/runmirrors
+ endef
+
+ install:
+- $(call install_bin,install,${DESTDIR}/${bindir})
+- install -D -m644 -t ${DESTDIR}/${docdir} \
++ $(call install_bin,install,${bindir})
++ install -D -m644 -t ${docdir} \
+ README.md
+- install -D -m644 -t ${DESTDIR}/${examplesdir} \
++ install -D -m644 -t ${examplesdir} \
+ etc/ftpsync.conf.sample \
+ etc/runmirrors.conf.sample \
+ etc/runmirrors.mirror.sample
+- install -D -m644 -t ${DESTDIR}/${man1dir} ${MAN1:%=doc/%.1}
+- install -D -m644 -t ${DESTDIR}/${man5dir} ${MAN5:%=doc/%.5}
++ install -D -m644 -t ${man1dir} ${MAN1:%=doc/%.1}
++ install -D -m644 -t ${man5dir} ${MAN5:%=doc/%.5}
+
+ install-tar:
+ $(call install_bin,install-tar,${DESTDIR}/bin/)
+--
+2.43.0
+
diff --git a/hosts/fscusat/pkgs/archvsync/common.patch b/hosts/fscusat/pkgs/archvsync/common.patch
new file mode 100644
index 0000000..d101f40
--- /dev/null
+++ b/hosts/fscusat/pkgs/archvsync/common.patch
@@ -0,0 +1,26 @@
+From 0bb6e03dbbf0bd47f6f8cc42274b8f7fa9fc9262 Mon Sep 17 00:00:00 2001
+From: sinanmohd <sinan@sinanmohd.com>
+Date: Sat, 17 Feb 2024 14:31:03 +0530
+Subject: [PATCH] common: fix config location when wrapped
+
+---
+ bin/common | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/bin/common b/bin/common
+index 7ac7977..941e77a 100644
+--- a/bin/common
++++ b/bin/common
+@@ -332,6 +332,9 @@ search_config() {
+ # Read config file
+ read_config() {
+ local name=$(echo "$1" | sed -e 's/[^A-Za-z0-9._-]/_/g')
++ name="${1%-wrapped.conf}"
++ name="${name#.}.conf"
++
+ local config=$(search_config "$name")
+ if [ "$config" ]; then
+ . "$config"
+--
+2.43.0
+
diff --git a/hosts/fscusat/pkgs/archvsync/default.nix b/hosts/fscusat/pkgs/archvsync/default.nix
new file mode 100644
index 0000000..bd3560e
--- /dev/null
+++ b/hosts/fscusat/pkgs/archvsync/default.nix
@@ -0,0 +1,52 @@
+{ lib,
+ stdenvNoCC,
+ fetchFromGitLab,
+ makeWrapper,
+
+ pandoc,
+ rsync,
+ bash,
+ hostname,
+}:
+
+stdenvNoCC.mkDerivation {
+ pname = "archvsync";
+ version = "unstable-2024-02-17";
+
+ src = fetchFromGitLab {
+ domain = "salsa.debian.org";
+ owner = "mirror-team";
+ repo = "archvsync";
+ rev = "653357779c338863917aa069afbae1b24472d32d";
+ hash = "sha256-vI32Cko5jXY/aZI9hKWm3GI26Oy89M5VLUFWBk1HNXQ=";
+ };
+
+ strictDeps = true;
+ nativeBuildInputs = [ makeWrapper pandoc ];
+ outputs = [ "out" "man" "doc" ];
+
+ patches = [ ./Makefile.patch ./common.patch ];
+
+ postInstall = ''
+ for s in $out/bin/*; do
+ wrapProgram $s --prefix PATH : ${lib.makeBinPath
+ [ rsync bash hostname ]
+ }
+ done
+ '';
+
+ makeFlags = [
+ "OUT=${placeholder "out"}"
+ "MAN=${placeholder "man"}"
+ "DOC=${placeholder "doc"}"
+ ];
+
+ meta = with lib; {
+ description = "Scripts for maintaining a Debian archive mirror";
+ homepage = "https://salsa.debian.org/mirror-team/archvsync";
+ license = licenses.gpl2;
+ platforms = platforms.all;
+ maintainers = with maintainers; [ sinanmohd ];
+ mainProgram = "ftpsync";
+ };
+}