# installing oksh fails with catalog.mk not found using non-default prefix



## Alain De Vos (Apr 19, 2020)

Building oksh from ports fails with catalog not found,
The process is so short I'll post the full log,

```
/root root> #portmaster shells/oksh

===>>> Port directory: /usr/ports/shells/oksh

===>>> Gathering distinfo list for installed ports

===>>> Launching 'make checksum' for shells/oksh in background
===>>> Gathering dependency list for shells/oksh from ports
===>>> Initial dependency check complete for shells/oksh


===>>> Starting build for shells/oksh <<<===

===>>> All dependencies are up to date

===>  Cleaning for oksh-6.6,1
===>  License PD accepted by the user
===>   oksh-6.6,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by oksh-6.6,1 for building
===>  Extracting for oksh-6.6,1
=> SHA256 Checksum OK for oksh-6.6.tar.gz.
===>  Patching for oksh-6.6,1
===>   oksh-6.6,1 depends on file: /usr/local/lib/libncurses.so.6 - found
===>  Configuring for oksh-6.6,1
checking for C compiler... /usr/local/bin/clang90
checking if C compiler can compile C99 without -std=c99... yes
checking for -w compiler flag... yes
checking for OS... FreeBSD
checking for __dead... no
checking for __dead2... yes
checking for asprintf... yes
checking for confstr... yes
checking for curses library... curses.h
checking for issetugid... yes
checking for pledge... no
checking for reallocarray... yes
checking for setresgid... yes
checking for setresuid... yes
checking for sig_t... yes
checking for srand_deterministic... no
checking for st_mtim... yes
checking for st_mtimespec... yes
checking for stravis... yes
checking for strlcat... yes
checking for strlcpy... yes
checking for strtonum... yes
checking for strunvis... yes
checking for sys_siglist... yes
checking for sys_signame... yes
checking for timeradd... yes
checking for timersub... yes
creating Makefile... done
===>  Building for oksh-6.6,1
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c alloc.c -o alloc.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c asprintf.c -o asprintf.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c c_ksh.c -o c_ksh.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c c_sh.c -o c_sh.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c c_test.c -o c_test.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c c_ulimit.c -o c_ulimit.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c edit.c -o edit.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c emacs.c -o emacs.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c eval.c -o eval.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c exec.c -o exec.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c expr.c -o expr.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c history.c -o history.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c io.c -o io.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c jobs.c -o jobs.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c lex.c -o lex.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c mail.c -o mail.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c main.c -o main.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c misc.c -o misc.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c path.c -o path.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c shf.c -o shf.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c syn.c -o syn.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c table.c -o table.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c trap.c -o trap.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c tree.c -o tree.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c tty.c -o tty.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c var.c -o var.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c version.c -o version.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c vi.c -o vi.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c confstr.c -o confstr.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c reallocarray.c -o reallocarray.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c siglist.c -o siglist.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c signame.c -o signame.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c strlcat.c -o strlcat.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c strlcpy.c -o strlcpy.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c strtonum.c -o strtonum.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c unvis.c -o unvis.o
/usr/local/bin/clang90  -O2 -pipe -O2 -pipe -march=ivybridge  -fstack-protector-strong -fno-strict-aliasing  -DEMACS -DVI -w -c vis.c -o vis.o
/usr/local/bin/clang90 -Wl,-rpath=/usr/local/lib -fstack-protector-strong  -static -o oksh alloc.o asprintf.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o  emacs.o eval.o exec.o expr.o history.o io.o jobs.o lex.o mail.o  main.o misc.o path.o shf.o syn.o table.o trap.o tree.o tty.o var.o  version.o vi.o confstr.o reallocarray.o siglist.o signame.o  strlcat.o strlcpy.o strtonum.o unvis.o vis.o -lcurses
===>>> Building the port required 14 seconds
===>  Staging for oksh-6.6,1
===>   Generating temporary packing list
install  -s -m 555 /usr/ports/shells/oksh/work/oksh-6.6/oksh /usr/ports/shells/oksh/work/stage//bin
install  -m 444 /usr/ports/shells/oksh/work/oksh-6.6/oksh.1 /usr/ports/shells/oksh/work/stage//man/man1
====> Compressing man pages (compress-man)
===>  Installing for oksh-6.6,1
===>  Checking if oksh is already installed
===>   Registering installation for oksh-6.6,1
pkg-static: Unable to access file /usr/ports/shells/oksh/work/stage//share/licenses/oksh-6.6,1/catalog.mk:No such file or directory
pkg-static: Unable to access file /usr/ports/shells/oksh/work/stage//share/licenses/oksh-6.6,1/LICENSE:No such file or directory
pkg-static: Unable to access file /usr/ports/shells/oksh/work/stage//share/licenses/oksh-6.6,1/PD:No such file or directory
*** Error code 74

Stop.
make[1]: stopped in /usr/ports/shells/oksh
*** Error code 1

Stop.
make: stopped in /usr/ports/shells/oksh

===>>> Installation of oksh-6.6,1 (shells/oksh) failed
===>>> Aborting update


===>>> You can restart from the point of failure with this command line:
       portmaster <flags> shells/oksh

This command has been saved to /tmp/portmasterfail.txt

/root root> #
```


----------



## Alain De Vos (Apr 19, 2020)

The problem occurs only when I put a non default prefix, i.e.

```
.if ${.CURDIR:M*/shells/oksh}
PREFIX=/
.endif
```

The makefile contains. No other stagedir references found

```
Makefile:    ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
Makefile:    ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1
```

It's not a big deal to copy over the files manually but it would be nice to understand what is going wrong.


----------

