Skip to content

Commit 44c5ff3

Browse files
committed
Merge branch 'develop' of https://github.com/nexB/aboutcode-toolkit.git into develop
2 parents 851db45 + 2b3151e commit 44c5ff3

File tree

5 files changed

+127
-117
lines changed

5 files changed

+127
-117
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Remove restriction of python27 only on windows #453
88
* Documentation updated
99
* Code enhancement
10+
* Add Dockerfile to run aboutcode with docker
1011

1112

1213
2020-09-01

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
5+
# See https://github.com/nexB/aboutcode-toolkit for support or download.
6+
# See https://aboutcode.org for more information about nexB OSS projects.
7+
#
8+
9+
FROM python:3.6-slim-buster
10+
11+
RUN apt-get update \
12+
&& apt-get install -y bash bzip2 xz-utils zlib1g libxml2-dev libxslt1-dev libgomp1 libpopt0\
13+
&& apt-get clean \
14+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
15+
16+
# Create directory for aboutcode sources
17+
RUN mkdir aboutcode-toolkit
18+
19+
# Copy sources into docker container
20+
COPY . aboutcode-toolkit
21+
22+
# Set workdir
23+
WORKDIR aboutcode-toolkit
24+
25+
RUN bash -c "source ./configure"
26+
27+
# Add aboutcode to path
28+
#ENV PATH=$HOME/aboutcode-toolkit:$PATH
29+
30+
# Set entrypoint to be the aboutcode command, allows to run the generated docker image directly with the aboutcode arguments:
31+
# `docker run (...) <containername> <about arguments>`
32+
# Example: docker run --rm --name "aboutcode" -v ${PWD}:/project -v /tmp/result:/result aboutcode-toolkit attrib /project /result/c.html
33+
ENTRYPOINT ["./bin/about"]

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ identify redistributable source code used in your project to help you comply
2121
with open source licenses conditions.
2222

2323
This version of the AboutCode Toolkit follows the ABOUT specification version 3.2.1 at:
24-
https://github.com/nexB/aboutcode-toolkit/blob/develop/SPECIFICATION.rst
25-
24+
https://github.com/nexB/aboutcode-toolkit/blob/develop/docs/source/specification.rst
2625

2726
Build and tests status
2827
----------------------
@@ -38,7 +37,7 @@ Build and tests status
3837

3938
REQUIREMENTS
4039
------------
41-
The AboutCode Toolkit is tested with Python 3 only on Linux, Mac and Windows.
40+
The AboutCode Toolkit is tested with Python 3.6.2 or above only on Linux, Mac and Windows.
4241
You will need to install a Python interpreter if you do not have one already
4342
installed.
4443

templates/default_html.template

