2009-11-20 08:14:27 +01:00
|
|
|
# Written by Simon Josefsson <simon@josefsson.org>.
|
2013-02-04 16:53:27 +01:00
|
|
|
# Copyright (c) 2009-2013 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.
|
|
|
|
|
2013-04-17 19:01:50 +02:00
|
|
|
VERSION = 1.14
|
2009-12-15 20:54:38 +01:00
|
|
|
PACKAGE = yubikey-ksm
|
|
|
|
CODE = .htaccess Makefile NEWS ykksm-config.php ykksm-db.sql \
|
2012-12-18 11:28:33 +01:00
|
|
|
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
|
2012-12-18 11:28:33 +01:00
|
|
|
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
|
|
|
|
2013-01-28 12:11:23 +01:00
|
|
|
etcprefix = /etc/yubico/ksm
|
2009-12-14 20:16:47 +01:00
|
|
|
binprefix = /usr/bin
|
2013-01-28 12:11:23 +01:00
|
|
|
phpprefix = /usr/share/yubikey-ksm
|
|
|
|
docprefix = /usr/share/doc/yubikey-ksm
|
2013-01-31 15:14:55 +01:00
|
|
|
manprefix = /usr/share/man/man1
|
2013-04-20 20:37:26 +02:00
|
|
|
wwwgroup = apache
|
2009-12-14 20:16:47 +01:00
|
|
|
|
2012-12-20 15:20:54 +01:00
|
|
|
install: $(MANS)
|
2012-12-19 14:45:13 +01:00
|
|
|
install -D --mode 640 .htaccess $(DESTDIR)$(phpprefix)/.htaccess
|
|
|
|
install -D --mode 640 ykksm-decrypt.php $(DESTDIR)$(phpprefix)/ykksm-decrypt.php
|
|
|
|
install -D --mode 640 ykksm-utils.php $(DESTDIR)$(phpprefix)/ykksm-utils.php
|
|
|
|
install -D ykksm-gen-keys $(DESTDIR)$(binprefix)/ykksm-gen-keys
|
|
|
|
install -D ykksm-import $(DESTDIR)$(binprefix)/ykksm-import
|
|
|
|
install -D ykksm-export $(DESTDIR)$(binprefix)/ykksm-export
|
|
|
|
install -D ykksm-checksum $(DESTDIR)$(binprefix)/ykksm-checksum
|
|
|
|
install -D --backup --mode 640 --group $(wwwgroup) ykksm-config.php $(DESTDIR)$(etcprefix)/ykksm-config.php
|
2013-01-30 11:39:07 +01:00
|
|
|
install -D ykksm-gen-keys.1 $(DESTDIR)$(manprefix)/ykksm-gen-keys.1
|
|
|
|
install -D ykksm-import.1 $(DESTDIR)$(manprefix)/ykksm-import.1
|
|
|
|
install -D ykksm-export.1 $(DESTDIR)$(manprefix)/ykksm-export.1
|
|
|
|
install -D ykksm-checksum.1 $(DESTDIR)$(manprefix)/ykksm-checksum.1
|
2012-12-19 14:45:13 +01:00
|
|
|
install -D ykksm-db.sql $(DESTDIR)$(docprefix)/ykksm-db.sql
|
|
|
|
install -D Makefile $(DESTDIR)$(docprefix)/ykksm.mk
|
|
|
|
install -D $(DOCS) $(DESTDIR)$(docprefix)/
|
2009-12-14 20:16:47 +01:00
|
|
|
|
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
|
|
|
|
2012-12-18 11:28:33 +01:00
|
|
|
$(PACKAGE)-$(VERSION).tgz: $(FILES) $(MANS)
|
2013-04-17 17:49:18 +02:00
|
|
|
git submodule init
|
|
|
|
git submodule update
|
2009-12-15 20:52:37 +01:00
|
|
|
mkdir $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION)/doc
|
|
|
|
cp $(CODE) $(PACKAGE)-$(VERSION)/
|
2012-12-18 11:28:33 +01:00
|
|
|
cp $(MANS) $(PACKAGE)-$(VERSION)/
|
2009-12-15 20:52:37 +01:00
|
|
|
cp $(DOCS) $(PACKAGE)-$(VERSION)/doc/
|
2013-01-21 11:31:08 +01:00
|
|
|
git2cl > $(PACKAGE)-$(VERSION)/ChangeLog
|
2009-12-15 20:52:37 +01:00
|
|
|
tar cfz $(PACKAGE)-$(VERSION).tgz $(PACKAGE)-$(VERSION)
|
|
|
|
rm -rf $(PACKAGE)-$(VERSION)
|
|
|
|
|
|
|
|
dist: $(PACKAGE)-$(VERSION).tgz
|
|
|
|
|
2012-12-20 15:20:54 +01:00
|
|
|
distclean: clean
|
|
|
|
rm -f *.1
|
2012-12-20 14:39:56 +01:00
|
|
|
|
|
|
|
clean:
|
2009-12-15 20:52:37 +01:00
|
|
|
rm -f *~
|
|
|
|
rm -rf $(PACKAGE)-$(VERSION)
|
|
|
|
|
2012-12-18 11:28:33 +01:00
|
|
|
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: %
|
2013-04-20 20:37:26 +02:00
|
|
|
help2man -N --name=$(NAME_$*) ./$* > $@
|
2012-12-18 11:28:33 +01:00
|
|
|
|
|
|
|
man: $(MANS)
|
|
|
|
|
2009-12-15 20:52:37 +01:00
|
|
|
release: dist
|
2012-12-18 15:07:12 +01:00
|
|
|
@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
|
2013-01-30 16:52:16 +01:00
|
|
|
@head -1 NEWS | grep -q "Version $(VERSION) (released `date -I`)" || \
|
|
|
|
(echo 'error: You need to update date/version in NEWS'; exit 1)
|
2013-04-17 17:52:12 +02:00
|
|
|
@if test ! -d "$(YUBICO_GITHUB_REPO)"; then \
|
2013-04-10 09:49:12 +02:00
|
|
|
echo "yubico.github.com repo not found!"; \
|
|
|
|
echo "Make sure that YUBICO_GITHUB_REPO is set"; \
|
|
|
|
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
|
2013-01-30 16:52:16 +01:00
|
|
|
git tag -u $(KEYID) -m "$(PACKAGE)-$(VERSION)" $(PACKAGE)-$(VERSION)
|
2013-04-17 17:52:12 +02:00
|
|
|
@echo "Release created and tagged, remember to git push && git push --tags"
|
2013-04-10 09:49:12 +02:00
|
|
|
$(YUBICO_GITHUB_REPO)/publish $(PROJECT) $(VERSION) $(PACKAGE)-$(VERSION).tgz*
|