Changes between Version 1 and Version 2 of howto/ShareArchives
- Timestamp:
- Jun 25, 2008, 3:17:06 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/ShareArchives
v1 v2 14 14 === '''Enable Archive Mode''' === 15 15 16 For starters, lets edit your macports.conf file and enable archive mode. Your macports.conf is found in ${prefix}/etc/macports/macports.conf. For most people, this will be /opt/local/etc/macports/macports.conf. Edit this file in your editor of choice and look for "portarchivemode". It will probably be set to "no" by default. Change it to a "yes"and then save the file.16 For starters, lets edit your {{{macports.conf}}} file and enable archive mode. Your {{{macports.conf}}} is found in {{{${prefix}/etc/macports/macports.conf}}}. For most people, this will be {{{/opt/local/etc/macports/macports.conf}}}. Edit this file in your editor of choice and look for {{{portarchivemode}}}. It will probably be set to {{{no}}} by default. Change it to a {{{yes}}} and then save the file. 17 17 18 18 == Share archives between identical architectures == 19 19 20 If you're using two machines that are both the same architecture ( i386 or powerpc) then you have it relatively easy. Lets say that you want to copy a compiled copy of sqlite3 over to your other machine. We'll use the terms 'source' and 'target' to describe the two machines here. The source is the one that already has itinstalled.21 === Build the archive on the sourcemachine ===20 If you're using two machines that are both the same architecture (''i386'' or ''powerpc'') then you have it relatively easy. Lets say that you want to copy a compiled copy of ''sqlite3'' over to your other machine. We'll use the terms __source__ and __target__ to describe the two machines here. The __source__ is the machine that already has the package installed. 21 === Build the archive on the __source__ machine === 22 22 {{{ 23 23 sudo port archive sqlite3 24 24 }}} 25 === Install the archive on the targetmachine ===26 Now if you look on your source machine in ${prefix}/var/macports/packages/darwin/${arch} (where ${arch} is either i386 or powerpc) you should find a file named 'sqlite3-x.x.x_x.i386.tgz'. (The x's are the version number.) Copy that file to the same location on your target machine. Now on the targetdo:25 === Install the archive on the __target__ machine === 26 Now if you look on your __source__ machine in {{{${prefix}/var/macports/packages/darwin/${arch} }}} (where ${arch} is either ''i386'' or ''powerpc'') you should find a file named {{{sqlite3-x.x.x_x.i386.tgz}}}. (The x's are the version number.) Copy that file to the same location on your __target__ machine. Now on the __target__ do: 27 27 {{{ 28 28 sudo port unarchive sqlite3 … … 38 38 == Share archives between '''different''' architectures == 39 39 40 '''WARNING!!!''' Sharing archives between different architectures ''could'', in theory, seriously b0rkyour system! You have been warned!40 '''WARNING!!!''' Sharing archives between different architectures could, in theory, seriously '''b0rk''' your system! You have been warned! 41 41 42 Now, here's the fun part. Say you have an i386 machine and a powerpc machine. Chances are that the i386machine is a fair bit faster. But you can't share binaries between them... or can you? Thanks to the '''+universal''' variant, it's possible. Here's a good primer on [[wiki:howto/buildUniversal building universal binaries]].42 Now, here's the fun part. Say you have an ''i386'' machine and a ''powerpc'' machine. Chances are that the ''i386'' machine is a fair bit faster. But you can't share binaries between them... or can you? Thanks to the '''+universal''' variant, it's possible. Here's a good primer on [[wiki:howto/buildUniversal building universal binaries]]. 43 43 44 Unfortunately, just doing this is not enough. The archive system still knows where the archive was built, so by default a powerpc system will not use an i386 archive and vice versa. So what do we do? Well, we start with the simple steps. We'll be using the same example as above (sqlite3) going from a source i386 machine to a target powerpcmachine.44 Unfortunately, just doing this is not enough. The archive system still knows where the archive was built, so by default a ''powerpc'' system will not use an ''i386'' archive and vice versa. So what do we do? Well, we start with the simple steps. We'll be using the same example as above (''sqlite3'') going from a __source__ ''i386'' machine to a __target__ ''powerpc'' machine. 45 45 46 === Build the archive on the sourcemachine ===46 === Build the archive on the __source__ machine === 47 47 {{{ 48 48 sudo port archive sqlite3 +universal 49 49 }}} 50 === Install the archive on the targetmachine ===51 Now we're going to copy the file to the same location on the target machine. On our source machine we're going to find the file {{{/opt/local/var/macports/packages/darwin/i386/sqlite3-x.x.x_x+universal.i386.tgz}}} We're going to copy that file to the target machine. But the targetwon't have the appropriate directory, since it's a different architecture. So we're going to copy it into {{{/opt/local/var/macports/packages/darwin/powerpc/}}} instead.50 === Install the archive on the __target__ machine === 51 Now we're going to copy the file to the same location on the target machine. On our source machine we're going to find the file {{{/opt/local/var/macports/packages/darwin/i386/sqlite3-x.x.x_x+universal.i386.tgz}}} We're going to copy that file to the __target__ machine. But the __target__ won't have the appropriate directory, since it's a different architecture. So we're going to copy it into {{{/opt/local/var/macports/packages/darwin/powerpc/}}} instead. 52 52 53 You'll also notice that the archive has the architecture in the name. So we'll need to change that as well. Just rename the file and change i386 to powerpc.53 You'll also notice that the archive has the architecture in the name. So we'll need to change that as well. Just rename the file and change ''i386'' to ''powerpc''. The new name should be something like {{{sqlite3-x.x.x_x+universal.powerpc.tgz}}}. 54 54 55 55 Finally, we can proceed with the installation: … … 61 61 sudo port install sqlite3 +universal 62 62 }}} 63 Note that we're specifying the variant in both cases. Otherwise the commands wouldn't find the archive file and this wouldn't work. (Because the archive file has +universalin the name.)63 Note that we're specifying the variant in both cases. Otherwise the commands wouldn't find the archive file and this wouldn't work. (Because the archive file has ''+universal'' in the name.) 64 64 65 65 So that's it! Enjoy! :)