Don't overwrite `swm.desktop` on install

3ce65d3df8c073f906f61209e451d0f23a664e20
Alexis Sellier committed ago 1 parent c3e974a9
Makefile +3 -2
128 128
install: swm swmctl swm.1 swmctl.1
129 129
	install -Dm755 swm $(DESTDIR)$(PREFIX)/bin/swm
130 130
	install -Dm755 swmctl $(DESTDIR)$(PREFIX)/bin/swmctl
131 131
	install -Dm644 swm.1 $(DESTDIR)$(MANDIR)/man1/swm.1
132 132
	install -Dm644 swmctl.1 $(DESTDIR)$(MANDIR)/man1/swmctl.1
133 -
	install -Dm644 swm.desktop \
134 -
		$(DESTDIR)$(DATADIR)/wayland-sessions/swm.desktop
133 +
	@test -e $(DESTDIR)$(DATADIR)/wayland-sessions/swm.desktop || \
134 +
		install -Dm644 swm.desktop \
135 +
			$(DESTDIR)$(DATADIR)/wayland-sessions/swm.desktop
135 136
136 137
uninstall:
137 138
	rm -f $(DESTDIR)$(PREFIX)/bin/swm
138 139
	rm -f $(DESTDIR)$(PREFIX)/bin/swmctl
139 140
	rm -f $(DESTDIR)$(MANDIR)/man1/swm.1
PKGBUILD +1 -0
6 6
pkgdesc='Simple window manager for Wayland'
7 7
arch=('x86_64')
8 8
url='https://github.com/cloudhead/swm'
9 9
license=('GPL-3.0-only')
10 10
options=('!debug')
11 +
backup=('usr/share/wayland-sessions/swm.desktop')
11 12
depends=(
12 13
  'glibc'
13 14
  'libinput'
14 15
  'libxcb'
15 16
  'libxkbcommon'