Update nginx-compile.sh

This commit is contained in:
Bozhidar Slaveykov 2023-11-25 14:10:42 +02:00
parent 5d053f36df
commit d40b57d351

View file

@ -3,7 +3,8 @@
MAIN_DIR=$(pwd) MAIN_DIR=$(pwd)
# Install dependencies # Install dependencies
apt install build-essential dpkg-dev debhelper autotools-dev libgeoip-dev libssl-dev libpcre3-dev zlib1g-dev sudo apt-get update -y
sudo apt-get install build-essential dpkg-dev debhelper autotools-dev libgeoip-dev libssl-dev libpcre3-dev zlib1g-dev -y
#Download nginx source #Download nginx source
wget http://nginx.org/download/nginx-1.20.0.tar.gz wget http://nginx.org/download/nginx-1.20.0.tar.gz
@ -18,10 +19,12 @@ sudo make install
sudo mkdir $MAIN_DIR/alphax-nginx-1.20.0 sudo mkdir $MAIN_DIR/alphax-nginx-1.20.0
PACKAGE_MAIN_DIR=$MAIN_DIR/alphax-nginx-1.20.0 PACKAGE_MAIN_DIR=$MAIN_DIR/alphax-nginx-1.20.0
# Create debian package directories
sudo mkdir -p $PACKAGE_MAIN_DIR/DEBIAN sudo mkdir -p $PACKAGE_MAIN_DIR/DEBIAN
sudo mkdir -p $PACKAGE_MAIN_DIR/usr/local/alphax sudo mkdir -p $PACKAGE_MAIN_DIR/usr/local/alphax
sudo mkdir -p $PACKAGE_MAIN_DIR/etc/init.d sudo mkdir -p $PACKAGE_MAIN_DIR/etc/init.d
# Copy nginx compiled files
sudo mv /usr/local/alphax/nginx $PACKAGE_MAIN_DIR/usr/local/alphax sudo mv /usr/local/alphax/nginx $PACKAGE_MAIN_DIR/usr/local/alphax
# Rename nginx to alpha-nginx # Rename nginx to alpha-nginx
@ -34,12 +37,11 @@ sudo cp $MAIN_DIR/control $PACKAGE_MAIN_DIR/DEBIAN
sudo cp $MAIN_DIR/alphax $PACKAGE_MAIN_DIR/etc/init.d/alphax sudo cp $MAIN_DIR/alphax $PACKAGE_MAIN_DIR/etc/init.d/alphax
sudo chmod +x $PACKAGE_MAIN_DIR/etc/init.d/alphax sudo chmod +x $PACKAGE_MAIN_DIR/etc/init.d/alphax
# Make debian package
sudo dpkg-deb --build $PACKAGE_MAIN_DIR sudo dpkg-deb --build $PACKAGE_MAIN_DIR
sudo dpkg --info $PACKAGE_MAIN_DIR/alphax-nginx-1.20.0.deb sudo dpkg --info $MAIN_DIR/alphax-nginx-1.20.0.deb
sudo dpkg --contents $PACKAGE_MAIN_DIR/alphax-nginx-1.20.0.deb sudo dpkg --contents $MAIN_DIR/alphax-nginx-1.20.0.deb
# Move debian package to dist folder
sudo mkdir -p $MAIN_DIR/dist
sudo mv $MAIN_DIR/alphax-nginx-1.20.0.deb $MAIN_DIR/dist sudo mv $MAIN_DIR/alphax-nginx-1.20.0.deb $MAIN_DIR/dist
cd $MAIN_DIR
ls