Merge pull request #1607 from robertbaldyga/fix-manpage

Fix manpage installation
This commit is contained in:
Robert Baldyga 2025-02-06 11:32:53 +01:00 committed by GitHub
commit c4b862a3e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 8 deletions

View File

@ -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

View File

@ -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)