From 87e9effc84d6abe81f34d7d42089c0fb24964737 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Sat, 24 Feb 2018 11:14:56 +0300 Subject: [PATCH] Makefile: only install required files The previous Makefile is doing "cp *" and hence installing uninteresting files like the Makefile itself. Copy only the application-relevant files, and switch to using install for some of this where we can automatically create parent directories if required, solving issues when installing into an empty root. locale installation is optional; as before, locale files will be installed if they are present, but installation can also proceed without them. --- Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index acfdfa1f7..a803e6d83 100644 --- a/Makefile +++ b/Makefile @@ -8,15 +8,14 @@ all: install: rm -rf ${DESTDIR}${PREFIX}/share/anki mkdir -p ${DESTDIR}${PREFIX}/share/anki - cp -av * ${DESTDIR}${PREFIX}/share/anki/ + cp -av anki aqt web ${DESTDIR}${PREFIX}/share/anki/ + -cp -av locale ${DESTDIR}${PREFIX}/share/anki/ sed -e 's:@PREFIX@:${PREFIX}:' tools/runanki.system.in > tools/runanki.system - chmod 755 tools/runanki.system - cd ${DESTDIR}${PREFIX}/share/anki && (\ - mv tools/runanki.system ${DESTDIR}${PREFIX}/bin/anki;\ - test -d ${DESTDIR}${PREFIX}/share/pixmaps &&\ - mv anki.xpm anki.png ${DESTDIR}${PREFIX}/share/pixmaps/;\ - mv anki.desktop ${DESTDIR}${PREFIX}/share/applications;\ - mv anki.1 ${DESTDIR}${PREFIX}/share/man/man1/) + install -m 0755 -D tools/runanki.system ${DESTDIR}${PREFIX}/bin/anki + install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/pixmaps anki.xpm anki.png + install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/applications anki.desktop + install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/man/man1 anki.1 + install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/doc/anki README.contributing README.development README.md LICENSE xdg-mime install anki.xml --novendor xdg-mime default anki.desktop application/x-anki xdg-mime default anki.desktop application/x-apkg