-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·95 lines (81 loc) · 1.8 KB
/
package.sh
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
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
# Created by: WestleyR
# Email: [email protected]
# Url: https://github.com/WestleyR/list-files
# Last modified date: 2020-08-16
#
# This file is licensed under the terms of
#
# The Clear BSD License
#
# Copyright (c) 2019-2020 WestleyR
# All rights reserved.
#
# This software is licensed under a Clear BSD License.
#
#
# This script will make a gpack compatible tarball package.
#
# Usage:
# $ ./package.sh
#
#
# The tarball package should be like this:
# list-files/
# └── 1.6.0 (the package version)
# └── bin/
# └── lf (the binary)
#
set -e
echo " 1. x86_64_linux"
echo " 2. macos"
echo " 3. armv6l"
echo " 4. armv7l"
echo -n "Select your arch: "
if [ -z "$1" ]; then
read user_in
else
user_in="$1"
fi
case $user_in in
1)
package_arch="x86_64_linux"
;;
2)
package_arch="macos"
;;
3)
package_arch="armv6l"
;;
4)
package_arch="armv6l"
;;
*)
echo "Invalid option: $user_in"
exit 1
esac
echo "Package arch: $package_arch"
make cleanall
make
package_version=`./lf -V | cut -dv -f2 | rev | cut -d, -f3 | rev`
mkdir -p ./pkg/list-files/${package_version}/bin
cp -f ./lf ./pkg/list-files/${package_version}/bin
cd ./pkg
tar -czf ./lf-v${package_version}-${package_arch}.tar.gz ./list-files
echo ""
echo "Tarball v${package_version} is ready: ./pkg/lf-v${package_version}-${package_arch}.tar.gz"
echo ""
echo "Checksums:"
if type sha256sum > /dev/null; then
echo -n "sha256: "
sha256sum lf-v${package_version}-${package_arch}.tar.gz
fi
if type ssum > /dev/null ; then
echo -n "ssum20: "
ssum lf-v${package_version}-${package_arch}.tar.gz
fi
if type md5sum > /dev/null ; then
echo -n "md5sum: "
md5sum lf-v${package_version}-${package_arch}.tar.gz
fi
# vim: tabstop=2 shiftwidth=2 expandtab autoindent softtabstop=0