Centos and Debian packaging
[devwiki.git] / release / centos.mdwn
1 [[!meta title="Releasing for Centos"]]
2
3 Centos packages are built from [[master|branches]].   The procedures roughly works as follows:
4
5 1. A normal configure; make; make install on Painless Security machines
6 2. If this succeeds then a build is started on Janet machines
7
8 1. Another round of configure; make; make instal.  This round include a make dist to produce distribution tar files.
9 1. Run "rpmbuild -ta" on the distribution tar files.
10
11 1. Copy the results back to moonshot.suchdamage.org
12
13 # Spec file
14
15 Centos packaging is controlled by a .spec file.  In most packages the spec file is produced by a .spec.in file.  This controls dependencies, installation procedures, etc.
16
17 It's important that once a Centos package is placed into the archive it is never changed.  So, some component of the version number needs to be incremented whenever a new Centos package is desired.
18
19 The version number is spread across two fields in the spec file:
20
21 * Version: the upstream version number 
22 * Release: a RPM-specific release number
23
24 If the spec file is a .spec.in the upstream version number is probably auto-generated from configure.  Whenever the upstream version changes the release should be set back to 1.
25
26 # Steps
27
28 * Update the spec file, either resetting the release for a new upstream version or incrementing it.
29 * Commit the spec file; make sure not to commit a .spec in a package with .spec.in
30 * Push the submodule
31 * Commit and push the master repository
32 * Monitor the [build](http://www.project-moonshot.org/buildbot/builders/) until the Centos packaging succeeds
33
34 # Installing packages in Archive
35
36 At this point the packages have been copied to a file "~buildbot/rpm-packages.tar" on moonshot.suchdamage.org
37
38     ssh buildbot@moonshot.suchdamage.org
39     mkdir rpm-unpack
40     cd rpm-unpack
41     tar xvf ../rpm-packages.tar
42
43 Confirm the packages look reasonable.  Copy only new packages into place.  It's quite important not to copy packages whose  version number did not change.
44
45     rsync --ignore-existing -v -a . /srv/rpms/centos6
46
47 Sign the packages
48
49     cd /srv/rpms/centos6/RPMS/x86_64
50     rpmsign--addsign *rpm
51
52 Now update repository metadata:
53
54     cd /srv/rpms
55     createrepo -u http://repository.project-moonshot.org/rpms/centos6 centos6
56
57
58 At this point the Centos packages are available for installation.  Clearly more automation is desirable.
59