diff options
Diffstat (limited to 'ubuntu/_base/core/tde-i18n/debian/rules')
-rwxr-xr-x | ubuntu/_base/core/tde-i18n/debian/rules | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/ubuntu/_base/core/tde-i18n/debian/rules b/ubuntu/_base/core/tde-i18n/debian/rules index 3ab71190d..900b2d86e 100755 --- a/ubuntu/_base/core/tde-i18n/debian/rules +++ b/ubuntu/_base/core/tde-i18n/debian/rules @@ -10,6 +10,7 @@ I18N_DIRS := $(wildcard $(I18N_DIR_PREFIX)-*) # Stamps and support variables cur_lang = $(word 2,$(subst __, ,$@)) +cur_lang_target = $(subst @,_,$(cur_lang)) cur_lang_dir = $(patsubst %,$(I18N_DIR_PREFIX)-%,$(cur_lang)) cur_pkg_lang = $(subst _,,$(subst @,,$(subst @latn,latin,$(shell echo $(cur_lang) | tr '[:upper:]' '[:lower:]')))) cur_pkg = $(I18N_DEST_PREFIX)-$(cur_pkg_lang)-trinity @@ -25,6 +26,13 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif DEB_MAKE_PARALLEL ?= $(and $(DEB_BUILD_PARALLEL),$(DEB_PARALLEL_JOBS),-j$(DEB_PARALLEL_JOBS)) +ifneq "$(wildcard /usr/bin/ninja)" "" +MAKE = ninja -v +DEB_MAKE_ENVVARS += DESTDIR=$(DEB_DESTDIR) +DEB_MAKE_INSTALL_TARGET = install +DEB_CMAKE_NORMAL_ARGS += -GNinja +endif + # The default gzip compressor has been changed in dpkg >= 1.17.0. deb_default_compress = $(shell LANG=C dpkg-deb --version | head -n1 | \ sed -e "s|.*version ||" -e "s| .*||" | \ @@ -49,32 +57,65 @@ build:: dh_testdir dh_prep +ifneq "$(wildcard /usr/bin/ninja)" "" + +build:: debian/stamp__build + +debian/stamp__build: + [ -d build ] || \ + mkdir build + cd build && \ + cmake .. $(DEB_CMAKE_NORMAL_ARGS) $(DEB_CMAKE_EXTRA_FLAGS) && \ + $(MAKE) $(DEB_MAKE_PARALLEL) + touch $@ + +else + build:: $(STAMP_BUILD) $(STAMP_BUILD): # Building the '$(cur_lang)' language ... [ -d $(cur_lang_dir)/build ] || \ mkdir $(cur_lang_dir)/build - [ -e $(cur_lang_dir)/cmake ] || \ - ln -s ../cmake $(cur_lang_dir) [ -e $(cur_lang_dir)/CMakeLists.txt ] || \ ln -s ../template/commonCMakeLists.txt $(cur_lang_dir)/CMakeLists.txt cd $(cur_lang_dir)/build && \ - cmake .. $(DEB_CMAKE_EXTRA_FLAGS) && \ + cmake .. $(DEB_CMAKE_NORMAL_ARGS) $(DEB_CMAKE_EXTRA_FLAGS) && \ $(MAKE) $(DEB_MAKE_PARALLEL) touch $@ +endif install:: dh_testdir dh_testroot install:: $(I18N_INSTALL) + dh_testdir + cat debian/control-source > debian/control + find debian -name "control-lang-*" | LANG=C sort | xargs -r cat >> debian/control $(I18N_INSTALL): build +ifneq "$(wildcard /usr/bin/ninja)" "" + [ ! -e $(cur_lang_dir)/CMakeLists.txt ] || \ + DESTDIR=$(CURDIR)/debian/$(cur_pkg) $(MAKE) -C build install-$(cur_lang_target) +else cd $(cur_lang_dir)/build && \ - $(MAKE) install DESTDIR=$(CURDIR)/debian/$(cur_pkg) $(DEB_MAKE_PARALLEL) + DESTDIR=$(CURDIR)/debian/$(cur_pkg) $(MAKE) install $(DEB_MAKE_PARALLEL) +endif + if [ -e $(cur_lang_dir)/messages/entry.desktop ]; then \ + lang_desc=$$(sed -n "s|^Name=||p" $(cur_lang_dir)/messages/entry.desktop); \ + sed -e "s|@lang@|$(cur_lang)|g" \ + -e "s|@pkg_lang@|$(cur_pkg_lang)|g" \ + -e "s|@lang_desc@|$$lang_desc|" \ + < debian/control-lang > debian/control-lang-$(cur_pkg_lang); \ + fi + +ifneq "$(wildcard /usr/bin/ninja)" "" +clean: debian-clean + +else clean: $(I18N_CLEAN) debian-clean @@ -82,10 +123,19 @@ $(I18N_CLEAN): dh_testdir rm -rf $(cur_lang_dir)/build +endif + debian-clean: dh_testdir + rm -rf build rm -rf debian/$(I18N_DEST_PREFIX)-* rm -f debian/stamp__* + rm -f debian/control-lang-* + cat debian/control-source > debian/control + sed -e "s|@lang@|all|g" \ + -e "s|-@pkg_lang@||g" \ + -e "s|@lang_desc@|All languages|" \ + < debian/control-lang >> debian/control dh_clean @@ -100,6 +150,7 @@ binary-indep: build install dh_installdocs dh_installmenu dh_installchangelogs + dh_link dh_strip $(if $(wildcard /usr/bin/dh_strip_nondeterminism),\ dh_strip_nondeterminism) |