2024-01-06 23:52:16 +01:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
|
2023-10-05 12:00:00 +02:00
|
|
|
all: reaction ip46tables
|
|
|
|
|
|
|
|
clean:
|
2024-01-04 12:00:00 +01:00
|
|
|
rm -f reaction ip46tables reaction.deb deb reaction.minisig ip46tables.minisig reaction.deb.minisig
|
2023-12-20 15:56:22 +01:00
|
|
|
|
2023-10-05 12:00:00 +02:00
|
|
|
ip46tables: ip46tables.d/ip46tables.c
|
2024-01-05 12:00:00 +01:00
|
|
|
gcc -s -static ip46tables.d/ip46tables.c -o ip46tables
|
2023-10-05 12:00:00 +02:00
|
|
|
|
|
|
|
reaction: app/* reaction.go go.mod go.sum
|
2024-01-05 12:00:00 +01:00
|
|
|
CGO_ENABLED=0 go build -buildvcs=false -ldflags "-s -X main.version=`git tag --sort=v:refname | tail -n1` -X main.commit=`git rev-parse --short HEAD`"
|
2023-12-20 15:56:22 +01:00
|
|
|
|
|
|
|
reaction.deb: reaction ip46tables
|
|
|
|
chmod +x reaction ip46tables
|
|
|
|
mkdir -p deb/reaction/usr/bin/ deb/reaction/usr/sbin/ deb/reaction/lib/systemd/system/
|
|
|
|
cp reaction deb/reaction/usr/bin/
|
|
|
|
cp ip46tables deb/reaction/usr/sbin/
|
2023-12-20 12:00:00 +01:00
|
|
|
cp config/reaction.debian.service deb/reaction/lib/systemd/system/reaction.service
|
2023-12-20 15:56:22 +01:00
|
|
|
cp -r DEBIAN/ deb/reaction/DEBIAN
|
|
|
|
sed -e "s/LAST_TAG/`git tag --sort=v:refname | tail -n1`/" -e "s/Version: v/Version: /" -i deb/reaction/DEBIAN/*
|
|
|
|
cd deb && dpkg-deb --root-owner-group --build reaction
|
|
|
|
mv deb/reaction.deb reaction.deb
|
|
|
|
rm -rf deb/
|
2024-01-04 12:00:00 +01:00
|
|
|
|
|
|
|
signatures: reaction.deb reaction ip46tables
|
|
|
|
minisign -Sm ip46tables reaction reaction.deb
|
|
|
|
|
2024-01-06 23:52:16 +01:00
|
|
|
install: all
|
|
|
|
@install -m755 reaction $(DESTDIR)$(BINDIR)
|
|
|
|
@install -m755 ip46tables $(DESTDIR)$(BINDIR)
|