pkg(8): Show +DISPLAY message on deinstall

From my testing, it looks like meta/+DISPLAY is displayed only on installation. How can I display a (possibly different) message on deinstall?
 
Hi. Did you check here?

1724947131349.png
 
Thank you for the reply. Unless I'm missing something, that page appears to address only *ports*. I'm creating a package, and I generally don't create the +MANIFEST manually, but rather via pkg create. The page you cite definitely mentions:

PKGMESSAGE${PKGDIR}/pkg-message

which is the file ./meta/+DISPLAY in an input tree to pkg(8), but my experience so far suggests that file is displayed only on install.

What file do I need to place in ./meta/ to have that file displayed upon deinstall?
 
which is the file ./meta/+DISPLAY in an input tree to pkg(8), but my experience so far suggests that file is displayed only on install.
Well, did you try putting the UCL-formatted pkg-message file there? 🤔

BTW, why don't you build your package using a port in the first place? I'd say it's much easier and the ports framework really supports building "anything" (including e.g. packages with pre-built binaries, like used in the "linux" packages).
 
Sorry but i don't know differences between a port and a package.
A port is (nowadays*) a fully automated way (using the ports make framework) to build a package from source distribution files provided by upstream projects. It's not the only way you can create a package though, it's possible to create one directly with pkg(8). For that, all the (binary) contents must already exist. Actually, the ports framework uses pkg(8) itself for that step of creating the package (with make package).

--
* historically, a port installed the built software directly into the running system without any package management, with obvious drawbacks. A direct install (make install) is still possible, but nowadays does "staging" nevertheless and registers the installation with pkg's database as if an actual package was installed.
 
Thanks for your suggestions, @zirias@. I've tried a couple things, but the meta/+MANIFEST file is just plain text with leading keywords, not actual UCL syntax:

Code:
name: foobar
version: "1.0.0"
origin: my-pkgs/foobar
...

Your suggestion got me started on experimenting with how to either stuff UCL into that format (and if so, using what "tag" name); and also examining the pkg(8) source to see which sources pkg create is capable of pulling that information from, and in what format(s).

But taking a step back, yes, I generally create packages which either deal with non-binary files, such as installing a script in /root/bin and a cron job in /etc/cron.d that runs said script at prescribed times; or occasionally (rarely), I build and package tools for a software version for which the FreeBSD repo does not (yet) have a package, as when package of foobar version 1.4.X has a vulnerability, but the FreeBSD pkg repo does not yet have a package for version 1.4.$((X+1)) . Then when the Poudriere build machine does catch up, I generally delete my local package in favor of the standard FreeBSD pkg.

Perhaps one of the handiest of the ".cfg"-modifying scripts I've made is a group of modular enhancements to sshd(8), employing files in /etc/sshd_config.d/ and .../ssh_config.d/ and an AuthorizedKeysCommand script which supports searching /etc/ssh/authorized_keys.d/%u/*.conf and ~%u/.ssh/authorized_keys.d/*.conf for public keys which authorize access for user %u.

So yes, not a lot of binaries involved. Yet.
 
Back
Top