[Pkg-kde-commits] rev 1028 - branches/kde-3.4.0/cdbs

Christopher Martin chrsmrtn-guest@costa.debian.org
Sun, 24 Apr 2005 18:12:00 +0000


Author: chrsmrtn-guest
Date: 2005-04-24 18:11:59 +0000 (Sun, 24 Apr 2005)
New Revision: 1028

Added:
   branches/kde-3.4.0/cdbs/debian-qt-kde.mk
   branches/kde-3.4.0/cdbs/kde.mk
   branches/kde-3.4.0/cdbs/simple-patchsys.mk
Removed:
   branches/kde-3.4.0/cdbs/kde.mk
Log:
OK, here goes: The Split (tm)

kde.mk has been stripped on team-specific rules, which are now
in debian-qt-kde.mk.

We also now use our own copy of simple-patchsys.mk, with 3 fixes:

1) uu-encoded patches work (without my crappy hacks)
2) reverse-patches no longer runs update-config
   (which updates config.guess and config.sub)
3) all patch log files are cleaned up

All three of these fixes have been submitted upstream, so when
upstream applies them, we can revert to using the standard copy.

Also, I'd like to submit our kde.mk upstream, to replace the current
one, but I'll let that sit for a few days in case anyone objects to
what and how I've done things.


