[GH-ISSUE #3396] Vim contrib files do not follow the DESTDIR option in make install #2133

Closed
opened 2026-05-05 08:48:45 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @corecontingency on GitHub (May 3, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3396

Broken in commit 944049c.

The makefile is installing to $(datarootdir) instead of $(DESTDIR).

This breaks the AUR package, as it tries to to install the vim files to /usr/share/vim/vimfiles/ftdetect/ instead of the package working directory. See:

install -c -m 0755 contrib/sort.py /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/.
install -c -m 0755 contrib/syscalls.sh /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/.
install -c -m 0644 contrib/vim/ftdetect/firejail.vim /usr/share/vim/vimfiles/ftdetect/.
install: cannot create regular file '/usr/share/vim/vimfiles/ftdetect/./firejail.vim': Permission denied
make[1]: *** [Makefile:104: realinstall] Error 1
make[1]: Leaving directory '/home/user/Downloads/firejail-git/src/firejail-git'
make: *** [Makefile:150: install] Error 2
==> ERROR: A failure occurred in package().
    Aborting...
Originally created by @corecontingency on GitHub (May 3, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3396 Broken in commit [944049c](https://github.com/netblue30/firejail/commit/944049c4df9aec50cc7bc3ac7724e1d5dbf5d551). The makefile is installing to `$(datarootdir)` instead of` $(DESTDIR)`. This breaks the [AUR package](https://aur.archlinux.org/packages/firejail-git), as it tries to to install the vim files to `/usr/share/vim/vimfiles/ftdetect/` instead of the package working directory. See: ``` install -c -m 0755 contrib/sort.py /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/. install -c -m 0755 contrib/syscalls.sh /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/. install -c -m 0644 contrib/vim/ftdetect/firejail.vim /usr/share/vim/vimfiles/ftdetect/. install: cannot create regular file '/usr/share/vim/vimfiles/ftdetect/./firejail.vim': Permission denied make[1]: *** [Makefile:104: realinstall] Error 1 make[1]: Leaving directory '/home/user/Downloads/firejail-git/src/firejail-git' make: *** [Makefile:150: install] Error 2 ==> ERROR: A failure occurred in package(). Aborting... ```
Author
Owner

@rusty-snake commented on GitHub (May 3, 2020):

Should be fixed with 452fc93.

<!-- gh-comment-id:623069064 --> @rusty-snake commented on GitHub (May 3, 2020): Should be fixed with 452fc93.
Author
Owner

@ghost commented on GitHub (May 3, 2020):

For me the build from git master is still broken, even with 452fc93a91. I use a custom-made PKGBUILD on Arch, so I hadn't looked at the one from AUR in a while. What I find odd is it tries to install vim files in the first place, because the AUR PKGBUILD doesn't use the --enable-contrib-install flag AFAICT and I thought the default is not to.

Even when adding --datarootdir=/usr/share --enable-contrib-install make install still fails to find the vim files and aborts. The only way I can unbreak the build currently is by explicitly adding --disable-contrib-install, otherwise I keep seeing Install contrib scripts: yes in the configuration options output.

Together with #3393 it sure looks like our Makefile.in (which sadly I don't know enough about to properly fix it) needs some love... @netblue30?

<!-- gh-comment-id:623163912 --> @ghost commented on GitHub (May 3, 2020): For me the build from git master is still broken, even with https://github.com/netblue30/firejail/commit/452fc93a91b2e9dc6e9bee52d3bf10d0fb9f6616. I use a custom-made PKGBUILD on Arch, so I hadn't looked at the one from AUR in a while. What I find odd is it tries to install vim files in the first place, because the AUR PKGBUILD doesn't use the `--enable-contrib-install` flag AFAICT and I thought the default is not to. Even when adding `--datarootdir=/usr/share --enable-contrib-install` make install still fails to find the vim files and aborts. The only way I can unbreak the build currently is by explicitly adding `--disable-contrib-install`, otherwise I keep seeing **Install contrib scripts: yes** in the configuration options output. Together with #3393 it sure looks like our Makefile.in (which sadly I don't know enough about to properly fix it) needs some love... @netblue30?
Author
Owner

@corecontingency commented on GitHub (May 3, 2020):

Can confirm the AUR package is still failing:


install -c -m 0755 contrib/sort.py /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/.
install -c -m 0755 contrib/syscalls.sh /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/.
install -c -m 0644 contrib/vim/ftdetect/firejail.vim /home/user/Downloads/firejail-git/pkg/firejail-git//usr/share/vim/vimfiles/ftdetect/.
install: cannot create regular file '/home/user/Downloads/firejail-git/pkg/firejail-git//usr/share/vim/vimfiles/ftdetect/.': No such file or directory
make[1]: *** [Makefile:104: realinstall] Error 1
make[1]: Leaving directory '/home/user/Downloads/firejail-git/src/firejail-git'
make: *** [Makefile:150: install] Error 2
==> ERROR: A failure occurred in package().
    Aborting...
<!-- gh-comment-id:623186807 --> @corecontingency commented on GitHub (May 3, 2020): Can confirm the AUR package is still failing: ``` install -c -m 0755 contrib/sort.py /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/. install -c -m 0755 contrib/syscalls.sh /home/user/Downloads/firejail-git/pkg/firejail-git//usr/lib/firejail/. install -c -m 0644 contrib/vim/ftdetect/firejail.vim /home/user/Downloads/firejail-git/pkg/firejail-git//usr/share/vim/vimfiles/ftdetect/. install: cannot create regular file '/home/user/Downloads/firejail-git/pkg/firejail-git//usr/share/vim/vimfiles/ftdetect/.': No such file or directory make[1]: *** [Makefile:104: realinstall] Error 1 make[1]: Leaving directory '/home/user/Downloads/firejail-git/src/firejail-git' make: *** [Makefile:150: install] Error 2 ==> ERROR: A failure occurred in package(). Aborting... ```
Author
Owner

@rusty-snake commented on GitHub (May 3, 2020):

diff --git a/Makefile.in b/Makefile.in
index 9e026318..e7ccba14 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -104,6 +104,8 @@ ifeq ($(HAVE_CONTRIB_INSTALL),yes)
        install -c -m 0755 contrib/fj-mkdeb.py $(DESTDIR)/$(libdir)/firejail/.
        install -c -m 0755 contrib/sort.py $(DESTDIR)/$(libdir)/firejail/.
        install -c -m 0755 contrib/syscalls.sh $(DESTDIR)/$(libdir)/firejail/.
+       install -m 0755 -d $(DESTDIR)/$(datarootdir)/vim/vimfiles/ftdetect/.
+       install -m 0755 -d $(DESTDIR)/$(datarootdir)/vim/vimfiles/syntax/.
        install -c -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)/$(datarootdir)/vim/vimfiles/ftdetect/.
        install -c -m 0644 contrib/vim/syntax/firejail.vim $(DESTDIR)/$(datarootdir)/vim/vimfiles/syntax/.
 endif

<!-- gh-comment-id:623187338 --> @rusty-snake commented on GitHub (May 3, 2020): ```patch diff --git a/Makefile.in b/Makefile.in index 9e026318..e7ccba14 100644 --- a/Makefile.in +++ b/Makefile.in @@ -104,6 +104,8 @@ ifeq ($(HAVE_CONTRIB_INSTALL),yes) install -c -m 0755 contrib/fj-mkdeb.py $(DESTDIR)/$(libdir)/firejail/. install -c -m 0755 contrib/sort.py $(DESTDIR)/$(libdir)/firejail/. install -c -m 0755 contrib/syscalls.sh $(DESTDIR)/$(libdir)/firejail/. + install -m 0755 -d $(DESTDIR)/$(datarootdir)/vim/vimfiles/ftdetect/. + install -m 0755 -d $(DESTDIR)/$(datarootdir)/vim/vimfiles/syntax/. install -c -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)/$(datarootdir)/vim/vimfiles/ftdetect/. install -c -m 0644 contrib/vim/syntax/firejail.vim $(DESTDIR)/$(datarootdir)/vim/vimfiles/syntax/. endif ```
Author
Owner

@ghost commented on GitHub (May 3, 2020):

@rusty-snake Above patch returns 'Makefile:107: *** missing separator. Stop.'

<!-- gh-comment-id:623191288 --> @ghost commented on GitHub (May 3, 2020): @rusty-snake Above patch returns 'Makefile:107: *** missing separator. Stop.'
Author
Owner

@corecontingency commented on GitHub (May 3, 2020):

Seems to work fine for me, and it builds the package properly. I didn't use the patch though, just manually edited the changes into my fork of firejail and switched the URL in the PKGBUILD to my repo.

<!-- gh-comment-id:623191519 --> @corecontingency commented on GitHub (May 3, 2020): Seems to work fine for me, and it builds the package properly. I didn't use the patch though, just manually edited the changes into my fork of firejail and switched the URL in the PKGBUILD to my [repo](https://github.com/corecontingency/firejail).
Author
Owner

@ghost commented on GitHub (May 3, 2020):

Let me clean things up and try again...

<!-- gh-comment-id:623191718 --> @ghost commented on GitHub (May 3, 2020): Let me clean things up and try again...
Author
Owner

@ghost commented on GitHub (May 3, 2020):

Progress:
Works: ./configure --prefix=/usr --enable-apparmor
Works: ./configure --prefix=/usr --enable-apparmor --enable-contrib-install

Breaks: ./configure --prefix=/usr --enable-apparmor --disable-contrib-install
make: *** [Makefile:55: seccomp.32] Bus error (core dumped)
make: *** Deleting file 'seccomp.32'
make: *** Waiting for unfinished jobs....

So something still needs attention IMO, at least if we want the configure flags to work as advertised. @corecontingency Does it work for you when using the --disable-contrib-install flag?

<!-- gh-comment-id:623194821 --> @ghost commented on GitHub (May 3, 2020): Progress: Works: ./configure --prefix=/usr --enable-apparmor Works: ./configure --prefix=/usr --enable-apparmor --enable-contrib-install Breaks: ./configure --prefix=/usr --enable-apparmor --disable-contrib-install make: *** [Makefile:55: seccomp.32] Bus error (core dumped) make: *** Deleting file 'seccomp.32' make: *** Waiting for unfinished jobs.... So something still needs attention IMO, at least if we want the configure flags to work as advertised. @corecontingency Does it work for you when using the --disable-contrib-install flag?
Author
Owner

@corecontingency commented on GitHub (May 3, 2020):

@glitsj16

Does it work for you when using the --disable-contrib-install flag?

Yes, it seems to work, and build the package properly. Changed this line in the AUR PKGBUILD from:
./configure --prefix=/usr --enable-apparmor
to
./configure --prefix=/usr --enable-apparmor --disable-contrib-install

And switched the URL line to:
source=("${pkgname}::git+https://github.com/corecontingency/firejail.git")
which is master + rusty-snake's changes.

Let me try those other options.

EDIT: Normal, --enable-contrib-install, and --disable-contrib-install all work.

<!-- gh-comment-id:623196896 --> @corecontingency commented on GitHub (May 3, 2020): @glitsj16 > Does it work for you when using the --disable-contrib-install flag? Yes, it seems to work, and build the package properly. Changed this line in the AUR PKGBUILD from: `./configure --prefix=/usr --enable-apparmor` to `./configure --prefix=/usr --enable-apparmor --disable-contrib-install` And switched the URL line to: `source=("${pkgname}::git+https://github.com/corecontingency/firejail.git")` which is master + rusty-snake's changes. Let me try those other options. EDIT: Normal, `--enable-contrib-install`, and `--disable-contrib-install` all work.
Author
Owner

@ghost commented on GitHub (May 3, 2020):

@corecontingency Thanks for the heads-up. I messed too much with my setup here and need sleep :-) Sorry for the noise.

<!-- gh-comment-id:623198018 --> @ghost commented on GitHub (May 3, 2020): @corecontingency Thanks for the heads-up. I messed too much with my setup here and need sleep :-) Sorry for the noise.
Author
Owner

@rusty-snake commented on GitHub (May 4, 2020):

travis passing

<!-- gh-comment-id:623490123 --> @rusty-snake commented on GitHub (May 4, 2020): travis passing
Author
Owner

@ghost commented on GitHub (May 5, 2020):

@corecontingency The issue should be fixed now so we can close here. Feel free to reopen if needed. And thanks again for your input!

<!-- gh-comment-id:623856239 --> @ghost commented on GitHub (May 5, 2020): @corecontingency The issue should be fixed now so we can close here. Feel free to reopen if needed. And thanks again for your input!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2133
No description provided.