0

I am currently supporting devices which are running FreeBSD 9.2, as well as 10. And I need to somehow install a newer version of archivers/libarchive than that which is available for these FreeBSD versions (3.2.1 seems to have first become available in 11.0). I also can't change anything in /usr/ports (that is, I need to keep the new libarchive port in a completely different directory). Also, the build script that assembles the device's environment can only use make to compile the ports, as far as I know.

My own idea of building libarchive 3.2.1 is:

  1. check out the ports tree from ports/tags/RELEASE_11_0_0/ from SVN, then only leave the libarchive and its dependencies, as well as the contents of the ports/Mk directory.

  2. cd path/to/new/ports/arhivers/libarchive and run make, probably specifying the alternative search path for the .included .mk-files via -I. Possibly also change the value of the PORTSDIR variable?

Am I missing something (is my approach even valid..?)? Is there a better way to accomplish this?

Exander
  • 101
  • 1
  • Migrate the server to version 11 ? – yagmoth555 Oct 27 '16 at 15:11
  • Unfortunately, it's impossible right now (it's complicated :)). – Exander Oct 27 '16 at 15:14
  • FreeBSD version bumps for the devices happen once a year at most; I need a new version of libarchive now... – Exander Oct 27 '16 at 15:15
  • Have your tried to use fresh ports? E. g. updated via portsnap or from svn.freebsd.org/ports/head/ FreeBSD 9 is still supported and current port tree should work on FreeBSD 9.2 too. Tags in FreeBSD ports SVN is just mark ports tree as was used for given release (iso images e. t.c.). – citrin Oct 27 '16 at 17:15

1 Answers1

0

1) The canonical way without base system upgrade. zfs snapshot the old ports, checkout the new one from head. Try to build it. Unfortunetaly, this has 80% chance of failure 'cause there was way much changes to the FreeBSD port tree itself from 9.x to 10.x. Rollback the ports tree in case of failure.

2) The Solaris way. Build from sources into custom PREFIX. Get the source tarball, extract it to the ~/src/libarchive, install devel/gmake, lang/gcc48, devel/autoconf269 if appropriate, tar xvzf or whatever, then cwd to the extracted path, ./configure --prefix /usr/local/libarchive && gmake all install (talking briefly). Then use the binaries or link with locally installed libraries in the same way.

4) Create your own port version for 9.2 ports tree. Copy the port to the ~/ports/libarchive, substitute the tarball version for 3.2.1, edit the port version in Makefile (and probably the CONFIGURE_ARGS) and the pkg-plist accordingly. This will take some time, and, most probably, will fail for the first or second attempt, but seems doable (I took a brief look at the port).

5) Most convenient way. Upgrade your legacy 9.2 to the 10.3, because the only reason to have this museum antiquity is having a set of closed-code custom built binaries, which are proven to crash under new ABI, even with misc/compat9x port installed. And I've never seen such things.

drookie
  • 8,051
  • 1
  • 17
  • 27