Skip to content

Instantly share code, notes, and snippets.

@xi
Created November 6, 2016 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xi/0a0033d219dd0b98fa7b608b2c17b2f0 to your computer and use it in GitHub Desktop.
Save xi/0a0033d219dd0b98fa7b608b2c17b2f0 to your computer and use it in GitHub Desktop.
Build a Debian package that adds guest-account functionality to LightDM.
# Build a Debian package that adds guest-account functionality to LightDM.
#
# For guest accounts to work LightDM needs a binary "guest-account" which it
# will run to create / destroy guest accounts.[0] The default Debian package
# does not provide one.[1] However, the Ubuntu package does.[2]
#
# The simple way to use this script is simply to call `make install`. This will
# fetch the Ubuntu package, unpack it and install only the files that are
# relevant for guest accounts. However, this is strongly discouraged because
# it bypasses the package system.
#
# The recommended way to use this script is to call `make`. This will use
# checkinstall[3] to create a Debian package that does exactly the same as
# `make install`.
#
# NOTE: This script will create some temporary files. It is recommended to run
# it in an otherwise empty directory to avoid pollution.
#
# [0]: https://lists.freedesktop.org/archives/lightdm/2014-July/000631.html
# [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661230
# [2]: http://packages.ubuntu.com/xenial/lightdm
# [4]: https://wiki.debian.org/CheckInstall
PREFIX := /
VERSION := 1.18.3-0ubuntu1
ARCH := amd64
checkinstall:
checkinstall --install=no -y --pkgname=guest-account --pkgversion=$(VERSION) --pkgarch=all --pkgsource=lightdm
install: tmp tmp/install.sh
cd tmp && ./install.sh usr/sbin/guest-account
cd tmp && ./install.sh usr/lib/lightdm/guest-session-auto.sh
cd tmp && ./install.sh usr/share/lightdm/guest-session/setup.sh
cd tmp && ./install.sh usr/share/lightdm/guest-session/skel/.config/autostart/guest-session-startup.desktop
cd tmp && ./install.sh etc/apparmor.d/lightdm-guest-session
tmp/install.sh: tmp
echo '#!/bin/sh\nmkdir -p "$(PREFIX)$$(dirname $$1)"\ncp --preserve=mode "$$1" "$(PREFIX)$$1"' > $@
chmod +x $@
tmp:
mkdir -p tmp/
cd tmp && wget http://archive.ubuntu.com/ubuntu/pool/main/l/lightdm/lightdm_$(VERSION)_$(ARCH).deb -O source.deb
cd tmp && unp source.deb
cd tmp && unp data.tar.xz
clean:
rm -rf tmp
rm -f description-pak
rm -f backup-*.tgz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment