]> Pileus Git - ~andy/gtk/blob - makecopyright
Initial revision
[~andy/gtk] / makecopyright
1 #!/bin/sh
2
3
4 copyright_glib ()
5 {
6   cat << EOF
7 /* GLIB - Library of useful routines for C programming
8  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the Free
22  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24 EOF
25 }
26
27 copyright_gdk ()
28 {
29   cat << EOF
30 /* GDK - The GIMP Drawing Kit
31  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
32  *
33  * This library is free software; you can redistribute it and/or
34  * modify it under the terms of the GNU Library General Public
35  * License as published by the Free Software Foundation; either
36  * version 2 of the License, or (at your option) any later version.
37  *
38  * This library is distributed in the hope that it will be useful,
39  * but WITHOUT ANY WARRANTY; without even the implied warranty of
40  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
41  * Library General Public License for more details.
42  *
43  * You should have received a copy of the GNU Library General Public
44  * License along with this library; if not, write to the Free
45  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
46  */
47 EOF
48 }
49
50 copyright_gtk ()
51 {
52   cat << EOF
53 /* GTK - The GIMP Toolkit
54  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
55  *
56  * This library is free software; you can redistribute it and/or
57  * modify it under the terms of the GNU Library General Public
58  * License as published by the Free Software Foundation; either
59  * version 2 of the License, or (at your option) any later version.
60  *
61  * This library is distributed in the hope that it will be useful,
62  * but WITHOUT ANY WARRANTY; without even the implied warranty of
63  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
64  * Library General Public License for more details.
65  *
66  * You should have received a copy of the GNU Library General Public
67  * License along with this library; if not, write to the Free
68  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
69  */
70 EOF
71 }
72
73 copyright_interp ()
74 {
75   cat << EOF
76 /* GTK Interp - The GTK Interpreter
77  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
78  *
79  * This library is free software; you can redistribute it and/or
80  * modify it under the terms of the GNU Library General Public
81  * License as published by the Free Software Foundation; either
82  * version 2 of the License, or (at your option) any later version.
83  *
84  * This library is distributed in the hope that it will be useful,
85  * but WITHOUT ANY WARRANTY; without even the implied warranty of
86  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
87  * Library General Public License for more details.
88  *
89  * You should have received a copy of the GNU Library General Public
90  * License along with this library; if not, write to the Free
91  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
92  */
93 EOF
94 }
95
96
97 exclude_files="./glib/gconfig.h"
98
99 for file in `find . -name "*.[ch]" -print`; do
100   exclude=`echo $exclude_files | grep $file`
101
102   if test "x$exclude" = "x"; then
103     dir=`dirname $file`
104     if test "x$dir" != "x."; then
105       subdir=`basename $dir`
106
107       grepout=`grep Copyright $file`
108       if test "x$grepout" = "x"; then
109         backup_dir="$dir/bak"
110         if test ! -d $backup_dir; then
111           echo "making directory: $backup_dir"
112           mkdir $backup_dir
113         fi
114
115         echo $file
116
117         filename=`basename $file`
118         cp $file $backup_dir/$filename
119         copyright_$subdir > $file
120         cat $backup_dir/$filename >> $file
121       fi
122     fi
123   fi
124 done