From fe387e89423813e0e774891b7b950ca7893af8e9 Mon Sep 17 00:00:00 2001
From: Julien Cristau <jcristau@debian.org>
Date: Tue, 2 Nov 2010 23:52:10 +0100
Subject: [PATCH] Generate debian/copyright at build time from upstream COPYINGs

---
 debian/copyright      |  190 -------------------------------------------------
 debian/copyright.head |    3 +
 debian/rules          |   12 +++-
 3 files changed, 13 insertions(+), 192 deletions(-)
 delete mode 100644 debian/copyright
 create mode 100644 debian/copyright.head

diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 0b76678..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,190 +0,0 @@
-The contents of this package were downloaded from
-http://xorg.freedesktop.org/releases/individual/app/
-It contains the setxkbmap, xkbcomp, xkbevd, xkbprint and xkbutils applications.
-
-setxkbmap:
-   Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc.
-  
-   Permission to use, copy, modify, and distribute this
-   software and its documentation for any purpose and without
-   fee is hereby granted, provided that the above copyright
-   notice appear in all copies and that both that copyright
-   notice and this permission notice appear in supporting
-   documentation, and that the name of Silicon Graphics not be 
-   used in advertising or publicity pertaining to distribution 
-   of the software without specific prior written permission.
-   Silicon Graphics makes no representation about the suitability 
-   of this software for any purpose. It is provided "as is"
-   without any express or implied warranty.
-   
-   SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
-   SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
-   AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-   GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
-   DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-   DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
-   OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-   THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-xkbcomp:
-  Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
- 
-  Permission to use, copy, modify, and distribute this
-  software and its documentation for any purpose and without
-  fee is hereby granted, provided that the above copyright
-  notice appear in all copies and that both that copyright
-  notice and this permission notice appear in supporting
-  documentation, and that the name of Silicon Graphics not be 
-  used in advertising or publicity pertaining to distribution 
-  of the software without specific prior written permission.
-  Silicon Graphics makes no representation about the suitability 
-  of this software for any purpose. It is provided "as is"
-  without any express or implied warranty.
-  
-  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
-  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
-  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
-  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
-  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-  THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-  Copyright 1988, 1998  The Open Group
-  
-  Permission to use, copy, modify, distribute, and sell this software and its
-  documentation for any purpose is hereby granted without fee, provided that
-  the above copyright notice appear in all copies and that both that
-  copyright notice and this permission notice appear in supporting
-  documentation.
-  
-  The above copyright notice and this permission notice shall be included in
-  all copies or substantial portions of the Software.
-  
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-  OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-  AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-  
-  Except as contained in this notice, the name of The Open Group shall not be
-  used in advertising or otherwise to promote the sale, use or other dealings
-  in this Software without prior written authorization from The Open Group.
-  
-  
-  Copyright 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
-  
-                          All Rights Reserved
-  
-  Permission to use, copy, modify, and distribute this software and its 
-  documentation for any purpose and without fee is hereby granted, 
-  provided that the above copyright notice appear in all copies and that
-  both that copyright notice and this permission notice appear in 
-  supporting documentation, and that the name of Digital not be
-  used in advertising or publicity pertaining to distribution of the
-  software without specific, written prior permission.  
-  
-  DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-  DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-  ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-  SOFTWARE.
-  
-  
-                                COPYRIGHT 1990
-                          DIGITAL EQUIPMENT CORPORATION
-                             MAYNARD, MASSACHUSETTS
-                              ALL RIGHTS RESERVED.
-  
-  THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
-  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
-  DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
-  FOR ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
-  WARRANTY.
-  
-  IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
-  RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
-  ADDITION TO THAT SET FORTH ABOVE.
-  
-  Permission to use, copy, modify, and distribute this software and its
-  documentation for any purpose and without fee is hereby granted, provided
-  that the above copyright notice appear in all copies and that both that
-  copyright notice and this permission notice appear in supporting
-  documentation, and that the name of Digital Equipment Corporation not be
-  used in advertising or publicity pertaining to distribution of the
-  software without specific, written prior permission.
-
-xkbevd:
-  Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
- 
-  Permission to use, copy, modify, and distribute this
-  software and its documentation for any purpose and without
-  fee is hereby granted, provided that the above copyright
-  notice appear in all copies and that both that copyright
-  notice and this permission notice appear in supporting
-  documentation, and that the name of Silicon Graphics not be 
-  used in advertising or publicity pertaining to distribution 
-  of the software without specific prior written permission.
-  Silicon Graphics makes no representation about the suitability 
-  of this software for any purpose. It is provided "as is"
-  without any express or implied warranty.
-  
-  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
-  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
-  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
-  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
-  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-  THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-xkbprint:
-  Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
- 
-  Permission to use, copy, modify, and distribute this
-  software and its documentation for any purpose and without
-  fee is hereby granted, provided that the above copyright
-  notice appear in all copies and that both that copyright
-  notice and this permission notice appear in supporting
-  documentation, and that the name of Silicon Graphics not be 
-  used in advertising or publicity pertaining to distribution 
-  of the software without specific prior written permission.
-  Silicon Graphics makes no representation about the suitability 
-  of this software for any purpose. It is provided "as is"
-  without any express or implied warranty.
-  
-  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
-  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
-  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
-  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
-  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-  THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-xkbutils:
-  Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
- 
-  Permission to use, copy, modify, and distribute this
-  software and its documentation for any purpose and without
-  fee is hereby granted, provided that the above copyright
-  notice appear in all copies and that both that copyright
-  notice and this permission notice appear in supporting
-  documentation, and that the name of Silicon Graphics not be 
-  used in advertising or publicity pertaining to distribution 
-  of the software without specific prior written permission.
-  Silicon Graphics makes no representation about the suitability 
-  of this software for any purpose. It is provided "as is"
-  without any express or implied warranty.
-  
-  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
-  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
-  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
-  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
-  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-  THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/debian/copyright.head b/debian/copyright.head
new file mode 100644
index 0000000..2dd1368
--- /dev/null
+++ b/debian/copyright.head
@@ -0,0 +1,3 @@
+The contents of this package were downloaded from
+http://xorg.freedesktop.org/releases/individual/app/
+It contains the setxkbmap, xkbcomp, xkbevd, xkbprint and xkbutils applications.
diff --git a/debian/rules b/debian/rules
index ffd4348..39ff7e2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,9 +41,17 @@ endif
 
 
 build: build-stamp
-build-stamp: $(BUILD_STAMPS)
+build-stamp: $(BUILD_STAMPS) debian/copyright
 	>$@
 
+debian/copyright: $(addsuffix /COPYING, $(XKB_SUBDIRS)) debian/copyright.head
+	cp debian/copyright.head debian/copyright
+	for subdir in $(XKB_SUBDIRS); do \
+		echo >> debian/copyright && \
+		echo $$subdir: >> debian/copyright && \
+		sed -e 's/^./  &/' < $$subdir/COPYING >> debian/copyright \
+	|| exit; done
+
 $(STAMP_DIR)/build-%: $(STAMP_DIR)/genscripts $(STAMP_DIR)/patch
 	dh_testdir
 
@@ -66,7 +74,7 @@ clean: xsfclean
 	rm -rf autom4te.cache */autom4te.cache
 	rm -rf *-build
 
-	dh_clean
+	dh_clean debian/copyright
 
 install: build
 	dh_testdir
-- 
1.7.2.3

