-
-
Notifications
You must be signed in to change notification settings - Fork 754
Expand file tree
/
Copy pathscancode-create-release-app-linux.sh
More file actions
executable file
·85 lines (70 loc) · 2.38 KB
/
Copy pathscancode-create-release-app-linux.sh
File metadata and controls
executable file
·85 lines (70 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
################################################################################
# ScanCode release build script for a Linux app archive
################################################################################
set -e
# Un-comment to trace execution
#set -x
operating_system=linux
python_dot_version=$1
python_version=${python_dot_version//.}
python_exe="python$python_dot_version"
release_dir=scancode-toolkit-$(git describe --tags)
rm -rf $release_dir
mkdir -p $release_dir
echo -n "$python_exe" > $release_dir/PYTHON_EXECUTABLE
git describe --tags > $release_dir/SCANCODE_VERSION
thirdparty_dir=$release_dir/thirdparty
thirdparty_src_dir=$release_dir/thirdparty-src
mkdir -p $thirdparty_dir
mkdir -p $thirdparty_src_dir
./configure --dev
venv/bin/python etc/scripts/fetch_thirdparty.py \
--requirements requirements-native.txt \
--requirements requirements-linux.txt \
--wheel-only packagedcode-msitools \
--wheel-only rpm-inspector-rpm \
--wheel-only extractcode-7z \
--wheel-only extractcode-libarchive \
--wheel-only typecode-libmagic \
--dest $thirdparty_src_dir \
--sdists \
--use-cached-index
venv/bin/python etc/scripts/fetch_thirdparty.py \
--requirements requirements-linux.txt \
--requirements requirements.txt \
--dest $thirdparty_dir \
--operating-system=$operating_system \
--python-version=$python_version \
--wheels \
--use-cached-index
mv $thirdparty_src_dir/* $thirdparty_dir/
rm -rf $thirdparty_src_dir
mkdir -p $release_dir/etc
cp -r etc/thirdparty $release_dir/etc
# Build the wheel
./configure --dev
venv/bin/scancode-reindex-licenses
venv/bin/scancode-reindex-package-patterns
venv/bin/scancode-train-gibberish-model
venv/bin/python setup.py --quiet bdist_wheel --python-tag cp$python_version
cp -r \
dist/scancode_*.whl \
scancode extractcode configure \
*.rst \
samples \
*NOTICE *LICENSE *ABOUT \
$release_dir
tarball=scancode-toolkit-$(git describe --tags)_py$python_dot_version-$operating_system.tar.gz
mkdir -p release
tar -cvzf release/$tarball $release_dir
set +e
set +x