Skip to content

Commit

Permalink
Automatically set package version from git rev-list.
Browse files Browse the repository at this point in the history
Fix shutdown by execing the xsession script.
Override nodm configuration on package install
  • Loading branch information
schlomo committed Feb 17, 2015
1 parent 710eea6 commit 2f93178
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 13 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/DEBIAN/control → DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: kiosk-browser
Version: 51
Version: SET_FROM_GIT_REV_LIST
Priority: optional
Section: web
Architecture: all
Expand Down
25 changes: 18 additions & 7 deletions src/DEBIAN/postinst → DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@ echo "/usr/sbin/nodm" >/etc/X11/default-display-manager
# lightdm needs this for the debconf stuff because it uses kiosk-browser as a display manager
ln -sf nodm /usr/sbin/kiosk-browser

# disable X cursor
sed -i \
-e 's/NODM_X_OPTIONS=.*/NODM_X_OPTIONS="-nocursor -nolisten tcp"/' \
-e 's/NODM_ENABLED=.*/NODM_ENABLED=true/' \
-e 's/NODM_USER=.*/NODM_USER=kiosk-browser/' \
-e 's#NODM_XSESSION=.*#NODM_XSESSION=/usr/share/kiosk-browser/xsession.sh#' \
/etc/default/nodm
cat >/etc/default/nodm <<EOF
# nodm configuration for kiosk-browser package
#
# Note: Must be sh compatible!
if type plymouth >/dev/null 2>&1 ; then
plymouth quit # disable plymouth on Ubuntu, it prevents restarting the kiosk-browser
fi
NODM_ENABLED=true
NODM_USER=kiosk-browser
NODM_FIRST_VT='7'
NODM_XSESSION="exec /usr/share/kiosk-browser/xsession.sh"
NODM_X_OPTIONS="-nocursor -nolisten tcp"
NODM_MIN_SESSION_TIME=60
EOF

# if lightdm is running stop if first (only on Ubuntu)
if test -r /etc/init/lightdm.conf && status lightdm ; then
Expand All @@ -34,6 +44,7 @@ fi

if pgrep -u kiosk-browser >/dev/null ; then
service nodm stop || :
pkill -TERM -u kiosk-browser
echo "Waiting for kiosk-browser processes to exit..."
sleep 5 # wait for chromium and other subprocesses to exit
fi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
DPKG=dpkg
DPKG_OPTS=-b
.PHONY: info repo clean

*.deb: clean src/*
*.deb: check_status clean
rm -Rf build
mkdir -p out
cp -r src build
cp -r DEBIAN build
V=$$(git rev-list HEAD | wc -l) ; sed -i -e "s/Version:.*/Version: $$V/" build/DEBIAN/control
git log | gzip -9 >build/usr/share/doc/kiosk-browser/changelog.gz
chmod -R g-w build
chmod 0440 build/etc/sudoers.d/kiosk-browser
/usr/sbin/visudo -c -f build/etc/sudoers.d/kiosk-browser
fakeroot ${DPKG} ${DPKG_OPTS} build out
fakeroot dpkg -b build out
rm -Rf build
lintian -i out/*.deb

Expand All @@ -23,4 +24,5 @@ repo: out/*.deb
clean:
rm -fr out build


check_status:
@git diff-index --quiet HEAD -- || { echo ; git status -s ; echo -e "\nERROR: All changes must be comitted!\n" ; false ; }

0 comments on commit 2f93178

Please sign in to comment.