Linux-rt-users archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] make: Make man page compression configurable
@ 2020-01-30  8:29 Kurt Kanzenbach
  2020-01-30 19:45 ` John Kacur
  0 siblings, 1 reply; 2+ messages in thread
From: Kurt Kanzenbach @ 2020-01-30  8:29 UTC (permalink / raw)
  To: John Kacur, Clark Williams; +Cc: rt-users, Kurt Kanzenbach

Currently the man pages are unconditionally gzip compressed. However, users
might want to use something else such as bzip2 or none.

When using package management systems it makes sense to use no compression at
all, as the package system might chose the appropriate one. Therefore, introduce
MAN_COMPRESSION. This variable is handling how the compression is done. Default
is gzip.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 Makefile | 60 ++++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
index e2142ba3f4e9..ecbd5b1cb98b 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,32 @@ LDFLAGS ?=
 
 PYLIB  ?= $(shell python3 -c 'import distutils.sysconfig;  print (distutils.sysconfig.get_python_lib())')
 
+MANPAGES = src/cyclictest/cyclictest.8 \
+	   src/pi_tests/pi_stress.8 \
+	   src/ptsematest/ptsematest.8 \
+	   src/rt-migrate-test/rt-migrate-test.8 \
+	   src/sigwaittest/sigwaittest.8 \
+	   src/svsematest/svsematest.8 \
+	   src/pmqtest/pmqtest.8 \
+	   src/hackbench/hackbench.8 \
+	   src/signaltest/signaltest.8 \
+	   src/pi_tests/pip_stress.8 \
+	   src/queuelat/queuelat.8 \
+	   src/sched_deadline/deadline_test.8 \
+	   src/ssdd/ssdd.8 \
+	   src/sched_deadline/cyclicdeadline.8
+
+ifdef PYLIB
+	MANPAGES += src/hwlatdetect/hwlatdetect.8
+endif
+
+MAN_COMPRESSION ?= gzip
+ifeq ($(MAN_COMPRESSION),gzip)
+	MANPAGES := $(MANPAGES:.8=.8.gz)
+else ifeq ($(MAN_COMPRESSION),bzip2)
+	MANPAGES := $(MANPAGES:.8=.8.bz2)
+endif
+
 ifndef DEBUG
 	CFLAGS	+= -O2 -g
 else
@@ -150,11 +176,17 @@ queuelat: $(OBJDIR)/queuelat.o $(OBJDIR)/librttest.a
 ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
 
+%.8.gz: %.8
+	gzip -c $< > $@
+
+%.8.bz2: %.8
+	bzip2 -c $< > $@
+
 LIBOBJS =$(addprefix $(OBJDIR)/,error.o rt-get_cpu.o rt-sched.o rt-utils.o)
 $(OBJDIR)/librttest.a: $(LIBOBJS)
 	$(AR) rcs $@ $^
 
-CLEANUP  = $(TARGETS) *.o .depend *.*~ *.orig *.rej *.d *.a
+CLEANUP  = $(TARGETS) *.o .depend *.*~ *.orig *.rej *.d *.a *.8.gz *.8.bz2
 CLEANUP += $(if $(wildcard .git), ChangeLog)
 
 .PHONY: clean
@@ -175,36 +207,26 @@ rebuild:
 	$(MAKE) all
 
 .PHONY: install
-install: all install_hwlatdetect
-	mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8"
+install: all install_manpages install_hwlatdetect
+	mkdir -p "$(DESTDIR)$(bindir)"
 	cp $(TARGETS) "$(DESTDIR)$(bindir)"
 	install src/queuelat/get_cpuinfo_mhz.sh "$(DESTDIR)$(bindir)"
 	install src/queuelat/determine_maximum_mpps.sh "${DESTDIR}${bindir}"
-	gzip -c src/cyclictest/cyclictest.8 >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
-	gzip -c src/pi_tests/pi_stress.8 >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
-	gzip -c src/ptsematest/ptsematest.8 >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
-	gzip -c src/rt-migrate-test/rt-migrate-test.8 >"$(DESTDIR)$(mandir)/man8/rt-migrate-test.8.gz"
-	gzip -c src/sigwaittest/sigwaittest.8 >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
-	gzip -c src/svsematest/svsematest.8 >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
-	gzip -c src/pmqtest/pmqtest.8 >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
-	gzip -c src/hackbench/hackbench.8 >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
-	gzip -c src/signaltest/signaltest.8 >"$(DESTDIR)$(mandir)/man8/signaltest.8.gz"
-	gzip -c src/pi_tests/pip_stress.8 >"$(DESTDIR)$(mandir)/man8/pip_stress.8.gz"
-	gzip -c src/queuelat/queuelat.8 >"$(DESTDIR)$(mandir)/man8/queuelat.8.gz"
-	gzip -c src/sched_deadline/deadline_test.8 >"$(DESTDIR)$(mandir)/man8/deadline_test.8.gz"
-	gzip -c src/ssdd/ssdd.8 >"$(DESTDIR)$(mandir)/man8/ssdd.8.gz"
-	gzip -c src/sched_deadline/cyclicdeadline.8 >"$(DESTDIR)$(mandir)/man8/cyclicdeadline.8.gz"
 
 .PHONY: install_hwlatdetect
 install_hwlatdetect: hwlatdetect
 	if test -n "$(PYLIB)" ; then \
-		mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
+		mkdir -p "$(DESTDIR)$(bindir)" ; \
 		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
 		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
 		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-		gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
 	fi
 
+.PHONY: install_manpages
+install_manpages: $(MANPAGES)
+	mkdir -p "$(DESTDIR)$(mandir)/man8"
+	cp $(MANPAGES) "$(DESTDIR)$(mandir)/man8"
+
 .PHONY: tarball
 tarball:
 	git archive --worktree-attributes --prefix=rt-tests-${VERSION}/ -o rt-tests-${VERSION}.tar v${VERSION}
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] make: Make man page compression configurable
  2020-01-30  8:29 [PATCH] make: Make man page compression configurable Kurt Kanzenbach
@ 2020-01-30 19:45 ` John Kacur
  0 siblings, 0 replies; 2+ messages in thread
