| 1 | MacPorts AutoBuild |
|---|
| 2 | Version 0.5, 2008-05-31 |
|---|
| 3 | |
|---|
| 4 | Introduction |
|---|
| 5 | ------------ |
|---|
| 6 | MacPorts AutoBuild (mpab) is a set of scripts which creates a chroot |
|---|
| 7 | environment in which to run MacPorts and build the entire group of ports |
|---|
| 8 | available to it. Once complete (which could take a long time) or stopped, |
|---|
| 9 | the build logs are moved out of the chroot to be available for review. |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | Prerequisites |
|---|
| 13 | ------------- |
|---|
| 14 | You need to have 10.5, Xcode 3.0, and Apple's X11 (other versions of Xcode |
|---|
| 15 | and X11 may work, but these are the ones tested so far). |
|---|
| 16 | |
|---|
| 17 | For the MacPorts which will live in the chroot, you'll need (in the same |
|---|
| 18 | directory as the mpab script) a tarball named macports_dist.tar.bz2. To |
|---|
| 19 | create this straight from the MacPorts svn server (assuming current |
|---|
| 20 | working directory is the same as the mpab script): |
|---|
| 21 | |
|---|
| 22 | svn export http://svn.macports.org/repository/macports/trunk mpexport |
|---|
| 23 | cd mpexport |
|---|
| 24 | tar cf - . | bzip2 -c > ../macports_dist.tar.bz2 |
|---|
| 25 | cd .. |
|---|
| 26 | rm -rf mpexport |
|---|
| 27 | |
|---|
| 28 | This just exports it from svn (since the .svn stuff isn't needed for this) |
|---|
| 29 | then creates the tarball; note everything in the tarball is based on the |
|---|
| 30 | current working directory. |
|---|
| 31 | |
|---|
| 32 | If you already have MacPorts from svn, run this instead of the first command |
|---|
| 33 | above, then do the rest: |
|---|
| 34 | |
|---|
| 35 | svn export /path/to/macports/svn/trunk mpexport |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | Installation |
|---|
| 39 | ------------ |
|---|
| 40 | Once the MPAB tarball is extracted (which you've probably done if you're |
|---|
| 41 | reading this), make sure the above prerequisites are available, then you |
|---|
| 42 | are ready to go |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | Running |
|---|
| 46 | ------- |
|---|
| 47 | To just build it all (every port): |
|---|
| 48 | |
|---|
| 49 | sudo ./mpab |
|---|
| 50 | |
|---|
| 51 | (assuming you are in the directory with the mpab script). This will do |
|---|
| 52 | what needs doing to get a chroot, install MacPorts in said chroot, then |
|---|
| 53 | start building ports. |
|---|
| 54 | |
|---|
| 55 | The first time you run, it will take some time as it is creating a chroot |
|---|
| 56 | environment, which involves copying several gigabytes of files into |
|---|
| 57 | said chroot...be patient. |
|---|
| 58 | |
|---|
| 59 | To build only a certain set of ports you need a file containing the |
|---|
| 60 | list of the port names. The `port list' command adds more information |
|---|
| 61 | than you want here, like version and category. To create an list for |
|---|
| 62 | mpab consumption, you can use something like this: |
|---|
| 63 | |
|---|
| 64 | port echo maintainer:YOURNAME > own_ports |
|---|
| 65 | |
|---|
| 66 | and then |
|---|
| 67 | |
|---|
| 68 | sudo ./mpab buildports own_ports |
|---|
| 69 | |
|---|
| 70 | You can run './mpab help' to see what commands can be used with |
|---|
| 71 | mpab. |
|---|
| 72 | |
|---|
| 73 | Note that ports don't get rebuild when you run this twice, since they |
|---|
| 74 | get stored as package once built sucessfully, and only rebuild when |
|---|
| 75 | the version or revision gets changed. The port file definitions come |
|---|
| 76 | from the macports_dist.tar.bz2 file you used for creating the disk images. |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | Maintenance |
|---|
| 80 | ----------- |
|---|
| 81 | mpab creates several disk images: |
|---|
| 82 | |
|---|
| 83 | mproot.dmg - this is the basic chroot environment with various system |
|---|
| 84 | programs installed; it is read-only |
|---|
| 85 | mproot.dmg.shadow - this is where updates to the chroot go, which means |
|---|
| 86 | to restart with a bare chroot, simply delete it and |
|---|
| 87 | all traces of MacPorts are gone |
|---|
| 88 | mproot_distcache.sparseimage - this is a disk image only containing the |
|---|
| 89 | distfiles MacPorts downloads (which are |
|---|
| 90 | in /opt/local/var/macports/distfiles) |
|---|
| 91 | |
|---|
| 92 | When the OS version is updated, both mproot.dmg and mproot.dmg.shadow |
|---|
| 93 | should be deleted so they can be rebuilt. Any time you want to clean out |
|---|
| 94 | the built MacPorts within the chroot but not rebuild the entire environment, |
|---|
| 95 | you can delete just mproot.dmg.shadow, to start from scratch. Note if you |
|---|
| 96 | want to rebuild MacPorts program and libraries, mpab has a rebuildmp target |
|---|
| 97 | to do just that. |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | Todo |
|---|
| 101 | ---- |
|---|
| 102 | improve the amount of debugging available via MPABDEBUG |
|---|
| 103 | |
|---|
| 104 | add 10.4 support (mostly needs different paths in pathsToCreate and |
|---|
| 105 | pathsToCopy in buildImages()) |
|---|
| 106 | |
|---|
| 107 | add a method to allow variants either globally or to an individual port |
|---|
| 108 | |
|---|
| 109 | fix dependency checking to work more like MP; currently if a port fails, all |
|---|
| 110 | those depending on it are skipped, but if it's lib:...:port then it might |
|---|
| 111 | still be buildable (see some things which depend on gnutar, and this will |
|---|
| 112 | allow to skip the XFree86/xorg special-casing) |
|---|