RetroBSD Net
Title:
Generate a pkg_summary for your packages
Authors:
Paolo Vincenzo Olivo
Date:
Topics:
Pkgsrc
Id:
78f462

While pkg_comp will automatically generate a pkg_summary.gz for locally built packages at the given path - namely /usr/pkgsrc/packags/All - the same does not apply for packages generated by running make in the pkgsrc tree. If you don't know what I'm talking about, see pkg_summary(5) man.

On my Slackware desktop and my Solaris VM I usually build everything from source. With a i7 7000 and 16 Gb of physical memroy, this is acceptable. Not that I'm given much choice: would you use Joyent's packages built built against EPEL7 on Slackware 15?

Even while compiling from source you may still want to use pkgin to manage your repo and handle dependencies. A couple of common uses:

- reinstall previously built an later on deinstalled packages

- autoremove unused dependencies

So, this is the script I use to generate a local pkg_summary.

pkg_path="/usr/pkgsrc/packages/All" sum="/tmp/pkg_summary.gz" if [ -d $pkg_path ]; then ( cd $pkg_path ; pkg_info -X *.tgz | gzip -9 > $sum ) fi mv -v $sum $pkg_path

Place it somewhere in root's PATH (or use sudo -E).

Now edit /usr/pkg/etc/pkgin/repositories.conf to include

file:///usr/pkgsrc/packages/All

As first or sole repository.

Finally, update your package repo:

~ $ pkgin -f update reading local summary... processing local summary... reading local summary... processing local summary... processing remote summary (file:///usr/pkgsrc/packages/All)... pkg_summary.gz 100% 98KB 49.1KB/s 00:02

And you're ready to go.