Building a portable dfhack package:
mkdir linux && cd linux
cmake ../.. -DDFHACK_INSTALL=portable -DCMAKE_INSTALL_PREFIX=~/my_dfhack -DCMAKE_BUILD_TYPE=Release
make
make install
You'll end up with portable linux dfhack in ~/my_dfhack. Probably not useful when you want to install it into the system and let other things link against the library though.
Now, the way to make dfhack build without any extra packaging steps:
mkdir linux && cd linux
cmake ../.. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DMEMXML_DATA_PATH=/usr/share/dfhack
make
sudo make install
This way you'll end up with dfhack files all over your system. Not very nice. On debian systems, you can replace the last step with "sudo checkinstall" and it will install using dpkg so dfhack will be removable later.
Finally, a packaging example (taken from my arch linux PKGBUILD file for dfhack):
build() {
cd "${srcdir}/${pkgname}"
mkdir -p pkg-build&&cd pkg-build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${pkgdir}/usr -DMEMXML_DATA_PATH:path=/usr/share/dfhack ..
make || return 1
make install || return 1
cd ..
}
The ${pkgdir} obviously never matches the actual "/".
Now, I'm all ears about any kind of improvement I can make here...