From 0f6c122e17408bd8a0d4dc81c8c2ee1607788f2e Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Mon, 27 Jan 2025 22:19:10 +0100 Subject: [PATCH] Fix manpage installation gzip manpage properly and update mandb after its installation. Signed-off-by: Robert Baldyga --- casadm/Makefile | 12 +++++++++--- utils/Makefile | 16 +++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/casadm/Makefile b/casadm/Makefile index d010125..a7d77b9 100644 --- a/casadm/Makefile +++ b/casadm/Makefile @@ -1,5 +1,6 @@ # # Copyright(c) 2012-2022 Intel Corporation +# Copyright(c) 2025 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -121,7 +122,7 @@ LDFLAGS = -z noexecstack -z relro -z now -pie -pthread -lm # Targets # -all: sync +all: sync manpage $(MAKE) build build: $(TARGETS) @@ -156,10 +157,14 @@ endif -include $(addprefix $(OBJDIR),$(OBJS:.o=.d)) +manpage: + gzip -k $(TARGET).8 + clean: @echo " CLEAN " @rm -f *.a $(TARGETS) @rm -f $(shell find -name \*.d) $(shell find -name \*.o) + @rm -f $(TARGET).8.gz distclean: clean @@ -168,11 +173,12 @@ install: install_files install_files: @echo "Installing casadm" @install -m 755 -D $(TARGET) $(DESTDIR)$(BINARY_PATH)/$(TARGET) - @install -m 644 -D $(TARGET).8 $(DESTDIR)/usr/share/man/man8/$(TARGET).8 + @install -m 644 -D $(TARGET).8.gz $(DESTDIR)/usr/share/man/man8/$(TARGET).8.gz + @mandb -q uninstall: @echo "Uninstalling casadm" $(call remove-file,$(DESTDIR)$(BINARY_PATH)/$(TARGET)) - $(call remove-file,$(DESTDIR)/usr/share/man/man8/$(TARGET).8) + $(call remove-file,$(DESTDIR)/usr/share/man/man8/$(TARGET).8.gz) .PHONY: clean distclean all sync build install uninstall diff --git a/utils/Makefile b/utils/Makefile index 5a36c1b..b1f445f 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,5 +1,6 @@ # # Copyright(c) 2012-2022 Intel Corporation +# Copyright(c) 2025 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -20,7 +21,11 @@ else endif # Just a placeholder when running make from parent dir without install/uninstall arg -all: ; +all: manpage + +manpage: + gzip -k opencas.conf.5 + gzip -k casctl.8 install: install_files ifeq (, $(PYTHON3)) @@ -37,7 +42,7 @@ install_files: @install -m 644 -D $(UTILS_DIR)/opencas.conf $(DESTDIR)/etc/opencas/opencas.conf @install -m 644 -D $(UTILS_DIR)/ioclass-config.csv $(DESTDIR)/etc/opencas/ioclass-config.csv @install -m 644 -D $(METADATA_DIR)/cas_version $(DESTDIR)/var/lib/opencas/cas_version - @install -m 644 -D $(UTILS_DIR)/opencas.conf.5 $(DESTDIR)/usr/share/man/man5/opencas.conf.5 + @install -m 644 -D opencas.conf.5.gz $(DESTDIR)/usr/share/man/man5/opencas.conf.5.gz @install -m 644 -D opencas.py $(DESTDIR)$(CASCTL_DIR)/opencas.py @install -m 755 -D casctl $(DESTDIR)$(CASCTL_DIR)/casctl @@ -51,11 +56,12 @@ install_files: @install -m 644 -D 60-persistent-storage-cas-load.rules $(DESTDIR)$(UDEVRULES_DIR)/60-persistent-storage-cas-load.rules @install -m 644 -D 60-persistent-storage-cas.rules $(DESTDIR)$(UDEVRULES_DIR)/60-persistent-storage-cas.rules - @install -m 644 -D casctl.8 $(DESTDIR)/usr/share/man/man8/casctl.8 + @install -m 644 -D casctl.8.gz $(DESTDIR)/usr/share/man/man8/casctl.8.gz @install -m 644 -D open-cas-shutdown.service $(DESTDIR)$(SYSTEMD_DIR)/open-cas-shutdown.service @install -m 644 -D open-cas.service $(DESTDIR)$(SYSTEMD_DIR)/open-cas.service @install -m 755 -D open-cas.shutdown $(DESTDIR)$(SYSTEMD_DIR)/../system-shutdown/open-cas.shutdown + @mandb -q endif uninstall: @@ -66,7 +72,7 @@ uninstall: $(call remove-directory,$(DESTDIR)/etc/opencas) $(call remove-file,$(DESTDIR)/var/lib/opencas/cas_version) $(call remove-directory,$(DESTDIR)/var/lib/opencas) - $(call remove-file,$(DESTDIR)/usr/share/man/man5/opencas.conf.5) + $(call remove-file,$(DESTDIR)/usr/share/man/man5/opencas.conf.5.gz) $(call remove-file,$(DESTDIR)$(CASCTL_DIR)/opencas.py) $(call remove-file,$(DESTDIR)$(CASCTL_DIR)/casctl) @@ -77,7 +83,7 @@ uninstall: $(call remove-file,$(DESTDIR)/sbin/casctl) - $(call remove-file,$(DESTDIR)/usr/share/man/man8/casctl.8) + $(call remove-file,$(DESTDIR)/usr/share/man/man8/casctl.8.gz) $(call remove-file,$(DESTDIR)$(UDEVRULES_DIR)/60-persistent-storage-cas-load.rules) $(call remove-file,$(DESTDIR)$(UDEVRULES_DIR)/60-persistent-storage-cas.rules)