Page MenuHomeFreeBSD

Create pkgbase packages for CDDL libraries and binaries
Needs RevisionPublic

Authored by rogiel_rogiel.com on Sep 30 2016, 3:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 17 2024, 4:00 PM
Unknown Object (File)
Mar 17 2024, 3:32 PM
Unknown Object (File)
Jan 10 2024, 10:37 AM
Unknown Object (File)
Dec 20 2023, 2:13 AM
Unknown Object (File)
Dec 6 2023, 1:39 AM
Unknown Object (File)
Nov 10 2023, 7:31 AM
Unknown Object (File)
Jan 14 2023, 9:46 AM
Unknown Object (File)
Jan 1 2023, 11:47 PM

Details

Reviewers
bapt
gnn
Summary

This diff adds the following pkgbase packages:

  • zfs
  • ctf
  • dtrace
  • libdrti
  • libavl
  • libctf
  • libdtrace
  • libnvpair
  • libumem
  • libuutil
  • libzfs

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

rogiel_rogiel.com retitled this revision from to Create pkgbase packages for CDDL libraries and binaries.
rogiel_rogiel.com updated this object.
rogiel_rogiel.com edited the test plan for this revision. (Show Details)
rogiel_rogiel.com added a reviewer: bapt.
rogiel_rogiel.com set the repository for this revision to rS FreeBSD src repository - subversion.
gnn requested changes to this revision.Sep 30 2016, 9:27 PM
gnn edited edge metadata.

I'd like a reference to what these will actually do. It seems that each library is now a package but that may not make sense based on the structure of those libraries.

This revision now requires changes to proceed.Sep 30 2016, 9:27 PM

All libraries are individual packages with the exception of libzfs which in fact includes three: libzfs, libzfs_core and libzpool which are directly related. I did this way because it seemed to be pattern on the lib subdir where all libraries are in lib${LIB} package, with the exception of C and C++ standard libraries which reside in a clibs package.

It seems that libraries like nvpair, uutil and umem seem to only be required by ZFS, but I still see them as different packages because they are not libzfs, but dependencies of it. The same could be said for libctf which is required by dtrace and ctf* tools.

As for the binaries, I packaged them in a zfs package, a dtrace package and a ctf package which I think is a pretty straight forward packaging.

Do we have a document on how the packaging for base works? I'd like to understand the process a bit better before approving this review.

Here is a presentation from bapt in BSDCan 2015: http://pres.gandi.net/downloads/FreeBSD-packaging-base.pdf
Also, the wiki has some content: https://wiki.freebsd.org/PkgBase, though the wiki is mostly on how to use and not how to package a prog or lib.

From what I could tell, the PACKAGE= is enough to tell <bsd.prog.mk>/<bsd.lib.mk> to create a package with that name. It will also generate a plist (a metadata file which lists all files that belong to that package) from the installed files by that prog/lib.

Also, when no PACKAGE name is available, it will default to runtime. Currently, all zfs and dtrace stuff are being packaged in runtime because theres no PACKAGE for them.

To give a practical example, heres zfs.ucl, the package metadata file generated by the "package" target.

#
# $FreeBSD$
#

name = "FreeBSD-zfs"
origin = "base"
version = "20161001"
comment = "zfs package"
categories = [ base ]
maintainer = "re@FreeBSD.org"
www = "https://www.FreeBSD.org"
prefix = "/"
licenselogic = "single"
licenses = [ BSD2CLAUSE ]
desc = <<EOD
zfs package
EOD

Notice that I manually override the version string to match the date so that the system will create a daily-snapshot version. In a regular build that should be 12-CURRENT or something like that.

And here is zfs.plist, which list files installed by that package:

@(root,wheel,0555,) /etc/rc.d//zfs
@(root,wheel,0555,) /etc/rc.d//zfsd
@(root,wheel,0555,) /etc/rc.d//zvol
@(root,wheel,0555,) /sbin/zfs
@(root,wheel,0555,) /sbin/zpool
@(root,wheel,0555,) /usr/bin/zinject
@(root,wheel,0555,) /usr/bin/zstreamdump
@(root,wheel,0555,) /usr/bin/ztest
@(root,wheel,0555,) /usr/sbin/zdb
@(root,wheel,0555,) /usr/sbin/zfsd
@(root,wheel,0555,) /usr/sbin/zhack