Combine preamble, wxWindows license and LGPL files into a single LICENSE.txt file

This commit is contained in:
Robin Dunn
2017-06-23 13:36:23 -07:00
parent e5b4c33421
commit 1bcde3d6fd
5 changed files with 14 additions and 2 deletions

1
.gitignore vendored
View File

@@ -16,6 +16,7 @@ mydbstub.py*
/tmp
/dist
/license
/LICENSE.txt
/*.egg-info
/REV.txt
/.idea

View File

@@ -6,6 +6,7 @@
recursive-include wx **
recursive-include license *.txt
include LICENSE.txt
recursive-exclude wx .git
recursive-exclude wx *.pyc

View File

@@ -1757,6 +1757,7 @@ def cmd_sdist(options, args):
# Copy the license files from wxWidgets
updateLicenseFiles(cfg)
shutil.copytree('license', opj(PDEST, 'license'))
copyFile('LICENSE.txt', PDEST)
# Also add the waf executable, fetching it first if we don't already have it
getWafCmd()

View File

@@ -910,7 +910,15 @@ def updateLicenseFiles(cfg):
from distutils.file_util import copy_file
from distutils.dir_util import mkpath
# Copy the license files from wxWidgets
mkpath('license')
for filename in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
for filename in ['preamble.txt', 'licence.txt', 'lgpl.txt', 'gpl.txt']:
copy_file(opj(cfg.WXDIR, 'docs', filename), opj('license',filename), update=1, verbose=1)
# Combine the relevant files into a single LICENSE.txt file
text = ''
for filename in ['preamble.txt', 'licence.txt', 'lgpl.txt']:
with open(opj('license', filename), 'r') as f:
text += f.read() + '\n\n'
with open('LICENSE.txt', 'w') as f:
f.write(text)

View File

@@ -1,2 +1,3 @@
[metadata]
license-file = license/licence.txt
license-file = LICENSE.txt