You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.8 KiB

6 years ago
1 month ago
1 month ago
1 month ago
6 years ago
6 years ago
6 years ago
6 years ago
1 month ago
  1. PREFIX = /usr
  2. EXEC_PREFIX = $(PREFIX)
  3. BINDIR = $(EXEC_PREFIX)/bin
  4. DATAROOTDIR = $(PREFIX)/share
  5. DATADIR = $(DATAROOTDIR)
  6. MAN5DIR = $(DATADIR)/man/man5
  7. MAN8DIR = $(DATADIR)/man/man8
  8. SYSCONFDIR = /etc
  9. VARLIBDIR = /var/lib
  10. RUNSTATEDIR = /run
  11. TARGET_DIR = ./target/$(TARGET)/release
  12. MAN_SRC_DIR = ./man/en
  13. MAN_DST_DIR = $(TARGET_DIR)/man
  14. FEATURES = openssl_dyn
  15. all: man_dir
  16. if test -n "$(TARGET)"; then \
  17. VARLIBDIR="$(VARLIBDIR)" SYSCONFDIR="$(SYSCONFDIR)" RUNSTATEDIR="$(RUNSTATEDIR)" cargo build --release --no-default-features --features "$(FEATURES)" --target "$(TARGET)"; \
  18. else \
  19. VARLIBDIR="$(VARLIBDIR)" SYSCONFDIR="$(SYSCONFDIR)" RUNSTATEDIR="$(RUNSTATEDIR)" cargo build --release --no-default-features --features "$(FEATURES)"; \
  20. fi
  21. gzip <"$(MAN_SRC_DIR)/acmed.8" >"$(MAN_DST_DIR)/acmed.8.gz"
  22. gzip <"$(MAN_SRC_DIR)/acmed.toml.5" >"$(MAN_DST_DIR)/acmed.toml.5.gz"
  23. man_dir:
  24. @mkdir -p $(MAN_DST_DIR)
  25. install:
  26. install -d -m 0755 $(DESTDIR)$(BINDIR)
  27. install -d -m 0755 $(DESTDIR)$(MAN8DIR)
  28. if test -f "$(TARGET_DIR)/acmed"; then \
  29. install -d -m 0755 $(DESTDIR)$(MAN5DIR); \
  30. install -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/acmed; \
  31. install -d -m 0755 $(DESTDIR)$(VARLIBDIR)/acmed/certs; \
  32. install -d -m 0700 $(DESTDIR)$(VARLIBDIR)/acmed/accounts; \
  33. install -m 0755 $(TARGET_DIR)/acmed $(DESTDIR)$(BINDIR)/acmed; \
  34. install -m 0644 $(TARGET_DIR)/man/acmed.8.gz $(DESTDIR)$(MAN8DIR)/acmed.8.gz; \
  35. install -m 0644 $(TARGET_DIR)/man/acmed.toml.5.gz $(DESTDIR)$(MAN5DIR)/acmed.toml.5.gz; \
  36. install -m 0644 acmed/config/acmed.toml $(DESTDIR)$(SYSCONFDIR)/acmed/acmed.toml; \
  37. install -m 0644 acmed/config/default_hooks.toml $(DESTDIR)$(SYSCONFDIR)/acmed/default_hooks.toml; \
  38. install -m 0644 acmed/config/letsencrypt.toml $(DESTDIR)$(SYSCONFDIR)/acmed/letsencrypt.toml; \
  39. fi
  40. clean:
  41. cargo clean
  42. .PHONY: all man_dir install clean