mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24:36 +00:00
Add make install and make uninstall
This commit is contained in:
parent
63558d647a
commit
aa7499aa12
37
Makefile
37
Makefile
@ -1,10 +1,13 @@
|
|||||||
PYTHON=python3
|
PYTHON=python3
|
||||||
REQ_MINOR_VERSION=4
|
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
|
# 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.
|
# use one of each file to act as a representative, a target, of these groups.
|
||||||
submodules_target = hscommon/__init__.py
|
submodules_target = hscommon/__init__.py
|
||||||
|
|
||||||
|
packages = hscommon qtlib core qt
|
||||||
localedirs = $(wildcard locale/*/LC_MESSAGES)
|
localedirs = $(wildcard locale/*/LC_MESSAGES)
|
||||||
pofiles = $(wildcard locale/*/LC_MESSAGES/*.po)
|
pofiles = $(wildcard locale/*/LC_MESSAGES/*.po)
|
||||||
mofiles = $(patsubst %.po,%.mo,$(pofiles))
|
mofiles = $(patsubst %.po,%.mo,$(pofiles))
|
||||||
@ -12,18 +15,18 @@ mofiles = $(patsubst %.po,%.mo,$(pofiles))
|
|||||||
vpath %.po $(localedirs)
|
vpath %.po $(localedirs)
|
||||||
vpath %.mo $(localedirs)
|
vpath %.mo $(localedirs)
|
||||||
|
|
||||||
.PHONY : default
|
all : | run.py
|
||||||
default : | run.py
|
|
||||||
@echo "Build complete! You can run dupeGuru with 'make run'"
|
@echo "Build complete! You can run dupeGuru with 'make run'"
|
||||||
|
|
||||||
run.py : | env i18n modules qt/dg_rc.py
|
run.py : | env i18n modules qt/dg_rc.py
|
||||||
cp qt/run_template.py run.py
|
cp qt/run_template.py run.py
|
||||||
|
|
||||||
.PHONY : run
|
|
||||||
run: | run.py
|
run: | run.py
|
||||||
./env/bin/python run.py
|
./env/bin/python run.py
|
||||||
|
|
||||||
.PHONY : reqs
|
pyc:
|
||||||
|
${PYTHON} -m compileall ${packages}
|
||||||
|
|
||||||
reqs :
|
reqs :
|
||||||
@ret=`${PYTHON} -c "import sys; print(int(sys.version_info[:2] >= (3, ${REQ_MINOR_VERSION})))"`; \
|
@ret=`${PYTHON} -c "import sys; print(int(sys.version_info[:2] >= (3, ${REQ_MINOR_VERSION})))"`; \
|
||||||
if [ $${ret} -ne 1 ]; then \
|
if [ $${ret} -ne 1 ]; then \
|
||||||
@ -51,7 +54,6 @@ build/help : | env
|
|||||||
qt/dg_rc.py : qt/dg.qrc
|
qt/dg_rc.py : qt/dg.qrc
|
||||||
pyrcc5 qt/dg.qrc > qt/dg_rc.py
|
pyrcc5 qt/dg.qrc > qt/dg_rc.py
|
||||||
|
|
||||||
.PHONY : i18n
|
|
||||||
i18n: $(mofiles)
|
i18n: $(mofiles)
|
||||||
|
|
||||||
%.mo : %.po
|
%.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
|
./env/bin/python hscommon/build_ext.py $^ _block_qt
|
||||||
mv _block_qt.*.so qt/pe
|
mv _block_qt.*.so qt/pe
|
||||||
|
|
||||||
.PHONY: modules
|
|
||||||
modules : core/pe/_block.*.so core/pe/_cache.*.so qt/pe/_block_qt.*.so
|
modules : core/pe/_block.*.so core/pe/_cache.*.so qt/pe/_block_qt.*.so
|
||||||
|
|
||||||
.PHONY : mergepot
|
|
||||||
mergepot :
|
mergepot :
|
||||||
./env/bin/python build.py --mergepot
|
./env/bin/python build.py --mergepot
|
||||||
|
|
||||||
.PHONY : normpo
|
|
||||||
normpo :
|
normpo :
|
||||||
./env/bin/python build.py --normpo
|
./env/bin/python build.py --normpo
|
||||||
|
|
||||||
.PHONY : srcpkg
|
|
||||||
srcpkg :
|
srcpkg :
|
||||||
./scripts/srcpkg.sh
|
./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:
|
clean:
|
||||||
-rm run.py
|
-rm run.py
|
||||||
-rm -rf build
|
-rm -rf build
|
||||||
-rm locale/*/LC_MESSAGES/*.mo
|
-rm locale/*/LC_MESSAGES/*.mo
|
||||||
-rm core/pe/*.so qt/pe/*.so
|
-rm core/pe/*.so qt/pe/*.so
|
||||||
|
|
||||||
|
.PHONY : clean srcpkg normpo mergepot modules i18n reqs run pyc install uninstall all
|
||||||
|
8
pkg/dupeguru.desktop
Normal file
8
pkg/dupeguru.desktop
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=dupeGuru
|
||||||
|
Comment=Find duplicate files.
|
||||||
|
Exec=dupeguru
|
||||||
|
Icon=dupeguru
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
Categories=Utility;
|
Loading…
x
Reference in New Issue
Block a user