-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
83 lines (72 loc) · 3.07 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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:
mkdir -p ./packaging/
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 ./packaging/; \
done
rpm:
mkdir -p ./packaging/
git submodule init; git submodule update
for v in rocky8 rocky9 sle15sp6 tumbleweed rawhide fedora41; do \
echo "Building $$v RPM packages"; \
$(DOCKER) build -t himmelblau-$$v-build -f images/rpm/Dockerfile.$$v .; \
$(DOCKER) run --rm -it -v ./:/himmelblau himmelblau-$$v-build; \
for file in ./target/generate-rpm/*.rpm; do \
mv "$$file" "$${file%.rpm}-$$v.rpm"; \
done; \
mv ./target/generate-rpm/*.rpm ./packaging/; \
done
package: deb rpm
ls ./packaging/