Added: branches/kde-3.4.0/cdbs/debian-qt-kde.mk
===================================================================
--- branches/kde-3.4.0/cdbs/debian-qt-kde.mk	2005-04-23 02:59:23 UTC (rev 1027)
+++ branches/kde-3.4.0/cdbs/debian-qt-kde.mk	2005-04-24 18:11:59 UTC (rev 1028)
@@ -0,0 +1,94 @@
+ifndef _cdbs_bootstrap
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_class_debian-qt-kde
+_cdbs_class_debian-qt-kde := 1
+
+include debian/cdbs/kde.mk$(_cdbs_makefile_suffix)
+
+DEB_PATCHDIRS := debian/patches/common debian/patches
+
+DEB_KDE_ENABLE_FINAL := yes
+DEB_INSTALL_DOCS_ALL :=
+
+DEB_DH_MAKESHLIBS_ARGS_ALL := -V
+DEB_SHLIBDEPS_INCLUDE = $(foreach p,$(PACKAGES_WITH_LIBS),debian/$(p)/usr/lib)
+
+buildprep: clean apply-patches
+	make -f admin/Makefile.common dist
+	debian/rules clean
+
+common-build-arch common-build-indep:: debian/stamp-apidox
+debian/stamp-apidox:
+	if test -n "$(DEB_KDE_APIDOX)"; then \
+		$(DEB_MAKE_INVOKE) apidox; \
+	fi
+	touch debian/stamp-apidox
+
+common-install-arch common-install-indep:: install-apidox
+install-apidox::
+	if test -n "$(DEB_KDE_APIDOX)"; then \
+		$(DEB_MAKE_INVOKE) install-apidox DESTDIR=$(DEB_DESTDIR); \
+	fi
+
+common-build-arch:: debian/stamp-man-pages
+debian/stamp-man-pages:
+	[ -d debian/man/out ] || mkdir -p debian/man/out
+	for f in $$(find debian/man -name '*.sgml'); do \
+		docbook-to-man $$f > debian/man/out/`basename $$f .sgml`.1; \
+	done
+	for f in $$(find debian/man -name '*.man'); do \
+		soelim -I debian/man $$f \
+		> debian/man/out/`basename $$f .man`.`head -n1 $$f | awk '{print $$NF}'`; \
+	done
+	touch debian/stamp-man-pages
+
+clean::
+	rm -rf debian/man/out
+	-rmdir debian/man
+	rm -f debian/stamp-man-pages
+	rm -f debian/stamp-apidox
+	rm -rf debian/shlibs-check
+
+$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
+	if test -x /usr/bin/dh_desktop; then dh_desktop -p$(cdbs_curpkg) $(DEB_DH_DESKTOP_ARGS); fi
+	if test -e debian/$(cdbs_curpkg).lintian; then \
+		install -p -D -m644 debian/$(cdbs_curpkg).lintian \
+			debian/$(cdbs_curpkg)/usr/share/lintian/overrides/$(cdbs_curpkg); \
+	fi
+
+binary-install/$(DEB_SOURCE_PACKAGE)-doc-html::
+	set -e; \
+	for doc in `cd $(DEB_DESTDIR)/usr/share/doc/kde/HTML/en; find . -name index.docbook`; do \
+		pkg=$${doc%/index.docbook}; pkg=$${pkg#./}; \
+		echo Building $$pkg HTML docs...; \
+		mkdir -p $(CURDIR)/debian/$(DEB_SOURCE_PACKAGE)-doc-html/usr/share/doc/kde/HTML/en/$$pkg; \
+		cd $(CURDIR)/debian/$(DEB_SOURCE_PACKAGE)-doc-html/usr/share/doc/kde/HTML/en/$$pkg; \
+		meinproc $(DEB_DESTDIR)/usr/share/doc/kde/HTML/en/$$pkg/index.docbook; \
+	done
+	for pkg in $(DOC_HTML_PRUNE) ; do \
+	  rm -rf debian/$(DEB_SOURCE_PACKAGE)-doc-html/usr/share/doc/kde/HTML/en/$$pkg; \
+	done
+
+common-configure-arch common-configure-indep:: debian/stamp-cvs-make
+debian/stamp-cvs-make:
+	if test -n "$(DEB_KDE_CVS_MAKE)" -a ! -f configure; then \
+		$(MAKE) -C $(DEB_SRCDIR) -f admin/Makefile.common dist; \
+	fi
+	touch debian/stamp-cvs-make
+
+clean::
+	if test -n "$(DEB_KDE_CVS_MAKE)" && test -d $(DEB_SRCDIR); then \
+		cd $(DEB_SRCDIR); \
+		find . -name Makefile.in -print | \
+			xargs --no-run-if-empty rm -f; \
+		rm -f Makefile.am acinclude.m4 aclocal.m4 config.h.in \
+			configure configure.files configure.in stamp-h.in \
+			subdirs; \
+	fi
+	rm -f debian/stamp-cvs-make
+
+endif

Deleted: branches/kde-3.4.0/cdbs/kde.mk

Added: branches/kde-3.4.0/cdbs/kde.mk
===================================================================
--- branches/kde-3.4.0/cdbs/kde.mk	2005-04-23 02:59:23 UTC (rev 1027)
+++ branches/kde-3.4.0/cdbs/kde.mk	2005-04-24 18:11:59 UTC (rev 1028)
@@ -0,0 +1,68 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2003 Christopher L Cheney <ccheney@debian.org>
+# Description: A class for KDE packages; sets KDE environment variables, etc
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+
+ifndef _cdbs_bootstrap
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_class_kde
+_cdbs_class_kde := 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+ifdef _cdbs_tarball_dir
+DEB_BUILDDIR = $(_cdbs_tarball_dir)/obj-$(DEB_BUILD_GNU_TYPE)
+else
+DEB_BUILDDIR = obj-$(DEB_BUILD_GNU_TYPE)
+endif
+
+include $(_cdbs_class_path)/autotools.mk$(_cdbs_makefile_suffix)
+
+export kde_cgidir  = \$${libdir}/cgi-bin
+export kde_confdir = \$${sysconfdir}/kde3
+export kde_htmldir = \$${datadir}/doc/kde/HTML
+
+ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	cdbs_kde_enable_final = $(if $(DEB_KDE_ENABLE_FINAL),--enable-final,)
+endif
+
+ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	cdbs_kde_enable_final = 
+	cdbs_kde_enable_debug = --enable-debug=yes
+else
+	cdbs_kde_enable_debug = --disable-debug
+endif
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	cdbs_kde_enable_debug = --enable-debug=full
+endif
+
+cdbs_configure_flags += --with-qt-dir=/usr/share/qt3 --disable-rpath --with-xinerama $(cdbs_kde_enable_final) $(cdbs_kde_enable_debug)
+
+DEB_AC_AUX_DIR = $(DEB_SRCDIR)/admin
+DEB_CONFIGURE_INCLUDEDIR = "\$${prefix}/include/kde"
+DEB_COMPRESS_EXCLUDE := .bz2 .css .dcl .docbook -license .tag .sty .el
+
+cleanbuilddir::
+	-if test "$(DEB_BUILDDIR)" != "$(DEB_SRCDIR)"; then rm -rf $(DEB_BUILDDIR); fi
+
+endif

Added: branches/kde-3.4.0/cdbs/simple-patchsys.mk
===================================================================
--- branches/kde-3.4.0/cdbs/simple-patchsys.mk	2005-04-23 02:59:23 UTC (rev 1027)
+++ branches/kde-3.4.0/cdbs/simple-patchsys.mk	2005-04-24 18:11:59 UTC (rev 1028)
@@ -0,0 +1,153 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2002,2003 Colin Walters <walters@debian.org>
+# Description: A sample patch system which uses separate files in debian/patches
+#  Patch suffix is specified by DEB_PATCH_SUFFIX. Defaults to .patch.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+ifndef _cdbs_bootstrap
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_rules_patchsys
+_cdbs_rules_patchsys := 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+ifeq ($(_cdbs_included_patchsys),)
+_cdbs_included_patchsys := 1
+
+_cdbs_patch_system_apply_rule := apply-patches
+_cdbs_patch_system_unapply_rule := reverse-patches
+
+# uu-encoded patches allowed - Bug ##305857
+DEB_PATCH_SUFFIX ?= .diff .diff.gz .diff.bz2 .diff.uu .patch .patch.gz .patch.bz2 .patch.uu
+DEB_PATCHDIRS ?= debian/patches
+close_parenthesis ?= )
+DEB_PATCHES := $(shell\
+for dir in $(DEB_PATCHDIRS) ; do \
+	for file in $$dir/* ; do \
+		for suffix in $(DEB_PATCH_SUFFIX) ; do \
+			case $$file in *$$suffix$(close_parenthesis) echo $$file ;; esac ; \
+		done ; \
+	done ; \
+done)
+
+# if we have any patches, check if some are patching config.{guess,sub,rpath}
+# and print a warning
+ifneq (, $(DEB_PATCHES))
+CDBS_BUILD_DEPENDS    := $(CDBS_BUILD_DEPENDS), patchutils
+evil_patches_that_do_nasty_things := $(shell\
+if lsdiff=`which lsdiff` ; then \
+  $$lsdiff -H $(DEB_PATCHES) \
+  | egrep "/config\.(guess|sub|rpath)$$" | tr "\n" " " ; \
+fi)
+ifneq (, $(evil_patches_that_do_nasty_things))
+$(warning ** WARNING **:  The following patches are modifiing auto-updated files.   Please exclude the following files from your patch:  $(evil_patches_that_do_nasty_things))
+endif
+endif
+
+post-patches:: apply-patches
+
+# clean up log files in all patch directories - Bug ##296984
+clean:: reverse-patches
+	for dir in $(DEB_PATCHDIRS) ; do \
+	  rm -f $$dir/*.log ; \
+	done
+
+# The patch subsystem 
+apply-patches: pre-build debian/stamp-patched
+debian/stamp-patched: $(DEB_PATCHES)
+debian/stamp-patched reverse-patches:
+	$(MAKE) -f debian/rules reverse-config
+	@echo "patches: $(DEB_PATCHES)"
+	@set -e ; reverse=""; patches="$(DEB_PATCHES)"; \
+	  if [ "$@" = "reverse-patches" ]; then \
+	    if [ ! -e debian/stamp-patched ]; then \
+	      echo "Not reversing not applied patches."; \
+	      exit 0; \
+	    fi; \
+	    reverse="-R"; \
+	    for patch in $$patches; do reversepatches="$$patch $$reversepatches"; done; \
+	    patches="$$reversepatches"; \
+	  fi; \
+	  for patch in $$patches; do \
+          case $$patch in \
+            *.gz) cat=zcat ;; \
+            *.bz2) cat=bzcat ;; \
+            *.uu) cat="uudecode -o -" ;; \
+            *) cat=cat ;; \
+          esac; \
+	  level=$$(head $$patch | egrep '^#DPATCHLEVEL=' | cut -f 2 -d '='); \
+	  reverse=""; \
+	  if [ "$@" = "reverse-patches" ]; then reverse="-R"; fi; \
+	  success=""; \
+	  if [ -z "$$level" ]; then \
+	    echo -n "Trying "; if test -n "$$reverse"; then echo -n "reversed "; fi; echo -n "patch $$patch at level "; \
+	    for level in 0 1 2; do \
+	      if test -z "$$success"; then \
+	        echo -n "$$level..."; \
+		if [ "$(DEB_PATCHDIRS_READONLY)" = "yes" ] ; then \
+		  logfile="/dev/null" ; \
+		else \
+		  logfile="$$patch.level-$$level.log" ; \
+		fi ; \
+	        if $$cat $$patch | patch -d $(DEB_SRCDIR) $$reverse -E --dry-run -p$$level 1>$$logfile 2>&1; then \
+	          if $$cat $$patch | patch -d $(DEB_SRCDIR) $$reverse -E --no-backup-if-mismatch -V never -p$$level 1>$$logfile 2>&1; then \
+	            success=yes; \
+	            touch debian/stamp-patch-$$(basename $$patch); \
+	            echo "success."; \
+                  fi; \
+	        fi; \
+	      fi; \
+            done; \
+	    if test -z "$$success"; then \
+	      if test -z "$$reverse"; then \
+	        echo "failure."; \
+	        exit 1; \
+	       else \
+	         echo "failure (ignored)."; \
+               fi \
+	    fi; \
+	  else \
+	    echo -n "Trying patch $$patch at level $$level..."; \
+	        echo -n "$$level..."; \
+	    if [ "$(DEB_PATCHDIRS_READONLY)" = "yes" ] ; then \
+	      logfile="/dev/null" ; \
+	    else \
+	      logfile="$$patch.log" ; \
+	    fi ; \
+	    if $$cat $$patch | patch -d $(DEB_SRCDIR) $$reverse -E --no-backup-if-mismatch -V never -p$$level 1>$$logfile 2>&1; then \
+              touch debian/stamp-patch-$$(basename $$patch); \
+	      echo "success."; \
+	    else \
+	      echo "failure:"; \
+	      cat $$logfile; \
+	      if test -z "$$reverse"; then exit 1; fi; \
+            fi; \
+	  fi; \
+	done
+	if [ "$@" = "debian/stamp-patched" ] ; then touch debian/stamp-patched ; \
+	elif [ "$@" = "reverse-patches" ] ; then rm -f debian/stamp-patch* ; \
+	fi
+	# eliminate update-config when reversing patches - Bug ##299010
+	if [ "$@" != "reverse-patches" ] ; then $(MAKE) -f debian/rules update-config ; fi
+
+endif
+
+endif