Skip to content

Commit

Permalink
Merge pull request htr-tech#393 from sepp0/master-custom
Browse files Browse the repository at this point in the history
Unify build call for .deb package + Dockerfile visual improvement
  • Loading branch information
htr-tech authored Dec 31, 2021
2 parents bc4334f + 8c31d9e commit e8f8412
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM debian:latest
LABEL MAINTAINER="https://github.com/htr-tech/zphisher"

WORKDIR zphisher/
WORKDIR /zphisher/
ADD . /zphisher

RUN apt update && apt full-upgrade -y && apt install -y curl unzip wget && apt install --no-install-recommends -y php && apt clean
CMD ["./zphisher.sh"]
RUN apt update && \
apt full-upgrade -y && \
apt install -y curl unzip wget && \
apt install --no-install-recommends -y php && \
apt clean
CMD ["./zphisher.sh"]
49 changes: 23 additions & 26 deletions make-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,32 @@ ZPHISHER_VERSION=2.2
PACKAGE_ARCH=all
DISTRO=$(uname -o)

echo "Building Zphisher deb package..."

build_termux(){
mkdir -p ./package/DEBIAN
mkdir -p ./package/data/data/com.termux/files/usr/bin
mkdir -p ./package/data/data/com.termux/files/usr/opt
cp -rf ./.package/TERMUX/control ./package/DEBIAN/control
mkdir -p package/data/data/com.termux/files/usr/opt/$PACKAGE_NAME
cp -rf ./LICENSE ./.sites ./.imgs ./zphisher.sh ./package/data/data/com.termux/files/usr/opt/$PACKAGE_NAME
cp -rf ./.package/launch.sh ./package/data/data/com.termux/files/usr/bin/$PACKAGE_NAME
build_package() {
# define variables depending on detected platform
distr_name=$1
if [ "$distr_name" == "Android" ]; then
platform="Termux"
path_part="data/data/com.termux/files/"
else
platform="Debian"
path_part=""
fi
# print out message with detected platform
echo "Building .deb package for: $platform"
# run preparations and build package
platform=${platform^^}
mkdir -p ./package/DEBIAN
mkdir -p ./package/"$path_part"usr/bin
mkdir -p ./package/"$path_part"usr/opt
cp -rf ./.package/"$platform"/control ./package/DEBIAN/control
mkdir -p package/"$path_part"usr/opt/$PACKAGE_NAME
cp -rf ./LICENSE ./.sites ./.imgs ./zphisher.sh ./package/"$path_part"usr/opt/$PACKAGE_NAME
cp -rf ./.package/launch.sh ./package/"$path_part"usr/bin/$PACKAGE_NAME
chmod 755 ./package/DEBIAN
dpkg-deb --build ./package $PACKAGE_NAME\_$ZPHISHER_VERSION\_$PACKAGE_ARCH.deb

}

build_linux(){
mkdir -p ./package/DEBIAN
mkdir -p ./package/usr/bin
mkdir -p ./package/usr/opt
cp -rf ./.package/DEBIAN/control ./package/DEBIAN/control
mkdir -p package/usr/opt/$PACKAGE_NAME
cp -rf ./LICENSE ./.sites ./.imgs ./zphisher.sh ./package/usr/opt/$PACKAGE_NAME
cp -rf ./.package/launch.sh ./package/usr/bin/$PACKAGE_NAME
chmod 755 ./package/DEBIAN
dpkg-deb --build ./package $PACKAGE_NAME\_$ZPHISHER_VERSION\_$PACKAGE_ARCH.deb
}

if [ $DISTRO == Android ]; then
build_termux
else
build_linux
fi
# launch the build
build_package $DISTRO

0 comments on commit e8f8412

Please sign in to comment.