Difference between revisions of "Packaging madagascar"

From Madagascar
Jump to navigation Jump to search
(Making RPMs)
Line 3: Line 3:
 
* system administrators who need to do their own packaging, such as for the purpose of easy, customized software management over a large number of machines
 
* system administrators who need to do their own packaging, such as for the purpose of easy, customized software management over a large number of machines
  
If you want to package a released stable version, you need to [http://sourceforge.net/projects/rsf/files/ download the source code tarball]. If you want to package a snapshot of the development version, you need to [[Download#Current_development_version | get the source code from the repository via svn]], then run the <tt>admin/svn2tgz</tt> script to remove the <tt>svn</tt> directories, as well as other items that you do not want the final package to contain.
+
==RPM==
 +
To make the RPMs, it is a good idea to first create a user just for this, i.e. <tt>makerpm</tt>. Then, install dependencies and set up. As root:
 +
 
 +
<bash>
 +
yum -y groupinstall "Development Tools"
 +
yum -y install rpmdevtools mock rpmlint
 +
</bash>
 +
 
 +
Log in as <tt>makerpm</tt>. Type: <tt>rpmdev-setuptree</tt> to create the <tt>~/rpmbuild</tt> directory. Place the [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/admin/m8r-fedora12-x86_64.spec?view=markup spec file] in ~/rpmbuild/SPECS , then cd to that directory and run:
 +
 
 +
<bash>
 +
rpmbuild -ba madagascar.spec
 +
</bash>
 +
 
 +
If you want a log of the entire process, use something like:
 +
 
 +
<bash>
 +
rpmbuild -ba madagascar.spec |& tee ~/log_rpm.asc
 +
</bash>
 +
 
 +
If you want to make other RPM files, you may find useful to run
 +
 
 +
<bash>
 +
rpmlint yourfile.spec
 +
</bash>
 +
 
 +
Some warnings are OK. If you want to debug your experiments, you can comment the contents of the prep, build or clean sections in the spec file. For prep and build, you must have executed it uncommented at least once.
 +
 
 +
You may be able to QC the build with <tt>mock</tt>. For this, run as root:
 +
 
 +
<bash>
 +
yum -y install mock
 +
useradd -G mock makerpm
 +
</bash>
 +
 
 +
Then run it with <tt>mock -r fedora-12-x86_64 rebuild path_to_source_RPM </tt>.
 +
 
 +
Excellent further reading on this topic is given by [https://fedoraproject.org/wiki/How_to_create_an_RPM_package Fedora's guide to creating RPM packages]

Revision as of 23:48, 28 June 2010

There are many benefits to managing your software through the standard packaging system for your platform. This page is written for the benefit of:

  • future madagascar developers who want to prepare packages for distribution
  • system administrators who need to do their own packaging, such as for the purpose of easy, customized software management over a large number of machines

RPM

To make the RPMs, it is a good idea to first create a user just for this, i.e. makerpm. Then, install dependencies and set up. As root:

<bash> yum -y groupinstall "Development Tools" yum -y install rpmdevtools mock rpmlint </bash>

Log in as makerpm. Type: rpmdev-setuptree to create the ~/rpmbuild directory. Place the spec file in ~/rpmbuild/SPECS , then cd to that directory and run:

<bash> rpmbuild -ba madagascar.spec </bash>

If you want a log of the entire process, use something like:

<bash> rpmbuild -ba madagascar.spec |& tee ~/log_rpm.asc </bash>

If you want to make other RPM files, you may find useful to run

<bash> rpmlint yourfile.spec </bash>

Some warnings are OK. If you want to debug your experiments, you can comment the contents of the prep, build or clean sections in the spec file. For prep and build, you must have executed it uncommented at least once.

You may be able to QC the build with mock. For this, run as root:

<bash> yum -y install mock useradd -G mock makerpm </bash>

Then run it with mock -r fedora-12-x86_64 rebuild path_to_source_RPM .

Excellent further reading on this topic is given by Fedora's guide to creating RPM packages