pmattes / x3270

Family of IBM 3270 emulators
46 stars 18 forks source link

Install issue for script prtodir #73

Closed Rhialto closed 7 months ago

Rhialto commented 7 months ago

Hi! I was packaging your latest version 4.3ga4 for pkgsrc, and I ran into a small issue when installing the script prtodir.

The Makefile installs this with

        $(INSTALL_PROGRAM) prtodir $(DESTDIR)$(BINDIR)/prtodir

However if the install program for $(INSTALL_PROGRAM) is set to strip binaries (which is the case for pkgsrc), this fails because it isn't a binary it can recognize (because it's a script).

The patch is simple:

--- pr3287/Makefile.obj.in.orig 2023-10-14 16:30:03.000000000 +0000
+++ pr3287/Makefile.obj.in
@@ -46,6 +46,7 @@ LIBS = @LIBS@
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@

 HOST = @host@
 include pr3287_files.mk libs.mk
@@ -70,7 +71,7 @@ install: pr3287 prtodir
        [ -d $(DESTDIR)$(BINDIR) ] || \
                mkdir -p $(DESTDIR)$(BINDIR)
        $(INSTALL_PROGRAM) pr3287 $(DESTDIR)$(BINDIR)/pr3287
-       $(INSTALL_PROGRAM) prtodir $(DESTDIR)$(BINDIR)/prtodir
+       $(INSTALL_SCRIPT) prtodir $(DESTDIR)$(BINDIR)/prtodir

 install.man: man
        [ -d $(DESTDIR)$(MANDIR)/man1 ] || \

Looking at the script itself: it starts with

#!/usr/bin/env /bin/sh

Pkgsrc forbids the use of env as an interpreter (protential security issues, I guess), but combined with an absolute path its path-searching facility goes unused, and the whole thing can simply be replaced by a plain

#!/bin/sh
pmattes commented 7 months ago

Thank you for the report! I will look into this ASAP.

pmattes commented 7 months ago

Fixes committed to master and the 4.3 release branch. It will be released in 4.3ga5.