1. 使用rpmbuild
添加mockbuild用户和组
# groupadd mockbuild
# useradd -gmockbuild mockbuild
# cat /etc/passwd
# cat /etc/group
安装rpm-build
# yum install rpm-build*
准备环境(安装build所需包)
#yum install libblkid-devel autoconf automake gettext-devel libtool python-devel python-devel libxml2-devel xhtml1-dtds readline-devel ncurses-devel libtasn1-devel gnutls-devel augeas libudev-devel libpciaccess-devel yajl-devel sanlock-devel libpcap-devel libnl-devel avahi-devel libselinux-devel cyrus-sasl-devel parted-devel device-mapper-devel numactl-devel libcap-ng-devel netcf-devel libcurl-devel audit-libs-devel systemtap-sdt-devel libattr-devel libnl3-devel fuse-devel dbus-devel polkit-devel
开始build
方法一:
# rpmbuild --rebuild ****.src.rpm
方法二:
Generate the spec file
#rpmbuild -bp /root/rpmbuild/SPECS/libvirt.spec
Modify the code, The following was the code path
#cd rpmbuild/BUILD/libvirt-0.10.2/
re-compile the code
# cd rpmbuild/BUILD/libvirt-0.10.2/
# pwd
/root/rpmbuild/BUILD/libvirt-0.10.2
# ./autogen.sh --system
# make
# make check
2. 使用git repo里自带的autogen
连接下载远程git repo
# git clone git://git.app.eng.bos.redhat.com/libvirt-rhel.git
查看本地branch
# git branch
next-6.5
* rhel7 ====================》当前工作的branch
git clone会下载远程repo正在工作的branch到本地,如果这不是你需要的,或者你想要下载其它远程branch,用下面方法:
# git branch -r =======================> 查看远程repo中的所有branch
# git checkout -b rhel7 origin/next-7.0 ===============》加载next-7.0 到本地
build libvirt
# ./autogen.sh --system --without-udev --without-storage-mpath --without-storage-disk --without-macvtap
阅读(1413) | 评论(0) | 转发(0) |