All checks were successful
Build Module / Build Module (push) Successful in 2m11s
Reviewed-on: #29 Co-authored-by: GregoryDosh <authentik@gregorydosh.com> Co-committed-by: GregoryDosh <authentik@gregorydosh.com>
79 lines
2.6 KiB
Makefile
79 lines
2.6 KiB
Makefile
# Custom build of Uber's SSH Certificate PAM module
|
|
# Source available at git.auengun.net/GregoryDosh/pam_ussh
|
|
# Copyright (C) 2024 GregoryDosh
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
# License, or (at your option) any later version.
|
|
|
|
# This program 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 Affero General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# SPDX-FileCopyrightText: 2024 GregoryDosh
|
|
|
|
# avoid noisy directory messages
|
|
MAKEFLAGS += --no-print-directory
|
|
|
|
.PHONY: test
|
|
test:
|
|
go test -cover
|
|
|
|
.PHONY: install_deps
|
|
install_deps:
|
|
@go get
|
|
@go mod verify
|
|
|
|
.PHONY: build
|
|
build:
|
|
@make build_amd64 build_arm64
|
|
|
|
.PHONY: build_amd64
|
|
build_amd64:
|
|
@echo "Building Linux/amd64"
|
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=$(shell which gcc) go build -buildmode=c-shared -o release/pam_ussh.amd64.so
|
|
sha256sum release/pam_ussh.amd64.so | cut -f1 -d " " > release/pam_ussh.amd64.so.sha256
|
|
|
|
.PHONY: build_arm64
|
|
build_arm64:
|
|
@echo "Building Linux/arm64"
|
|
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=$(shell which aarch64-linux-gnu-gcc) go build -buildmode=c-shared -o release/pam_ussh.arm64.so
|
|
sha256sum release/pam_ussh.arm64.so | cut -f1 -d " " > release/pam_ussh.arm64.so.sha256
|
|
|
|
.PHONY: vet
|
|
vet:
|
|
# REUSE-IgnoreStart
|
|
@echo "// SPDX-FileCopyrightText: NONE" | tee release/build.log
|
|
@echo "//" | tee -a release/build.log
|
|
@echo "// SPDX-License-Identifier: AGPL-3.0-or-later" | tee -a release/build.log
|
|
# REUSE-IgnoreEnd
|
|
@echo
|
|
@echo "Starting at `date`" | tee -a release/build.log
|
|
@echo
|
|
@echo # Syft Scan Format... | tee -a release/build.log
|
|
@syft scan -o json ./ >> release/syft.json | tee -a release/build.log
|
|
|
|
@echo
|
|
@echo # Grype Vulnerability Scanning... | tee -a release/build.log
|
|
@grype --fail-on high -o table sbom:release/syft.json | tee -a release/build.log
|
|
|
|
@echo
|
|
@echo # REUSE License Checking... | tee -a release/build.log
|
|
@reuse lint | tee -a release/build.log
|
|
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
@rm -f ./release/pam_ussh.amd64.h
|
|
@rm -f ./release/pam_ussh.amd64.so
|
|
@rm -f ./release/pam_ussh.amd64.so.sha256
|
|
@rm -f ./release/pam_ussh.arm64.h
|
|
@rm -f ./release/pam_ussh.arm64.so
|
|
@rm -f ./release/pam_ussh.arm64.so.sha256
|
|
@rm -f ./release/*.log
|