From: John Kacur @ 2020-01-30 19:45 UTC (permalink / raw)
  To: Kurt Kanzenbach; +Cc: Clark Williams, rt-users



On Thu, 30 Jan 2020, Kurt Kanzenbach wrote:

> Currently the man pages are unconditionally gzip compressed. However, users
> might want to use something else such as bzip2 or none.
> 
> When using package management systems it makes sense to use no compression at
> all, as the package system might chose the appropriate one. Therefore, introduce
> MAN_COMPRESSION. This variable is handling how the compression is done. Default
> is gzip.
> 
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
> ---
>  Makefile | 60 ++++++++++++++++++++++++++++++++++++++------------------
>  1 file changed, 41 insertions(+), 19 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index e2142ba3f4e9..ecbd5b1cb98b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -34,6 +34,32 @@ LDFLAGS ?=
>  
>  PYLIB  ?= $(shell python3 -c 'import distutils.sysconfig;  print (distutils.sysconfig.get_python_lib())')
>  
> +MANPAGES = src/cyclictest/cyclictest.8 \
> +	   src/pi_tests/pi_stress.8 \
> +	   src/ptsematest/ptsematest.8 \
> +	   src/rt-migrate-test/rt-migrate-test.8 \
> +	   src/sigwaittest/sigwaittest.8 \
> +	   src/svsematest/svsematest.8 \
> +	   src/pmqtest/pmqtest.8 \
> +	   src/hackbench/hackbench.8 \
> +	   src/signaltest/signaltest.8 \
> +	   src/pi_tests/pip_stress.8 \
> +	   src/queuelat/queuelat.8 \
> +	   src/sched_deadline/deadline_test.8 \
> +	   src/ssdd/ssdd.8 \
> +	   src/sched_deadline/cyclicdeadline.8
> +
> +ifdef PYLIB
> +	MANPAGES += src/hwlatdetect/hwlatdetect.8
> +endif
> +
> +MAN_COMPRESSION ?= gzip
> +ifeq ($(MAN_COMPRESSION),gzip)
> +	MANPAGES := $(MANPAGES:.8=.8.gz)
> +else ifeq ($(MAN_COMPRESSION),bzip2)
> +	MANPAGES := $(MANPAGES:.8=.8.bz2)
> +endif
> +
>  ifndef DEBUG
>  	CFLAGS	+= -O2 -g
>  else
> @@ -150,11 +176,17 @@ queuelat: $(OBJDIR)/queuelat.o $(OBJDIR)/librttest.a
>  ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
>  	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
>  
> +%.8.gz: %.8
> +	gzip -c $< > $@
> +
> +%.8.bz2: %.8
> +	bzip2 -c $< > $@
> +
>  LIBOBJS =$(addprefix $(OBJDIR)/,error.o rt-get_cpu.o rt-sched.o rt-utils.o)
>  $(OBJDIR)/librttest.a: $(LIBOBJS)
>  	$(AR) rcs $@ $^
>  
> -CLEANUP  = $(TARGETS) *.o .depend *.*~ *.orig *.rej *.d *.a
> +CLEANUP  = $(TARGETS) *.o .depend *.*~ *.orig *.rej *.d *.a *.8.gz *.8.bz2
>  CLEANUP += $(if $(wildcard .git), ChangeLog)
>  
>  .PHONY: clean
> @@ -175,36 +207,26 @@ rebuild:
>  	$(MAKE) all
>  
>  .PHONY: install
> -install: all install_hwlatdetect
> -	mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8"
> +install: all install_manpages install_hwlatdetect
> +	mkdir -p "$(DESTDIR)$(bindir)"
>  	cp $(TARGETS) "$(DESTDIR)$(bindir)"
>  	install src/queuelat/get_cpuinfo_mhz.sh "$(DESTDIR)$(bindir)"
>  	install src/queuelat/determine_maximum_mpps.sh "${DESTDIR}${bindir}"
> -	gzip -c src/cyclictest/cyclictest.8 >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
> -	gzip -c src/pi_tests/pi_stress.8 >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
> -	gzip -c src/ptsematest/ptsematest.8 >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
> -	gzip -c src/rt-migrate-test/rt-migrate-test.8 >"$(DESTDIR)$(mandir)/man8/rt-migrate-test.8.gz"
> -	gzip -c src/sigwaittest/sigwaittest.8 >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
> -	gzip -c src/svsematest/svsematest.8 >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
> -	gzip -c src/pmqtest/pmqtest.8 >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
> -	gzip -c src/hackbench/hackbench.8 >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
> -	gzip -c src/signaltest/signaltest.8 >"$(DESTDIR)$(mandir)/man8/signaltest.8.gz"
> -	gzip -c src/pi_tests/pip_stress.8 >"$(DESTDIR)$(mandir)/man8/pip_stress.8.gz"
> -	gzip -c src/queuelat/queuelat.8 >"$(DESTDIR)$(mandir)/man8/queuelat.8.gz"
> -	gzip -c src/sched_deadline/deadline_test.8 >"$(DESTDIR)$(mandir)/man8/deadline_test.8.gz"
> -	gzip -c src/ssdd/ssdd.8 >"$(DESTDIR)$(mandir)/man8/ssdd.8.gz"
> -	gzip -c src/sched_deadline/cyclicdeadline.8 >"$(DESTDIR)$(mandir)/man8/cyclicdeadline.8.gz"
>  
>  .PHONY: install_hwlatdetect
>  install_hwlatdetect: hwlatdetect
>  	if test -n "$(PYLIB)" ; then \
> -		mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
> +		mkdir -p "$(DESTDIR)$(bindir)" ; \
>  		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
>  		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
>  		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> -		gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
>  	fi
>  
> +.PHONY: install_manpages
> +install_manpages: $(MANPAGES)
> +	mkdir -p "$(DESTDIR)$(mandir)/man8"
> +	cp $(MANPAGES) "$(DESTDIR)$(mandir)/man8"
> +
>  .PHONY: tarball
>  tarball:
>  	git archive --worktree-attributes --prefix=rt-tests-${VERSION}/ -o rt-tests-${VERSION}.tar v${VERSION}
> -- 
> 2.20.1
> 
> 

Thanks

Signed-off-by: John Kacur <jkacur@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30  8:29 [PATCH] make: Make man page compression configurable Kurt Kanzenbach
2020-01-30 19:45 ` John Kacur

Linux-rt-users archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git