From b3d0af2de29711abfe6da373786d365d9a6de198 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 13 Mar 2024 21:17:51 +0100 Subject: feat: Rewrite to golang I have found a nice lib in go to handle XML so I migrate to it. Go is ages easier to deploy then python. --- Makefile | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7922953..69b82d9 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,26 @@ +BIN?=jnfilter +PREFIX?=/usr/local +BINDIR?=$(PREFIX)/bin -rpm: rpm_dist - rpmbuild -bb \ - ./build/bdist.linux-x86_64/rpm/SPECS/jnfilter.spec \ - --define "_topdir $(PWD)/build/bdist.linux-x86_64/rpm/" +OUT=./bin/$(BIN) +SERVER=./main.go -rpm_dist: - python setup.py bdist_rpm +GO_BUILD=go build -v -ldflags '-w -s' +GO_RUN=go run -v +all: build -clean: - python setup.py clean --all - rm -rf dist jnfilter.egg-info +install: build + install -Dm755 $(OUT) $(BINDIR)/$(BIN) -docs: - pandoc -s \ - --include-in-header=docs/bamboo.min.css \ - --metadata title="Filtro para Nerdcast" \ - --template docs/template.html \ - -s README.md \ - -o index.html +build: + $(GO_BUILD) -o $(OUT) $(SERVER) -install_deps: - dnf install -y rpmdevtools rpmlint python +compress: build + upx -1 $(OUT) + +compress_into_oblivion: build + upx --best --ultra-brute $(OUT) + +run: sass tmpl + $(GO_RUN) $(SERVER) -.PHONY: docs -- cgit v1.2.3