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)
|
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
all: \
|
|
|
|
build \
|
|
|
|
install
|
2009-03-13 13:32:32 +00:00
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
clean: \
|
|
|
|
clean-ui \
|
|
|
|
clean-qrc \
|
|
|
|
clean-bin \
|
|
|
|
clean-lib \
|
|
|
|
clean-data \
|
|
|
|
clean-doc
|
2009-03-13 13:32:32 +00:00
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
build: \
|
|
|
|
build-ui \
|
|
|
|
build-qrc \
|
|
|
|
build-bin \
|
|
|
|
build-lib \
|
|
|
|
build-data
|
|
|
|
|
2011-03-10 16:56:03 +00:00
|
|
|
doc: build-doc
|
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
install: \
|
|
|
|
install-ui \
|
|
|
|
install-qrc \
|
|
|
|
install-bin \
|
|
|
|
install-lib \
|
|
|
|
install-data
|
|
|
|
|
|
|
|
## DOC SECTION
|
|
|
|
|
2011-03-10 16:56:03 +00:00
|
|
|
.PHONY: build-doc
|
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
clean-doc:
|
2011-03-10 16:56:03 +00:00
|
|
|
rm -fr doc
|
2012-07-28 14:34:35 +00:00
|
|
|
|
|
|
|
build-doc: clean-doc
|
2011-03-10 16:56:03 +00:00
|
|
|
$(RDOC) \
|
|
|
|
--promiscuous \
|
|
|
|
--inline-source \
|
|
|
|
--line-numbers \
|
2012-07-28 14:34:35 +00:00
|
|
|
-o doc lib/$(NAME)/ \
|
2011-07-29 11:45:58 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
## QRC -> QRC_RB SECTION
|
|
|
|
|
|
|
|
QRC_FILES=$(wildcard lib/$(NAME)/*.qrc)
|
|
|
|
RBQRC_FILES=$(patsubst %.qrc,%_qrc.rb,$(QRC_FILES))
|
|
|
|
|
|
|
|
clean-qrc:
|
|
|
|
rm -f $(RBQRC_FILES)
|
|
|
|
|
|
|
|
build-qrc: $(RBQRC_FILES)
|
|
|
|
echo $(RBQRC_FILES)
|
|
|
|
|
|
|
|
install-qrc: $(RBQRC_FILES)
|
|
|
|
# FIXME install qrc
|
|
|
|
|
|
|
|
%_qrc.rb: %.qrc
|
|
|
|
rbrcc $< -o $@
|
|
|
|
|
|
|
|
## UI -> UI_RB SECTION
|
|
|
|
|
|
|
|
UI_FILES=$(wildcard lib/$(NAME)/ui/*.ui)
|
|
|
|
RBUI_FILES=$(patsubst %.ui,%_ui.rb,$(UI_FILES))
|
|
|
|
|
|
|
|
clean-ui:
|
|
|
|
rm -f $(RBUI_FILES)
|
|
|
|
|
|
|
|
build-ui: $(RBUI_FILES)
|
|
|
|
echo $(RBUI_FILES)
|
|
|
|
|
|
|
|
install-ui: $(RBUI_FILES)
|
|
|
|
# FIXME install
|
|
|
|
|
|
|
|
%_ui.rb: %.ui
|
2014-03-31 07:25:32 +00:00
|
|
|
bundle exec rbuic4 $< -o $@
|
2012-08-02 09:10:25 +00:00
|
|
|
sed -e '/^module Ui/,/^end # module Ui/d' \
|
2012-07-30 17:31:39 +00:00
|
|
|
-i $@
|
2012-07-28 14:34:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
## BINARY SECTION
|
|
|
|
|
|
|
|
clean-bin:
|
|
|
|
# make no sense in ruby
|
2011-07-31 01:05:12 +00:00
|
|
|
|
2012-07-28 14:36:23 +00:00
|
|
|
build-bin:
|
|
|
|
|
2011-07-31 01:05:12 +00:00
|
|
|
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; \
|
2013-06-21 12:25:03 +00:00
|
|
|
sed -i -e 's|^QASIM_INCLUDE_DIR.*|QASIM_INCLUDE_DIR = "$(SHAREDIR)/$(NAME)/lib"|' $(BINDIR)/$$BINFILE; \
|
|
|
|
sed -i -e 's|^QASIM_DATA_DIR.*|QASIM_DATA_DIR = "$(SHAREDIR)/$(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
|
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
## LIB SECTION
|
|
|
|
|
|
|
|
clean-lib:
|
2012-07-28 14:36:23 +00:00
|
|
|
|
|
|
|
build-lib:
|
2012-07-28 14:34:35 +00:00
|
|
|
|
2011-07-31 01:05:12 +00:00
|
|
|
install-lib:
|
2012-08-03 16:24:05 +00:00
|
|
|
IFS="" find lib -name '*.rb' | while read libfile ; 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
|
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
|
|
|
|
## DATA SECTION
|
|
|
|
|
|
|
|
clean-data:
|
|
|
|
|
2012-07-28 14:36:23 +00:00
|
|
|
build-data:
|
|
|
|
|
2011-07-31 01:05:12 +00:00
|
|
|
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
|
2012-08-03 16:24:05 +00:00
|
|
|
install -D -o root -g root -m 644 $(CURDIR)/data/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
|
|
|
|
2012-07-28 14:34:35 +00:00
|
|
|
|
|
|
|
## OTHER
|
|
|
|
|
2013-06-21 12:25:03 +00:00
|
|
|
.PHONY: tmp/destdir
|
|
|
|
dev-install:
|
|
|
|
rm -fr tmp/destdir
|
|
|
|
fakeroot $(MAKE) install DESTDIR=tmp/destdir
|
2011-07-29 11:45:58 +00:00
|
|
|
|