From bcba0ef4486eb9baec3cd4d17250b91e1c8a7f79 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 31 Dec 2025 18:55:49 +0300 Subject: no longer touch installed files at install-time * hash-bang lines in grosciteco.tes and tedoc.tes are fixed up at build time instead of install-time (via install-exec-hook). * This will hopefully resolve problems with the FreeBSD port, since Poudriere installs the package as non-root but with BINMODE=555. The alternative would have been to set BINMODE=755 in the port which may not be acceptible by the official port committer. Anyway, I decided to go out of the way of any conflicts. See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?format=multiple&id=283601 * On the downside, this will break install-path overrides at install-time (e.g. `make install bindir=...`). --- doc/Makefile.am | 58 +++++++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 35 deletions(-) (limited to 'doc/Makefile.am') diff --git a/doc/Makefile.am b/doc/Makefile.am index 8ac9fad..9c83eee 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -7,21 +7,20 @@ include $(top_srcdir)/bootstrap.am # code. # It generates Troff manpage markup and acts as a Troff # preprocessor to manpage templates. -dist_bin_SCRIPTS = tedoc.tes - -# Name of tedoc.tes after installation, taking --program-prefix -# into account. -TEDOC_INSTALLED = \ - $(bindir)/`echo tedoc.tes | @SED@ '$(transform)'` +bin_SCRIPTS = tedoc.tes +CLEANFILES = tedoc.tes +dist_noinst_SCRIPTS = tedoc.tes.in %.in : %.template tedoc.tes @top_srcdir@/src/*.c - $(SCITECO_FULL) -m -- @srcdir@/tedoc.tes \ + $(SCITECO_FULL) -m -- tedoc.tes \ -C $@ $< @top_srcdir@/src/*.c # grosciteco is a troff postprocessor similar to grotty # which can be used to produce SciTECO-friendly output # (woman pages). -dist_bin_SCRIPTS += grosciteco.tes +bin_SCRIPTS += grosciteco.tes +CLEANFILES += grosciteco.tes +dist_noinst_SCRIPTS += grosciteco.tes.in # grosciteco, like many other postprocessors, works # best with its own macro package. # Unfortunately, there is no way to query the built-in @@ -32,34 +31,23 @@ dist_bin_SCRIPTS += grosciteco.tes # the directory via `groff -M`. dist_scitecodata_DATA = sciteco.tmac -# Name of grosciteco.tes after installation, taking --program-prefix -# into account. -GROSCITECO_INSTALLED = \ - $(bindir)/`echo grosciteco.tes | @SED@ '$(transform)'` - -# Fix up the hash-bang line of installed SciTECO scripts upon -# installation to refer to the installed sciteco binary. -# This takes --program-prefix into account. -# This wouldn't work on Windows since SciTECO cannot open -# the /mingw64 paths. -# -# FIXME: This will patch the hash-bang line repeatedly. -# Perhaps it would be better to do that using a preprocessing -# step before installation - see the known problems that this -# is causing on FreeBSD/Poudriere. -if !WIN32 -install-exec-hook: - $(SCITECO_FULL) -e "<%i^[ :Q[^A^E\\i]:; @EB'^EN[^A^E\\i]' \ - 0,^Q::@FR'#!^EM^Xsciteco'#!$(SCITECO_INSTALLED)'> \ - :EX" \ - $(DESTDIR)$(GROSCITECO_INSTALLED) \ - $(DESTDIR)$(TEDOC_INSTALLED) -endif +# Fix up the hash-bang line of installed SciTECO scripts. +# This takes --prefix and --program-prefix into account. +# On the other hand, since this is run at build time, +# it breaks bindir-overwriting at `make install` time, +# which could only be made to work with an install-exec-hook. +# Patching installed scripts however broke the FreeBSD port +# builds with Poudriere where BINMODE=555 is set. +# It was therefore decided to sacrifice the rarely used +# `make install bindir=...` and appease the FreeBSD port +# committers instead. +%.tes : %.tes.in + $(SCITECO_FULL) -qioe "0,^Q::@FR'#\!^EM^Xsciteco'#\!$(SCITECO_INSTALLED)'" <$< >$@ womendir = $(scitecolibdir)/women women_DATA = grosciteco.tes.1.woman grosciteco.tes.1.woman.tec -CLEANFILES = grosciteco.tes.1 +CLEANFILES += grosciteco.tes.1 EXTRA_DIST = grosciteco.tes.1.in women_DATA += tedoc.tes.1.woman tedoc.tes.1.woman.tec @@ -86,15 +74,15 @@ CLEANFILES += $(women_DATA) %.woman : % sciteco.tmac grosciteco.tes @GROFF@ @GROFF_FLAGS@ -wall -Z -Tutf8 -t -man -M@srcdir@ -msciteco $< | \ - $(SCITECO_FULL) -im -- @srcdir@/grosciteco.tes $@ + $(SCITECO_FULL) -im -- grosciteco.tes $@ tutorial.woman : tutorial.ms sciteco.tmac grosciteco.tes @GROFF@ @GROFF_FLAGS@ -wall -Z -Tutf8 -t -ms -M@srcdir@ -msciteco $< | \ - $(SCITECO_FULL) -im -- @srcdir@/grosciteco.tes $@ + $(SCITECO_FULL) -im -- grosciteco.tes $@ man_MANS = grosciteco.tes.1 tedoc.tes.1 sciteco.1 sciteco.7 -dist_noinst_SCRIPTS = htbl.tes +dist_noinst_SCRIPTS += htbl.tes if BUILD_HTMLDOCS html_DATA = grosciteco.tes.1.html tedoc.tes.1.html \ -- cgit v1.2.3