2016-03-12 21:35:05 +00:00
|
|
|
SHELL:=/usr/bin/env bash
|
2016-03-13 09:14:28 +00:00
|
|
|
PREFIX?="/usr"
|
2016-03-12 21:35:05 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Building:
|
|
|
|
#
|
|
|
|
|
2016-06-16 19:34:25 +00:00
|
|
|
git-secret: src/version.sh src/_utils/* src/commands/* src/main.sh
|
|
|
|
@cat $^ > "$@"; \
|
|
|
|
chmod +x git-secret; sync
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: all
|
2016-02-21 13:26:17 +00:00
|
|
|
all: build
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: clean
|
2016-02-21 13:26:17 +00:00
|
|
|
clean:
|
|
|
|
@rm -f git-secret
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: build
|
2016-02-21 13:26:17 +00:00
|
|
|
build: git-secret
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
2016-06-16 19:34:25 +00:00
|
|
|
@chmod +x "./utils/install.sh"; sync; \
|
|
|
|
"./utils/install.sh" "${PREFIX}"
|
2016-05-14 11:03:33 +00:00
|
|
|
|
2016-06-28 21:00:15 +00:00
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
|
|
|
@chmod +x "./utils/uninstall.sh"; sync; \
|
|
|
|
"./utils/uninstall.sh" "${PREFIX}"
|
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Testing:
|
|
|
|
#
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install-test
|
2016-02-21 13:26:17 +00:00
|
|
|
install-test:
|
2016-06-16 19:34:25 +00:00
|
|
|
@if [ ! -d "vendor/bats" ]; then \
|
|
|
|
git clone https://github.com/sstephenson/bats.git vendor/bats; fi
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: test
|
2016-06-16 19:34:25 +00:00
|
|
|
test: install-test clean build
|
|
|
|
@chmod +x "./utils/tests.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
export PATH="${PWD}/vendor/bats/bin:${PWD}:${PATH}"; \
|
|
|
|
"./utils/tests.sh"
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Manuals:
|
|
|
|
#
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install-ronn
|
2016-03-12 19:21:04 +00:00
|
|
|
install-ronn:
|
|
|
|
@if [ ! `gem list ronn -i` == "true" ]; then gem install ronn; fi
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: build-man
|
2016-06-16 19:34:25 +00:00
|
|
|
build-man: install-ronn
|
|
|
|
@ronn --roff man/*/*.ronn
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: build-gh-pages
|
2016-02-23 21:25:39 +00:00
|
|
|
build-gh-pages:
|
2016-06-16 19:34:25 +00:00
|
|
|
@chmod +x "./utils/gh-branch.sh"; sync; \
|
|
|
|
"./utils/gh-branch.sh"
|
2016-02-23 21:25:39 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Development:
|
|
|
|
#
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install-hooks
|
2016-02-21 13:26:17 +00:00
|
|
|
install-hooks:
|
2016-06-16 19:34:25 +00:00
|
|
|
@ln -fs "${PWD}/utils/hooks/pre-commit.sh" "${PWD}/.git/hooks/pre-commit"; \
|
|
|
|
chmod +x "${PWD}/.git/hooks/pre-commit"; sync; \
|
|
|
|
ln -fs "${PWD}/utils/hooks/post-commit.sh" "${PWD}/.git/hooks/post-commit"; \
|
|
|
|
chmod +x "${PWD}/.git/hooks/post-commit"; sync
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: develop
|
2016-02-21 13:26:17 +00:00
|
|
|
develop: clean build install-hooks
|
2016-03-12 19:21:04 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Packaging:
|
|
|
|
#
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install-fpm
|
2016-03-12 19:21:04 +00:00
|
|
|
install-fpm:
|
|
|
|
@if [ ! `gem list fpm -i` == "true" ]; then gem install fpm; fi
|
|
|
|
|
2016-06-16 19:34:25 +00:00
|
|
|
# .deb:
|
2016-03-12 19:21:04 +00:00
|
|
|
|
2016-06-16 19:34:25 +00:00
|
|
|
.PHONY: build-deb
|
|
|
|
build-deb: clean build install-fpm
|
|
|
|
@chmod +x "./utils/build-utils.sh"; sync; \
|
|
|
|
chmod +x "./utils/deb/deb-build.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/deb/deb-build.sh"
|
|
|
|
|
|
|
|
.PHONY: test-deb-ci
|
|
|
|
test-deb-ci: install-test build-deb
|
|
|
|
@chmod +x "./utils/deb/deb-ci.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
export PATH="${PWD}/vendor/bats/bin:${PATH}"; \
|
|
|
|
"./utils/deb/deb-ci.sh"
|
|
|
|
|
|
|
|
.PHONY: deploy-deb
|
|
|
|
deploy-deb: build-deb
|
|
|
|
@chmod +x "./utils/deb/deb-deploy.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/deb/deb-deploy.sh"
|
|
|
|
|
|
|
|
# .rpm:
|
|
|
|
|
|
|
|
.PHONY: build-rpm
|
|
|
|
build-rpm: clean build install-fpm
|
|
|
|
@chmod +x "./utils/build-utils.sh"; sync; \
|
|
|
|
chmod +x "./utils/rpm/rpm-build.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/rpm/rpm-build.sh"
|
|
|
|
|
|
|
|
.PHONY: test-rpm-ci
|
|
|
|
test-rpm-ci: install-test build-rpm
|
|
|
|
@chmod +x "./utils/rpm/rpm-ci.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
export PATH="${PWD}/vendor/bats/bin:${PATH}"; \
|
|
|
|
"./utils/rpm/rpm-ci.sh"
|
|
|
|
|
|
|
|
.PHONY: deploy-rpm
|
|
|
|
deploy-rpm: build-rpm
|
|
|
|
@chmod +x "./utils/rpm/rpm-deploy.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/rpm/rpm-deploy.sh"
|
2016-07-02 09:32:07 +00:00
|
|
|
|
|
|
|
# make:
|
|
|
|
|
|
|
|
.PHONY: test-make-ci
|
|
|
|
test-make-ci: clean install-test
|
|
|
|
@chmod +x "./utils/make/make-ci.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
2016-07-02 09:59:55 +00:00
|
|
|
export PATH="${PWD}/vendor/bats/bin:${PATH}"; \
|
2016-07-02 09:32:07 +00:00
|
|
|
"./utils/make/make-ci.sh"
|