1
0
mirror of https://github.com/Yubico/yubikey-ksm.git synced 2024-12-12 21:08:55 +01:00
yubikey-ksm/Makefile

120 lines
4.2 KiB
Makefile
Raw Normal View History

2009-11-20 08:14:27 +01:00
# Written by Simon Josefsson <simon@josefsson.org>.
2012-01-23 20:47:28 +01:00
# Copyright (c) 2009-2012 Yubico AB
2009-11-20 08:14:27 +01:00
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2010-09-21 12:36:10 +02:00
VERSION = 1.6
2009-12-15 20:54:38 +01:00
PACKAGE = yubikey-ksm
CODE = .htaccess Makefile NEWS ykksm-config.php ykksm-db.sql \
ykksm-decrypt.php ykksm-export ykksm-gen-keys \
ykksm-import ykksm-utils.php ykksm-checksum
2009-12-15 20:54:38 +01:00
DOCS = doc/DecryptionProtocol.wiki doc/DesignGoals.wiki \
2009-12-15 20:52:37 +01:00
doc/GenerateKeys.wiki doc/GenerateKSMKey.wiki \
doc/ImportKeysToKSM.wiki doc/Installation.wiki \
2010-03-16 15:19:09 +01:00
doc/KeyProvisioningFormat.wiki doc/ServerHardening.wiki \
doc/SyncMonitor.wiki
MANS = ykksm-checksum.1 ykksm-export.1 ykksm-gen-keys.1 \
ykksm-import.1
2009-11-20 08:14:27 +01:00
2009-12-15 20:52:37 +01:00
all:
2009-12-15 20:54:38 +01:00
@echo "Try 'make install' or 'make symlink'."
2012-12-18 14:06:54 +01:00
@echo "Docs: https://github.com/Yubico/$(PROJECT)/wiki/Installation"
2009-12-15 20:52:37 +01:00
@exit 1
2009-11-20 08:14:27 +01:00
2009-12-15 20:52:37 +01:00
# Installation rules.
2009-11-20 08:14:27 +01:00
2009-12-14 20:21:08 +01:00
etcprefix = /etc/ykksm
2009-12-14 20:16:47 +01:00
binprefix = /usr/bin
phpprefix = /usr/share/ykksm
docprefix = /usr/share/doc/ykksm
2009-12-15 20:03:59 +01:00
wwwgroup = www-data
2009-12-14 20:16:47 +01:00
install:
2009-12-15 20:16:39 +01:00
install -D .htaccess $(phpprefix)/.htaccess
2009-12-14 20:16:47 +01:00
install -D ykksm-decrypt.php $(phpprefix)/ykksm-decrypt.php
install -D ykksm-utils.php $(phpprefix)/ykksm-utils.php
install -D ykksm-gen-keys $(binprefix)/ykksm-gen-keys
install -D ykksm-import $(binprefix)/ykksm-import
install -D ykksm-export $(binprefix)/ykksm-export
install -D ykksm-checksum $(binprefix)/ykksm-checksum
2009-12-15 20:03:59 +01:00
install -D --backup --mode 640 --group $(wwwgroup) ykksm-config.php $(etcprefix)/ykksm-config.php
2009-12-14 20:16:47 +01:00
install -D ykksm-db.sql $(docprefix)/ykksm-db.sql
2009-12-15 20:16:39 +01:00
install -D Makefile $(docprefix)/ykksm.mk
2009-12-14 20:16:47 +01:00
install -D $(DOCS) $(docprefix)/
2009-12-15 20:05:26 +01:00
wwwprefix = /var/www/wsapi
symlink:
install -d $(wwwprefix)
ln -sf $(phpprefix)/.htaccess $(wwwprefix)/.htaccess
2009-12-15 20:17:37 +01:00
ln -sf $(phpprefix)/ykksm-decrypt.php $(wwwprefix)/decrypt.php
2009-12-15 20:05:26 +01:00
2009-12-15 20:52:37 +01:00
# Maintainer rules.
2010-01-19 07:53:23 +01:00
PROJECT = $(PACKAGE)
2009-11-20 08:14:27 +01:00
$(PACKAGE)-$(VERSION).tgz: $(FILES) $(MANS)
2009-12-15 20:52:37 +01:00
mkdir $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION)/doc
cp $(CODE) $(PACKAGE)-$(VERSION)/
cp $(MANS) $(PACKAGE)-$(VERSION)/
2009-12-15 20:52:37 +01:00
cp $(DOCS) $(PACKAGE)-$(VERSION)/doc/
tar cfz $(PACKAGE)-$(VERSION).tgz $(PACKAGE)-$(VERSION)
rm -rf $(PACKAGE)-$(VERSION)
dist: $(PACKAGE)-$(VERSION).tgz
2012-12-18 14:01:34 +01:00
clean: clean-man
2009-12-15 20:52:37 +01:00
rm -f *~
rm -rf $(PACKAGE)-$(VERSION)
NAME_ykksm-checksum = 'Print checksum of important database fields. Useful for quickly determining whether several KSMs are in sync.'
NAME_ykksm-export = 'Tool to export keys to the YKKSM-KEYPROV format.'
NAME_ykksm-gen-keys = 'Tool to generate keys on the YKKSM-KEYPROV format.'
NAME_ykksm-import = 'Tool to import key data on the YKKSM-KEYPROV format.'
%.1: %
help2man -N --name=$(NAME_$*) --version-string=1 ./$* > $@
man: $(MANS)
clean-man:
rm -f *.1
2009-12-15 20:52:37 +01:00
release: dist
@if test -z "$(KEYID)"; then \
echo "Try this instead:"; \
echo " make release KEYID=[PGPKEYID]"; \
echo "For example:"; \
echo " make release KEYID=2117364A"; \
exit 1; \
fi
2009-11-20 08:14:27 +01:00
gpg --detach-sign --default-key $(KEYID) $(PACKAGE)-$(VERSION).tgz
gpg --verify $(PACKAGE)-$(VERSION).tgz.sig
2012-12-18 14:43:08 +01:00
git tag -sm "$(PACKAGE)-$(VERSION)" $(PACKAGE)-$(VERSION)
2012-12-18 14:43:08 +01:00
git push
git push --tags