Skip to content

Commit ee22753

Browse files
committed
CLOUDSTACK-1: Updated the instructions for building RPMs to reflect Maven changes and new packaging.sh script contributed by Hugo, et. al.
1 parent 5e4c2c8 commit ee22753

1 file changed

Lines changed: 75 additions & 71 deletions

File tree

docs/en-US/build-rpm.xml

Lines changed: 75 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5,78 +5,82 @@
55
]>
66

77
<!-- Licensed to the Apache Software Foundation (ASF) under one
8-
or more contributor license agreements. See the NOTICE file
9-
distributed with this work for additional information
10-
regarding copyright ownership. The ASF licenses this file
11-
to you under the Apache License, Version 2.0 (the
12-
"License"); you may not use this file except in compliance
13-
with the License. You may obtain a copy of the License at
14-
15-
http://www.apache.org/licenses/LICENSE-2.0
16-
17-
Unless required by applicable law or agreed to in writing,
18-
software distributed under the License is distributed on an
19-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20-
KIND, either express or implied. See the License for the
21-
specific language governing permissions and limitations
22-
under the License.
8+
or more contributor license agreements. See the NOTICE file
9+
distributed with this work for additional information
10+
regarding copyright ownership. The ASF licenses this file
11+
to you under the Apache License, Version 2.0 (the
12+
"License"); you may not use this file except in compliance
13+
with the License. You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing,
18+
software distributed under the License is distributed on an
19+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20+
KIND, either express or implied. See the License for the
21+
specific language governing permissions and limitations
22+
under the License.
2323
-->
2424

