Commit 1eae155d authored by nextime's avatar nextime

Fix --server-only option to build wsssh-server Debian package

- Modified --server-only to automatically enable Debian package building
- Updated build logic to build wsssh-server package when --server-only is used
- Fixed output messages to show wsssh-server package in server-only builds
- Updated help text to clarify that --server-only builds the Debian package
- Improved build.sh help formatting and usage examples
parent 6730a4d3
...@@ -37,6 +37,7 @@ while [[ $# -gt 0 ]]; do ...@@ -37,6 +37,7 @@ while [[ $# -gt 0 ]]; do
;; ;;
--server-only) --server-only)
BUILD_SERVER_ONLY=true BUILD_SERVER_ONLY=true
BUILD_DEBIAN=true
shift shift
;; ;;
--no-server) --no-server)
...@@ -52,7 +53,7 @@ while [[ $# -gt 0 ]]; do ...@@ -52,7 +53,7 @@ while [[ $# -gt 0 ]]; do
echo "Options:" echo "Options:"
echo " --debian Build Debian packages (wsssh-server and wsssh-tools)" echo " --debian Build Debian packages (wsssh-server and wsssh-tools)"
echo " --debian-only Build only Debian packages (skip binaries)" echo " --debian-only Build only Debian packages (skip binaries)"
echo " --server-only Build only the server (wssshd) and wsssh-server package" echo " --server-only Build only the server (wssshd) and wsssh-server Debian package"
echo " --no-server Skip building the server (wssshd) and wsssh-server package" echo " --no-server Skip building the server (wssshd) and wsssh-server package"
echo " --wssshtools-only Build only the C tools (wssshtools) and wsssh-tools package" echo " --wssshtools-only Build only the C tools (wssshtools) and wsssh-tools package"
echo " --help, -h Show this help" echo " --help, -h Show this help"
...@@ -60,7 +61,7 @@ while [[ $# -gt 0 ]]; do ...@@ -60,7 +61,7 @@ while [[ $# -gt 0 ]]; do
;; ;;
*) *)
echo "Unknown option: $1" echo "Unknown option: $1"
echo "Usage: $0 [--debian] [--debian-only] [--server-only] [--no-server] [--wssshtools-only]" echo "Usage: $0 [--debian] [--debian-only] [--server-only] [--no-server] [--wssshtools-only] [--help]"
echo "Try '$0 --help' for more information." echo "Try '$0 --help' for more information."
exit 1 exit 1
;; ;;
...@@ -189,8 +190,8 @@ if [ "$BUILD_DEBIAN" = true ]; then ...@@ -189,8 +190,8 @@ if [ "$BUILD_DEBIAN" = true ]; then
echo "All Debian build dependencies found." echo "All Debian build dependencies found."
echo "Building Debian packages..." echo "Building Debian packages..."
# Build wsssh-server package if it exists and not wssshtools-only # Build wsssh-server package if it exists and (not wssshtools-only OR server-only)
if [ "$BUILD_WSSSHTOOLS_ONLY" = false ] && [ -d "wsssh-server" ] && [ -d "wsssh-server/debian" ]; then if ([ "$BUILD_WSSSHTOOLS_ONLY" = false ] || [ "$BUILD_SERVER_ONLY" = true ]) && [ -d "wsssh-server" ] && [ -d "wsssh-server/debian" ]; then
echo "Building wsssh-server Debian package..." echo "Building wsssh-server Debian package..."
cd wsssh-server cd wsssh-server
dpkg-buildpackage -us -uc dpkg-buildpackage -us -uc
...@@ -248,7 +249,7 @@ elif [ "$BUILD_SERVER_ONLY" = true ]; then ...@@ -248,7 +249,7 @@ elif [ "$BUILD_SERVER_ONLY" = true ]; then
echo "Server binary available in dist/ directory:" echo "Server binary available in dist/ directory:"
echo "- dist/wssshd (server with web interface)" echo "- dist/wssshd (server with web interface)"
fi fi
if [ "$BUILD_DEBIAN" = true ] && ls dist/wsssh-server*.deb >/dev/null 2>&1; then if ls dist/wsssh-server*.deb >/dev/null 2>&1; then
echo "- dist/wsssh-server*.deb (wssshd server Debian package)" echo "- dist/wsssh-server*.deb (wssshd server Debian package)"
fi fi
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment