On Fri, Sep 06, 2024 at 02:00:49PM +0100, Stuart Henderson wrote:
> ===>  Faking installation for nsh-1.2.2
> install -c -s  -o root -g bin  -m 755 nsh 
> /pobj/nsh-1.2.2/fake-amd64/usr/local/bin/nsh
> test -e /usr/local/bin/save.sh || install -m 755 -o root -g bin  
> /usr/obj/ports/nsh-1.2.2/nsh-1.2.2/save-rw.sh /usr/local/bin/save.sh
> install: /usr/local/bin/INS@XIeCpSEu4i: Permission denied
> *** Error 1 in /usr/obj/ports/nsh-1.2.2/nsh-1.2.2 (Makefile:63 'afterinstall')

Thanks! I missed this because save.sh existed on the system khich
I used to build the port.

Is the below solution adequate? The reason for making the upstream
Makefile create save.sh was that compiling nsh from the Git repo
and running 'make install' would result a broken setup where the
write-config command would not work.

diff /usr/ports
commit - f640b88fef18c3032a9b02b089db0dee4d88cf43
path + /usr/ports
blob - 66bab971f2124f1025600e908dbb4984214bfd85
file + shells/nsh/Makefile
--- shells/nsh/Makefile
+++ shells/nsh/Makefile
@@ -2,10 +2,9 @@ COMMENT =      network switch style shell
 
 CATEGORIES =   shells net
 HOMEPAGE =     https://www.nmedia.net/nsh/
-V =            1.2.1
+V =            1.2.2
 DISTNAME =     nsh-${V}
 SITES =                
https://github.com/yellowman/nsh/releases/download/v${V}/
-REVISION =     0
 
 MAINTAINER =   Tom Smyth <[email protected]>
 
@@ -32,7 +31,7 @@ LIB_DEPENDS = databases/sqlite3
 FAKE_FLAGS =   PREFIX=${TRUEPREFIX}
 
 .if ${FLAVOR:Mstatic}
-MAKE_FLAGS +=  LDFLAGS="-L${LOCALBASE}/lib -ledit -ltermcap -lsqlite3 -lm 
-lpthread -static"
+ALL_TARGET =   static
 .endif
 
 NO_TEST=       Yes
@@ -45,5 +44,10 @@ post-install:
 .for i in README.md COPYRIGHT
        ${INSTALL_DATA} ${WRKDIST}/${i} ${PREFIX}/share/doc/nsh/
 .endfor
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/nsh
+.for s in extensive-nsh-openbsd-integrate.sh rc.local-nsh-openbsd-integrate.sh
+       ${INSTALL_DATA} ${WRKDIST}/scripts/shell/${s} \
+               ${PREFIX}/share/examples/nsh/
+.endfor
 
 .include <bsd.port.mk>
blob - 644f8cc92d2911a3e757849b207930517cd1eee8
file + shells/nsh/distinfo
--- shells/nsh/distinfo
+++ shells/nsh/distinfo
@@ -1,2 +1,2 @@
-SHA256 (nsh-1.2.1.tar.gz) = rU/ep0MEA9O7CJacaF3vvMx82MRlUmLc2U/riRgJgTs=
-SIZE (nsh-1.2.1.tar.gz) = 221571
+SHA256 (nsh-1.2.2.tar.gz) = EfR0Yya3F7Ej6nfPd+WlqLT+Z8A8ZUb6fcWb1pQamw8=
+SIZE (nsh-1.2.2.tar.gz) = 228756
blob - /dev/null
file + shells/nsh/patches/patch-Makefile (mode 644)
--- /dev/null
+++ shells/nsh/patches/patch-Makefile
@@ -0,0 +1,14 @@
+Index: Makefile
+--- Makefile.orig
++++ Makefile
+@@ -59,8 +59,8 @@ mantab.c: mantab.sh nsh.8
+       sh ${.CURDIR}/mantab.sh ${.CURDIR}/nsh.8 > mantab.c
+ 
+ afterinstall:
+-      test -e ${PREFIX}/bin/save.sh || install -m 755 -o root -g bin \
+-              ${.CURDIR}/save-rw.sh ${PREFIX}/bin/save.sh
++      test -e ${DESTDIR}${PREFIX}/bin/save.sh || install -m 755 -o root -g 
bin \
++              ${.CURDIR}/save-rw.sh ${DESTDIR}${PREFIX}/bin/save.sh
+ 
+ release: clean
+       sed -i -e "s/_RELEASE=No/_RELEASE=Yes/" ${.CURDIR}/nsh-version.mk
blob - 2897dbbb594af24ccdae8265ac828cc1e17db426
file + shells/nsh/pkg/PLIST
--- shells/nsh/pkg/PLIST
+++ shells/nsh/pkg/PLIST
@@ -5,7 +5,7 @@ bin/save-rw.sh
 @mode 755
 @owner root
 @group bin
-@sample bin/save.sh
+bin/save.sh
 @mode 04555
 @owner
 @group
@@ -16,3 +16,6 @@ bin/save-rw.sh
 share/doc/nsh/
 share/doc/nsh/COPYRIGHT
 share/doc/nsh/README.md
+share/examples/nsh/
+share/examples/nsh/extensive-nsh-openbsd-integrate.sh
+share/examples/nsh/rc.local-nsh-openbsd-integrate.sh

Reply via email to