summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordyknon <dyknon@r5f.jp>2025-07-20 19:43:19 +0900
committerdyknon <dyknon@r5f.jp>2025-07-20 19:44:12 +0900
commit7fc1aaff3008982ccf3d2e47a34bc2a91c0b0746 (patch)
treefbeda337373e9fbcc0de39d4016859332af4d701
parent205d6775be4031f72e410f6514a00530a40ee2fa (diff)
place copyright related filesHEADmaster
-rw-r--r--README9
-rwxr-xr-xdebian/collect_copyright.pl45
-rw-r--r--debian/control4
-rw-r--r--debian/copyright14
-rwxr-xr-xdebian/rules10
5 files changed, 80 insertions, 2 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..f9c5c0b
--- /dev/null
+++ b/README
@@ -0,0 +1,9 @@
+= ABOUT
+
+This, "prometheus-exporter-multiplexer", is a prometheus or openmetrics
+tool to combine multiple exporters and multiplex their outputs.
+
+= LICENSE
+
+prometheus-exporter-multiplexer is public domain.
+It is associated with CC0 1.0 Universal.
diff --git a/debian/collect_copyright.pl b/debian/collect_copyright.pl
new file mode 100755
index 0000000..5556d87
--- /dev/null
+++ b/debian/collect_copyright.pl
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+
+use v5.36;
+
+sub slurp($file){
+ open(my $fh, "<", $file) or die;
+ local $/;
+ $/ = "\n" if(wantarray);
+ <$fh>
+}
+
+my $root = $ENV{DPKG_ROOT} // "";
+
+my %pkg;
+my $pkg;
+for(slurp("$root/var/lib/dpkg/status")){
+ $pkg = $1 if(/^Package:\s*([^\s]*)/);
+ if(/^Source:\s*([^\s(]*)/){
+ my $src = $1;
+ next if($src eq $pkg);
+ $pkg{$src} //= [];
+ push $pkg{$src}->@*, $pkg;
+ }
+}
+
+my @deps;
+for(@ARGV){
+ push @deps, map{s/^\s*//; s/\s*$//r}
+ map{s/.*?.?=//; split(/, */)}
+ grep{/^misc:Static-Built-Using.?=/}
+ slurp($_);
+}
+
+DEP: for my $namev(@deps){
+ my $name = $namev =~ s/\s*\(.*//r;
+ for($name, $pkg{$name}->@*){
+ if(-f "$root/usr/share/doc/$_/copyright"){
+ print("Package: $namev\n");
+ print(slurp("/usr/share/doc/$_/copyright"));
+ print("\n");
+ next DEP;
+ }
+ }
+ die;
+}
diff --git a/debian/control b/debian/control
index 4b32190..a02c3d9 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,7 @@
Source: prometheus-exporter-multiplexer
Section: golang
Priority: optional
-Maintainer: dyknon <dyknon@users.osdn.me>
+Maintainer: dyknon <dyknon@r5f.jp>
Build-Depends: debhelper-compat (= 13), dh-sequence-golang,
golang-github-prometheus-common-dev,
golang-github-prometheus-prometheus-dev,
@@ -9,7 +9,7 @@ Build-Depends: debhelper-compat (= 13), dh-sequence-golang,
golang-gopkg-alecthomas-kingpin.v2-dev,
golang-gopkg-yaml.v2-dev,
Standards-Version: 4.7.2
-XS-Go-Import-Path: r5f.jp/cgit/prometheus-exporter-multiplexer
+XS-Go-Import-Path: r5f.jp/go/prometheus_exporter_multiplexer
Package: prometheus-exporter-multiplexer
Architecture: any
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..1bc1c8e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,14 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+
+Files: *
+Copyright: 2025 dyknon <dyknon@r5f.jp>
+License: CC0-1.0
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+ .
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+ .
+ On Debian systems, the full text of the CC0 1.0 Universal license can be found
+ in the file `/usr/share/common-licenses/CC0-1.0'.
diff --git a/debian/rules b/debian/rules
index 76faa77..c933a1c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,17 @@
#!/usr/bin/make -f
+BINNAME=prometheus-exporter-multiplexer
+
%:
dh $@ --builddirectory=_build --buildsystem=golang
override_dh_auto_install:
dh_auto_install -- --no-source
+
+execute_after_dh_auto_install:
+ mv debian/$(BINNAME)/usr/bin/$(subst -,_,$(BINNAME)) \
+ debian/$(BINNAME)/usr/bin/$(BINNAME)
+
+execute_after_dh_golang:
+ debian/collect_copyright.pl debian/$(BINNAME).substvars \
+ > debian/$(BINNAME)/usr/share/doc/$(BINNAME)/copyright.built-using