aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-14 15:20:37 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-14 15:20:37 +0300
commit6399cfcfa2ddc8f94247b01b61cedf36d44e8b11 (patch)
tree6b050e9f1e388fef1eab35c3e5789c044dda269a
parent003cb1e430739d8a464321b236ac6f34f7b39678 (diff)
downloadsciteco-6399cfcfa2ddc8f94247b01b61cedf36d44e8b11.tar.gz
fix up hash-bang lines only of the scripts really installed by the current `make install` invocation
* The previous way of fixing up all `*.tes` scripts had the disadvantage of touching unrelated scripts or grosciteco/tedoc of a previous invocation. E.g. installing a Gtk build after the ncurses build would overwrite all hash-bang lines of the curses-version scripts as well with gsciteco. * This caused problems with the RPM package where both variants were installed into the same buildroot and introduced a dependency from sciteco-curses to sciteco-gtk. This is worked around in sciteco.spec with a manual sed call. * It would be better to get rid of the install-exec-hook altogether as it causes problems with FreeBSD/Poudriere (FIXME).
-rw-r--r--doc/Makefile.am21
1 files changed, 18 insertions, 3 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 428d0ce..4911cb1 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -9,6 +9,11 @@ include $(top_srcdir)/bootstrap.am
# 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)'`
+
%.in : %.template tedoc.tes @top_srcdir@/src/*.c
$(SCITECO_FULL) -m -- @srcdir@/tedoc.tes \
-C $@ $< @top_srcdir@/src/*.c
@@ -27,6 +32,11 @@ 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.
@@ -34,11 +44,16 @@ dist_scitecodata_DATA = sciteco.tmac
# 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 "@EB'$(DESTDIR)$(bindir)/*.tes' 1U* \
- EJ-1<%*^[ 0,^Q::@FR'#!^EM^Xsciteco'#!$(SCITECO_INSTALLED)'> \
- :EX"
+ $(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
womendir = $(scitecolibdir)/women