From b0608e094aa6d2d36ccb1c65af3fafe2f2237c44 Mon Sep 17 00:00:00 2001 From: Schlomo Schapiro Date: Mon, 22 May 2017 16:50:21 +0200 Subject: [PATCH] Update to work with systemd, switch over to use debuild and release building Includes now Vagrantfile to test on Ubuntu and Debian. --- .gitignore | 9 +++ ...able-inputs.conf => 00-disable-inputs.conf | 0 DEBIAN/conffiles | 1 - DEBIAN/control | 17 ---- Makefile | 78 +++++++++++++------ Vagrantfile | 44 +++++++++++ .../lib/X11/app-defaults/XOsview => XOsview | 0 debian/changelog | 5 ++ debian/compat | 1 + {DEBIAN => debian}/config | 0 debian/control | 20 +++++ .../doc/kiosk-browser => debian}/copyright | 0 debian/kiosk-browser.lintian-overrides | 2 + {DEBIAN => debian}/postinst | 0 {DEBIAN => debian}/postrm | 0 debian/rules | 3 + debian/source/format | 1 + {DEBIAN => debian}/templates | 0 {DEBIAN => debian}/triggers | 0 ...k-browser-control => kiosk-browser-control | 0 .../openbox-rc.xml => openbox-rc.xml | 0 runtests.sh | 10 +++ src/usr/share/lintian/overrides/kiosk-browser | 1 - src/etc/sudoers.d/kiosk-browser => sudoers | 0 .../kiosk-browser/xsession.sh => xsession.sh | 8 +- 25 files changed, 153 insertions(+), 47 deletions(-) rename src/usr/share/X11/xorg.conf.d/00-disable-inputs.conf => 00-disable-inputs.conf (100%) delete mode 100644 DEBIAN/conffiles delete mode 100755 DEBIAN/control create mode 100644 Vagrantfile rename src/usr/lib/X11/app-defaults/XOsview => XOsview (100%) create mode 100644 debian/changelog create mode 100644 debian/compat rename {DEBIAN => debian}/config (100%) create mode 100644 debian/control rename {src/usr/share/doc/kiosk-browser => debian}/copyright (100%) create mode 100644 debian/kiosk-browser.lintian-overrides rename {DEBIAN => debian}/postinst (100%) rename {DEBIAN => debian}/postrm (100%) create mode 100755 debian/rules create mode 100644 debian/source/format rename {DEBIAN => debian}/templates (100%) rename {DEBIAN => debian}/triggers (100%) rename src/usr/bin/kiosk-browser-control => kiosk-browser-control (100%) rename src/usr/share/kiosk-browser/openbox-rc.xml => openbox-rc.xml (100%) create mode 100755 runtests.sh delete mode 100644 src/usr/share/lintian/overrides/kiosk-browser rename src/etc/sudoers.d/kiosk-browser => sudoers (100%) rename src/usr/share/kiosk-browser/xsession.sh => xsession.sh (97%) diff --git a/.gitignore b/.gitignore index 3c0160d..e4d5c1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,11 @@ build/ out/ +*.log +debian/kiosk-browser +debian/*debhelper* +debian/*substvars +debian/files +.deps +.vagrant + + diff --git a/src/usr/share/X11/xorg.conf.d/00-disable-inputs.conf b/00-disable-inputs.conf similarity index 100% rename from src/usr/share/X11/xorg.conf.d/00-disable-inputs.conf rename to 00-disable-inputs.conf diff --git a/DEBIAN/conffiles b/DEBIAN/conffiles deleted file mode 100644 index 5715324..0000000 --- a/DEBIAN/conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/sudoers.d/kiosk-browser diff --git a/DEBIAN/control b/DEBIAN/control deleted file mode 100755 index 219e13c..0000000 --- a/DEBIAN/control +++ /dev/null @@ -1,17 +0,0 @@ -Package: kiosk-browser -Version: SET_FROM_GIT_REV_LIST -Priority: optional -Section: web -Architecture: all -Maintainer: Schlomo Schapiro -Pre-Depends: nodm -Depends: chromium | chromium-browser, epiphany-browser, uzbl, x11-xserver-utils, xdotool, x11-apps, sudo, imagemagick, debconf, xtightvncviewer, xosd-bin, xosview, openbox -Homepage: https://github.com/ImmobilienScout24/kiosk-browser -Description: Web Browser for non-interactive use like a web kiosk - Setup system to work as a kiosk browser, showing only a full-screen browser. - . - Configuration options in /etc/default/kiosk-browser - KIOSK_BROWSER_START_PAGE sets the start page - Also add your own customization to that file, e.g. xrandr calls. - . - See project homepage for full list of config options. diff --git a/Makefile b/Makefile index c302675..27b8f4c 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,58 @@ -.PHONY: info repo clean +.PHONY: all build test install clean commit-release release deb repo +PACKAGE=kiosk-browser +SHELL=bash +VERSION := $(shell git rev-list HEAD --count --no-merges) +GIT_STATUS := $(shell git status --porcelain) -*.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 -n9 >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 -b build out - rm -Rf build - lintian --suppress-tags postrm-contains-additional-updaterc.d-calls -i out/*.deb - -info: out/*.deb - dpkg-deb -I out/*.deb - dpkg-deb -c out/*.deb - -repo: out/*.deb - ../putinrepo.sh out/*.deb + +all: build + +build: + @echo No build required + +commit-release: +ifneq ($(GIT_STATUS),) + $(error Please commit all changes before releasing. $(shell git status 1>&2)) +endif + gbp dch --full --release --new-version=$(VERSION) --distribution stable --auto --git-author --commit + git push + +release: commit-release deb + @latest_tag=$$(git describe --tags `git rev-list --tags --max-count=1`); \ + comparison="$$latest_tag..HEAD"; \ + if [ -z "$$latest_tag" ]; then comparison=""; fi; \ + changelog=$$(git log $$comparison --oneline --no-merges --reverse); \ + github-release schlomo/$(PACKAGE) v$(VERSION) "$$(git rev-parse --abbrev-ref HEAD)" "**Changelog**
$$changelog" 'out/*.deb'; \ + git pull + dput ppa:sschapiro/ubuntu/ppa/xenial out/$(PACKAGE)_*_source.changes + +test: + ./runtests.sh + +install: + install -m 0644 00-disable-inputs.conf -D -t $(DESTDIR)/usr/share/X11/xorg.conf.d + install -m 0755 kiosk-browser-control -D -t $(DESTDIR)/usr/bin + install -m 0644 openbox-rc.xml -D -t $(DESTDIR)/usr/share/$(PACKAGE) + install -m 0644 sudoers -D $(DESTDIR)/etc/sudoers.d/$(PACKAGE) + install -m 0644 XOsview -D -t $(DESTDIR)/usr/lib/X11/app-defaults + install -m 0755 xsession.sh -D -t $(DESTDIR)/usr/share/$(PACKAGE) clean: - rm -fr out build + rm -Rf debian/$(PACKAGE) debian/*debhelper* debian/*substvars debian/files out/* + +deb: clean +ifneq ($(MAKECMDGOALS), release) + $(eval DEBUILD_ARGS := -us -uc) +endif + debuild $(DEBUILD_ARGS) -i -b --lintian-opts --profile debian + debuild $(DEBUILD_ARGS) -i -S --lintian-opts --profile debian + mkdir -p out + mv ../$(PACKAGE)*.{xz,dsc,deb,build,changes} out/ + cd out ; apt-ftparchive packages . >Packages + dpkg -I out/*.deb + dpkg -c out/*.deb + +repo: + ../putinrepo.sh out/*.deb -check_status: - @git diff-index --quiet HEAD -- || { echo ; git status -s ; echo -e "\nERROR: All changes must be comitted!\n" ; false ; } +# vim: set ts=4 sw=4 tw=0 noet : diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..c5f8622 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,44 @@ +# workaround for vagrant-share error: vagrant plugin install vagrant-share --plugin-version 1.1.8 (from https://github.com/mitchellh/vagrant/issues/8519) +# +# you need the reload plugin: vagrant plugin install vagrant-reload +# +# then vagrant up +# + +nodes = [ + { :hostname => 'debian', :box => 'debian/contrib-jessie64', :ram => 1024 }, + { :hostname => 'ubuntu', :box => 'ubuntu/xenial64', :ram => 1024 }, +] + +$script = <