1
# -*- mode: makefile; coding: utf-8 -*-
2
# Copyright © 2005-2006 Jonas Smedegaard <dr@jones.dk>
3
# Description: Check for changes to copyright notices in source
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.
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.
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
20
ifndef _cdbs_bootstrap
21
_cdbs_scripts_path ?= /usr/lib/cdbs
22
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
23
_cdbs_class_path ?= /usr/share/cdbs/1/class
26
ifndef _cdbs_rules_copyright-check
27
_cdbs_rules_copyright-check := 1
29
include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
31
cdbs_copyright-check_find_opts := -not -regex '\./debian/.*'
34
@echo 'Scanning upstream source for new/changed copyright notices...'
35
@echo '(the debian/ subdir is _not_ examined - do that manually!)'
36
find . -type f $(cdbs_copyright-check_find_opts) -exec cat '{}' ';' \
37
| egrep --text -rih 'copyright.*[0-9]{4}' \
38
| sed -e 's/^[[:space:]*#]*//' -e 's/[[:space:]]*$$//' \
40
> debian/copyright_newhints
41
if [ ! -f debian/copyright_hints ]; then touch debian/copyright_hints; fi
42
@echo "diff --normal debian/copyright_hints debian/copyright_newhints | egrep '^>'"
43
@diff --normal debian/copyright_hints debian/copyright_newhints | egrep '^>'; \
44
if [ "$$?" -eq "0" ]; then \
45
echo "New or changed copyright notices discovered! Do this:"; \
46
echo " 1) Search source for each of the above lines ('grep -r' is your friend)"; \
47
echo " 2) Update debian/copyright as needed"; \
48
echo " 3) Replace debian/copyright_hints with debian/copyright_newhints"; \
52
@echo 'No new copyright notices found - assuming no news is good news...'
53
rm -f debian/copyright_newhints