Lib packaging for your own repo

This is a note to self about the release procedure and distro packaging of a development library.

This instructions expect aptly and createrepo to be preinstalled on your repo server together with a valid GPG key.

Packaging a .deb

1. Checkout the release tag and build the deb according to README. Each build should be done on the same machine as the target distribution. If I am packaging for Centos 6 I am also building on Centos 6. If CMake and CPack are set up correctly it usually boils down to:

If the project is missing CMake, refuse to package it.

2. Check that deb info is correct:

3. Rename it to distro you are building on, then scp to your repo server

4. If aptly repo does not exist yet, create it

Ideally you only create the repo the first time, for future updates you create a snapshot of it, add a package, then switch the repo to new snapshot. See aptly docs for more.

Alternatively, you can just add more packages and update the repo with


5. Add package to repo

6. Publish repo

7. On target machine, add repo to /etc/apt/sources.list and fetch public key

8. Update and then check if package info is correct

9. If big mistakes were made

..and start over. Repeat for Debian 8 etc.

Packaging an .rpm

1. See the previous #1. The only difference is

2. Check that rpm info is correct

3. Rename it to distro you are building on, then scp to your repo server

4. Make sure you have .rpmmacros file in home dir with uid of gpg signing key (check out your keys with gpg –list-keys). If you don’t have one, generate it. Entry in the file should look like:

5. Sign rpm

4. Move to appropriate repo that was created by createrepo earlier (see createrepo docs)

5. Update repo metadata

6. Add your repo on the target machine

Since createrepo is pretty much just an http server you can simply delete an rpm and update the metadata in case things go south.

Repeat for Centos 6 etc.

150 Total Views 1 Views Today