-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
67 lines (59 loc) · 2.63 KB
/
Makefile
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
all:
git submodule init; git submodule update
cargo build --release
build-tests:
$(MAKE) -C tests
test: build-tests
$(MAKE) -C tests test
clean:
cargo clean
$(MAKE) -C tests clean
PLATFORM := $(shell grep '^ID=' /etc/os-release | awk -F= '{ print $$2 }' | tr -d '"')
install-opensuse:
install -D -d -m 0755 /etc/himmelblau
install -m 0644 ./src/config/himmelblau.conf.example /etc/himmelblau/himmelblau.conf
install -m 0755 ./target/release/libnss_himmelblau.so /usr/lib64/libnss_himmelblau.so.2
install -m 0755 ./target/release/libpam_himmelblau.so /usr/lib64/security/pam_himmelblau.so
install -m 0755 ./target/release/himmelblaud /usr/sbin
install -m 0755 ./target/release/himmelblaud_tasks /usr/sbin
install -m 0755 ./target/release/aad-tool /usr/bin
install -m 0644 ./platform/opensuse/himmelblaud.service /usr/lib/systemd/system
install -m 0644 ./platform/opensuse/himmelblaud-tasks.service /usr/lib/systemd/system
install-ubuntu:
install -D -d -m 0755 /etc/himmelblau
install -m 0644 ./src/config/himmelblau.conf.example /etc/himmelblau/himmelblau.conf
install -m 0755 ./target/release/libnss_himmelblau.so /usr/lib/x86_64-linux-gnu/libnss_himmelblau.so.2
install -m 0755 ./target/release/libpam_himmelblau.so /usr/lib/x86_64-linux-gnu/security/pam_himmelblau.so
if [ -d "/usr/lib/security" ]; then \
ln -s /usr/lib/x86_64-linux-gnu/security/pam_himmelblau.so /usr/lib/security/pam_himmelblau.so; \
fi
install -m 0644 ./platform/debian/pam-config /usr/share/pam-configs/himmelblau
install -m 0755 ./target/release/himmelblaud /usr/sbin
install -m 0755 ./target/release/himmelblaud_tasks /usr/sbin
install -m 0755 ./target/release/aad-tool /usr/bin
install -m 0644 ./platform/debian/himmelblaud.service /etc/systemd/system
install -m 0644 ./platform/debian/himmelblaud-tasks.service /etc/systemd/system
if [ -d "/etc/ssh/sshd_config.d" ]; then \
install -m 0644 ./platform/debian/sshd_config /etc/ssh/sshd_config.d/himmelblau.conf; \
fi
install:
ifeq ($(PLATFORM), debian)
$(MAKE) install-ubuntu
else ifeq ($(PLATFORM), ubuntu)
$(MAKE) install-ubuntu
else ifneq (,$(findstring opensuse,$(PLATFORM)))
$(MAKE) install-opensuse
else
$(error "Unsupported platform: $(PLATFORM)")
endif
DOCKER := $(shell command -v podman || command -v docker)
deb:
git submodule init; git submodule update
for v in 22.04 24.04; do \
echo "Building Ubuntu $$v packages"; \
$(DOCKER) build -t himmelblau-ubuntu$$v-build -f images/ubuntu/Dockerfile.$$v .; \
$(DOCKER) run --rm -it -v ./:/himmelblau himmelblau-ubuntu$$v-build; \
mv ./target/debian/*.deb ./target/release/; \
done
mv ./target/release/*.deb ./target/debian/
ls ./target/debian/*.deb