-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·36 lines (28 loc) · 1.24 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
#!/bin/sh
NMAP_SVN="https://svn.nmap.org/nmap-releases/"
DIR=$(dirname $(realpath $0))
NMAP_VER_FOLDER=`svn ls $NMAP_SVN | tail -n 1`
NMAP_VER=${NMAP_VER_FOLDER%/}
NMAP_VER=${NMAP_VER#nmap-}
echo "-- nmap version is $NMAP_VER"
echo $NMAP_VER > $DIR/NMAP_VERSION
if [ "$1" != "--nodl" ]; then
echo "--- Preparing linuxdeploy..."
curl https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o linuxdeploy -L
chmod +x linuxdeploy
echo "--- Cloning latest version of nmap..."
svn checkout $NMAP_SVN/$NMAP_VER_FOLDER $DIR/nmap
fi
echo "--- Build nmap..."
rm -rf $DIR/AppDir
cd $DIR/nmap
./configure --with-nmap --with-ncat --with-nping --without-ndiff --without-zenmap --prefix /usr
make install -j 4 DESTDIR=$DIR/AppDir || exit
mkdir -p $DIR/AppDir/usr/share/metainfo
cp $DIR/org.nmap.metainfo.xml $DIR/AppDir/usr/share/metainfo
ln -s org.nmap.metainfo.xml $DIR/AppDir/usr/share/metainfo/org.nmap.appdata.xml
echo "--- Packaging AppImage..."
cd $DIR
export VERSION=$NMAP_VER
export UPDATE_INFORMATION="gh-releases-zsync|iTrooz|nmap-appimage|latest|nmap-*.AppImage.zsync"
./linuxdeploy --appimage-extract-and-run --appdir AppDir -d nmap.desktop -i nmap.png --custom-apprun AppRun --output appimage