Skip to content

Conversation

@gabm
Copy link

@gabm gabm commented Jun 30, 2017

We want to package cpplocate (and others) but we cannot install it using system-dir-install into fakeroot due to auto-recognition of cppassist

Solution: add an optional override flag to do that

@gabm gabm changed the title Problem: cppassist cannot be installed to non-system directories in system-dir-install Problem: cpplocate cannot be installed to non-system directories in system-dir-install Jun 30, 2017
@scheibel
Copy link
Member

Thanks for providing a PR that solves a problem using our libraries.
I'll use this PR as representative for the other ones (cginternals/cppfs#4, cginternals/cppexpose#42, and cginternals/cppassist#38) to talk about contents and reviews as I think everything applies there as well.

I'm currently trying to understand your deployment prodecure to get a clue on how your fix is working. It seems like you want to install cpplocate as a package maintainer in a fakeroot environment so that the correct file permissions are set prior to packaging. We currently target PPA deployment for Ubuntu, where I think we do something similar. However, we use cmake-builtin functionality and a small cmake-init hack to emulate the DESTDIR behavior on linux systems. Can you give an example on how you try to package our libraries and which steps are not working as intended?

Although your solution seems effective, we try to keep the cmake options required for deployment at a minimum (currently zero) and usually search for other solutions.

@scheibel
Copy link
Member

Here is an example how we use the existing cmake build system to prepare our libraries for deb-file packaging:

export BUILDDIR = build
mkdir $(BUILDDIR)
cd $(BUILDDIR);cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DOPTION_BUILD_DOCS=On ..

cd $(BUILDDIR); DESTDIR=../debian/tmp COMPONENT=runtime make component_install
mkdir -p debian/tmp/DEBIAN
dpkg-gencontrol -plibcpplocate
dpkg --build debian/tmp ..
rm -rf debian/tmp

cd $(BUILDDIR); DESTDIR=../debian/tmp COMPONENT=dev make component_install
mkdir -p debian/tmp/DEBIAN
dpkg-gencontrol -plibcpplocate-dev
dpkg --build debian/tmp ..
rm -rf debian/tmp

cd $(BUILDDIR); DESTDIR=../debian/tmp COMPONENT=docs make component_install
mkdir -p debian/tmp/DEBIAN
dpkg-gencontrol -plibcpplocate-docs
dpkg --build debian/tmp ..
rm -rf debian/tmp

@gabm
Copy link
Author

gabm commented Jun 30, 2017

thanks for your answer... Unfortunately we cannot detect the SYSTEM_DIR_INSTALL by comparing the CMAKE_INSTALL_PREFIX with /usr/ because our install directory is something arbitrary in a temporary location... Also we use exactly the same filesystem structure (UNIX-like) on Windows OS, where the if query will fail anyway which results in the dll to be located in the root of the install dir and not in bin...

It seemed the easiest way to me to solve it like this, I just wanted a "clean" UNIX-like installation tree, no matter where I install to or in which platform I am...

@sbusch42
Copy link
Member

Yes, the current behavior of detecting system-dir installs by comparing with /usr or /usr/local does not work with the described use case. I think your solution is fine for the moment, we will later rewrite this from the ground up (but it will most likely be very similar to this, use an option instead of trying to detect it).

@gabm
Copy link
Author

gabm commented Jun 30, 2017

well auto detection is always somewhat critical for packaging although I understand the need to reduce configuration options...

@ekilmer ekilmer mentioned this pull request Feb 18, 2022
@gabm gabm closed this Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants