README 3.28 KB
Newer Older
1 2 3 4 5 6
prepare slapos build for obs
============================

This environment is made to prepare a SlapOS tarball and packaging configurations
to be used with openSUSE Build Service (OBS).

7 8 9 10 11 12 13 14 15 16 17
Notes
-----

Build in OBS is a bit complex. The build of the packages itself is in offline mode,
meaning that we don't have internet connection. Of course, doing "bin/buildout" to
install slapos and make the package requires internet connection.

Solution: run bin/buildout outside of the OBS system to fetch all the needed files,
put them in a cache and upload it in the OBS system so that buildout is happy and works in
offline mode.

18 19 20 21
Requirements
------------
- A computer
- Internet connection
Cédric Le Ninivin's avatar
Cédric Le Ninivin committed
22
- gcc, g++, make, patch, wget, python, chrpath, osc, devscripts
23 24 25 26 27 28 29 30 31 32 33
- An account on OBS

Documentation
-------------
- http://en.opensuse.org/openSUSE:Build_Service_Tutorial
- http://en.opensuse.org/Portal:Packaging
- http://wiki.debian.org/IntroDebianPackaging

Directory Organisation
----------------------

Cédric Le Ninivin's avatar
Cédric Le Ninivin committed
34
- prepare_slapos_build.sh : This is the script you have to run to prepare the packet.
35
  You can choose the version you want to build in it.
Cédric Le Ninivin's avatar
Cédric Le Ninivin committed
36 37 38
- ./home:VIFIBnexedi:branches:home:VIFIBnexedi/SlapOS-Node : This is the directory for OBS.
  It is the one used to generate unreleased package and testing it.
  If you have/want to use another directory, update its path in prepare_slapos_build.sh
39 40 41 42 43 44 45
- templates/ : Contain templates to build the package.
  	     - debian/ : contain configuration files for .deb packaging
	     - Makefile.in : Makefile to build slapos
	     - offline.sh.in : Prepare network-cache build building once slapos
	     - slapos.dsc.in : File needed by obs to build .deb package
	     - slapos.spec.in : configuration file for rpm packaging
- slapos-node/ : Template to build package
Cédric Le Ninivin's avatar
Cédric Le Ninivin committed
46
  	       - Makefile : Makefile to build slapos and add files for package
47
	       - slapos-re6st-setup : shell script that can setup re6st for you.
48
	       - slapos-test : python script to check user configuration and cron file
Cédric Le Ninivin's avatar
Cédric Le Ninivin committed
49 50
	       - template/ : template files for package (cron.d, service)
	       - slapos/ : to build slapos. Contain buildout.cfg.in
51 52 53 54 55 56


preparing the package
---------------------

First make sure all files are ready and you have all necessary packages installed.
Cédric de Saint Martin's avatar
Cédric de Saint Martin committed
57
You need in particular an OBS directory (for example, the vifib test directory)::
Cédric de Saint Martin's avatar
Cédric de Saint Martin committed
58 59 60 61 62 63

  $ cd <directory_to_contain_prepare_script>
  $ osc checkout home:VIFIBnexedi:branches:home:VIFIBnexedi/SlapOS-Node
  $ cd home:VIFIBnexedi:branches:home:VIFIBnexedi/SlapOS-Node
  $ osc up

64
SlapOS is build using buildout and need an internet connection to fetch all elements.
Cédric Le Ninivin's avatar
Cédric Le Ninivin committed
65
On obs package are build on virtual machines without internet access.
66 67 68
prepare_slapos_build.sh will compile slapos on your computer and build a network-cache thanks to offline.sh script.
At the end it remove slapos installation and only keep cache.
It makes a tarball out of it to be used by obs.
Cédric Le Ninivin's avatar
Cédric Le Ninivin committed
69 70 71
It then fetch packaging configuration from templates directory. Everything is then commit to obs thanks to osc.

So to build package just run:
72 73 74 75 76 77 78
# bash prepare_slapos_build.sh

About cron file
---------------

Main cron file is situated in slapos-node/template/slapos-node.cron.d
Prepare script will copy this one in the debian directory.
79
WARNING: if you update cron, do not forget to update slapos-test which check cron file