Create your own APT repository

From Koha Wiki
Jump to navigation Jump to search

Creating your own apt repository for publishing your packages will probably make life easier for people maintaining Koha installs.

This instructions let you create your own APT repository on the same machine you are building the packages. The repository can be used directly from this server using a HTTP server in front of this files. This repository could also be published in a separate server using rsync.

These instructions are used for building packages for Ubuntu 12.04 LTS in amd64 architecture. Feel free to adjust this to your needs.

Note: there are references to a GPG Key (B2F3C15F), you should create your own and replace with it. ('gpg --gen-key' can be used to create such a key)

Dependancies

You'll need the reprepro package installed on your system

apt-get install reprepro

Create the repository directory structure

mkdir -p /srv/repositories/koha/{conf,dists,incoming,indices,logs,pool,project,tmp}


Create the repository's configuration files

/srv/repositories/koha/conf/distributions

Origin: Tomás Cohen Arazi
Label: UNC Koha Repository
Codename: precise
Architectures: amd64 i386 source
Components: main
Description: UNC's own Koha repository
SignWith: B2F3C15F

/srv/repositories/koha/conf/options

ask-passphrase
basedir .

Build your own packages

Go to your git clone and checkout the desired commit/tag you want to build a package for:

cd /srv/build/koha/src
git checkout origin/3.14.x -b custom_3_14_build

Build:

debian/build-git-snapshot -r /srv/build/koha/debs/ -D precise --noautoversion -v "3.14.06-1indexer"

(See also: Building Debian Packages - The Easy Way.)

Sign the packages:

debsign -kB2F3C15F /srv/build/koha/debs/koha_3.14.06-1indexer_amd64.changes

Populate the repository with the new packages:

cd /srv/build/koha/debs/
reprepro -b /srv/repositories/koha/ include precise koha_3.14.06-1indexer_amd64.changes

Build Perl dependencies

Build:

mkdir /srv/build/kohaperldeps
cd /srv/build/kohaperldeps
cpan2deb Koha::Contrib::Tamil

Publish:

reprepro -b /srv/repositories/koha/ includedeb precise libkoha-contrib-tamil-perl_0.031-1_all.deb

Roll the new stuff to the production repository

cd /srv/repositories/koha
rsync -avl --delete --rsh=ssh . root@ubuntu.unc.edu.ar:/srv/sites/koha

Note: you might as well mount the remote server directory in /srv/repositories/koha to directly work on it. I wouldn't, just in case.