Skip to content

Commit

Permalink
license: move from debian/copyright to LICENSE.txt
Browse files Browse the repository at this point in the history
Create LICENSE.txt by calling

devtools/update-license-file.sh

which merges LICENSE.template and core/LICENSE.
core/LICENSE covers the code in core/
and stays unchanged, at it has been setup with legal help.

Before there has been a mechanism to update debian/copyright.
Now debian/copyright is just a link to LICENSE.txt,
which is formated according to
https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

Co-authored-by: Bruno Friedmann @bareos <89836284+bruno-at-bareos@users.noreply.github.com>
  • Loading branch information
2 people authored and BareosBot committed Apr 15, 2024
1 parent 548d7a9 commit 2d8403a
Show file tree
Hide file tree
Showing 11 changed files with 2,522 additions and 2,354 deletions.
File renamed without changes.
512 changes: 457 additions & 55 deletions debian/copyright.license → LICENSE.template

Large diffs are not rendered by default.

2,012 changes: 2,012 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion core/platforms/packaging/bareos.spec
Expand Up @@ -1340,7 +1340,8 @@ mkdir -p %{?buildroot}/%{_libdir}/bareos/plugins/vmware_plugin
%{_mandir}/man8/btraceback.8.gz
%attr(0770, %{daemon_user}, %{daemon_group}) %dir %{working_dir}
%attr(0775, %{daemon_user}, %{daemon_group}) %dir /var/log/%{name}
%doc core/AGPL-3.0.txt core/LICENSE core/README.* debian/copyright
%license AGPL-3.0.txt LICENSE.txt
%doc core/README.*
#TODO: cmake does not create build directory
#doc build/

Expand Down
24 changes: 0 additions & 24 deletions debian/Makefile

This file was deleted.

3 changes: 1 addition & 2 deletions debian/bareos-common.docs
@@ -1,3 +1,2 @@
core/AGPL-3.0.txt
core/LICENSE
AGPL-3.0.txt
core/README.*
2,012 changes: 0 additions & 2,012 deletions debian/copyright

This file was deleted.

1 change: 1 addition & 0 deletions debian/copyright
231 changes: 0 additions & 231 deletions debian/copyright.core_exceptions

This file was deleted.

28 changes: 0 additions & 28 deletions debian/copyright.header

This file was deleted.

47 changes: 47 additions & 0 deletions devtools/update-license-file.sh
@@ -0,0 +1,47 @@
#!/bin/bash

# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2024-2024 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
# License as published by the Free Software Foundation and included
# in the file 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
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

set -e
set -u
set -o pipefail

YEAR=$(date +"%Y")
PROJECT_SOURCE_DIR="$(dirname "$0")/.."
LICENSE_TEMPLATE="${PROJECT_SOURCE_DIR}/LICENSE.template"
LICENSE_FILE="${PROJECT_SOURCE_DIR}/LICENSE.txt"

echo "Updating file $LICENSE_FILE from template."

# replace empty lines by " .":
#sed -i -z -r -e 's/\n[[:space:]]*\n /\n .\n /g' LICENSE.template

# replace ${YEAR} by current year
# and handle @include statements

true > "${LICENSE_FILE}"
sed "s/\${YEAR}/${YEAR}/g" < "${LICENSE_TEMPLATE}" | while IFS= read -r line; do
if grep -q '^@include("' <<< "${line}"; then
include_file=$(sed -n 's/@include("\(.*\)")/\1/p' <<< "${line}")
sed -r -e 's/^[[:space:]]*$/./' -e 's/^(.*)$/ \1/' "${PROJECT_SOURCE_DIR}/${include_file}" >> "${LICENSE_FILE}"
else
echo "${line}" >> "${LICENSE_FILE}"
fi
done
3 changes: 2 additions & 1 deletion third-party/README.md
Expand Up @@ -8,7 +8,8 @@ Each Library will be put into its own subdirectory with `git subtree` and will h

A typical git subtree command would look like this : `git subtree add --prefix destination/path https://www.yourgithost.com/your/repo yourbranch(usuallymaster) --squash`

Make sure the library license is covert by `core/LICENSE`. At best, the library is also licensed as AGPL-3. If it is not already covered, a section needs to be added for it in `core/LICENSE` and `debian/copyright.footer`. Also execute `cd debian; make copyright` to update `debian/copyright`.
Make sure the library license is covert by `LICENSE.txt`. At best, the library is also licensed as AGPL-3. If it is not already covered, a section needs to be added for it in `LICENSE.template`.
Also execute `devtools/update-license-file.sh` to update `LICENSE.txt`, and commit new version.

### What to add?

Expand Down

0 comments on commit 2d8403a

Please sign in to comment.