Lines changed: 67 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -30,84 +30,74 @@ See "get_license_file_key" in `attrib.py` for more information
3030
</style>
3131
<title>Open Source Software Information</title>
3232
</head>
33-
3433
<body>
3534
<h1>OPEN SOURCE SOFTWARE INFORMATION</h1>
36-
<div>
37-
<p>Licenses, acknowledgments and required copyright notices for
38-
open source components:</p>
35+
<div> <p>Licenses, acknowledgments and required copyright notices for open source components:</p> </div>
36+
<div class="oss-table-of-contents">
37+
{% for about_object in abouts %}
38+
<p><a href="#component_{{ loop.index0 }}">{{ about_object.name.value }}{% if about_object.version.value %} {{ about_object.version.value }}{% endif %}</a></p>
39+
{% endfor %}
3940
</div>
40-
41-
<div class="oss-table-of-contents">
42-
{% for about_object in abouts %}
43-
<p><a href="#component_{{ loop.index0 }}">{{ about_object.name.value }}{% if about_object.version.value %} {{ about_object.version.value }}{% endif %}</a></p>
44-
{% endfor %}
45-
</div>
46-
47-
<hr/>
48-
49-
50-
{% for about_object in abouts %}
51-
<div class="oss-component" id="component_{{ loop.index0 }}">
52-
<h3 class="component-name">{{ about_object.name.value }}
53-
{% if about_object.version.value %}{{ about_object.version.value }}{% endif %}
54-
</h3>
55-
{% if about_object.license_expression.value %}
56-
<p>This component is licensed under
57-
{{ about_object.license_expression.value }}
58-
{% endif %}
59-
{% if about_object.copyright.value %}
60-
<pre>{{about_object.copyright.value}}</pre>
61-
{% endif %}
62-
{% if about_object.notice_file.value %}
63-
{% for notice in about_object.notice_file.value %}
64-
<pre class="component-notice">{{ about_object.notice_file.value[notice] }}</pre>
65-
{% endfor %}
66-
{% endif %}
67-
{% if about_object.license_key.value %}
68-
{% for license_key in about_object.license_key.value %}
69-
{% if license_key in common_licenses %}
70-
<p>Full text of
71-
<a class="{{ license_key }}" href="#component-license-{{ license_key }}">
72-
{{ license_key }}
73-
</a>
74-
is available at the end of this document.</p>
75-
{% endif %}
76-
{% endfor %}
77-
{% if about_object.license_file.value %}
78-
{% for lic_file_name in about_object.license_file.value %}
79-
{% if not license_file_key_and_license_key[license_file_name_and_license_file_key[lic_file_name]] in common_licenses %}
80-
{% if about_object.license_file.value[lic_file_name] %}
81-
<pre>{{ about_object.license_file.value[lic_file_name] | e}}</pre>
82-
{% endif %}
83-
{% endif %}
84-
{% endfor %}
85-
{% endif %}
86-
{% else %}
87-
{% if about_object.license_file.value %}
88-
{% for lic_file_name in about_object.license_file.value %}
89-
{% if about_object.license_file.value[lic_file_name] %}
90-
<pre>{{ about_object.license_file.value[lic_file_name] | e}}</pre>
91-
{% endif %}
92-
{% endfor %}
93-
{% endif %}
94-
{% endif %}
95-
</div>
96-
{% endfor %}
97-
98-
<hr/>
99-
100-
<h3>Common Licenses Used in This Product</h3>
101-
102-
{% for key in license_file_key_and_context %}
103-
{% if key in common_licenses %}
104-
<h3 id="component-license-{{ key }}">{{ key }}</h3>
105-
<pre>{{ license_file_key_and_context[key]|e }}</pre>
106-
{% endif %}
107-
{% endfor %}
108-
109-
<h3><a id="End">End</a></h3>
110-
<i>This file was generated with AboutCode Toolkit version: {{ tkversion }} on: {{ utcnow }} (UTC)</i>
111-
</body>
41+
<hr/>
42+
{% for about_object in abouts %}
43+
<div class="oss-component" id="component_{{ loop.index0 }}">
44+
<h3 class="component-name">{{ about_object.name.value }} {% if about_object.version.value %}{{ about_object.version.value }}{% endif %} </h3>
45+
{% if about_object.license_expression.value %}
46+
<p>This component is licensed under {{ about_object.license_expression.value }}</p>
47+
{% endif %}
48+
{% if about_object.copyright.value %}
49+
<pre>
50+
{{about_object.copyright.value}}
51+
</pre>
52+
{% endif %}
53+
{% if about_object.notice_file.value %}
54+
{% for notice in about_object.notice_file.value %}
55+
<pre class="component-notice">
56+
{{ about_object.notice_file.value[notice] }}
57+
</pre>
58+
{% endfor %}
59+
{% endif %}
60+
{% if about_object.license_key.value %}
61+
{% for license_key in about_object.license_key.value %}
62+
{% if license_key in common_licenses %}
63+
<p>Full text of <a class="{{ license_key }}" href="#component-license-{{ license_key }}"> {{ license_key }}</a> is available at the end of this document.</p>
64+
{% endif %}
65+
{% endfor %}
66+
{% if about_object.license_file.value %}
67+
{% for lic_file_name in about_object.license_file.value %}
68+
{% if not license_file_key_and_license_key[license_file_name_and_license_file_key[lic_file_name]] in common_licenses %}
69+
{% if about_object.license_file.value[lic_file_name] %}
70+
<pre>
71+
{{ about_object.license_file.value[lic_file_name] | e}}
72+
</pre>
73+
{% endif %}
74+
{% endif %}
75+
{% endfor %}
76+
{% endif %}
77+
{% else %}
78+
{% if about_object.license_file.value %}
79+
{% for lic_file_name in about_object.license_file.value %}
80+
{% if about_object.license_file.value[lic_file_name] %}
81+
<pre>
82+
{{ about_object.license_file.value[lic_file_name] | e}}
83+
</pre>
84+
{% endif %}
85+
{% endfor %}
86+
{% endif %}
87+
{% endif %}
88+
</div>
89+
{% endfor %}
90+
<hr/>
91+
<h3>Common Licenses Used in This Product</h3>
92+
{% for key in license_file_key_and_context %}
93+
{% if key in common_licenses %}
94+
<h3 id="component-license-{{ key }}">{{ key }}</h3>
95+
<pre>
96+
{{ license_file_key_and_context[key]|e }}
97+
</pre>
98+
{% endif %}
99+
{% endfor %}
100+
<h3><a id="End">End</a></h3>
101+
<i>This file was generated with AboutCode Toolkit version: {{ tkversion }} on: {{ utcnow }} (UTC)</i>
102+
</body>
112103
</html>
113-

tests/testdata/test_attrib/gen_default_template/expected_default_attrib.html

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,30 @@
99
</style>
1010
<title>Open Source Software Information</title>
1111
</head>
12-
1312
<body>
1413
<h1>OPEN SOURCE SOFTWARE INFORMATION</h1>
15-
<div>
16-
<p>Licenses, acknowledgments and required copyright notices for
17-
open source components:</p>
14+
<div> <p>Licenses, acknowledgments and required copyright notices for open source components:</p> </div>
15+
<div class="oss-table-of-contents">
16+
17+
<p><a href="#component_0">Apache HTTP Server 2.4.3</a></p>
18+
1819
</div>
19-
20-
<div class="oss-table-of-contents">
21-
22-
<p><a href="#component_0">Apache HTTP Server 2.4.3</a></p>
23-
24-
</div>
25-
26-
<hr/>
27-
28-
29-
30-
<div class="oss-component" id="component_0">
31-
<h3 class="component-name">Apache HTTP Server
32-
2.4.3
33-
</h3>
34-
35-
36-
37-
38-
39-
40-
</div>
41-
42-
43-
<hr/>
44-
45-
<h3>Common Licenses Used in This Product</h3>
46-
47-
48-
49-
<h3><a id="End">End</a></h3>
50-
</body>
51-
</html>
20+
<hr/>
21+
22+
<div class="oss-component" id="component_0">
23+
<h3 class="component-name">Apache HTTP Server 2.4.3 </h3>
24+
25+
26+
27+
28+
29+
30+
</div>
31+
32+
<hr/>
33+
<h3>Common Licenses Used in This Product</h3>
34+
35+
<h3><a id="End">End</a></h3>
36+
<i>This file was generated with AboutCode Toolkit version: 6.0.0 on: 2021-08-30 10:58:38.548879 (UTC)</i>
37+
</body>
38+
</html>

0 commit comments

Comments
 (0)