summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorModestas Vainius <modestas@vainius.eu>2011-03-09 15:00:52 +0200
committerModestas Vainius <modestas@vainius.eu>2011-03-09 15:06:12 +0200
commit111c1694786d46f34d3569051c3b36f4109c3317 (patch)
treeca379250a79fd5905080a4a335ed9356c427edbc
parent7d2e771653e5ef5998e4a131344abdb75f1e4788 (diff)
downloadpkg-kde-tools-111c1694786d46f34d3569051c3b36f4109c3317.tar.gz
Port policy checks.
-rw-r--r--qt-kde-team/2/TODO1
-rw-r--r--qt-kde-team/2/debian-qt-kde.mk12
-rw-r--r--qt-kde-team/2/policy.mk27
-rw-r--r--qt-kde-team/2/policy/unstable.mk19
4 files changed, 52 insertions, 7 deletions
diff --git a/qt-kde-team/2/TODO b/qt-kde-team/2/TODO
index 62b72a6..acc0958 100644
--- a/qt-kde-team/2/TODO
+++ b/qt-kde-team/2/TODO
@@ -1,2 +1 @@
-* policy
* --remaining-packages on the second and subsequent reruns (without clean)
diff --git a/qt-kde-team/2/debian-qt-kde.mk b/qt-kde-team/2/debian-qt-kde.mk
index 8bb3d49..e42a23e 100644
--- a/qt-kde-team/2/debian-qt-kde.mk
+++ b/qt-kde-team/2/debian-qt-kde.mk
@@ -2,6 +2,7 @@ ifndef dqk_dir
dqk_dir := $(dir $(lastword $(MAKEFILE_LIST)))
dqk_sourcepkg := $(shell dpkg-parsechangelog | sed -n '/^Source:/{ s/^Source:[[:space:]]*//; p; q }')
+dqk_upstream_version ?= $(shell dpkg-parsechangelog | sed -n '/^Version:/{ s/^Version:[[:space:]]*\(.*\)-.*/\1/g; p; q }')
dqk_destdir = $(CURDIR)/debian/tmp
# We want to use kde and pkgkde-symbolshelper plugins by default
@@ -10,15 +11,14 @@ dh := --with=kde,pkgkde-symbolshelper $(dh)
# Include dhmk file
include $(dqk_dir)dhmk.mk
+# dqk_disable_policy_check lists distributions for which policy check should be
+# disabled
+dqk_disable_policy_check ?=
+include $(dqk_dir)policy.mk
+
# KDE packages are parallel safe. Add --parallel to dh_auto_% commands
$(call set_command_options,dh_auto_%, += --parallel)
-# TODO:
-# DEB_KDE_DISABLE_POLICY_CHECK lists distributions for which
-# policy check should be disabled
-# DEB_KDE_DISABLE_POLICY_CHECK ?=
-# include $(DEB_PKG_KDE_QT_KDE_TEAM)/policy.mk
-
# Link with --as-needed by default
# (subject to be moved to kde dh addon/debhelper buildsystem)
link_with_as_needed ?= yes
diff --git a/qt-kde-team/2/policy.mk b/qt-kde-team/2/policy.mk
new file mode 100644
index 0000000..bef6af5
--- /dev/null
+++ b/qt-kde-team/2/policy.mk
@@ -0,0 +1,27 @@
+# policy.mk must be included from debian_qt_kde.mk
+ifdef dqk_dir
+
+dqk_disable_policy_check ?=
+dqk_distribution := $(shell dpkg-parsechangelog | sed -n '/^Distribution:/{ s/^Distribution:[[:space:]]*//g; p; q }')
+dqk_kde_major_version := $(shell echo "$(dqk_upstream_version)" | cut -d. -f1-2)
+dqk_maintainer_check := $(shell grep -e '^Maintainer:.*<debian-qt-kde@lists\.debian\.org>[[:space:]]*$$' \
+ -e '^XSBC-Original-Maintainer:.*<debian-qt-kde@lists\.debian\.org>[[:space:]]*$$' debian/control)
+
+# Distribution-specific policy file may not exist. It is fine
+ifeq (,$(filter $(dqk_distribution),$(dqk_disable_policy_check)))
+ dqk_distribution_policy = $(dqk_dir)/policy/$(dqk_distribution).mk
+ ifeq (yes,$(shell test -f "$(dqk_distribution_policy)" && echo yes))
+ include $(dqk_dir)policy/$(dqk_distribution).mk
+ endif
+endif
+
+# Reject packages not maintained by Debian Qt/KDE Maintainers
+ifeq (,$(dqk_maintainer_check))
+ $(info ### debian_qt_kde.mk can only be used with packages (originally) maintained by)
+ $(info ### Debian Qt/KDE Maintainers, please read /usr/share/pkg-kde-tools/qt-kde-team/README)
+ $(info ### for more details. Please read /usr/share/doc/pkg-kde-tools/README.Debian for more)
+ $(info ### information on how to use pkg-kde-tools with other KDE packages.)
+ $(error debian_qt_kde.mk usage denied by policy.)
+endif
+
+endif
diff --git a/qt-kde-team/2/policy/unstable.mk b/qt-kde-team/2/policy/unstable.mk
new file mode 100644
index 0000000..df43468
--- /dev/null
+++ b/qt-kde-team/2/policy/unstable.mk
@@ -0,0 +1,19 @@
+dqk_upstream_version_check:
+ifeq (srcpkg_ok,$(patsubst kde%,srcpkg_ok,$(dqk_sourcepkg)))
+ifeq (version_ok,$(patsubst 4:4.%,version_ok,$(dqk_upstream_version)))
+ @\
+ if dpkg --compare-versions "$(dqk_kde_major_version).60" le "$(dqk_upstream_version)" && \
+ dpkg --compare-versions "$(dqk_upstream_version)" lt "$(dqk_kde_major_version).90"; then \
+ echo >&2; \
+ echo " ###" >&2; \
+ echo " ### CAUTION: early KDE development releases (alpha or beta) ($(dqk_upstream_version))" >&2; \
+ echo " ### should not be uploaded to unstable" >&2; \
+ echo " ###" >&2; \
+ echo >&2; \
+ fi
+endif
+endif
+
+$(foreach t,$(dhmk_standard_targets),pre_$(t)): dqk_upstream_version_check
+
+.PHONY: dqk_upstream_version_check