~ubuntu-branches/ubuntu/jaunty/ezstream/jaunty

« back to all changes in this revision

Viewing changes to debian/cdbs/1/rules/copyright-check.mk

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis, Jonas Smedegaard, Romain Beauxis
  • Date: 2008-01-08 22:18:25 UTC
  • Revision ID: james.westby@ubuntu.com-20080108221825-l7h7n3hvr0scaixk
Tags: 0.5.3~dfsg-1
[ Jonas Smedegaard ]
* Add local CDBS tweaks:
  + Add copyright-check-mk to help maintaining debian/copyright file
  + Add buildinfo.mk to aid debugging packaging-specific problems.
* Rewrite debian/copyright to conform to proposed new format at
  http://wiki.debian.org/Proposals/CopyrightFormat .
* Fix name of upstream author () in debian/copyright.
* Include GPL-2 in references to Debian-shared files in
  debian/copyright.
* Improve debian/watch file:
  + Add comment hinting about using uscan
  + Use svn-update (not uupdate)
  + Better indentation

[ Romain Beauxis ]
* Repacked orig tarball to remove file with non-free license.
* Updated standards to 3.7.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode: makefile; coding: utf-8 -*-
 
2
# Copyright © 2005-2007 Jonas Smedegaard <dr@jones.dk>
 
3
# Description: Check for changes to copyright notices in source
 
4
#
 
5
# This program is free software; you can redistribute it and/or
 
6
# modify it under the terms of the GNU General Public License as
 
7
# published by the Free Software Foundation; either version 2, or (at
 
8
# your option) any later version.
 
9
#
 
10
# This program is distributed in the hope that it will be useful, but
 
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
# General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License
 
16
# along with this program; if not, write to the Free Software
 
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
18
# 02111-1307 USA.
 
19
 
 
20
# TODO: Save scan as "file: match" (needs rewrite of main loop in perl)
 
21
 
 
22
# TODO: Save scan as "file (license): match" (needs /usr/bin/licensecheck from kdesdk-scripts)
 
23
 
 
24
_cdbs_scripts_path ?= /usr/lib/cdbs
 
25
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
 
26
_cdbs_class_path ?= /usr/share/cdbs/1/class
 
27
 
 
28
ifndef _cdbs_rules_copyright-check
 
29
_cdbs_rules_copyright-check := 1
 
30
 
 
31
include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
 
32
 
 
33
cdbs_copyright-check_find_opts := -not -regex 'debian/.*' -not -regex '\(.*/\)?config\.\(guess\|sub\|log\|rpath\)\(\..*\)?'
 
34
cdbs_copyright-check_egrep_opts := --text -rih '(copyright|\(c\) ).*[0-9]{4}'
 
35
 
 
36
pre-build:: debian/stamp-copyright-check
 
37
 
 
38
debian/stamp-copyright-check:
 
39
        @echo 'Scanning upstream source for new/changed copyright notices (except debian subdir!)...'
 
40
        find * -type f $(cdbs_copyright-check_find_opts) -exec cat '{}' ';' \
 
41
                | tr '\r' '\n' \
 
42
                | LC_ALL=C sed -e 's/[^[:print:]]//g' \
 
43
                | egrep $(cdbs_copyright-check_egrep_opts) \
 
44
                | sed -e 's/^[[:space:]*#]*//' -e 's/[[:space:]]*$$//' \
 
45
                | LC_ALL=C sort -u \
 
46
                > debian/copyright_newhints
 
47
        @if [ ! -f debian/copyright_hints ]; then touch debian/copyright_hints; fi
 
48
        @newstrings=`diff -u debian/copyright_hints debian/copyright_newhints | sed '1,2d' | egrep '^\+' | sed 's/^\+//'`; \
 
49
                if [ -n "$$newstrings" ]; then \
 
50
                        echo "Error: The following new or changed copyright notices discovered:"; \
 
51
                        echo "$$newstrings"; \
 
52
                        echo "Trying to locate the files containing the new/changed copyright notices..."; \
 
53
                        echo "(Strings part of binary data you need to resolve yourself)"; \
 
54
                        find * -type f $(cdbs_copyright-check_find_opts) -exec grep -F -l -e "$$newstrings" '{}' ';'; \
 
55
                        echo; \
 
56
                        echo "To fix the situation please do the following:"; \
 
57
                        echo "  1) Investigate the above changes and update debian/copyright as needed"; \
 
58
                        echo "  2) Replace debian/copyright_hints with debian/copyright_newhints"; \
 
59
                        exit 1; \
 
60
                fi
 
61
        
 
62
        @echo 'No new copyright notices found - assuming no news is good news...'
 
63
        rm -f debian/copyright_newhints
 
64
        touch $@
 
65
 
 
66
clean::
 
67
        rm -f debian/stamp-copyright-check
 
68
 
 
69
endif