You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
136 lines
3.9 KiB
136 lines
3.9 KiB
14 years ago
|
#!/usr/bin/make -f
|
||
|
|
||
|
# Uncomment this to turn on verbose mode.
|
||
|
#export DH_VERBOSE=1
|
||
|
|
||
13 years ago
|
I18N_DIR_PREFIX := tde-i18n
|
||
11 years ago
|
I18N_DEST_PREFIX := $(I18N_DIR_PREFIX)
|
||
13 years ago
|
I18N_DIR_PAT := $(I18N_DIR_PREFIX)-%
|
||
|
I18N_DIRS := $(wildcard $(I18N_DIR_PREFIX)-*)
|
||
14 years ago
|
|
||
|
# Stamps and support variables
|
||
|
cur_lang = $(word 2,$(subst __, ,$@))
|
||
13 years ago
|
cur_lang_dir = $(patsubst %,$(I18N_DIR_PREFIX)-%,$(cur_lang))
|
||
11 years ago
|
cur_pkg = $(I18N_DEST_PREFIX)-$(cur_lang)
|
||
14 years ago
|
|
||
|
STAMP_BUILD := $(patsubst $(I18N_DIR_PAT),debian/stamp__%__build,$(I18N_DIRS))
|
||
|
I18N_INSTALL := $(patsubst $(I18N_DIR_PAT),install__%,$(I18N_DIRS))
|
||
11 years ago
|
I18N_CLEAN := $(patsubst $(I18N_DIR_PAT),clean__%,$(I18N_DIRS))
|
||
14 years ago
|
|
||
11 years ago
|
DEB_CONFIGURE_INCLUDEDIR := /opt/trinity/include
|
||
14 years ago
|
DEB_CONFIGURE_MANDIR := /opt/trinity/share/man
|
||
|
DEB_CONFIGURE_PREFIX := /opt/trinity
|
||
|
DEB_CONFIGURE_INFODIR := /opt/trinity/share/info
|
||
|
|
||
9 years ago
|
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
||
|
DEB_PARALLEL_JOBS ?= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
||
|
endif
|
||
|
DEB_MAKE_PARALLEL ?= $(and $(DEB_BUILD_PARALLEL),$(DEB_PARALLEL_JOBS),-j$(DEB_PARALLEL_JOBS))
|
||
|
|
||
11 years ago
|
configkde=\
|
||
|
--disable-rpath \
|
||
|
--prefix=$(DEB_CONFIGURE_PREFIX) \
|
||
|
--sysconfdir=/etc \
|
||
|
--includedir=$(DEB_CONFIGURE_INCLUDEDIR) \
|
||
|
--infodir=$(DEB_CONFIGURE_INFODIR) \
|
||
|
--mandir=$(DEB_CONFIGURE_MANDIR)
|
||
|
|
||
|
DEB_CMAKE_EXTRA_FLAGS := \
|
||
|
-DCMAKE_INSTALL_PREFIX="/opt/trinity" \
|
||
|
-DCONFIG_INSTALL_DIR="/etc/trinity" \
|
||
|
-DSYSCONF_INSTALL_DIR="/etc/trinity" \
|
||
|
-DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \
|
||
|
-DCMAKE_VERBOSE_MAKEFILE="ON" \
|
||
|
-DBUILD_ALL="ON"
|
||
14 years ago
|
|
||
12 years ago
|
DEB_DH_BUILDDEB_ARGS += -- -Z$(shell dpkg-deb --help | grep -q ":.* xz[,.]" \
|
||
|
&& echo xz || echo bzip2)
|
||
|
|
||
14 years ago
|
|
||
|
build::
|
||
|
dh_testdir
|
||
|
|
||
11 years ago
|
build:: $(STAMP_BUILD)
|
||
14 years ago
|
|
||
|
$(STAMP_BUILD):
|
||
|
# Building the '$(cur_lang)' language ...
|
||
11 years ago
|
[ -d $(cur_lang_dir)/build ] || mkdir $(cur_lang_dir)/build
|
||
|
if [ ! -e $(cur_lang_dir)/CMakeLists.txt ]; then \
|
||
|
([ -e $(cur_lang_dir)/admin ] || ln -s ../admin $(cur_lang_dir)) && \
|
||
|
cd $(cur_lang_dir) && \
|
||
|
autoreconf && automake -f && \
|
||
|
$(MAKE) -f ../admin/Makefile.common && \
|
||
|
cd build && \
|
||
|
../configure --build=build $(configkde) && \
|
||
9 years ago
|
$(MAKE) $(DEB_MAKE_PARALLEL); \
|
||
11 years ago
|
fi
|
||
|
if [ -e $(cur_lang_dir)/CMakeLists.txt ]; then \
|
||
|
([ -e $(cur_lang_dir)/cmake ] || ln -s ../cmake $(cur_lang_dir)) && \
|
||
|
cd $(cur_lang_dir)/build && \
|
||
|
cmake .. $(DEB_CMAKE_EXTRA_FLAGS) && \
|
||
9 years ago
|
$(MAKE) $(DEB_MAKE_PARALLEL); \
|
||
11 years ago
|
fi
|
||
14 years ago
|
touch $@
|
||
|
|
||
|
|
||
|
install::
|
||
|
dh_testdir
|
||
|
dh_testroot
|
||
|
dh_clean -k
|
||
|
|
||
|
install:: $(I18N_INSTALL)
|
||
|
# copying the non 2 letter languages into the correct directory
|
||
11 years ago
|
mkdir debian/$(I18N_DEST_PREFIX)-engb-trinity
|
||
|
cp -aR debian/$(I18N_DEST_PREFIX)-en_GB-trinity/* debian/$(I18N_DEST_PREFIX)-engb-trinity/
|
||
|
mkdir debian/$(I18N_DEST_PREFIX)-ptbr-trinity
|
||
|
cp -aR debian/$(I18N_DEST_PREFIX)-pt_BR-trinity/* debian/$(I18N_DEST_PREFIX)-ptbr-trinity/
|
||
|
mkdir debian/$(I18N_DEST_PREFIX)-srlatin-trinity
|
||
|
cp -aR debian/$(I18N_DEST_PREFIX)-sr@Latn-trinity/* debian/$(I18N_DEST_PREFIX)-srlatin-trinity/
|
||
|
mkdir debian/$(I18N_DEST_PREFIX)-zhcn-trinity
|
||
|
cp -aR debian/$(I18N_DEST_PREFIX)-zh_CN-trinity/* debian/$(I18N_DEST_PREFIX)-zhcn-trinity/
|
||
|
mkdir debian/$(I18N_DEST_PREFIX)-zhtw-trinity
|
||
|
cp -aR debian/$(I18N_DEST_PREFIX)-zh_TW-trinity/* debian/$(I18N_DEST_PREFIX)-zhtw-trinity/
|
||
14 years ago
|
|
||
|
$(I18N_INSTALL):
|
||
9 years ago
|
cd $(cur_lang_dir)/build && $(MAKE) install DESTDIR=$(CURDIR)/debian/$(cur_pkg)-trinity $(DEB_MAKE_PARALLEL)
|
||
11 years ago
|
|
||
14 years ago
|
|
||
11 years ago
|
clean: $(I18N_CLEAN) debian-clean
|
||
|
|
||
|
$(I18N_CLEAN):
|
||
|
dh_testdir
|
||
|
rm -rf $(cur_lang_dir)/build
|
||
14 years ago
|
|
||
|
debian-clean:
|
||
|
dh_testdir
|
||
11 years ago
|
rm -rf debian/$(I18N_DEST_PREFIX)-*
|
||
14 years ago
|
rm -f debian/stamp__*
|
||
|
dh_clean
|
||
|
|
||
|
|
||
|
binary-arch: build
|
||
|
dh_testroot
|
||
|
dh_testdir
|
||
|
|
||
|
|
||
|
binary-indep: build install
|
||
|
dh_testroot
|
||
|
dh_testdir
|
||
|
dh_installdocs
|
||
|
dh_installmenu
|
||
|
dh_installchangelogs
|
||
|
dh_strip
|
||
|
dh_compress -X.docbook -X.css -X-license -X.dcl -X.bz2
|
||
|
dh_fixperms
|
||
|
dh_installdeb
|
||
|
dh_shlibdeps
|
||
|
dh_gencontrol
|
||
|
dh_md5sums
|
||
12 years ago
|
dh_builddeb $(DEB_DH_BUILDDEB_ARGS)
|
||
14 years ago
|
|
||
|
|
||
|
# Below here is fairly generic really
|
||
|
binary: binary-indep binary-arch
|
||
|
|
||
11 years ago
|
.PHONY: binary binary-arch binary-indep clean build install $(I18N_INSTALL)
|