Centos and Debian packaging
[devwiki.git] / release / centos.mdwn
diff --git a/release/centos.mdwn b/release/centos.mdwn
new file mode 100644 (file)
index 0000000..7412953
--- /dev/null
@@ -0,0 +1,59 @@
+[[!meta title="Releasing for Centos"]]
+
+Centos packages are built from [[master|branches]].   The procedures roughly works as follows:
+
+1. A normal configure; make; make install on Painless Security machines
+2. If this succeeds then a build is started on Janet machines
+
+1. Another round of configure; make; make instal.  This round include a make dist to produce distribution tar files.
+1. Run "rpmbuild -ta" on the distribution tar files.
+
+1. Copy the results back to moonshot.suchdamage.org
+
+# Spec file
+
+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.
+
+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.
+
+The version number is spread across two fields in the spec file:
+
+* Version: the upstream version number 
+* Release: a RPM-specific release number
+
+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.
+
+# Steps
+
+* Update the spec file, either resetting the release for a new upstream version or incrementing it.
+* Commit the spec file; make sure not to commit a .spec in a package with .spec.in
+* Push the submodule
+* Commit and push the master repository
+* Monitor the [build](http://www.project-moonshot.org/buildbot/builders/) until the Centos packaging succeeds
+
+# Installing packages in Archive
+
+At this point the packages have been copied to a file "~buildbot/rpm-packages.tar" on moonshot.suchdamage.org
+
+    ssh buildbot@moonshot.suchdamage.org
+    mkdir rpm-unpack
+    cd rpm-unpack
+    tar xvf ../rpm-packages.tar
+
+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.
+
+    rsync --ignore-existing -v -a . /srv/rpms/centos6
+
+Sign the packages
+
+    cd /srv/rpms/centos6/RPMS/x86_64
+    rpmsign--addsign *rpm
+
+Now update repository metadata:
+
+    cd /srv/rpms
+    createrepo -u http://repository.project-moonshot.org/rpms/centos6 centos6
+
+
+At this point the Centos packages are available for installation.  Clearly more automation is desirable.
+