1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-16 04:13:02 +01:00

Makefile: add toxic.desktop to install target

This commit is contained in:
Ansa89 2014-10-21 10:31:30 +02:00
parent ae04dd8fa5
commit f5090532fb
2 changed files with 10 additions and 11 deletions

View File

@ -16,6 +16,7 @@ MISC_DIR = $(BASE_DIR)/misc
# Project files # Project files
MANFILES = toxic.1 toxic.conf.5 MANFILES = toxic.1 toxic.conf.5
DATAFILES = DHTnodes DNSservers toxic.conf.example DATAFILES = DHTnodes DNSservers toxic.conf.example
DESKFILE = toxic.desktop
SNDFILES = ToxicContactOnline.wav ToxicContactOffline.wav ToxicError.wav SNDFILES = ToxicContactOnline.wav ToxicContactOffline.wav ToxicError.wav
SNDFILES += ToxicRecvMessage.wav ToxicOutgoingCall.wav ToxicIncomingCall.wav SNDFILES += ToxicRecvMessage.wav ToxicOutgoingCall.wav ToxicIncomingCall.wav
SNDFILES += ToxicTransferComplete.wav ToxicTransferStart.wav SNDFILES += ToxicTransferComplete.wav ToxicTransferStart.wav
@ -25,3 +26,4 @@ PREFIX = /usr/local
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share/toxic DATADIR = $(PREFIX)/share/toxic
MANDIR = $(PREFIX)/share/man MANDIR = $(PREFIX)/share/man
APPDIR = $(PREFIX)/share/applications

View File

@ -1,21 +1,19 @@
# Install target # Install target
install: toxic install: toxic
mkdir -p $(abspath $(DESTDIR)/$(BINDIR))
mkdir -p $(abspath $(DESTDIR)/$(DATADIR))
mkdir -p $(abspath $(DESTDIR)/$(DATADIR))/sounds
mkdir -p $(abspath $(DESTDIR)/$(MANDIR))
@echo "Installing toxic executable" @echo "Installing toxic executable"
@install -m 0755 toxic $(abspath $(DESTDIR)/$(BINDIR)) @install -Dm 0755 toxic $(abspath $(DESTDIR)/$(BINDIR)/toxic)
@echo "Installing desktop file"
@install -Dm 0644 $(MISC_DIR)/$(DESKFILE) $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE))
@echo "Installing data files" @echo "Installing data files"
@for f in $(DATAFILES) ; do \ @for f in $(DATAFILES) ; do \
install -m 0644 $(MISC_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)) ;\ install -Dm 0644 $(MISC_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\
file=$(abspath $(DESTDIR)/$(DATADIR))/$$f ;\ file=$(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\
sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\ sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\
done done
@for f in $(SNDFILES) ; do \ @for f in $(SNDFILES) ; do \
install -m 0644 $(SND_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR))/sounds ;\ install -Dm 0644 $(SND_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)/sounds/$$f) ;\
done done
@echo "Installing man pages" @echo "Installing man pages"
@ -25,8 +23,7 @@ install: toxic
fi ;\ fi ;\
section=$(abspath $(DESTDIR)/$(MANDIR))/man`echo $$f | rev | cut -d "." -f 1` ;\ section=$(abspath $(DESTDIR)/$(MANDIR))/man`echo $$f | rev | cut -d "." -f 1` ;\
file=$$section/$$f ;\ file=$$section/$$f ;\
mkdir -p $$section ;\ install -Dm 0644 $(DOC_DIR)/$$f $$file ;\
install -m 0644 $(DOC_DIR)/$$f $$file ;\
sed -i'' -e 's:__VERSION__:'$(VERSION)':g' $$file ;\ sed -i'' -e 's:__VERSION__:'$(VERSION)':g' $$file ;\
sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\ sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\
gzip -f -9 $$file ;\ gzip -f -9 $$file ;\