2009-03-13 13:32:32 +00:00
|
|
|
|
2011-07-29 11:45:58 +00:00
|
|
|
NAME=qasim
|
2011-07-30 00:50:23 +00:00
|
|
|
CONFDIR=$(DESTDIR)/etc
|
2009-03-13 13:32:32 +00:00
|
|
|
BINDIR=$(DESTDIR)/usr/bin
|
|
|
|
MANDIR=$(DESTDIR)/usr/share/man
|
2011-08-05 16:05:32 +00:00
|
|
|
DOCDIR=$(DESTDIR)/usr/share/doc
|
|
|
|
SHAREDIR=$(DESTDIR)/usr/share
|
2009-04-03 16:27:49 +00:00
|
|
|
|
2011-03-10 16:56:03 +00:00
|
|
|
RUBYVERSION=1.8
|
|
|
|
RDOC=rdoc$(RUBYVERSION)
|
|
|
|
|
2009-03-13 13:32:32 +00:00
|
|
|
all:
|
2011-07-29 11:45:58 +00:00
|
|
|
$(MAKE) -C $(NAME)
|
2009-03-13 13:32:32 +00:00
|
|
|
|
|
|
|
clean:
|
2011-07-29 11:45:58 +00:00
|
|
|
$(MAKE) -C $(NAME) clean
|
2009-03-13 13:32:32 +00:00
|
|
|
|
2011-03-10 16:56:03 +00:00
|
|
|
doc: build-doc
|
|
|
|
|
|
|
|
.PHONY: build-doc
|
|
|
|
|
|
|
|
build-doc:
|
|
|
|
rm -fr doc
|
|
|
|
$(RDOC) \
|
|
|
|
--promiscuous \
|
|
|
|
--inline-source \
|
|
|
|
--line-numbers \
|
2011-07-29 11:45:58 +00:00
|
|
|
-o doc $(NAME)/ \
|
|
|
|
bin/
|
2011-03-10 16:56:03 +00:00
|
|
|
# --diagram
|
|
|
|
#
|
|
|
|
|
|
|
|
install-doc:
|
|
|
|
# # install documentation
|
2011-08-05 16:05:32 +00:00
|
|
|
rm -fr $(DOCDIR)/$(NAME)
|
|
|
|
mkdir -p $(DOCDIR)/$(NAME)
|
|
|
|
cp -a doc $(DOCDIR)/$(NAME)
|
2011-03-10 16:56:03 +00:00
|
|
|
|
|
|
|
|
2011-07-31 01:05:12 +00:00
|
|
|
install: install-bin install-lib install-data
|
|
|
|
|
|
|
|
install-bin:
|
2009-03-13 13:32:32 +00:00
|
|
|
mkdir -p $(BINDIR)
|
2011-07-31 01:05:12 +00:00
|
|
|
for binfile in bin/*.rb ; do \
|
|
|
|
BINFILE=`basename $$binfile |sed -e 's/.rb$$//'`; \
|
|
|
|
install -D -o root -g root -m 755 $$binfile $(BINDIR)/$$BINFILE; \
|
2012-07-23 23:14:50 +00:00
|
|
|
sed -i -e 's|^QASIM_INCLUDE_DIR.*|QASIM_INCLUDE_DIR = "/usr/share/$(NAME)/lib"|' $(BINDIR)/$$BINFILE; \
|
|
|
|
sed -i -e 's|^QASIM_DATA_DIR.*|QASIM_DATA_DIR = "/usr/share/$(NAME)"|' $(BINDIR)/$$BINFILE; \
|
2011-07-31 01:05:12 +00:00
|
|
|
done
|
|
|
|
#install -D -o root -g root -m 755 $(CURDIR)/bin/$(NAME)-gui.rb $(BINDIR)/$(NAME)-gui
|
|
|
|
|
|
|
|
install-lib:
|
|
|
|
for libfile in $(NAME)/*.rb ; do \
|
2011-08-05 16:05:32 +00:00
|
|
|
install -D -o root -g root -m 644 $$libfile $(SHAREDIR)/$(NAME)/$$libfile; \
|
2011-07-31 01:05:12 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
install-data:
|
2011-07-31 01:15:23 +00:00
|
|
|
## Install man pages
|
|
|
|
# mkdir -p $(MANDIR)/man1
|
|
|
|
# cat $(NAME).1 | gzip > $(MANDIR)/man1/$(NAME).1.gz
|
|
|
|
#
|
|
|
|
## Install icons
|
2011-08-05 16:05:32 +00:00
|
|
|
mkdir -p $(SHAREDIR)/$(NAME)/icons
|
2011-07-31 01:15:23 +00:00
|
|
|
install -D -o root -g root -m 644 $(CURDIR)/icons/$(NAME).svg \
|
2011-08-05 16:05:32 +00:00
|
|
|
$(SHAREDIR)/$(NAME)/icons/$(NAME).svg
|
2011-07-31 01:15:23 +00:00
|
|
|
#
|
2011-07-29 11:45:58 +00:00
|
|
|
## Install completion file
|
|
|
|
# install -D -o root -g root -m 644 $(CURDIR)/$(NAME).completion $(DESTDIR)/etc/bash_completion.d/$(NAME)
|
2009-08-15 17:13:52 +00:00
|
|
|
#
|
2011-07-31 01:15:23 +00:00
|
|
|
## Install configuration files
|
2011-07-30 00:50:23 +00:00
|
|
|
mkdir -p $(CONFDIR)/xdg/autostart
|
2011-08-05 15:56:10 +00:00
|
|
|
install -D -o root -g root -m 644 $(CURDIR)/conf/$(NAME).desktop \
|
2011-07-30 00:50:23 +00:00
|
|
|
$(CONFDIR)/xdg/autostart/$(NAME).desktop
|
2011-08-05 15:56:10 +00:00
|
|
|
install -D -o root -g root -m 644 $(CURDIR)/conf/$(NAME).desktop \
|
|
|
|
$(SHAREDIR)/applications/$(NAME).desktop
|
2011-07-30 00:50:23 +00:00
|
|
|
mkdir -p $(CONFDIR)/$(NAME)
|
|
|
|
install -D -o root -g root -m 644 $(CURDIR)/conf/config \
|
|
|
|
$(CONFDIR)/$(NAME)/config
|
|
|
|
install -D -o root -g root -m 644 $(CURDIR)/conf/default.map \
|
|
|
|
$(CONFDIR)/$(NAME)/default.map
|
2011-07-31 01:15:23 +00:00
|
|
|
#
|
|
|
|
# Install examples
|
2011-08-05 16:05:32 +00:00
|
|
|
mkdir -p $(DOCDIR)/$(NAME)/examples
|
2009-08-15 17:13:52 +00:00
|
|
|
for f in `ls examples`; do \
|
2011-08-05 16:05:32 +00:00
|
|
|
cat examples/$$f | gzip -f9 > $(DOCDIR)/$(NAME)/examples/$$f.gz ; \
|
2009-03-13 13:32:32 +00:00
|
|
|
done
|
2011-07-29 11:45:58 +00:00
|
|
|
|
|
|
|
.PHONY: destdir
|
|
|
|
destdir:
|
|
|
|
rm -fr destdir
|
|
|
|
fakeroot $(MAKE) install DESTDIR=destdir
|
|
|
|
|