Ask Your Question
2

How to build package from source code?

asked 2014-03-04 04:19:35 -0500

kerwin gravatar image

updated 2014-03-04 10:50:27 -0500

sgordon gravatar image

What is the standard way to build rpm package from openstack source code.

e.g. nova package

from

https://github.com/openstack/nova

to rpm like

http://repos.fedorapeople.org/repos/o...

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2014-03-04 10:43:50 -0500

sgordon gravatar image

updated 2014-03-04 10:50:08 -0500

You can use setup.py to build "vanilla" RPMs from the project source trees like this:

$ python setup.py bdist_rpm

The Anvil project ( http://anvil.readthedocs.org/en/latest/ ) aims to facilitate such orchestrated RPM builds for OpenStack projects. To get something closer to what RDO is distributing you can download and examine the SRPMs, for your example this would be:

These can then be extracted like so:

$ wget http://repos.fedorapeople.org/repos/openstack/openstack-havana/epel-6/openstack-nova-2013.2-0.19.b3.el6.src.rpm
$ rpm2cpio openstack-nova-2013.2-0.19.b3.el6.src.rpm | cpio -idmv

This will leave you with an extract of the files in the package typically including:

  • A specification file.
  • A tarball of the project source.
  • Any additional patches being backported/applied to the tarball.
  • Any distribution specific init scripts etc.

For example, from the above package:

0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
0002-remove-runtime-dep-on-python-pbr.patch
0003-Revert-Use-oslo.sphinx-and-remove-local-copy-of-doc-.patch
0004-Fix-compute_node_get_all-for-Nova-Baremetal.patch
nova-2013.2.b3.tar.gz
nova-dist.conf
nova-ifc-template
nova-polkit.pkla
nova-sudoers
nova.logrotate
openstack-nova-api.init
openstack-nova-api.upstart
openstack-nova-cells.init
openstack-nova-cells.upstart
openstack-nova-cert.init
openstack-nova-cert.upstart
openstack-nova-compute.init
openstack-nova-compute.upstart
openstack-nova-conductor.init
openstack-nova-conductor.upstart
openstack-nova-console.init
openstack-nova-console.upstart
openstack-nova-consoleauth.init
openstack-nova-consoleauth.upstart
openstack-nova-metadata-api.init
openstack-nova-metadata-api.upstart
openstack-nova-network.init
openstack-nova-network.upstart
openstack-nova-newdeps.patch
openstack-nova-novncproxy.init
openstack-nova-novncproxy.sysconfig
openstack-nova-novncproxy.upstart
openstack-nova-objectstore.init
openstack-nova-objectstore.upstart
openstack-nova-scheduler.init
openstack-nova-scheduler.upstart
openstack-nova-spicehtml5proxy.init
openstack-nova-spicehtml5proxy.upstart
openstack-nova-xvpvncproxy.init
openstack-nova-xvpvncproxy.upstart
openstack-nova.spec

To update this you would update the tarball and use rpmbuild -ba <SPECFILE> to rebuild the package. Some edits to the SPEC may be required to ensure the name, version, and release of the source file match its expectations. You may also need to set up your RPM build environment for this, and other options listed above, to work - refer to http://wiki.centos.org/HowTos/SetupRp...

edit flag offensive delete link more

Comments

Thanks! I want to know where RDO maintain these spec files to?

kerwin gravatar imagekerwin ( 2014-03-04 20:03:59 -0500 )edit

My understanding is we are actually building them in Koji (the Fedora build system) at the moment, e.g.: http://koji.fedoraproject.org/koji/packageinfo?packageID=12510 Each package has a git repository in dist-git, e.g. http://pkgs.fedoraproject.org/cgit/openstack-nova.git/

sgordon gravatar imagesgordon ( 2014-03-04 20:22:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2014-03-04 04:19:35 -0500

Seen: 1,477 times

Last updated: Mar 04 '14