[Bro] Issues with DESTDIR support

Hank Leininger hlein at korelogic.com
Wed Mar 7 11:53:53 PST 2012


I'm encountering some issues with DESTDIR support.

I'm trying to create an updated Gentoo .ebuild for bro 2.0.  Gentoo's
packaging process basically compiles and installs into a sandbox
directory under /var/tmp/portage/blahblahblah, using 'make
DESTDIR=/var/tmp/portage/blahblahblah/image/ install', and then merges
the contents of the sandbox into the real filesystem.

Most of bro's build system supports DESTDIR correctly; lib/, share/, and
bin/ all get populated properly under the sandbox directory.  But, it
seems that all config-file-writing code does not.  For instance, any
time a cmake_install.cmake file contains a section like:

  if (EXISTS /opt/bro/etc/something.cfg)
      ... cmake -E compare_files new_file /opt/bro/etc/something.cfg
      if not equal
          configure_file(new_file /opt/bro/etc/something.cfg.example)
      configure_file(new_file /opt/bro/etc/something.cfg)

I believe the right thing to do there is to leave the 'compare_files'
call alone (looking in the real FS for something.cfg), but then the
configure_file calls ought to write to $ENV{DESTDIR}/...

I've tried manually tweaking CMakeLists.txt, cmake_install.cmake etc
files to make that change, and I get... closer, but not quite.  I'm a
cmake n00b.

Any advice, or patches that people have done to package for other
distros with similar requirements would be much appreciated!



Hank Leininger <hlein at korelogic.com>
D24D 2C2A F3AC B9AE CD03  B506 2D57 32E1 686B 6DB3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 447 bytes
Desc: Digital signature
Url : http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20120307/58e0756a/attachment.bin 

More information about the Bro mailing list