[Midnightbsd-cvs] [MidnightBSD/mports] 895d6f: net/samba419: fix staging path doubling in post-in...

Lucas Holt noreply at github.com
Sun Sep 20 00:28:59 EDT 2026


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/mports
  Commit: 895d6f76b9c05c238df60f512e4bdd8f42b1077d
      https://github.com/MidnightBSD/mports/commit/895d6f76b9c05c238df60f512e4bdd8f42b1077d
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-09-20 (Sun, 20 Sep 2026)

  Changed paths:
    M net/samba419/Makefile

  Log Message:
  -----------
  net/samba419: fix staging path doubling in post-install (#1491)

With the platform detection fixed in c608a5c175 (#1486) and
`sysutils/libsunacl` updated in 9e4227c587 (#1488), `net/samba419`
compiled but failed while staging:

```
ln: .../work/fake-inst-amd64/usr/mports/net/samba419/work/fake-inst-amd64/usr/local/share/man/man5/smb4.conf.5.gz: No such file or directory
```

Note the doubled path.

## Cause

`Mk/components/fake/vars.mk` sets, for the fake stage:

```make
FAKE_SETUP= TRUE_PREFIX=${TRUE_PREFIX} PREFIX=${FAKE_DESTDIR}${TRUE_PREFIX} ...
```

So `${PREFIX}` is *already* redirected in the plain `post-install`
chain, and writing `${FAKE_DESTDIR}${PREFIX}` prefixes it a second time.
The port has never built on MidnightBSD, so this was never exercised.

## What changed

Dropped the redundant prefix for `${PREFIX}`, `${DOCSDIR}` and
`${SAMBA4_MODULEDIR}` in `post-install`, `post-install-rm-junk` and
`post-install-fix-manpages` — 9 sites.

**Deliberately left alone**, because fake does *not* redirect them:

| | Why |
|---|---|
| `${PYTHON_SITELIBDIR}` | derives from `PYTHONBASE`, a `!=` shell
assignment evaluated at parse time from `sys.prefix`, so it keeps the
real path |
| `${SAMBA4_LOGDIR}`, `${RUNDIR}`, `${LOCKDIR}`, `${BINDDNSDIR}`,
`${PRIVATEDIR}` | under `/var`, outside `${PREFIX}` |
| `post-install-DOCS-on`, `post-install-FRUIT-off`,
`post-install-CLUSTER-on` | option-conditional targets are **not** run
with the redirected `PREFIX` |

That last one is the non-obvious part, and I got it wrong on the first
attempt. With the prefix dropped there, the build log showed the docs
going to the live filesystem rather than the stage:

```
/bin/mkdir -p /usr/local/share/doc/samba419
install -m 0644 .../work/README.FreeBSD /usr/local/share/doc/samba419
```

so the explicit `${FAKE_DESTDIR}` is correct in those targets and has
been kept.

One `.for` loop mixed both kinds — creating the `/var` directories and
`${SAMBA4_MODULEDIR}` in the same iteration — so `${SAMBA4_MODULEDIR}`
is now installed separately.

## Validation

`samba419` builds, stages, packages **and installs** on amd64. Verified
that `README.FreeBSD` lands in
`.../fake-inst-amd64/usr/local/share/doc/samba419` during staging, and
that the copy now in `/usr/local` is owned by the installed package
rather than leaked by the build.

This was the last of four MidnightBSD-specific problems in this port;
with #1486 and #1488 merged, samba419 works again. That in turn unblocks
installing `x11/plasma6-plasma-workspace`, whose `RUN_DEPENDS` chain
runs through `kio-extras` → `samba419`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01NSsgED5s7GPYJNb1HxuaU9

## Summary by Sourcery

Fix samba419 post-install staging paths so the port can build and
install correctly on MidnightBSD.

Bug Fixes:
- Fix samba419 staging failures caused by applying the fake-stage
destination prefix twice during post-install processing.

Enhancements:
- Correct post-install path handling for man pages, stripping, module
directories, and related staged files while preserving explicit staging
paths for non-redirected locations.

Tests:
- Verify that samba419 builds, stages, packages, and installs
successfully on amd64 without leaking staged documentation into the live
filesystem.

Signed-off-by: Lucas Holt <luke at foolishgames.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/mports/settings/notifications



More information about the Midnightbsd-cvs mailing list