File: Makefile

package info (click to toggle)
monkeysphere 0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 844 kB
  • sloc: sh: 1,483; perl: 1,007; ansic: 671; makefile: 92
file content (121 lines) | stat: -rwxr-xr-x 5,429 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/make -f

# Makefile for monkeysphere

# © 2008-2019 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
# Licensed under GPL v3 or later

MONKEYSPHERE_VERSION = `head -n1 Changelog | sed 's/.*(\([^-]*\)).*/\1/'`

# these defaults are for debian.  porters should probably adjust them
# before calling make install
ETCPREFIX ?= 
ETCSUFFIX ?= 
PREFIX ?= /usr
MANPREFIX ?= $(PREFIX)/share/man
LOCALSTATEDIR ?= /var/lib

CFLAGS += $(shell libassuan-config --cflags)
CFLAGS += $(shell libgcrypt-config --cflags)
CFLAGS += --pedantic -Wall -Werror -std=c99
LIBS += $(shell libassuan-config --libs)
LIBS += $(shell libgcrypt-config --libs)

REPLACEMENTS = src/monkeysphere src/monkeysphere-host		\
src/monkeysphere-authentication src/share/defaultenv $(wildcard	\
src/transitions/*)

REPLACED_COMPRESSED_MANPAGES = $(addsuffix .gz,$(addprefix replaced/,$(wildcard man/*/*)))

all: src/agent-transfer/agent-transfer $(addprefix replaced/,$(REPLACEMENTS)) $(REPLACED_COMPRESSED_MANPAGES)

src/agent-transfer/agent-transfer: src/agent-transfer/main.c src/agent-transfer/ssh-agent-proto.h
	$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< $(LIBS)

debian-package:
	git buildpackage -uc -us

# don't explicitly depend on the tarball, since our tarball
# (re)generation is not idempotent even when no source changes.
freebsd-distinfo: 
	./util/build-freebsd-distinfo

macports-portfile:
	./util/build-macports-portfile

clean:
	rm -f src/agent-transfer/agent-transfer
	rm -rf replaced/
	# clean up old monkeysphere packages lying around as well.
	rm -f monkeysphere_*

replaced/%: %
	mkdir -p $(dir $@)
	sed < $< > $@ \
	-e 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' \
	-e 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' \
	-e 's:__SYSDATADIR_PREFIX__:$(LOCALSTATEDIR):'

replaced/%.gz: replaced/%
	gzip -f -n $<

# this target is to be called from the tarball, not from the git
# working dir!
install: all installman
	mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/sbin
	mkdir -p $(DESTDIR)$(PREFIX)/share/monkeysphere/m $(DESTDIR)$(PREFIX)/share/monkeysphere/mh $(DESTDIR)$(PREFIX)/share/monkeysphere/ma $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
	mkdir -p $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
	mkdir -p $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
	printf "Monkeysphere %s\n" $(MONKEYSPHERE_VERSION) > $(DESTDIR)$(PREFIX)/share/monkeysphere/VERSION
	install replaced/src/monkeysphere $(DESTDIR)$(PREFIX)/bin
	install replaced/src/monkeysphere-host $(DESTDIR)$(PREFIX)/sbin
	install replaced/src/monkeysphere-authentication $(DESTDIR)$(PREFIX)/sbin
	install src/monkeysphere-authentication-keys-for-user $(DESTDIR)$(PREFIX)/share/monkeysphere
	install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
	install -m 0644 replaced/src/share/defaultenv $(DESTDIR)$(PREFIX)/share/monkeysphere
	install -m 0755 src/share/checkperms $(DESTDIR)$(PREFIX)/share/monkeysphere
	install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
	ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
	ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
	ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2pem
	ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2spki
	install -m 0755 src/agent-transfer/agent-transfer $(DESTDIR)$(PREFIX)/bin
	install -m 0744 replaced/src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
	install -m 0644 src/transitions/README.txt $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
	install -m 0644 src/share/m/* $(DESTDIR)$(PREFIX)/share/monkeysphere/m
	install -m 0644 src/share/mh/* $(DESTDIR)$(PREFIX)/share/monkeysphere/mh
	install -m 0644 src/share/ma/* $(DESTDIR)$(PREFIX)/share/monkeysphere/ma
	install -m 0644 Changelog $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
	install -d $(DESTDIR)$(PREFIX)/share/doc/monkeysphere/examples
	install -m 0644 examples/* $(DESTDIR)$(PREFIX)/share/doc/monkeysphere/examples
	install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
	install -m 0644 etc/monkeysphere-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-host.conf$(ETCSUFFIX)
	install -m 0644 etc/monkeysphere-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-authentication.conf$(ETCSUFFIX)

installman: $(REPLACED_COMPRESSED_MANPAGES)
	mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
	install replaced/man/man1/* $(DESTDIR)$(MANPREFIX)/man1
	install replaced/man/man7/* $(DESTDIR)$(MANPREFIX)/man7
	install replaced/man/man8/* $(DESTDIR)$(MANPREFIX)/man8
	ln -sf openpgp2ssh.1.gz $(DESTDIR)$(MANPREFIX)/man1/openpgp2pem.1.gz
	ln -sf openpgp2ssh.1.gz $(DESTDIR)$(MANPREFIX)/man1/openpgp2spki.1.gz

# this target depends on you having the monkeysphere-docs
# repo checked out as a peer of your monkeysphere repo.
releasenote:
	../monkeysphere-docs/utils/build-releasenote

test: test-keytrans test-basic test-ed25519

check: test

test-basic: src/agent-transfer/agent-transfer
	MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/basic

test-ed25519: src/agent-transfer/agent-transfer
	MONKEYSPHERE_TEST_NO_EXAMINE=true MONKEYSPHERE_TEST_USE_ED25519=true ./tests/basic

test-keytrans: src/agent-transfer/agent-transfer
	MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans

.PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote test check