-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·56 lines (48 loc) · 1.4 KB
/
build.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
#!/bin/sh
# get distro information
. /etc/os-release
FGET_VERSION="1.1.1-0"
# install build dependencies
if [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; then
apt update
apt install cmake g++ wget libssl-dev zip git libc6 -y
elif [ "$ID" = "arch" ] || [ "$ID_LIKE" = "arch" ]; then
pacman -Sy cmake gcc wget openssl unzip glibc make --noconfirm
fi
# Fetch cryptopp and cmake files
mkdir cryptopp && cd cryptopp || exit
wget https://cryptopp.com/cryptopp840.zip
unzip cryptopp840.zip
wget https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_4_0.zip
unzip -j CRYPTOPP_8_4_0.zip
# Build cryptopp
mkdir cmake-build && cd cmake-build || exit
cmake ..
make cryptopp-static
make install
# Build fget
cd ../..
cmake .
make
# Ubuntu / Debian systems
# Build .deb
if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
mkdir -p fget_$FGET_VERSION/usr/local/bin
cp fget fget_$FGET_VERSION/usr/local/bin
mkdir fget_$FGET_VERSION/DEBIAN
echo "
Package: fget
Version: $FGET_VERSION
Architecture: all
Section: base
Priority: optional
Depends: libc6 (>= $(dpkg-query --showformat='${Version}' --show libc6)), libssl1.1 (>= 1.1)
Maintainer: bain <[email protected]>
Description: fget is a utility for downloading from f.bain-like websites"\
> fget_$FGET_VERSION/DEBIAN/control
dpkg --build fget_$FGET_VERSION
fi
# create output dir and move finished binaries into it
mkdir bin
mv fget bin
mv fget_$FGET_VERSION.deb bin