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.
|
|
|
|
|
2013-01-23 17:44:15 +01:00
|
|
|
VERSION = 1.10
|
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
|
2009-12-15 20:03:59 +01:00
|
|
|
wwwgroup = www-data
|
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)
|
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: %
|
|
|
|
help2man -N --name=$(NAME_$*) --version-string=1 ./$* > $@
|
|
|
|
|
|
|
|
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)
|
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
|
|
|
|
2013-01-30 16:52:16 +01:00
|
|
|
git tag -u $(KEYID) -m "$(PACKAGE)-$(VERSION)" $(PACKAGE)-$(VERSION)
|
2012-12-18 14:43:08 +01:00
|
|
|
git push
|
|
|
|
git push --tags
|
2012-12-19 12:58:52 +01:00
|
|
|
|
|
|
|
git add $(PACKAGE)-$(VERSION).tgz
|
|
|
|
git add $(PACKAGE)-$(VERSION).tgz.sig
|
|
|
|
git stash
|
|
|
|
git checkout gh-pages
|
|
|
|
git stash pop
|
|
|
|
git mv $(PACKAGE)-$(VERSION).tgz releases/
|
|
|
|
git mv $(PACKAGE)-$(VERSION).tgz.sig releases/
|
2013-01-30 16:52:16 +01:00
|
|
|
x=$$(ls -1v releases/*.tgz | awk -F\- '{print $$3}' | sed 's/.tgz//' | paste -sd ',' - | sed 's/,/, /g');sed -i -e "2s/\[.*\]/[$$x]/" releases.html
|
2012-12-19 12:58:52 +01:00
|
|
|
git add releases.html
|
|
|
|
git commit -m "Added tarball for release $(VERSION)"
|
|
|
|
git push
|
|
|
|
git checkout master
|