Fix manpage installation

gzip manpage properly and update mandb after its installation.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga 2025-01-27 22:19:10 +01:00
parent 1934e801e7
commit 0f6c122e17
2 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2012-2022 Intel Corporation # Copyright(c) 2012-2022 Intel Corporation
# Copyright(c) 2025 Huawei Technologies
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -121,7 +122,7 @@ LDFLAGS = -z noexecstack -z relro -z now -pie -pthread -lm
# Targets # Targets
# #
all: sync all: sync manpage
$(MAKE) build $(MAKE) build
build: $(TARGETS) build: $(TARGETS)
@ -156,10 +157,14 @@ endif
-include $(addprefix $(OBJDIR),$(OBJS:.o=.d)) -include $(addprefix $(OBJDIR),$(OBJS:.o=.d))
manpage:
gzip -k $(TARGET).8
clean: clean:
@echo " CLEAN " @echo " CLEAN "
@rm -f *.a $(TARGETS) @rm -f *.a $(TARGETS)
@rm -f $(shell find -name \*.d) $(shell find -name \*.o) @rm -f $(shell find -name \*.d) $(shell find -name \*.o)
@rm -f $(TARGET).8.gz
distclean: clean distclean: clean
@ -168,11 +173,12 @@ install: install_files
install_files: install_files:
@echo "Installing casadm" @echo "Installing casadm"
@install -m 755 -D $(TARGET) $(DESTDIR)$(BINARY_PATH)/$(TARGET) @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: uninstall:
@echo "Uninstalling casadm" @echo "Uninstalling casadm"
$(call remove-file,$(DESTDIR)$(BINARY_PATH)/$(TARGET)) $(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 .PHONY: clean distclean all sync build install uninstall

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2012-2022 Intel Corporation # Copyright(c) 2012-2022 Intel Corporation
# Copyright(c) 2025 Huawei Technologies
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -20,7 +21,11 @@ else
endif endif
# Just a placeholder when running make from parent dir without install/uninstall arg # 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 install: install_files
ifeq (, $(PYTHON3)) 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)/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 $(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 $(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 644 -D opencas.py $(DESTDIR)$(CASCTL_DIR)/opencas.py
@install -m 755 -D casctl $(DESTDIR)$(CASCTL_DIR)/casctl @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-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 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-shutdown.service $(DESTDIR)$(SYSTEMD_DIR)/open-cas-shutdown.service
@install -m 644 -D open-cas.service $(DESTDIR)$(SYSTEMD_DIR)/open-cas.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 @install -m 755 -D open-cas.shutdown $(DESTDIR)$(SYSTEMD_DIR)/../system-shutdown/open-cas.shutdown
@mandb -q
endif endif
uninstall: uninstall:
@ -66,7 +72,7 @@ uninstall:
$(call remove-directory,$(DESTDIR)/etc/opencas) $(call remove-directory,$(DESTDIR)/etc/opencas)
$(call remove-file,$(DESTDIR)/var/lib/opencas/cas_version) $(call remove-file,$(DESTDIR)/var/lib/opencas/cas_version)
$(call remove-directory,$(DESTDIR)/var/lib/opencas) $(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)/opencas.py)
$(call remove-file,$(DESTDIR)$(CASCTL_DIR)/casctl) $(call remove-file,$(DESTDIR)$(CASCTL_DIR)/casctl)
@ -77,7 +83,7 @@ uninstall:
$(call remove-file,$(DESTDIR)/sbin/casctl) $(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-load.rules)
$(call remove-file,$(DESTDIR)$(UDEVRULES_DIR)/60-persistent-storage-cas.rules) $(call remove-file,$(DESTDIR)$(UDEVRULES_DIR)/60-persistent-storage-cas.rules)