Compile CloudStack 4.10.0 version from CentOS7 source code to generate RPM package

Prerequisites for compiling Apache CloudStack¶

There are many prerequisites for compiling CloudStack. This article is compiled on Linux CentOS7 system, using RPM package management.

The following are the minimum requirements for compiling CloudStack:

  1. Maven (version 3)
  2. Java (Java 8/OpenJDK 1.8)
  3. Apache web server common tools (ws-commons-util)
  4. MySQL
  5. MySQLdb (provides python database API)
  6. Tomcat 7
  7. genisoimage
  8. rpmbuild
  1. Download source package

    wget http://www.apache.org/dyn/closer.lua/cloudstack/releases/4.10.0.0/apache-cloudstack-4.10.0.0-src.tar.bz2

    Or clone the source code on github, and then switch to the 4.10.0 branch

  2. Extracted source code

    tar -xvf apache-cloudstack-4.10.0.0-src.tar.bz2

     

  3. Configure the Yum source for MySQL

    cat << eof >  /etc/yum.repos.d/mysql.repo
    [mysql-community]
    name=MySQL Community connectors
    baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/$basearch/
    enabled=1
    gpgcheck=1
    eof
  4. Import GPG public key from MySQL

    rpm --import http://repo.mysql.com/RPM-GPG-KEY-mysql
  5. Install mysql-connector

    yum install mysql-connector-python
  6. Install openjdk, mysql, maven, etc.

    yum install java-1.8.0-openjdk-devel.x86_64 genisoimage mysql mysql-server ws-commons-util MySQL-python tomcat maven

     

  7. Install netscaler, vmware and other jars to the local maven repository

    #进入deps目录
    [root@czfbsdb500h01 cloudstack]# cd deps
    
    #执行如下wget下载jar包
    wget http://zooi.widodh.nl/cloudstack/build-dep/cloud-manageontap.jar
    wget http://zooi.widodh.nl/cloudstack/build-dep/cloud-iControl.jar
    wget http://zooi.widodh.nl/cloudstack/build-dep/vmware-vim.jar
    wget http://zooi.widodh.nl/cloudstack/build-dep/vmware-vim25.jar
    wget http://zooi.widodh.nl/cloudstack/build-dep/vmware-apputils.jar
    wget http://zooi.widodh.nl/cloudstack/build-dep/cloud-netscaler.jar
    
    #下载成功后执行安装到本地maven仓库
    [root@czfbsdb500h01 deps]# ./install-non-oss.sh 
  8. Generate RPM package

    cd packaging/
    ./package.sh -d centos7

    Note: The initial packaging execution time is very long

  9. Generate RPM package directory as follows

    [root@czfbsdb500h01 x86_64]# pwd
    /root/apache-cloudstack-4.10.0.0-src/dist/rpmbuild/RPMS/x86_64

     

  10. List of RPM packages

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324437728&siteId=291194637