Home

Awesome

NAME

Pakket - An Unopinionated Meta-Packaging System

DESCRIPTION

Pakket is a meta-packaging system that allows you to manage dependencies. It works by trying to avoid work.

What can you do with Pakket?

The main purpose of Pakket is simple: Package applications and libraries. That is all.

Pakket provides a lot of flexibility in how this is done. Here is a list of specific things you can do with Pakket.

Pakket elements

Pakket has several key elements:

Packages

Everything you wish to build and install is a package. A package can be a program in your favorite language, a library of a language, or anything at all. It will go through a build process you pick and it will get bundled into a parcel.

Categories

All packages have a category. Unlike other systems, Pakket doesn't have a flat structure of packages. They're split into categories.

The category of a package tells Pakket what kind of build system it needs, how to retrieve metadata from the sources, and what to do with it.

For example, packages in the perl category tell Pakket that the builder will need to use one of the available build systems for a Perl module (such as ExtUtils::MakeMaker or Module::Build). It will also use the versioning scheme that Perl has in order to decide which is a newer version and which is older.

Requirements

Pakket makes a difference between a package and a requirement. A package is an existing instance; a requirement is a description. The requirement can have a range of allowed versions for a package, for example.

Spec files

Similar to RPM spec files, Pakket has spec files. You can create them yourself or you can use the generate command to create them for you.

The basic spec file in Pakket contain a package's category, name, and version. It usually contains prereqs as well, keyed by the category and the phase. The phases can be configure (for build-time), test (for when testing the build), and runtime (for using it).

An example of a spec in Pakket in JSON:

{
   "Package" : {
      "category" : "perl",
      "name" : "AnyEvent-YACurl",
      "release" : "2",
      "source" : "https://cpan.metacpan.org/authors/id/T/TV/TVDW/AnyEvent-YACurl-0.20.tar.gz",
      "version" : "0.20"
   },
   "Pakket" : {
      "build" : {
         "make-options" : [
            "OTHERLDFLAGS=-Wl,--verbose -L%PACKAGE_PKG_DIR%/lib -lcurl -lcares -lnghttp2 -lbrotlidec -lzstd -lz -lkrb5"
         ],
         "pre" : [
            "yum -y install krb5-devel",
            "rm -rf /lib/include/curl",
            "rm -f /usr/lib64/pkgconfig/libcurl.pc",
            "/bin/bash -c 'rm -f /usr/lib64/libcurl.*'",
            "/bin/bash -c 'rm -f /usr/lib64/libz.*'"
         ]
      },
      "prereqs" : {
         "build" : {
            "requires" : {
               "perl/ExtUtils-MakeMaker" : "0"
            }
         },
         "configure" : {
            "requires" : {
               "perl/ExtUtils-MakeMaker" : "0"
            }
         },
         "runtime" : {
            "requires" : {
               "native/curl" : "==7.74.0",
               "perl/AnyEvent" : "7.0"
            }
         }
      },
      "version" : "3.060"
   }
}

The package details are in the Package section. The prereqs are in the Prereqs section, under the native or perl categories, under the configure or runtime phase.

Pakket might store these configurations in JSON, but it could also store it in other ways if desired.

Parcels

Parcels are the result of building packages. Parcels are what gets finally installed. You may also call them the "build artifacts" if you wish.

While other packaging systems usually have development packages (or devel or dev), Pakket doesn't differentiate between those. Instead, a Pakket package contains everything created at install time for a built package, including the headers, if such would have been installed.

AUTHOR

Booking.com

COPYRIGHT AND LICENSE

This software is Copyright (c) 2020 by Booking.com.

This is free software, licensed under:

The MIT (X11) License