Confirmed users
1,018
edits
No edit summary |
|||
| Line 26: | Line 26: | ||
config['centos-6-i386-os']['macros']['dist'] = '.el6' | config['centos-6-i386-os']['macros']['dist'] = '.el6' | ||
</pre> | </pre> | ||
==Prepare the Package== | |||
For this example, I want to build a new mozilla-python27 package based on 2.7.3 instead of 2.7.2. I'm going to fetch the original .src.rpm and extract it into a subdirectory: | For this example, I want to build a new mozilla-python27 package based on 2.7.3 instead of 2.7.2. I'm going to fetch the original .src.rpm and extract it into a subdirectory: | ||
| Line 42: | Line 44: | ||
</pre> | </pre> | ||
Now we want to rebuild the package. | ==Build the Package== | ||
Now we want to rebuild the package using our updated .spec file. | |||
<pre> | <pre> | ||
| Line 53: | Line 57: | ||
Note: adjust the target to 'centos-6-i386-os' to generate a 32-bit package. | Note: adjust the target to 'centos-6-i386-os' to generate a 32-bit package. | ||
In this case, though, I wanted to use mock (not mach) to build the final package since my mach build machine does not have access to the Mozilla yum repos. | In this case, though, I wanted to use mock (not mach) to build the final package since my mach build machine does not have access to the Mozilla yum repos. We can use the .src.rpm generated above and feed that to mock. | ||
Note that this is a simple example. mach has an advantage over mock in that it figures out dependencies when building multiple packages and automatically pulls in source files (normally a manual operation). This can save a lot of time and hassle. | |||
==Configure Mock== | |||
* Install mock | |||
* Copy the [http://hg.mozilla.org/users/john.hopkins_mozillamessaging.com/misc/file/default/mock mock-config] folder to your home directory (this example uses /home/cltbld/mock-config). | |||
==Build Using Mock== | |||
* Fetch the .src.rpm you built earlier. | |||
* Execute these steps to build: | |||
<pre> | |||
$ mock='mock --configdir=/home/cltbld/mock-config -r epel-6-x86_64 -v' | |||
$ $mock --rebuild mozilla-python27-2.7.3-0.el6.src.rpm | |||
</pre> | |||
* The script will tell you where the results are available. | |||
* Use 'epel-6-i386' to build a 32-bit package. | |||