-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·52 lines (39 loc) · 1.01 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
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)" # get current script dir portibly
## check we are sudo
if [[ "${EUID}" -ne 0 ]]; then
echo "Please run as root (or sudo)."
exit 1
fi
## ensure version is set
if [ -z "${IN_VERSION}" ]; then
echo -ne "Please export or set IN_VERSION variable\n"
exit 1
fi
export IN_VERSION="${IN_VERSION}"
## install deps
apt update 2>/dev/null
apt install build-essential file checkinstall wget -y 2>/dev/null
## run make
cd "${SCRIPT_DIR}"
make
## run makeinstall
checkinstall --install=no \
--pkgname=libnet-sftp-foreign-perl \
--pkgversion="5.99+really"${IN_VERSION} \
--pkgrelease=1 \
--pkgarch="all" \
--pkglicense="Perl5" \
--pkgaltsource="https://metacpan.org/pod/Net::SFTP::Foreign" \
--maintainer="[email protected]" \
--requires="openssh-client,perl" \
--strip=no \
--stripso=no \
-d2 \
make install
## tidyup
make clean
git checkout -- .
mkdir -pv ./dist
mv -v ./*.deb ./dist
mv -v ./checkinstall-debug.*.tgz ./dist