-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgl
159 lines (152 loc) · 6.54 KB
/
gl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#! /bin/bash
LICENSE="bsd2"
DEVELOPER="Daniel Tkocz"
echo "Please report all bugs of this script to [email protected]"
echo "usage:"
echo "$0 -l <license> -d <developer>"
echo "valid licenses:"
echo "mit"
echo "gpl"
echo "lgpl"
echo "boost"
echo "bsd2"
echo "cc-zero"
echo "cc-by"
echo "cc-by-sa"
echo "cc-by-nc"
echo "cc-by-nc-sa"
echo "cc-by-nc-nd"
echo "cc-by-nd"
while getopts l:d:h opt
do
case $opt in
d) DEVELOPER=$OPTARG;;
l) LICENSE=$OPTARG;;
h) exit 0;;
esac
done
#no licence specified
if [ -z "$LICENSE" ]
then
LICENSE="bsd2"
echo "no licence specified: using $LICENSE"
fi
if [ -z "$DEVELOPER" ]
then
echo "you need to specify your name"
exit 1
fi
if [ "$LICENSE" != "mit" ] && [ "$LICENSE" != "gpl" ] && [ "$LICENSE" != "lgpl" ] && [ "$LICENSE" != "boost" ] && [ "$LICENSE" != "cc-by" ] && [ "$LICENSE" != "cc-by-sa" ] && [ "$LICENSE" != "cc-by-nc" ] && [ "$LICENSE" != "cc-by-nc-sa" ] && [ "$LICENSE" != "cc-by-nd" ] && [ "$LICENSE" != "cc-by-nc-nd" ] && [ "$LICENSE" != "bsd2" ] && [ "$LICENSE" != "cc-zero" ]
then
echo "specified license not supported"
exit 1
fi
if [ -e "COPYRIGHT.txt" ]
then
echo "COPYRIGHT already exists"
else
if [ "$LICENSE" = "mit" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under the MIT License. To view this license, open LICENSE.txt." >> COPYRIGHT.txt
echo "The MIT License (MIT)" > LICENSE.txt
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" >> LICENSE.txt
cat /etc/gp/licenses/mit.txt >> LICENSE.txt
cp /etc/gp/images/opensource.png OPENSOURCE.png
cp /etc/gp/images/opensourcelicense.png OPENSOURCELICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "boost" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under the Boost Software License. To view a copy of this license, visit http://www.boost.org/LICENSE_1_0.txt or open LICENSE.txt." >> COPYRIGHT.txt
cat /etc/gp/licenses/boost.txt > LICENSE.txt
cp /etc/gp/images/opensource.png OPENSOURCE.png
cp /etc/gp/images/opensourcelicense.png OPENSOURCELICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "bsd2" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under the BSD 2-Clause License. To view this license, open LICENSE.txt." >> COPYRIGHT.txt
echo "Copyright (c) $(date +%Y), ${DEVELOPER}" > LICENSE.txt
echo "All rights reserved." >> LICENSE.txt
echo "" >> LICENSE.txt
cat /etc/gp/licenses/bsd2.txt >> LICENSE.txt
cp /etc/gp/images/opensource.png OPENSOURCE.png
cp /etc/gp/images/opensourcelicense.png OPENSOURCELICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "cc-zero" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under a Creative Commons Zero 1.0 Universal License. To view a copy of this license, visit http://creativecommons.org/publicdomain/zero/1.0/." >> COPYRIGHT.txt
cp /etc/gp/images/cc-zero.png LICENSE.png
cp /etc/gp/images/freeculturallicense.png FREECULTURALLICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "cc-by" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/." >> COPYRIGHT.txt
cp /etc/gp/images/cc-by.png LICENSE.png
cp /etc/gp/images/freeculturallicense.png FREECULTURALLICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "cc-by-sa" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/." >> COPYRIGHT.txt
cp /etc/gp/images/cc-by-sa.png LICENSE.png
cp /etc/gp/images/freeculturallicense.png FREECULTURALLICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "cc-by-nc" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/." >> COPYRIGHT.txt
cp /etc/gp/images/cc-by-nc.png LICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "cc-by-nc-sa" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/." >> COPYRIGHT.txt
cp /etc/gp/images/cc-by-nc-sa.png LICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "cc-by-nc-nd" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/." >> COPYRIGHT.txt
cp /etc/gp/images/cc-by-nc-nd.png LICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "cc-by-nd" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under a Creative Commons Attribution-NoDerivs 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/3.0/." >> COPYRIGHT.txt
cp /etc/gp/images/cc-by-nd.png LICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "gpl" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under the GNU GENERAL PUBLIC LICENSE. To view a copy of this license, visit http://www.gnu.org/licenses/gpl-3.0-standalone.html or open LICENSE.txt." >> COPYRIGHT.txt
cat /etc/gp/licenses/gpl3.txt > LICENSE.txt
cp /etc/gp/images/gpl3.png LICENSE.png
cp /etc/gp/images/opensource.png OPENSOURCE.png
cp /etc/gp/images/opensourcelicense.png OPENSOURCELICENSE.png
echo "created COPYRIGHT.txt"
fi
if [ "$LICENSE" = "lgpl" ]
then
echo "Copyright (c) $(date +%Y) ${DEVELOPER}" > COPYRIGHT.txt
echo "This work is licensed under the GNU LESSER GENERAL PUBLIC LICENSE. To view a copy of this license, visit http://www.gnu.org/licenses/lgpl-3.0-standalone.html or open LICENSE.txt." >> COPYRIGHT.txt
cat /etc/gp/licenses/lgpl3.txt > LICENSE.txt
cp /etc/gp/images/lgpl3.png LICENSE.png
cp /etc/gp/images/opensource.png OPENSOURCE.png
cp /etc/gp/images/opensourcelicense.png OPENSOURCELICENSE.png
echo "created COPYRIGHT.txt"
fi
fi