mirror of
https://github.com/clearlinux/mixer-tools.git
synced 2026-09-03 20:21:32 +00:00
This release includes minor enhancements and bug fixes. Enhancements: - Initialize local yum repo even when its empty as newer versions of DNF requires that yum repos be initialized. - Install special case files in the end so that they will not create directories with potentially conflicting permissions. The order of installation is now packages, contents and then special case files. Bug Fixes: - Set file permissions in the chroot after creating it and setting the file owner. This is necessary because umask can prevent newly created files from acquiring the source file's permissions. - Don't follow symlinks when comparing files between content and full chroot. - Skip format bump check in MCA. Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
88 lines
2.6 KiB
Makefile
88 lines
2.6 KiB
Makefile
include Makefile.bats
|
|
|
|
.NOTPARALLEL:
|
|
|
|
VERSION=6.2.1
|
|
GO_PACKAGE_PREFIX := github.com/clearlinux/mixer-tools
|
|
GOPATH ?= ${HOME}/go
|
|
gopath = $(shell go env GOPATH)
|
|
|
|
.PHONY: build install clean check
|
|
|
|
.DEFAULT_GOAL := build
|
|
|
|
build:
|
|
go install -mod=vendor -ldflags="-X ${GO_PACKAGE_PREFIX}/builder.Version=${VERSION}" ${GO_PACKAGE_PREFIX}/mixer
|
|
go install -mod=vendor ${GO_PACKAGE_PREFIX}/mixin
|
|
go install -mod=vendor ${GO_PACKAGE_PREFIX}/swupd-extract
|
|
go install -mod=vendor ${GO_PACKAGE_PREFIX}/swupd-inspector
|
|
go install -mod=vendor ${GO_PACKAGE_PREFIX}/mixer-completion
|
|
|
|
install: build
|
|
test -d $(DESTDIR)/usr/bin || install -D -d -m 00755 $(DESTDIR)/usr/bin;
|
|
install -m 00755 $(GOPATH)/bin/mixer $(DESTDIR)/usr/bin/.
|
|
install -m 00755 $(GOPATH)/bin/mixin $(DESTDIR)/usr/bin/.
|
|
install -m 00755 $(GOPATH)/bin/swupd-extract $(DESTDIR)/usr/bin/.
|
|
install -m 00755 $(GOPATH)/bin/swupd-inspector $(DESTDIR)/usr/bin/.
|
|
$(GOPATH)/bin/mixer-completion bash --path $(DESTDIR)/usr/share/bash-completion/completions/mixer
|
|
$(GOPATH)/bin/mixer-completion zsh --path $(DESTDIR)/usr/share/zsh/site-functions/_mixer
|
|
test -d $(DESTDIR)/usr/share/man/man1 || install -D -d -m 00755 $(DESTDIR)/usr/share/man/man1
|
|
install -m 00644 $(MANPAGES) $(DESTDIR)/usr/share/man/man1/
|
|
|
|
check:
|
|
go test -cover ${GO_PACKAGE_PREFIX}/...
|
|
|
|
.PHONY: checkcoverage
|
|
checkcoverage:
|
|
go test -cover ${GO_PACKAGE_PREFIX}/... -coverprofile=coverage.out
|
|
go tool cover -html=coverage.out
|
|
|
|
.PHONY: lint
|
|
lint:
|
|
@if ! $(gopath)/bin/golangci-lint --version &>/dev/null; then \
|
|
echo "Installing linters..."; \
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(gopath)/bin v1.22.2; \
|
|
fi
|
|
@$(gopath)/bin/golangci-lint run --deadline=10m --tests --disable-all \
|
|
--enable=misspell \
|
|
--enable=vet \
|
|
--enable=ineffassign \
|
|
--enable=gofmt \
|
|
$${CYCLO_MAX:+--enable=gocyclo --cyclo-over=$${CYCLO_MAX}} \
|
|
--enable=golint \
|
|
--enable=deadcode \
|
|
--enable=varcheck \
|
|
--enable=structcheck \
|
|
--enable=unused \
|
|
--enable=vetshadow \
|
|
--enable=errcheck \
|
|
./...
|
|
|
|
clean:
|
|
go clean -i -x ${GO_PACKAGE_PREFIX}/...
|
|
rm -f mixer-tools-*.tar.gz
|
|
|
|
release:
|
|
@if [ ! -d .git ]; then \
|
|
echo "Release needs to be used from a git repository"; \
|
|
exit 1; \
|
|
fi
|
|
git archive --format=tar.gz --verbose -o mixer-tools-${VERSION}.tar.gz HEAD --prefix=mixer-tools-${VERSION}/
|
|
|
|
MANPAGES = \
|
|
docs/mixer.1 \
|
|
docs/mixer.add-rpms.1 \
|
|
docs/mixer.build.1 \
|
|
docs/mixer.bundle.1 \
|
|
docs/mixer.config.1 \
|
|
docs/mixer.init.1 \
|
|
docs/mixer.repo.1 \
|
|
docs/mixer.versions.1 \
|
|
docs/mixin.1
|
|
|
|
man: $(MANPAGES)
|
|
|
|
% : %.rst
|
|
mkdir -p "$$(dirname $@)"
|
|
rst2man.py "$<" > "$@.tmp" && mv -f "$@.tmp" "$@"
|