aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/.gitignore2
-rw-r--r--debian/Makefile87
-rw-r--r--debian/README.Debian44
-rw-r--r--debian/Vagrantfile84
-rw-r--r--debian/changelog24
-rw-r--r--debian/control14
-rw-r--r--debian/copyright39
-rw-r--r--debian/gbp.conf6
-rw-r--r--debian/install12
l---------debian/linux-status.service1
-rwxr-xr-xdebian/rules3
-rw-r--r--debian/source/format1
12 files changed, 317 insertions, 0 deletions
diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644
index 0000000..3eb2fb2
--- /dev/null
+++ b/debian/.gitignore
@@ -0,0 +1,2 @@
+build-area/
+.vagrant/
diff --git a/debian/Makefile b/debian/Makefile
new file mode 100644
index 0000000..5152fdc
--- /dev/null
+++ b/debian/Makefile
@@ -0,0 +1,87 @@
+MAKEFLAGS += --warn-undefined-variables
+.DEFAULT_GOAL := all
+.DELETE_ON_ERROR:
+.SUFFIXES:
+SHELL := bash
+.SHELLFLAGS := -e -o pipefail -c
+
+escape = $(subst ','\'',$(1))
+
+# Don't expand parameters:
+define escape_arg
+ifeq ($$(origin $(1)),environment)
+ $(1) := $$(value $(1))
+endif
+ifeq ($$(origin $(1)),environment override)
+ $(1) := $$(value $(1))
+endif
+ifeq ($$(origin $(1)),command line)
+ override $(1) := $$(value $(1))
+endif
+endef
+
+PPA_OWNER ?= egor-tensin
+PPA_NAME ?= linux-status
+GPG_KEY ?= 3B3EF1235420917E0DB0723991D679FB92B036CB
+DIST ?= bionic
+
+$(eval $(call escape_arg,PPA_OWNER))
+$(eval $(call escape_arg,PPA_NAME))
+$(eval $(call escape_arg,GPG_KEY))
+$(eval $(call escape_arg,DIST))
+
+this_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+root := $(this_dir)/..
+build_area := $(this_dir)/build-area
+
+.PHONY: DO
+DO:
+
+.PHONY: dch
+dch:
+ gbp dch --distribution=unstable
+
+.PHONY: tag
+tag:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-tag-only
+
+.PHONY: src/test
+src/test:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-ignore-new -S -us -uc
+
+.PHONY: src
+src:
+ pushd '$(call escape,$(root))' && gbp buildpackage -S '-k0x$(call escape,$(GPG_KEY))'
+
+.PHONY: bin/test
+bin/test:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-ignore-new -b -us -uc
+
+.PHONY: bin
+bin:
+ pushd '$(call escape,$(root))' && gbp buildpackage -b '-k0x$(call escape,$(GPG_KEY))'
+
+.PHONY: dist/create
+dist/create:
+ pushd '$(call escape,$(root))' && env 'DIST=$(call escape,$(DIST))' git-pbuilder create
+
+.PHONY: dist/update
+dist/update:
+ pushd '$(call escape,$(root))' && env 'DIST=$(call escape,$(DIST))' git-pbuilder update
+
+.PHONY: dist/test
+dist/test:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-ignore-new --git-pbuilder '--git-dist=$(call escape,$(DIST))'
+
+.PHONY: dist
+dist:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-pbuilder '--git-dist=$(call escape,$(DIST))'
+ pushd '$(call escape,$(root))' && debsign '-k0x$(call escape,$(GPG_KEY))' --debs-dir '$(call escape,$(build_area))'
+
+.PHONY: upload
+upload:
+ find '$(call escape,$(build_area))' -type f -name '*.changes' -exec dput 'ppa:$(call escape,$(PPA_OWNER))/$(call escape,$(PPA_NAME))/ubuntu/$(DIST)' {} ';'
+
+.PHONY: clean
+clean:
+ rm -rf -- '$(call escape,$(build_area))'
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..3b9522e
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,44 @@
+linux-status for Debian
+----------------------
+
+There's a Vagrantfile to make maintenance easier. To start, use `vagrant up`,
+then `vagrant ssh`.
+
+There're a bunch of useful one-liners in Makefile. Everything is built in
+debian/build-area/.
+
+ * Make a source package:
+
+ make src
+ make src/test # Ignores uncommitted changes.
+
+ * Make a binary package:
+
+ make bin
+ make bin/test # Ignores uncommmited changes.
+
+ * Add a changelog entry (you'll need to fix it manually):
+
+ make dch
+
+ * Tag the last commit:
+
+ make tag
+
+ * Upload the source package to the PPA:
+
+ make upload
+
+ To make the package available for different Ubuntu distributions, copy the
+ package binaries on Launchpad. I dread the day when this becomes
+ impossible.
+
+ * Make a binary package using pbuilder (useful for testing that the package
+ builds on a particular distribution):
+
+ make dist/create DIST=focal
+ make dist/update DIST=focal
+ make dist DIST=focal
+ make dist/test DIST=focal # Ignores uncommitted changes.
+
+ -- Egor Tensin <Egor.Tensin@gmail.com> Mon, 08 Mar 2021 07:33:14 +0000
diff --git a/debian/Vagrantfile b/debian/Vagrantfile
new file mode 100644
index 0000000..6202207
--- /dev/null
+++ b/debian/Vagrantfile
@@ -0,0 +1,84 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+NAME = 'Egor Tensin'
+EMAIL = 'Egor.Tensin@gmail.com'
+GPG_KEY = '3B3EF1235420917E0DB0723991D679FB92B036CB'
+UID = Process.euid
+
+Vagrant.configure("2") do |config|
+ config.vm.box = "generic/ubuntu2004"
+
+ # Weirdly enough, VirtualBox's shared folders didn't quite work for me.
+ # gbp buildpackage would just exit with FileExistsError, which doesn't
+ # happen with NFS shares.
+ config.vm.synced_folder "../", "/vagrant", type: "nfs"
+
+ config.vm.provider "libvirt" do |v|
+ v.cpus = 2
+ v.memory = 4096
+ end
+
+ # Working with the git repository:
+ config.vm.provision "shell", privileged: false, inline: <<-SHELL
+#!/usr/bin/env bash
+set -o errexit -o nounset -o pipefail
+git config --global user.name '#{NAME}'
+git config --global user.email '#{EMAIL}'
+ SHELL
+ config.ssh.forward_agent = true
+
+ # Set DEB* environment variables:
+ config.vm.provision "shell", privileged: false, inline: <<-SHELL
+#!/usr/bin/env bash
+set -o errexit -o nounset -o pipefail
+tee -a ~/.bashrc <<'EOF'
+export DEBFULLNAME='#{NAME}'
+export DEBEMAIL='#{EMAIL}'
+EOF
+ SHELL
+
+ # gpg-agent forwarding (https://wiki.gnupg.org/AgentForwarding):
+ config.vm.provision "shell", privileged: false, inline: <<-SHELL
+#!/usr/bin/env bash
+set -o errexit -o nounset -o pipefail
+gpg --keyserver hkp://keyserver.ubuntu.com/ --recv-keys '0x#{GPG_KEY}'
+gpg --import-ownertrust <<'EOF'
+#{GPG_KEY}:6:
+EOF
+ SHELL
+ config.vm.provision "shell", inline: <<-SHELL
+#!/usr/bin/env bash
+set -o errexit -o nounset -o pipefail
+echo 'StreamLocalBindUnlink yes' >> /etc/ssh/sshd_config
+ SHELL
+ # "agent-extra-socket" on the host.
+ local_gpg_socket = one_line(run('gpgconf', '--list-dirs', 'agent-extra-socket'))
+ # "agent-socket" on the VM.
+ remote_gpg_socket = "/run/user/#{UID}/gnupg/S.gpg-agent"
+ config.ssh.extra_args = ['-R', "#{remote_gpg_socket}:#{local_gpg_socket}"]
+
+ # Install the required packages:
+ config.vm.provision "shell", inline: <<-SHELL
+#!/usr/bin/env bash
+set -o errexit -o nounset -o pipefail
+apt-get update
+apt-get install -y build-essential devscripts dh-make git-buildpackage
+ SHELL
+
+ config.vm.provision :reload
+end
+
+require "open3"
+
+def run(*cmd)
+ stdout, stderr, status = Open3.capture3(*cmd)
+ abort stderr unless status.success?
+ stdout
+end
+
+def one_line(output)
+ lines = output.lines.map(&:chomp)
+ abort "Must be a single line: #{lines}" unless lines.length == 1
+ lines.first
+end
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..e3ac438
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,24 @@
+linux-status (0.0.1-3) unstable; urgency=medium
+
+ * debian: target the lowest denominator bionic
+ * debian: lint Vagrantfile
+ * debian: add README.Debian
+ * debian: add `make dch` command
+
+ -- Egor Tensin <Egor.Tensin@gmail.com> Mon, 08 Mar 2021 07:55:46 +0000
+
+linux-status (0.0.1-2) unstable; urgency=medium
+
+ * debian: lower debhelper-compat level
+ * debian: add Vagrantfile for building packages
+ * debian: more one-liners in Makefile
+ * debian: set DEB* variables in Vagrantfile
+ * debian: add `make tag` command
+
+ -- Egor Tensin <Egor.Tensin@gmail.com> Sun, 07 Mar 2021 23:02:18 +0000
+
+linux-status (0.0.1-1) unstable; urgency=medium
+
+ * Initial release.
+
+ -- Egor Tensin <Egor.Tensin@gmail.com> Sat, 06 Mar 2021 19:48:48 +0000
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..e121a10
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,14 @@
+Source: linux-status
+Section: admin
+Priority: optional
+Maintainer: Egor Tensin <Egor.Tensin@gmail.com>
+Build-Depends: debhelper-compat (= 10)
+Standards-Version: 4.4.1
+Homepage: https://github.com/egor-tensin/linux-status
+
+Package: linux-status
+Architecture: all
+Depends: python3, ${misc:Depends}
+Description: Simple Linux status web page
+ A simple web app to display your `top`, systemd units & timers, allow you to
+ reboot, etc.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..334eed6
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,39 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: linux-status
+Upstream-Contact: Egor Tensin <Egor.Tensin@gmail.com>
+Source: https://github.com/egor-tensin/linux-status
+
+Files: *
+Copyright: 2018-2021 Egor Tensin <Egor.Tensin@gmail.com>
+License: MIT
+
+Files: debian/*
+Copyright: 2021 Egor Tensin <Egor.Tensin@gmail.com>
+License: MIT
+
+Files: css/bootstrap.min.css js/bootstrap.bundle.min.js
+Copyright: 2011-2018 The Bootstrap Authors
+License: MIT
+
+Files: js/jquery-3.3.1.min.js
+Copyright: JS Foundation and other contributors
+License: MIT
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..a32554f
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,6 @@
+[DEFAULT]
+upstream-tag = v%(version)s
+debian-branch = debian
+debian-tag = debian/v%(version)s
+pristine-tar = False
+export-dir = debian/build-area/
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..31d5cd4
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,12 @@
+LICENSE.txt usr/share/linux-status
+
+README.md usr/share/doc/linux-status
+img/example.png usr/share/doc/linux-status/img
+
+app.py srv/linux-status
+server.py srv/linux-status
+
+index.html srv/linux-status
+css/bootstrap.min.css srv/linux-status/css
+js/bootstrap.bundle.min.js srv/linux-status/js
+js/jquery-3.3.1.min.js srv/linux-status/js
diff --git a/debian/linux-status.service b/debian/linux-status.service
new file mode 120000
index 0000000..e104dba
--- /dev/null
+++ b/debian/linux-status.service
@@ -0,0 +1 @@
+../dist/systemd/linux-status.service \ No newline at end of file
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..cbe925d
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,3 @@
+#!/usr/bin/make -f
+%:
+ dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)