Tuesday 18 September 2012

Mock environment building

     
           Mock builds our source RPM package in a safe environment (chroot) to test our package functional  status, and the chroot simulates the real-world working platform for our testing purpose.

            First, I install the mock package by using command of "yum install mock", and then add myself to the group of mock by using command of " usermod -aG mock maximum".  Then, In the directory of ~/rpmbuild/SPRM/, I use command "mock -r fedor-17-x86_64 wget-1.13.4-2.fc17.src.rpm"to build the source rpm package in mock environment. The building process takes 5 minutes and 17 seconds. After finishing the building process, the result will save in the directory of /var/lib/mock/fedora-17-x86_64/result. In the result directory, it contains three log files normally, which are one binary rpm file, one source rpm file, and one debug rpm file. The build.log records the entire building process for the wget program, which simulates the building process in fedora-17-x86_64 working environment. The state.log file states the mock version number, and shows the building time phase. The root.log file shows the debug information and the running status.


No comments:

Post a Comment