Skip to content

Use fakeroot when building .deb packages - #759

Open
hex110 wants to merge 2 commits into
Syncplay:masterfrom
hex110:fix/deb-package-ownership
Open

Use fakeroot when building .deb packages#759
hex110 wants to merge 2 commits into
Syncplay:masterfrom
hex110:fix/deb-package-ownership

Conversation

@hex110

@hex110 hex110 commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Without fakeroot, files in the .deb package are created with the build user's UID:GID instead of root:root (0:0), causing incorrect ownership when installed via dpkg
  • Wraps both make install and dpkg -b with fakeroot in the client and server deb build scripts

Closes #513

hex110 and others added 2 commits February 16, 2026 02:02
Without fakeroot, files in the .deb are created with the build
user's UID:GID instead of root:root (0:0), causing incorrect
ownership when installed via dpkg.

Closes Syncplay#513

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Et0h

Et0h commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

I'm not a Linux user, but would it be better to use dpkg-deb --root-owner-group -b instead of fakeroot here to avoid an additional build dependency?

Under this alternative, the only changes from master would be to the final package-building command in each Debian packaging script:

# ci/deb-script.sh
 make install DESTDIR=/tmp/syncplay
-dpkg -b /tmp/syncplay/
+dpkg-deb --root-owner-group -b /tmp/syncplay/

# ci/deb-server-script.sh
 make install-server DESTDIR=/tmp/syncplay-server
-dpkg -b /tmp/syncplay-server/
+dpkg-deb --root-owner-group -b /tmp/syncplay-server/

The make install / make install-server staging steps and the generated DEBIAN/prerm scripts would remain unchanged.

For clarity, this sets the ownership of filesystem entries recorded in the package to root:root (i.e. it does not cause Syncplay or the media player processes it launches to run as root).

Debian documents --root-owner-group as:

Set the owner and group for each entry in the filesystem tree data to root with id 0

It also notes that the option is useful for rootless builds: https://manpages.debian.org/trixie/dpkg/dpkg-deb.1.en.html

This directly addresses #513 by preventing the CI user’s UID/GID from being stored in the package.

The option requires dpkg 1.19.0 or newer, which should be fine for current Debian and Ubuntu CI environments. Since Syncplay does not appear to ship files that intentionally require non-root ownership, this seems cleaner and more focused than adding fakeroot.

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.

Debian packages are not created with root privileges

3 participants