#!/bin/sh
#
#       Output a Copyright file for debian package
#

PKG_NAME="intel-i915-prerelease"
PKG_VER="1.0"
REL_NAME="1"
REL_TYPE=""
DEP_PKG_NAME=""

helpFunction()
{
	echo ""
	echo "Usage: $0 -n packagename -v packageversion -r releaseversion -p prerelease/opensource"
	echo -e "\t-n packagename"
	echo -e "\t-v packageversion"
	echo -e "\t-r releaseversion"
	echo -e "\t-p Release Type : prerelease/opensource"
	exit 1
}

while getopts "n:v:r:p:" opt
do
	case "$opt" in
		n ) PKG_NAME="$OPTARG" ;;
		v ) PKG_VER="$OPTARG" ;;
		r ) REL_NAME="$OPTARG" ;;
		p ) REL_TYPE="$OPTARG" ;;
		? ) helpFunction ;; # Print helpFunction
	esac
done

sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
	Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
	Upstream-Name: $PKG_NAME
	Source: https://git.kernel.org/cgit/linux/kernel/git/backports/backports.git

	Files: *
	Copyright: Linus Torvalds <Linus.Torvalds@cs.Helsinki.FI> and others
	License: GPL-2.0
	 This program is free software; you can redistribute it
	 and/or modify it under the terms of the GNU General Public
	 License as published by the Free Software Foundation; either
	 version 2 of the License.
	 .
	 This program 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 General Public License for more
	 details.
	 .
	 You should have received a copy of the GNU General Public
	 License along with this package; if not, write to the Free
	 Software Foundation, Inc., 51 Franklin St, Fifth Floor,
	 Boston, MA  02110-1301 USA
	 .
	 On Debian systems, the full text of the GNU General Public
	 License version 2 can be found in the file
	 '/usr/share/common-licenses/GPL-2'.

	Files: debian/*
	Copyright: 2020 Intel Corporation
	License: Apache-2.0
	 Licensed under the Apache License, Version 2.0 (the "License");
	 you may not use this file except in compliance with the License.
	 You may obtain a copy of the License at
	 .
	     http://www.apache.org/licenses/LICENSE-2.0
	 .
	 Unless required by applicable law or agreed to in writing, software
	 distributed under the License is distributed on an "AS IS" BASIS,
	 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 See the License for the specific language governing permissions and
	 limitations under the License.
EOF
