#!/bin/bash cd "$(dirname "$0")"/.. all_licenses=doc/all-licenses.txt # Header cat < debian/copyright-new Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Red Eclipse Upstream-Contact: Quinton "Quin" Reeves Lee "Eihrul" Salzman Source: https://github.com/red-eclipse/base/releases The following directories/files are removed from the upstream tarball: * data/fonts/Play* are font source files which are removed since they are shipped in the fonts-play package in Debian. * data/fonts/play* are generated font png files which are removed to simplify the build process. * bin contains various binaries and helper libs not relevant for Debian, plus auto-update scripts which are instead shipped as part of the client/server redeclipse in Debian. * src contains source code which is shipped as part of the client/server redeclipse package in Debian. * sql contains sql configurations which is shipped as part of the client/server redeclipse package in Debian. Files-Excluded: data/fonts/Play* data/fonts/play* bin src sql License: Red-Eclipse EOF # Summary license, indented sed -e 's/^/\ /' -e 's/^\ $/\ \./' doc/license.txt >> debian/copyright-new # Remove duplicated Format: line and insert upstream license dep5 file sed '/Format:.*/d' "$all_licenses" >> debian/copyright-new # Remove all records related to bin/*, config/*, doc/*, data/fonts/* and src/* # (not present in the source) awk 'BEGIN{ ORS="\n\n"; RS="" ; FS="\n"} $1 !~ /^Files: (bin|config|doc|src)\// ' debian/copyright-new > debian/copyright-temp mv debian/copyright-temp debian/copyright-new # Remove records for Play font files (deleted from source package) awk 'BEGIN{ ORS="\n\n"; RS="" ; FS="\n"} $1 !~ /^Files: data\/fonts\/[Pp]lay/' debian/copyright-new > debian/copyright-temp mv debian/copyright-temp debian/copyright-new # Add marker for inserting Debian chunk awk 'BEGIN{ ORS="\n\n"; RS="" ; FS="\n"} $1 ~ /^License: Zlib$/ { print "INSERT_DEBIAN_HERE" } { print }' debian/copyright-new > debian/copyright-temp mv debian/copyright-temp debian/copyright-new # Debian chunk ex -s debian/copyright-new < License: Zlib . w EOF echo "done -> debian/copyright-new"