Description: Install to FHS-compliant locations and handle DESTDIR
Author: Stephen Kitt <skitt@debian.org>

--- a/Makefile
+++ b/Makefile
@@ -395,16 +395,16 @@
 	$(CC) $(LDFLAGS) $^ $(LIBS) -o $(BIN)
 
 install:
-	mkdir -p $(BINDIR)
-	mkdir -p $(DATADIR)/icons
-	mkdir -p $(PREFIX)/share/pixmaps
-	install -m 0755 $(BIN) $(BINDIR)
-	install -m 0644 source/unix/icons/nestopia.desktop $(DATADIR)
-	install -m 0644 NstDatabase.xml $(DATADIR)
-	install -m 0644 source/unix/icons/*.png $(DATADIR)/icons
-	install -m 0644 source/unix/icons/*.svg $(DATADIR)/icons
-	install -m 0644 source/unix/icons/nestopia.svg $(PREFIX)/share/pixmaps
-	xdg-desktop-menu install --novendor $(DATADIR)/nestopia.desktop
+	mkdir -p $(DESTDIR)/$(BINDIR)
+	mkdir -p $(DESTDIR)/$(PREFIX)/share/applications
+	mkdir -p $(DESTDIR)/$(DATADIR)/icons
+	mkdir -p $(DESTDIR)/$(PREFIX)/share/pixmaps
+	install -m 0755 $(BIN) $(DESTDIR)/$(BINDIR)
+	install -m 0644 source/unix/icons/nestopia.desktop $(DESTDIR)/$(PREFIX)/share/applications
+	install -m 0644 NstDatabase.xml $(DESTDIR)/$(DATADIR)
+	install -m 0644 source/unix/icons/*.png $(DESTDIR)/$(DATADIR)/icons
+	install -m 0644 source/unix/icons/*.svg $(DESTDIR)/$(DATADIR)/icons
+	install -m 0644 source/unix/icons/nestopia.svg $(DESTDIR)/$(PREFIX)/share/pixmaps
 
 uninstall:
 	xdg-desktop-menu uninstall $(DATADIR)/nestopia.desktop
