1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
# Value of the kde-l10n:{Depends,Recommends,Suggests,Replaces,Breaks,Provides}
# substvars. Common relationships for each l10n package.
L10N_Depends := libkf5i18n5 | libkdecore5 (>= 4:4.10)
L10N_Recommends :=
L10N_Suggests := kde-standard
L10N_Replaces := okular-l10n, gwenview-i18n, filelight-l10n, konq-plugins-l10n, ktouchpadenabler (<< 4:4.10.4), kio-mtp (<< 0.75+git20140304-2), digikam-data (<< 4:4.14.0-1)
L10N_Breaks := okular-l10n, gwenview-i18n, filelight-l10n, konq-plugins-l10n, ktouchpadenabler (<< 4:4.10.4), kio-mtp (<< 0.75+git20140304-2), digikam-data (<< 4:4.14.0-1)
L10N_Provides := kde-l10n
# Handling of conflicts against kdepim 4.4 (which provides translations)
OLD_KDEPIM_WITH_L10N := akregator (<< 4:4.10.2), blogilo (<< 4:4.10.2), kaddressbook (<< 4:4.10.2), kalarm (<< 4:4.10.2), kdepim-groupware (<< 4:4.10.2), kdepim-kresources (<< 4:4.10.2), kdepim-wizards (<< 4:4.10.2), kjots (<< 4:4.10.2), kleopatra (<< 4:4.10.2), kmail (<< 4:4.10.2), knode (<< 4:4.10.2), knotes (<< 4:4.10.2), konsolekalendar (<< 4:4.10.2), kontact (<< 4:4.10.2), korganizer (<< 4:4.10.2), ktimetracker (<< 4:4.10.2), libkdepim4 (<< 4:4.10.2), libkleo4 (<< 4:4.10.2), libkpgp4 (<< 4:4.10.2), libksieve4 (<< 4:4.10.2), libmessagecore4 (<< 4:4.10.2), libmessagelist4 (<< 4:4.10.2), libmessageviewer0 (<< 4:4.10.2)
L10N_Replaces := $(L10N_Replaces), $(OLD_KDEPIM_WITH_L10N)
L10N_Breaks := $(L10N_Breaks), $(OLD_KDEPIM_WITH_L10N)
# Handling of conflicts against pre-Applications packages
OLD_PKGS_WITH_L10N := kdenlive-data (<< 15.04), kde-telepathy-data (<< 15.04), kde-config-telepathy-accounts (<< 15.04), kde-telepathy-text-ui (<< 15.04), kde-telepathy-integration-module (<< 15.04), kde-telepathy-approver (<< 15.04), kde-telepathy-auth-handler (<< 15.04), plasma-runner-telepathy-contact (<< 15.04), kde-telepathy-send-file (<< 15.04), kde-telepathy-filetransfer-handler (<< 15.04), kde-telepathy-contact-list (<< 15.04)
L10N_Replaces := $(L10N_Replaces), $(OLD_PKGS_WITH_L10N)
L10N_Breaks := $(L10N_Breaks), $(OLD_PKGS_WITH_L10N)
L10N_PREFIX := kde-l10n
#L10N_VERSION := $(shell cat debian/changelog | head -n1 | sed 's/.*(\([[:digit:]]\+:\)\?\(.\+\)-.\+).*/\2/')
L10N_LANGS := $(filter-out debian,$(subst ./,,$(shell find . -mindepth 1 -maxdepth 1 -type d ! -name .pc ! -name .git)))
L10N_DIRS = $(L10N_LANGS)
L10N_PACKAGES := $(patsubst %,$(L10N_PREFIX)-%,$(L10N_LANGS))
L10N_EXCLUDED_SUBDIRS :=
# Support variables to be used in targets
cur_lang = $(word 2,$(subst __, ,$@))
cur_lang_dir = $(cur_lang)
cur_lang_builddir = $(cur_lang_dir)/build
cur_pkg = $(L10N_PREFIX)-$(cur_lang)
# Stamps
STAMP_BUILD := $(patsubst %,debian/stamp__%__build,$(L10N_LANGS))
L10N_INSTALL := $(patsubst %,install__%,$(L10N_LANGS))
L10N_CLEAN := $(patsubst %,clean__%,$(L10N_LANGS))
# debian/control checks
L10N_PACKAGES_IN_CONTROL := $(shell dh_listpackages | grep '$(L10N_PREFIX)')
L10N_NOTEXIST_IN_CONTROL := $(filter-out $(L10N_PACKAGES_IN_CONTROL),$(L10N_PACKAGES))
L10N_EXCESS_IN_CONTROL := $(filter-out $(L10N_PACKAGES),$(L10N_PACKAGES_IN_CONTROL))
check_control:
@test -z "$(L10N_NOTEXIST_IN_CONTROL)" || \
(echo "-- ERROR: debian/control is missing language packages: $(L10N_NOTEXIST_IN_CONTROL)" && false)
@test -z "$(L10N_EXCESS_IN_CONTROL)" || \
(echo "-- ERROR: debian/control has excess language packages: $(L10N_EXCESS_IN_CONTROL)" && false)
prepare_build: check_control
dh_testdir
build: build-arch build-indep
build-arch:
# No architecture dependent build
build-indep: $(STAMP_BUILD)
build_progress = [$(shell ls -1 -d debian/stamp__*__build debian | wc -l)/$(words $(STAMP_BUILD))]
$(STAMP_BUILD): | prepare_build
# $(build_progress) Building '$(cur_lang)' language ...
dh_auto_configure -Scmake -D$(cur_lang) -B$(cur_lang_builddir) -- -DCMAKE_BUILD_TYPE=Debian \
-DCMAKE_MODULE_PATH='$(CURDIR)/debian/cmake' \
-DDEBIAN_EXCLUDE_DIRS='$(L10N_EXCLUDED_SUBDIRS)'
$(MAKE) -C $(cur_lang_builddir)
# $(build_progress) Built '$(cur_lang)' language.
touch $@
prepare_install:
dh_testdir
dh_testroot
dh_prep
install: $(L10N_INSTALL)
# Installed successfully
$(L10N_INSTALL): | prepare_install
# Installing '$(cur_lang)' to the '$(cur_pkg)' package
dh_auto_install -Scmake -D$(cur_lang) -B$(cur_lang_builddir) --destdir=$(CURDIR)/debian/$(cur_pkg)
# The new KF5 package have their own translations now, remove files listed in excluded_files.list
sed -e '/^$$/d;/^#/d' $(CURDIR)/debian/excluded_files.list | while read excluded_file; do \
find $(CURDIR)/debian/$(cur_pkg) -name $${excluded_file} -delete ; \
done
# Drop *_mimetypes.mo translations, since they are only helper for
# translating XML files
find $(CURDIR)/debian/$(cur_pkg) -name '*_mimetypes.mo' -delete
# Drop *.appdata.mo translations, since they are only helper for
# translating appdata files
find $(CURDIR)/debian/$(cur_pkg) -name '*.appdata.mo' -delete
prepare_clean:
dh_testdir
clean: $(L10N_CLEAN)
dh_clean
# Delete build directories
$(L10N_CLEAN): prepare_clean
rm -rf $(cur_lang_builddir) debian/stamp__$(cur_lang)__*
binary-arch:
# No architecture dependent files available
binary-indep: build install
dh_testroot
dh_testdir
dh_installdocs
dh_installchangelogs
dh_compress -X.docbook -X.css -X-license -X.dcl -X.bz2
dh_link
dh_fixperms
dh_installdeb
dh_gencontrol -- $(foreach rel,Depends Recommends Suggests Replaces Breaks Provides,-V'kde-l10n:$(rel)=$(L10N_$(rel))')
dh_md5sums
dh_builddeb -- -Zxz
# Below here is fairly generic really
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep build build-arch build-indep
.PHONY: clean install patch
.PHONY: check_control prepare_build prepare_install $(L10N_INSTALL) $(L10N_CLEAN)
|