开源项目打rpm包
1.系统环境安装git gcc并解压centos7.5系统
cd /tmp yum -y install git gcc git clone https://github.com/oVirt/ovirt-engine
2.使用普通用户打包rpm
useradd centos || passwd centos
su centos || cd ~/
3.创建rpm环境
mkdir -pv rpmbuild/{SOURCES,SPECS,BUILD,BUILDROOT,RPMS}
cat ~/.rpmmacros
%_topdir /home/centos/rpmbuild
rpmbuild --showrc | grep topdir
-14: _builddir %{_topdir}/BUILD
-14: _buildrootdir %{_topdir}/BUILDROOT
-14: _rpmdir %{_topdir}/RPMS
-14: _sourcedir %{_topdir}/SOURCES
-14: _specdir %{_topdir}/SPECS
-14: _srcrpmdir %{_topdir}/SRPMS
-14: _topdir /home/centos/rpmbuild
4.切换root用户开始安装ovirt-engine环境
cd /tmp/ovirt-engine make dist yum -y install python-daemon unzip bind-utils postgresql-server postgresql postgresql-contrib python-dateutil python-m2crypto libxml2-python python-psycopg2 otopi ansible ovirt-engine-metrics ovirt-ansible-role sovirt-host-deploy ovirt-setup-lib maven-3 python-ovirt-engine-sdk4 python-flake8 python-pep8 python-docker-py python2-isort yum -y install ovirt-engine-wildfly ovirt-engine-wildfly-overlay yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release-master.rpm sudo yum install -y $(cat automation/check-patch.packages)
yum install -y ovirt-engine-nodejs ovirt-engine-nodejs-modules ovirt-engine-yarn automake autoconf ant cp ./ovirt-engine-4.4.0_master.tar.gz /home/centos/rpmbuild/SOURCES cp ./ovirt-engine.spec /home/centos/rpmbuild/SPECS chown -R centos.centos /home/centos/
yum -y install assertj-core archaius-core hystrix-core hystrix-metrics-event-stream rxjava ovirt-jboss-modules-maven-plugin
5.切换centos用户开始build rpm
su centos && cd ~/rpmbuild/SPECS
rpmbuild -bb ovirt-engine.spec