Create a command for generating copyright notice for GPL licenses

This commit is contained in:
Ngô Ngọc Đức Huy 2021-02-11 21:51:19 +07:00
parent e111ecb1c2
commit e3d242df89
Signed by: huyngo
GPG Key ID: 904AF1C7CDF695C3
4 changed files with 77 additions and 0 deletions

23
gpl-notice.sh Executable file
View File

@ -0,0 +1,23 @@
name="Ngô Ngọc Đức Huy"
year=`date "+%Y"`
printf "Please input a license name: "
read license
printf "Please input the language: "
read language
printf "Please input the project name: "
read project
if [ $license = "agpl" ]
then
license="Affero General Public License"
elif [ $license = "gpl" ]
then
license="General Public License"
elif [ $license = "lgpl" ]
then
license="Lesser General Public License"
else
echo "Invalid license name."
fi
cat ~/utils/notices/notice.$language | sed "s/FULL_LICENSE_NAME/$license/" \
| sed s/YEAR/$year/ | sed "s/AUTHOR/$name/" \
| sed "s/PROJECT_NAME/$project/"

18
notices/notice.java Normal file
View File

@ -0,0 +1,18 @@
/* DESCRIPTION
* Copyright (C) YEAR AUTHOR
*
* This file is part of PROJECT_NAME.
*
* PROJECT_NAME is free software: you can redistribute it and/or modify
* it under the terms of the GNU FULL_LICENSE_NAME as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PROJECT_NAME is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU FULL_LICENSE_NAME for more details.
*
* You should have received a copy of the GNU FULL_LICENSE_NAME
* along with PROJECT_NAME. If not, see <https://www.gnu.org/licenses/>.
* */

17
notices/notice.py Normal file
View File

@ -0,0 +1,17 @@
# DESCRIPTION
# Copyright (C) YEAR AUTHOR
#
# This file is part of PROJECT_NAME.
#
# PROJECT_NAME is free software: you can redistribute it and/or modify
# it under the terms of the GNU FULL_LICENSE_NAME as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PROJECT_NAME is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU FULL_LICENSE_NAME for more details.
#
# You should have received a copy of the GNU FULL_LICENSE_NAME
# along with PROJECT_NAME. If not, see <https://www.gnu.org/licenses/>.

19
notices/notice.xml Normal file
View File

@ -0,0 +1,19 @@
<!--
~ DESCRIPTION
~ Copyright (C) YEAR AUTHOR
~
~ This file is part of PROJECT_NAME.
~
~ PROJECT_NAME is free software: you can redistribute it and/or modify
~ it under the terms of the GNU FULL_LICENSE_NAME as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ PROJECT_NAME is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU FULL_LICENSE_NAME for more details.
~
~ You should have received a copy of the GNU FULL_LICENSE_NAME
~ along with PROJECT_NAME. If not, see <https://www.gnu.org/licenses/>.
-->