Fix desktop file, add uninstall to Makefile

This commit is contained in:
zvon 2019-05-18 15:05:06 +02:00
parent 95d2c85dfe
commit 425941b50e
2 changed files with 19 additions and 7 deletions

View File

@ -2,7 +2,8 @@ CC ?= clang
CXX ?= clang++
CFLAGS ?= -O2 -Wall -Wextra -std=c++11
PREFIX ?= /usr/local/bin
APPFOLDER ?= /usr/share/applications
APPDIR ?= /usr/share/applications
ICONDIR ?= /usr/share/icons/hicolor
.PHONY: default
default: tv_rename
@ -20,10 +21,22 @@ install: tv_rename
install_gui: gui
install -d $(PREFIX)/
install -m 755 tv_rename_gui $(PREFIX)/
cat tv_rename.desktop | sed "s/\$$PWD/$$(pwd | sed 's/\//\\\//g')/" > temp.desktop
chmod +x temp.desktop
install -d $(APPFOLDER)
mv temp.desktop $(APPFOLDER)/tv_rename.desktop
install -d $(APPDIR)
install -m 755 tv_rename_gui.desktop $(APPDIR)/
install -d $(ICONDIR)
install -m 644 tv_rename.svg $(ICONDIR)/scalable/apps/
gtk-update-icon-cache -f $(ICONDIR)
.PHONY: uninstall
uninstall:
rm $(PREFIX)/tv_rename
.PHONY: uninstall_gui
uninstall_gui:
rm $(PREFIX)/tv_rename_gui
rm $(APPDIR)/tv_rename_gui.desktop
rm $(ICONDIR)/scalable/apps/tv_rename.svg
gtk-update-icon-cache -f $(ICONDIR)
tv_rename: functions.o filesystem_u.o network.o tv_rename.o main.cpp
$(CXX) $(CFLAGS) -o tv_rename main.cpp tv_rename.o functions.o filesystem_u.o network.o -lcurl

View File

@ -1,4 +1,3 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Value=1.0
@ -6,5 +5,5 @@ Type=Application
Name=TV Rename
GenericName=TV Rename
Comment=TV Rename
Icon=$PWD/tv_rename.svg
Icon=tv_rename
Exec=tv_rename_gui