2525
<section id="sect-source-buildrpm">
26-
<title>Building RPMs</title>
27-
<para>
28-
While we have defined, and you have presumably already installed the
29-
bootstrap prerequisites, there are a number of build time prerequisites
30-
that need to be resolved. &PRODUCT; uses maven for dependency resolution.
31-
You can resolve the buildtime depdencies for CloudStack by running the
32-
following command:
33-
<programlisting><prompt>$</prompt> <command>mvn</command> -P deps</programlisting>
34-
</para>
35-
<para>
36-
Now that we have resolved the dependencies we can move on to building &PRODUCT;
37-
and packaging them into RPMs by issuing the following command.
38-
<programlisting><prompt>$</prompt> <command>./waf</command> rpm</programlisting>
39-
</para>
40-
<para>
41-
Once this completes, you should find assembled RPMs in
42-
<filename>artifacts/rpmbuild/RPMS/x86_64</filename>
43-
</para>
44-
<section id="sect-source-buildrpm-repo">
45-
<title>Creating a yum repo</title>
46-
<para>
47-
While RPMs is an ideal packaging format - it's most easily consumed from
48-
yum repositories over a network. We'll move into the directory with the
49-
newly created RPMs by issuing the following command:
50-
<programlisting><prompt>$</prompt> <command>cd</command> artifacts/rpmbuild/RPMS/x86_64</programlisting>
51-
</para>
52-
<para>
53-
Next we'll issue a command to create the repository metadata by
54-
issuing the following command:
55-
<programlisting><prompt>$</prompt> <command>createrepo</command> ./</programlisting>
56-
</para>
57-
<para>
58-
The files and directories within our current working directory can now
59-
be uploaded to a web server and serve as a yum repository
60-
</para>
26+
<title>Building RPMs from Source</title>
27+
<para>As mentioned previously in <xref linkend="sect-source-prereq" />, you will need to install several prerequisites before you can build packages for &PRODUCT;. Here we'll assume you're working with a 64-bit build of CentOS or Red Hat Enterprise Linux.</para>
28+
<para><programlisting># yum groupinstall "Development Tools"</programlisting></para>
29+
<para><programlisting># yum install java-1.6.0-openjdk-devel.x86_64 genisoimage mysql mysql-server ws-common-utils MySQL-python tomcat6 createrepo</programlisting></para>
30+
<para>Next, you'll need to install build-time dependencies for CloudStack with
31+
Maven. We're using Maven 3, so you'll want to
32+
<ulink url="http://maven.apache.org/download.cgi">grab a Maven 3 tarball</ulink>
33+
and uncompress it in your home directory (or whatever location you prefer):</para>
34+
<para><programlisting>$ tar zxvf apache-maven-3.0.4-bin.tar.gz</programlisting></para>
35+
<para><programlisting>$ export PATH=/usr/local/apache-maven-3.0.4//bin:$PATH</programlisting></para>
36+
<para>Maven also needs to know where Java is, and expects the JAVA_HOME environment
37+
variable to be set:</para>
38+
<para><programlisting>$ export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/</programlisting></para>
39+
<para>Verify that Maven is installed correctly:</para>
40+
<para><programlisting>$ mvn --version</programlisting></para>
41+
<para>You probably want to ensure that your environment variables will survive a logout/reboot.
42+
Be sure to update <filename>~/.bashrc</filename> with the PATH and JAVA_HOME variables.</para>
43+
44+
<para>Building RPMs for $PRODUCT; is fairly simple. Assuming you already have the source downloaded and have uncompressed the tarball into a local directory, you're going to be able to generate packages in just a few minutes.</para>
45+
<note><title>Packaging has Changed</title>
46+
<para>If you've created packages for $PRODUCT; previously, you should be aware that the process has changed considerably since the project has moved to using Apache Maven. Please be sure to follow the steps in this section closely.</para>
47+
</note>
48+
<section id="generating-rpms">
49+
<title>Generating RPMS</title>
50+
<para>Now that we have the prerequisites and source, you will cd to the <filename>packaging/centos63/</filename> directory.</para>
51+
<para>Generating RPMs is done using the <filename>package.sh</filename> script:
52+
<programlisting><prompt>$</prompt>./package.sh</programlisting>
53+
</para>
54+
<para>That will run for a bit and then place the finished packages in <filename>dist/rpmbuild/RPMS/x86_64/</filename>.</para>
55+
<para>You should see seven RPMs in that directory: <filename>cloudstack-agent-4.1.0-SNAPSHOT.el6.x86_64.rpm</filename>, <filename>cloudstack-awsapi-4.1.0-SNAPSHOT.el6.x86_64.rpm</filename>, <filename>cloudstack-cli-4.1.0-SNAPSHOT.el6.x86_64.rpm</filename>, <filename>cloudstack-common-4.1.0-SNAPSHOT.el6.x86_64.rpm</filename>, <filename>cloudstack-docs-4.1.0-SNAPSHOT.el6.x86_64.rpm</filename>, <filename>cloudstack-management-4.1.0-SNAPSHOT.el6.x86_64.rpm</filename>, and <filename>cloudstack-usage-4.1.0-SNAPSHOT.el6.x86_64.rpm</filename>.</para>
56+
<section id="sect-source-buildrpm-repo">
57+
<title>Creating a yum repo</title>
58+
<para>
59+
While RPMs is a useful packaging format - it's most easily consumed from Yum repositories over a network. The next step is to create a Yum Repo with the finished packages:
60+
<programlisting><prompt>$</prompt> mkdir -p ~/tmp/repo</programlisting>
61+
<programlisting><prompt>$</prompt> cp dist/rpmbuild/RPMS/x86_64/*rpm ~/tmp/repo/</programlisting>
62+
<programlisting><prompt>$</prompt> createrepo ~/tmp/repo</programlisting>
63+
</para>
64+
<para>
65+
The files and directories within <filename>~/tmp/repo</filename> can now be uploaded to a web server and serve as a yum repository.
66+
</para>
67+
</section>
68+
<section id="sect-source-buildrpm-repo2">
69+
<title>Configuring your systems to use your new yum repository</title>
70+
<para>
71+
Now that your yum repository is populated with RPMs and metadata
72+
we need to configure the machines that need to install $PRODUCT;.
73+
Create a file named <filename>/etc/yum.repos.d/cloudstack.repo</filename> with this information:
74+
<programlisting>
75+
[apache-cloudstack]
76+
name=Apache CloudStack
77+
baseurl=http://<replaceable>webserver.tld/path/to/repo</replaceable>
78+
enabled=1
79+
gpgcheck=0
80+
</programlisting>
81+
</para>
82+
<para> Completing this step will allow you to easily install $PRODUCT; on a number of machines across the network.
83+
</para>
84+
</section>
85+
</section>
6186
</section>
62-
<section id="sect-source-buildrpm-repo2">
63-
<title>Configuring your systems to use your new yum repository</title>
64-
<para>
65-
Now that your yum repository is populated with RPMs and metadata
66-
we need to configure our machines that need to install CloudStack.
67-
We will create a file at <filename>/etc/yum.repos.d/cloudstack.repo</filename>
68-
with the following content:
69-
<programlisting>
70-
[apache-cloudstack]
71-
name=Apache CloudStack
72-
baseurl=http://<replaceable>webserver.tld/path/to/repo</replaceable>
73-
enabled=1
74-
gpgcheck=0
75-
</programlisting>
76-
</para>
77-
<para>
78-
Completing this step will allow you to easily install CloudStack on a number of
79-
machines across the network.
80-
</para>
81-
</section>
82-
</section>

0 commit comments

Comments
 (0)