2009-03-13 13:32:32 +00:00
|
|
|
|
2011-07-29 11:45:58 +00:00
|
|
|
NAME=qasim
|
2014-05-19 07:51:12 +00:00
|
|
|
DESTDIR=
|
2014-04-03 22:36:18 +00:00
|
|
|
DEV_DESTDIR=tmp
|
2011-07-30 00:50:23 +00:00
|
|
|
CONFDIR=$(DESTDIR)/etc
|
2014-05-19 07:51:12 +00:00
|
|
|
BINDIR=$(DESTDIR)/usr/bin
|
|
|
|
MANDIR=$(DESTDIR)/usr/share/man
|
|
|
|
DOCDIR=$(DESTDIR)/usr/share/doc
|
|
|
|
SHAREDIR=$(DESTDIR)/usr/share
|
2009-04-03 16:27:49 +00:00
|
|
|
|
2014-05-09 06:35:40 +00:00
|
|
|
RUBYVERSION=2.0
|
2011-03-10 16:56:03 +00:00
|
|
|
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
|
|
|
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-05-09 06:22:24 +00:00
|
|
|
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:
|
2014-08-12 07:22:51 +00:00
|
|
|
# remove external packages
|
|
|
|
rm -fr vendor/bundle
|
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:
|
2014-05-19 07:51:12 +00:00
|
|
|
env |sort
|
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
|
2014-08-12 07:22:51 +00:00
|
|
|
mkdir -p $(MANDIR)/man1
|
|
|
|
for binfile in bin/*.rb ; do \
|
|
|
|
BINFILE=`basename $$binfile |sed -e 's/.rb$$//'`; \
|
|
|
|
cat man/$${BINFILE}.1 | gzip > $(MANDIR)/man1/$${BINFILE}.1.gz ; \
|
|
|
|
done
|
2011-07-31 01:15:23 +00:00
|
|
|
#
|
|
|
|
## 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
|
|
|
|
|
2014-04-03 22:36:18 +00:00
|
|
|
.PHONY: destdir
|
2013-06-21 12:25:03 +00:00
|
|
|
dev-install:
|
2014-04-03 22:36:18 +00:00
|
|
|
rm -fr $(DEV_DESTDIR)
|
|
|
|
fakeroot $(MAKE) install DESTDIR=$(DEV_DESTDIR)
|
2011-07-29 11:45:58 +00:00
|
|
|
|