aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-24 14:48:00 -0300
committerEuAndreh <eu@euandre.org>2023-03-24 14:48:03 -0300
commit1dd95f5355481448a86ea7d10e6f470492ef2c6a (patch)
tree4df726fd740629f251fbd090e2dfcc6b18555706
parentMakefile: Split Guix tests from build (diff)
downloadpackage-repository-1dd95f5355481448a86ea7d10e6f470492ef2c6a.tar.gz
package-repository-1dd95f5355481448a86ea7d10e6f470492ef2c6a.tar.xz
src/bin/paku.in: Emit Makefile for generating $NAME.key for Guix channel
Instead of doing it inline in the Makefile with clever Perl one-liners. BONUS: add missing ".POSIX:" to the debian.mk file.
-rw-r--r--.gitignore3
-rw-r--r--Makefile14
-rwxr-xr-xsrc/bin/paku.in29
3 files changed, 29 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index e0369b0..dca71a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,8 @@
/result*
+/*.mk
/tests/internet/etc/postfix/main.cf
/tests/internet/etc/dkimproxyout.conf
/tests/internet/etc/dovecot/dovecot.conf
/.paku/
-/debian.mk
/public/
/src/bin/paku
-/*.sentinel
diff --git a/Makefile b/Makefile
index c63bb41..e63f1bd 100644
--- a/Makefile
+++ b/Makefile
@@ -28,14 +28,13 @@ paku.lock: src/bin/paku Makefile
touch $@
-guix: src/org/euandre/packages.scm channel-key.sentinel \
+guix: src/org/euandre/packages.scm guix.mk \
result-packages.sentinel result-services.sentinel
+ @$(MAKE) -f guix.mk
+
+guix.mk: paku.lock
+ paku guix-channel-key > $@
-channel-key.sentinel: paku.lock
- F="$$( perl -MJSON -0777 -E 'say $${decode_json <>}{maintainer}{name}' < paku.lock).key"; \
- ID="$$(perl -MJSON -0777 -E 'say $${decode_json <>}{maintainer}{email}' < paku.lock)"; \
- gpg --armour --export "$$ID" > "$$F"
- touch $@
src/org/euandre/packages.scm: paku.lock
paku guix > src/org/euandre/packages.scm
@@ -101,8 +100,7 @@ upload: public
clean:
rm -rf \
- $(derived-assets) result* .paku/ public/ debian.mk \
- *.sentinel \
+ $(derived-assets) result* *.mk .paku/ public/ \
local-files = \
diff --git a/src/bin/paku.in b/src/bin/paku.in
index 6cb550d..4d92d9b 100755
--- a/src/bin/paku.in
+++ b/src/bin/paku.in
@@ -32,6 +32,7 @@ sub help($fh) {
- debian
- nix
- html
+ - guix-channel-key
Generate package definitions for different package managers.
@@ -343,6 +344,18 @@ sub emit_guix() {
print ")\n";
}
+sub emit_guix_channel_key() {
+ my $json = load_json();
+ my $name = $json->{maintainer}{name};
+ my $id = $json->{maintainer}{email};
+ print <<~EOF;
+ .POSIX:
+
+ $name.key:
+ gpg --armour --export $id > \$\@
+ EOF
+}
+
sub emit_debian() {
my $json = load_json();
my @debs = ("debs = \\\n");
@@ -416,6 +429,7 @@ sub emit_debian() {
}
+ print ".POSIX:\n\n";
print "DIR = $dir\n\n";
print @debs, "\n";
print <<~EOF;
@@ -736,13 +750,14 @@ sub emit_html() {
my %actions = (
- 'debian-packages' => \&emit_packages,
- 'debian-release' => \&emit_release,
- nix => \&emit_nix,
- guix => \&emit_guix,
- debian => \&emit_debian,
- homebrew => \&emit_homebrew,
- html => \&emit_html,
+ 'debian-packages' => \&emit_packages,
+ 'debian-release' => \&emit_release,
+ nix => \&emit_nix,
+ guix => \&emit_guix,
+ 'guix-channel-key' => \&emit_guix_channel_key,
+ debian => \&emit_debian,
+ homebrew => \&emit_homebrew,
+ html => \&emit_html,
);
my $fn = $actions{$action} or die "Unknown ACTION: \"$action\"";