1
0
mirror of https://github.com/Yubico/yubikey-ksm.git synced 2024-11-29 00:24:14 +01:00
yubikey-ksm/Makefile

126 lines
4.9 KiB
Makefile
Raw Normal View History

2009-11-20 08:14:27 +01:00
# Written by Simon Josefsson <simon@josefsson.org>.
2014-09-04 13:22:35 +02:00
# Copyright (c) 2009-2014 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.
2014-09-30 22:07:25 +02:00
VERSION = 1.16
2009-12-15 20:54:38 +01:00
PACKAGE = yubikey-ksm
2013-04-22 12:16:06 +02:00
CODE = .htaccess Makefile NEWS README ykksm-config.php ykksm-db.sql \
ykksm-decrypt.php ykksm-export ykksm-gen-keys \
2014-09-30 22:07:25 +02:00
ykksm-import ykksm-utils.php ykksm-checksum \
COPYING BLURB
2014-10-30 09:30:24 +01:00
DOCS = doc/Decryption_Protocol.adoc doc/Design_Goals.adoc \
doc/Generate_Keys.adoc doc/Generate_KSM_Key.adoc \
doc/Import_Keys_To_KSM.adoc doc/Installation.adoc \
doc/Key_Provisioning_Format.adoc doc/Server_Hardening.adoc \
doc/Sync_Monitor.adoc
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'."
2014-10-30 09:30:24 +01:00
@echo "See doc/Installation.adoc for more information"
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
etcprefix = /etc/yubico/ksm
2009-12-14 20:16:47 +01:00
binprefix = /usr/bin
phpprefix = /usr/share/yubikey-ksm
docprefix = /usr/share/doc/yubikey-ksm
2013-01-31 15:14:55 +01:00
manprefix = /usr/share/man/man1
2009-12-15 20:03:59 +01:00
wwwgroup = www-data
2009-12-14 20:16:47 +01:00
install: $(MANS)
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
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
$(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/
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
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)
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=$(VERSION) ./$* > $@
man: $(MANS)
2009-12-15 20:52:37 +01:00
release: dist
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)
2014-09-04 13:22:35 +02:00
@if test ! -d "$(YUBICO_WWW_REPO)"; then \
echo "yubico www repo not found!"; \
echo "Make sure that YUBICO_WWW_REPO is set"; \
2013-04-10 09:49:12 +02:00
exit 1; \
fi
2014-09-19 15:05:18 +02:00
gpg --detach-sign $(PACKAGE)-$(VERSION).tgz
2009-11-20 08:14:27 +01:00
gpg --verify $(PACKAGE)-$(VERSION).tgz.sig
2014-09-19 15:05:18 +02:00
git tag -s -m "$(PACKAGE) $(VERSION)" $(PACKAGE)-$(VERSION)
2014-09-04 13:22:35 +02:00
$(YUBICO_WWW_REPO)/publish $(PROJECT) $(VERSION) $(PACKAGE)-$(VERSION).tgz*
2013-09-18 14:32:52 +02:00
@echo "Release created and tagged, remember to git push && git push --tags"