building deb package
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Mon, 10 Jan 2022 05:12:36 +0000 (16:12 +1100)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Mon, 10 Jan 2022 05:12:36 +0000 (16:12 +1100)
Makefile
debian/changelog [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]
sitetool/Makefile

index 1d27cfa13b0d9be73d0345edf7a9df18e84cc62c..e320708d23f290c984888ecbe6bdf55cb4de313a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,13 @@ MAIN = command.lsp
 LSP = $(filter-out $(MAIN),$(wildcard *.lsp))
 BIN = hourglass hourglass-web hourglass-site
 DOCS = hourglass-guide.html hourglass-guide.pdf
+MANPGS = hourglass.8
 IMGS = $(wildcard *.png)
 OTHER = setup.sh hourglass.conf
 VERSION = 0.1
+GENERATED = $(BIN) $(DOCS) $(MANPGS)
 
-dist: hourglass-$(VERSION).tgz
+default: dist
 
 hourglass: $(MAIN) $(LSP)
        packnl -w $@ $^
@@ -19,15 +21,45 @@ hourglass-site: sitetool
        $(MAKE) -C sitetool
        mv sitetool/sitetool $@
 
-hourglass-$(VERSION).tgz: $(BIN) $(OTHER) $(DOCS) $(IMGS)
-       tar czf $@ $^
-
 %.html: %.adoc
        asciidoctor $< > $@
 
 %.pdf: %.adoc | $(IMGS)
        asciidoctor-pdf $< > $@
 
+%.8: %.8.adoc
+       a2x -d manpage -f manpage $^
+
+############################################################
 clean:
        $(MAKE) -C manager clean
-       rm -f $(BIN) hourglass-$(VERSION).tgz
+       $(MAKE) -C sitetool clean
+       rm -f $(GENERATED)
+
+############################################################
+hourglass-$(VERSION).tgz: $(BIN) $(OTHER) $(DOCS) $(MANPGS) $(IMGS)
+       tar czf $@ $^
+
+dist: hourglass-$(VERSION).tgz
+
+########################################################
+BINDIR = $(DESTDIR)/usr/local/bin
+MANDIR = $(DESTDIR)/usr/local/man/man8
+RUNDIR = $(DESTDIR)/var/lib/hourglass
+DOCDIR = $(DESTDIR)/usr/share/hourglass
+
+INSTALLTARGETS = $(addprefix $(BINDIR)/,$(BIN))
+INSTALLTARGETS += $(addprefix $(MANDIR)/,$(MANPGS))
+INSTALLTARGETS += $(addprefix $(DOCDIR)/,$(DOCS))
+INSTALLTARGETS += $(addprefix $(RUNDIR)/,$(OTHER))
+
+
+$(BINDIR)/% $(MANDIR)/% $(RUNDIR)/% $(DOCDIR)/%: %
+       install -D -T $< $@
+
+install: $(INSTALLTARGETS)
+
+BUILDPACKAGE = -us -uc --build=full
+
+deb:
+       PREFIX= INCLUDE_PREFIX=/usr dpkg-buildpackage $(BUILDPACKAGE)
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..966cc3a
--- /dev/null
@@ -0,0 +1,5 @@
+hourglass (0.1) unstable; urgency=medium
+
+  * Initial release
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com>  Mon, 10 Jan 2022 14:41:16 +1100
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..17e3790
--- /dev/null
@@ -0,0 +1,26 @@
+Source: hourglass
+Section: unknown
+Priority: optional
+Maintainer: Ralph Ronnquist <ralph.ronnquist@gmail.com>
+Build-Depends: debhelper-compat (= 13)
+Standards-Version: 4.5.1
+Homepage: https://borta.rrq.id.au/git?p=ralph/hourglass.git
+Vcs-Browser: https://borta.rrq.id.au/git?p=ralph/hourglass.git
+Vcs-Git: https://borta.rrq.id.au/git?p=ralph/hourglass.git
+Rules-Requires-Root: no
+
+Package: hourglass
+Architecture: amd64
+Depends: ${shlibs:Depends}, ${misc:Depends}, newlisp, iptables, ipset
+Description: Automated Network Access Control System
+ This is a collection of programs (scripts) that implement an
+ automated network access control policy, aptly named "Hourglass". The
+ general idea is to have the network open or closed on weekly policy
+ schedule, with an easy-to-use interface for adhoc adjustments.
+ .
+ The Hourglass policy setting includes open and close times separately
+ for each weekday, as well as limits of the accumulated usage during
+ the open times. For example, one could set up Hourglass to have the
+ network open between 11am and 4pm each day, closed otherwise and each
+ day allow for 2 hours of usage. The following is a snapshot of the
+ operator web view of the policy.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..26cfb50
--- /dev/null
@@ -0,0 +1,19 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: hourglass
+Source: https://borta.rrq.id.au/git?p=ralph/hourglass.git
+
+Files: *
+Copyright: 2022, Ralph Ronnquist <ralph.ronnquist@gmail.com>
+License: GPL-2
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License. It is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+ .
+ See the GNU General Public License for more details. You should have
+ received a copy of the GNU General Public License along with this
+ program. If not, see <https://www.gnu.org/licenses/>. On Debian
+ systems, the complete text of the GNU General Public License version
+ 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..d4e2cb1
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+%:
+       dh $@
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+#override_dh_auto_configure:
+#      dh_auto_configure -- \
+#      -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+
+override_dh_usrlocal:
+       #mkdir -p usr/local/bin
+       dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..89ae9db
--- /dev/null
@@ -0,0 +1 @@
+3.0 (native)
index aac1ea45c9cf6f5b1cd71e5747306cf69fa73806..1e7ee7ed98e1e2f613c4913b3b15ad48289d50ca 100644 (file)
@@ -7,3 +7,6 @@ default: sitetool
 
 sitetool: $(MAIN) $(LSP) $(TCL) $(OTHER)
        packnl -w $@ $^
+
+clean:
+       rm -f sitetool