From 9d6d6172e404a5b59c038422575adcb9612ad3ff Mon Sep 17 00:00:00 2001 From: Joe Brockmeier Date: Fri, 19 Oct 2012 14:33:04 -0500 Subject: [PATCH] Made a number of fixes to the steps for compiling Debian packages, added section on adding an APT repository. --- docs/en-US/build-deb.xml | 91 +++++++++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 14 deletions(-) diff --git a/docs/en-US/build-deb.xml b/docs/en-US/build-deb.xml index 0fe3d90ce34..deee3ceb1de 100644 --- a/docs/en-US/build-deb.xml +++ b/docs/en-US/build-deb.xml @@ -26,35 +26,98 @@ Building DEB packages In addition to the bootstrap dependencies, you'll also need to install - a few other dependencies by issuing the following commands: - # apt-get update - $ apt-get install debhelper openjdk-6-jdk tomcat6 libws-commons-util-java genisoimage python-mysqldb - + several other dependencies. Note that we recommend using Maven 3, which + is not currently available in 12.04.1 LTS. So, you'll also need to add a + PPA repository that includes Maven 3. After running the command + add-apt-repository, you will be prompted to continue and + a GPG key will be added. + + +$ sudo apt-get update +$ sudo apt-get install python-software-properties +$ sudo add-apt-repository ppa:natecarlson/maven3 +$ sudo apt-get update +$ sudo apt-get install ant debhelper openjdk-6-jdk tomcat6 libws-commons-util-java genisoimage python-mysqldb libcommons-codec-java libcommons-httpclient-java liblog4j1.2-java maven3 + While we have defined, and you have presumably already installed the bootstrap prerequisites, there are a number of build time prerequisites that need to be resolved. &PRODUCT; uses maven for dependency resolution. - You can resolve the buildtime depdencies for CloudStack by running the - following command: - $ mvn -P deps - + You can resolve the buildtime depdencies for CloudStack by running: + +$ mvn3 -P deps Now that we have resolved the dependencies we can move on to building &PRODUCT; and packaging them into DEBs by issuing the following command. - # dpkg-buildpackage + +$ dpkg-buildpackge -uc -us + + + + This command will build 16 Debian packages. You should have all of the following: + + +cloud-agent_4.0.0-incubating_amd64.deb +cloud-agent-deps_4.0.0-incubating_amd64.deb +cloud-agent-libs_4.0.0-incubating_amd64.deb +cloud-awsapi_4.0.0-incubating_amd64.deb +cloud-cli_4.0.0-incubating_amd64.deb +cloud-client_4.0.0-incubating_amd64.deb +cloud-client-ui_4.0.0-incubating_amd64.deb +cloud-core_4.0.0-incubating_amd64.deb +cloud-deps_4.0.0-incubating_amd64.deb +cloud-python_4.0.0-incubating_amd64.deb +cloud-scripts_4.0.0-incubating_amd64.deb +cloud-server_4.0.0-incubating_amd64.deb +cloud-setup_4.0.0-incubating_amd64.deb +cloud-system-iso_4.0.0-incubating_amd64.deb +cloud-usage_4.0.0-incubating_amd64.deb +cloud-utils_4.0.0-incubating_amd64.deb +
Setting up an APT repo - TBD + + After you've created the packages, you'll want to copy them to a system where you can serve the packages over HTTP. You'll create a directory for the packages and then use dpkg-scanpackages to create Packages.gz, which holds information about the archive structure. Finally, you'll add the repository to your system(s) so you can install the packages using APT. + + The first step is to make sure that you have the dpkg-dev package installed. This should have been installed when you pulled in the debhelper application previously, but if you're generating Packages.gz on a different system, be sure that it's installed there as well. + +$ sudo apt-get install dpkg-dev + +The next step is to copy the DEBs to the directory where they can be served over HTTP. We'll use /var/www/cloudstack/repo in the examples, but change the directory to whatever works for you. + + +sudo mkdir -p /var/www/cloudstack/repo/binary +sudo cp *.deb /var/www/cloudstack/repo/binary +sudo cd /var/www/cloudstack/repo/binary +sudo dpkg-scanpackages . /dev/null | tee Packages | gzip -9 > Packages.gz + + +Note: Override Files + You can safely ignore the warning about a missing override file. + + +Now you should have all of the DEB packages and Packages.gz in the binary directory and available over HTTP. (You may want to use wget or curl to test this before moving on to the next step.) +
Configuring your machines to use the APT repository Now that we have created the repository, you need to configure your machine - to make use of the APT repository. We do that by issuing the following commands: - $ echo "deb http://url.to/apt/repo $(lsb_release -s -c) 4.0" > /etc/apt/sources.list.d/cloudstack.list - # apt-get update - + to make use of the APT repository. You can do this by adding a repository file + under /etc/apt/sources.list.d. Use your preferred editor to + create /etc/apt/sources.list.d/cloudstack.list with this + line: + + deb http://server.url/cloudstack/repo binary/ + + Now that you have the repository info in place, you'll want to run another + update so that APT knows where to find the &PRODUCT; packages. + +$ sudo apt-get update + +You can now move on to the instructions under Install on Ubuntu. +