wiki:CreatepkgHowto

Creating packages and managing binary repositories

In this howto we'll explain how to use createpkg to build packages from custom SlackBuild scripts and how to maintain binary repositories. We assume that you run all this commands as root.

Createpkg don't work with any kind of SlackBuild, but just with those that comply with our SlackBuild specification.

Createpkg basics

You can either create your own SlackBuilds or use the ones provided by the Slack Sarava Community. We recommend you to start using the ones provided by the community before creating or customizing SlackBuilds. To do so, first synchronize with the Slack Sarava's SlackBuilds repository:

createpkg --sync

By default, createpkg stores all SlackBuilds at /var/simplepkg/slackbuilds. Once you synced the SlackBuild tree you can search for a given SlackBuild using

createpkg --search package-name

If you want to list all the available SlackBuilds, just type

createpkg --search

To build a package from a given SlackBuild, type

createpkg package-name

That will create a package and store it in a subfolder of /var/simplepkg/repos/ corresponding to your current distribution and version. If you want to build and install the package, type

createpkg --install package-name

By default, all packages you build with createpkg become automatically available to simplaret, so a possible way to safely build, check if the package is ok and then install it can be done the following way:

createpkg package-name
simplaret update
simplaret install package-name

Createpkg manages the repository for you

By default, createpkg stores all packages it creates in a subfolder of /var/simplepkg/repos/ corresponding to your current distribution and version. So, if you're using Slackware 12.2, createpkg will store its packages at

/var/simplepkg/repos/slackware/slackware-12.2

The main storage folder (/var/simplepkg/repos) as well as the default storage behaviour can be changed at simplepkg's configuration, but we recommend to adopt this standard config as it seamlessly integrates with simplaret and is compatible with the standard Slackware repository structure.

When creating packages, createpkg also manages to create/update repository metadata like FILELIST.TXT, CHECKSUMS.md5.gz, FILE_LIST (in case of patches), .meta, slack-required and, if you want to, GPG-KEY and .asc files for integrity checking. Createpkg even takes care of removing old package versions, replacing for the new created ones.

Repository under version control

Another important createpkg feature is the ability to keep packages under subversion repositories. To begin managing your binary repository under svn, just import your /var/simplepkg/repos/ into a subversion tree, use

createpkg --import

That will create a subversion repository at /var/svn/packages, import existing packages to it and then make /var/simplepkg/repos/ as a working copy. If you want to import your packages to a diferent place, just tell createpkg to do so

createpkg --import /some/other/subversion/path

You can even import your packages to a remote repository using a command like

createpkg --import svn+ssh://server/path

Once you turned the storage folder to a working copy of a revision controlled repository, createpkg will detect that its storage folder is under svn and will automatically add and remove files from version control. Then, to check the changes createpkg did, just type

createpkg --status

To commit changes from createpkg working copy to the repository, type

createpkg --commit "commit message"

If you plan to build packages with more people or if you do this using different machines over a network, you might want to update createpkg repository working copy using

createpkg --update

The above command is createpkg's equivalent to svn update. There's also a command which allows you to checkout packages from a subversion repository:

createpkg --checkout

With by default make a working copy from Slack Sarava's Community Packages. If you want to specify another repository do checkout from without changing createpkg configuration, just tell it explicitly to do so:

createpkg --checkout repository-path

All these basic repository commands (import, status, commit, update and checkout) makes createpkg able to easily manage binary repositories for you, no need to worrying about repository metadata or to deal with packages by hand.

Integrity checking

If createpkg is building a package from a SlackBuilds built with Manifest checking support, then the source code and other files's integrity checking will automatically happen. If the Manifest is also signed, createpkg will try to update the user's keyring using the repository GPG-KEY file and the SlackBuild will check using gpg if the Manifest signature is valid.

Last modified 8 years ago Last modified on Mar 13, 2010, 11:16:37 AM