From aa7499aa1238a69e0ce53b50f4d8a7d940ca5d64 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 23 Aug 2016 23:02:38 -0400 Subject: [PATCH] Add make install and make uninstall --- Makefile | 37 +++++++++++++++++++++++++++---------- pkg/dupeguru.desktop | 8 ++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 pkg/dupeguru.desktop diff --git a/Makefile b/Makefile index 2a0c7b6f..b4ab24ba 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ PYTHON=python3 REQ_MINOR_VERSION=4 +PREFIX ?= /usr/local +MAINDIR = ${PREFIX}/share/dupeguru # Our build scripts are not very "make like" yet and perform their task in a bundle. For now, we # use one of each file to act as a representative, a target, of these groups. submodules_target = hscommon/__init__.py +packages = hscommon qtlib core qt localedirs = $(wildcard locale/*/LC_MESSAGES) pofiles = $(wildcard locale/*/LC_MESSAGES/*.po) mofiles = $(patsubst %.po,%.mo,$(pofiles)) @@ -12,18 +15,18 @@ mofiles = $(patsubst %.po,%.mo,$(pofiles)) vpath %.po $(localedirs) vpath %.mo $(localedirs) -.PHONY : default -default : | run.py +all : | run.py @echo "Build complete! You can run dupeGuru with 'make run'" run.py : | env i18n modules qt/dg_rc.py cp qt/run_template.py run.py -.PHONY : run run: | run.py ./env/bin/python run.py -.PHONY : reqs +pyc: + ${PYTHON} -m compileall ${packages} + reqs : @ret=`${PYTHON} -c "import sys; print(int(sys.version_info[:2] >= (3, ${REQ_MINOR_VERSION})))"`; \ if [ $${ret} -ne 1 ]; then \ @@ -51,7 +54,6 @@ build/help : | env qt/dg_rc.py : qt/dg.qrc pyrcc5 qt/dg.qrc > qt/dg_rc.py -.PHONY : i18n i18n: $(mofiles) %.mo : %.po @@ -69,24 +71,39 @@ qt/pe/_block_qt.*.so : qt/pe/modules/block.c | env ./env/bin/python hscommon/build_ext.py $^ _block_qt mv _block_qt.*.so qt/pe -.PHONY: modules modules : core/pe/_block.*.so core/pe/_cache.*.so qt/pe/_block_qt.*.so -.PHONY : mergepot mergepot : ./env/bin/python build.py --mergepot -.PHONY : normpo normpo : ./env/bin/python build.py --normpo -.PHONY : srcpkg srcpkg : ./scripts/srcpkg.sh -.PHONY : clean +install: build/help | all pyc + mkdir -p ${MAINDIR} + cp -rf ${packages} locale build/help ${MAINDIR} + cp -f run.py ${MAINDIR}/run.py + chmod 755 ${MAINDIR}/run.py + mkdir -p ${PREFIX}/bin + ln -sf ${MAINDIR}/run.py ${PREFIX}/bin/dupeguru + mkdir -p ${PREFIX}/share/applications + cp -f pkg/dupeguru.desktop ${PREFIX}/share/applications + mkdir -p ${PREFIX}/share/pixmaps + cp -f images/dgse_logo_128.png ${PREFIX}/share/pixmaps/dupeguru.png + +uninstall : + rm -rf "${MAINDIR}" + rm -f "${PREFIX}/bin/dupeguru" + rm -f "${PREFIX}/share/applications/dupeguru.desktop" + rm -f "${PREFIX}/share/pixmaps/dupeguru.png" + clean: -rm run.py -rm -rf build -rm locale/*/LC_MESSAGES/*.mo -rm core/pe/*.so qt/pe/*.so + +.PHONY : clean srcpkg normpo mergepot modules i18n reqs run pyc install uninstall all diff --git a/pkg/dupeguru.desktop b/pkg/dupeguru.desktop new file mode 100644 index 00000000..994cf4b3 --- /dev/null +++ b/pkg/dupeguru.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=dupeGuru +Comment=Find duplicate files. +Exec=dupeguru +Icon=dupeguru +Terminal=false +Type=Application +Categories=Utility;