# $Id Introduction ============ - The buildkit tool will build Kits based on the Kitscript and the structure of the Kit build directory. The tool is intended for users who want to package a collection of software and configure them to extend a Kusu system. - The kitscript is used to define what should be in a Kit. The kitscript is a simplified Python script that includes definitions of packages, components and the kit itself. There are helper methods and classes to make writing of the kitscript more convenient. Requirements ============ - You will need the following software installed and made available: - mkisofs for creating ISO images of the kits. - rpmbuild for creating RPM packages. - Development tools and libraries needed to build the software that intended for packaging. - The first two software requirements should have already been installed by default in a Kusu system. Installation ============ - If you install a Kusu system, buildkit should have already been installed on your master node. Run the following to verify. Note that 'PROMPT>' lines refer to your shell in the master node.: PROMPT> ls -l /opt/kusu/bin/buildkit PROMPT> buildkit --help - The first should show you the listing of the buildkit application. The second command will display the help message. Tutorial 1 ---------- - Throughout this tutorial, we'll walk you through the creation of a simple Kusu Kit. We will package the GNU Hello software from source and also create the necessary component and kit packages for the kit. 1. Create a working directory for making kits and change to it. This is optional. PROMPT> mkdir kits PROMPT> cd kits 2. Run the following command to create Kit build directory. This is where you can drop in assets like package source and modify the kitscript template. PROMPT> buildkit new kit=hellokit 3. You will notice that the hellokit directory has been created. Change to that directory and list the contents PROMPT> cd hellokit PROMPT> ls 4. There are several directories and a file called build.kit. This is a kitscript file. Use your favorite editor to edit this file. 5. You will notice that there are some definitions already exist in the file. You want to uncomment all the lines beginning that has anything to do with pkg1 (Lines 7 - 12 and line 20). Also modify the lines 7 to 12 to something like the following: pkg1 = SourcePackage() pkg1.name = 'hello' pkg1.version = '2.3' pkg1.release = '0' pkg1.installroot = '/opt/hello' pkg1.filename = 'hello-2.3.tar.bz2' 6. Save the changes made in that file and exit your editor. Run the following commands: PROMPT> cd sources PROMPT> wget http://ftp.gnu.org/gnu/hello/hello-2.3.tar.bz2 7. Note that the asset that you've defined for pkg1.filename earlier matches the downloaded file here. 8. Now that the kitscript have been defined and the asset is in place, we can go ahead with building the kit. Run the following to change back to the initial working directory and build the kit: PROMPT> cd ../.. PROMPT> buildkit make kit=hellokit 9. buildkit will proceed with the kitscript found in the hellokit build directory and create the necessary packages, component and kit packages and finally creates the ISO image. You now have a Kusu Kit ISO image in the hellokit directory. 10. This kit ISO image can be passed to kitops to install the kit.