~ritho/rweb

478496a82a5991f5682db2e4ade972fdcabde313 — Ritho 3 days ago 11a8783 v1.0.4
Improve the build and install targets on the Makefile.

Signed-off-by: Ritho <palvarez@ritho.net>
4 files changed, 13 insertions(+), 11 deletions(-)

M Config.mk
M Makefile
M debian/changelog
M debian/rules
M Config.mk => Config.mk +1 -1
@@ 7,7 7,7 @@ PWD ?= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
TOPDIR ?= $(PWD)
BUILDDIR ?= $(PWD)
DESTDIR ?= $(TOPDIR)
CONF_DIR ?= $(DESTDIR)/etc/web
CONF_DIR ?= $(TOPDIR)/conf
ASSETS_DIR ?= $(CONF_DIR)/assets
TMP_DIR ?= $(TOPDIR)/tmp
LOG_DIR ?= $(TOPDIR)/log

M Makefile => Makefile +5 -9
@@ 64,27 64,23 @@ clean:
.PHONY: build
build:
	@$(MAKE) build-dirs
	@$(MAKE) -C conf install
	@$(MAKE) -C $(CONF_DIR) install
	@go build -o $(PWD)/bin/${BIN} $(PWD)/cmd/${BIN}/main.go

.PHONY: install
install:
	@CONF_DIR=$(CONF_DIR) ASSETS_DIR=/etc/${BIN}/assets PORT=80 ${MAKE} -C $(TOPDIR)/conf install
	@ASSETS_DIR=/etc/${BIN}/assets PORT=80 ${MAKE} -C $(CONF_DIR) install
	@install -m 0755 -d $(DESTDIR)/usr/bin
	@install $(BUILDDIR)/bin/web $(DESTDIR)/usr/bin
	@install -m 0755 -d $(DESTDIR)/etc/init.d
	@install $(TOPDIR)/scripts/web $(DESTDIR)/etc/init.d/web
	@install -m 0755 -d $(ASSETS_DIR)
	@install -m 0755 -d $(ASSETS_DIR)/posts
	@install -m 0755 -d $(ASSETS_DIR)/css
	@install -m 0755 -d $(ASSETS_DIR)/images
	@install -m 0755 -d $(ASSETS_DIR)/static
	@install -m 0755 -d $(ASSETS_DIR)/packages
	@install $(TOPDIR)/assets/posts/* $(ASSETS_DIR)/posts
	@install $(TOPDIR)/assets/css/* $(ASSETS_DIR)/css
	@install $(TOPDIR)/assets/images/* $(ASSETS_DIR)/images
	@install $(TOPDIR)/assets/static/* $(ASSETS_DIR)/static
	@install $(TOPDIR)/assets/packages/* $(ASSETS_DIR)/packages
	@install -m 0755 -d $(ASSETS_DIR)/posts
	@install -m 0755 -d $(ASSETS_DIR)/static
	@install -m 0755 -d $(ASSETS_DIR)/views

deb-dependencies:
	@apt-get install -y build-essential autoconf autotools-dev git-buildpackage dh-make dh-golang golang-go

M debian/changelog => debian/changelog +6 -0
@@ 1,3 1,9 @@
web (1.0.4) unstable; urgency=low

  * Improve the build and install targets on the Makefile.

 -- Pablo Alvarez de Sotomayor Posadillo <palvarez@ritho.net>  Thu, 22 Sep 2022 13:44:57 +0200

web (1.0.3) unstable; urgency=low

  * Add the http port to the uncyphered server.

M debian/rules => debian/rules +1 -1
@@ 13,7 13,7 @@ export ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
	dh $@ --buildsystem=golang --with=golang

override_dh_auto_install:
	TOPDIR=$$(pwd) BUILDDIR=$$(pwd)/obj-$(ARCH) DESTDIR=$$(pwd)/debian/web CONF_DIR=$$(pwd)/debian/web/etc/web ASSETS_DIR=$$(pwd)/debian/web/etc/web/assets LOG_DIR=$$(pwd)/debian/web/var/log RUN_DIR=$$(pwd)/debian/web/var/run TMP_DIR=$$(pwd)/debian/web/tmp $(MAKE) install
	DESTDIR=$$(pwd)/debian/web ASSETS_DIR=$$(pwd)/debian/web/etc/web/assets LOG_DIR=$$(pwd)/debian/web/var/log RUN_DIR=$$(pwd)/debian/web/var/run TMP_DIR=$$(pwd)/debian/web/tmp $(MAKE) install
	install -m 0755 -d $$(pwd)/debian/web/etc/init.d
	install $$(pwd)/scripts/web $$(pwd)/debian/web/etc/init.d/web
	install -m 0755 -d $$(pwd)/debian/web/lib/systemd/system/