ca-scripts/Makefile

64 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2015-02-18 13:43:35 -05:00
NAME=ca-scripts
VERSION=0.9.0
2015-02-18 13:43:35 -05:00
DIRS=bin lib tpl
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
DOC_FILES=*.conf *.md doc/*.pod
SCRIPTS=ca-create-cert ca-init ca-list-certs ca-renew-cert ca-revoke-cert
2015-02-18 13:43:35 -05:00
PKG_DIR=ca-scripts
2015-02-20 13:31:22 -05:00
PKG_NAME=$(NAME)_$(VERSION)
PKG=$(PKG_DIR)/$(PKG_NAME).tar.gz
2015-02-18 13:43:35 -05:00
SIG=$(PKG_DIR)/$(PKG_NAME).asc
PREFIX?=/opt/$(NAME)
DOC_DIR=$(PREFIX)/doc
#DOC_DIR=$(PREFIX)/share/doc/$(PKG_NAME)
2015-02-18 13:43:35 -05:00
pkg:
mkdir -p $(PKG_DIR)
$(PKG): pkg
git archive --output=$(PKG) --prefix=$(PKG_NAME)/ HEAD
build: $(PKG)
$(SIG): $(PKG)
gpg --sign --detach-sign --armor $(PKG)
sign: $(SIG)
clean:
rm -f $(PKG) $(SIG)
all: $(PKG) $(SIG)
test:
tag:
git tag v$(VERSION)
git push --tags
release: $(PKG) $(SIG) tag
install:
for dir in $(INSTALL_DIRS); do mkdir -p $(PREFIX)/$$dir; done
for file in $(INSTALL_FILES); do cp $$file $(PREFIX)/$$file; done
mkdir -p $(DOC_DIR)
cp -r $(DOC_FILES) $(DOC_DIR)/
symlinks:
for link in $(SCRIPTS); do ln -s $(PREFIX)/bin/$$link /usr/local/bin/$$link
2015-02-18 13:43:35 -05:00
uninstall:
for file in $(INSTALL_FILES); do rm -f $(PREFIX)/$$file; done
rm -rf $(DOC_DIR)
rmsymlinks:
for link in $(SCRIPTS); do rm -f /usr/local/bin/$$link
2015-02-18 13:43:35 -05:00
.PHONY: build sign clean test tag release install uninstall all