-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathbuild_debian.sh
More file actions
85 lines (74 loc) · 2.68 KB
/
Copy pathbuild_debian.sh
File metadata and controls
85 lines (74 loc) · 2.68 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# Build script for Waymap Debian package
# Run this on a Debian/Kali Linux system
set -e
echo "Building Waymap Debian Package for Kali Linux"
echo "=============================================="
# Check if running on Linux
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
echo "Error: This script must be run on Linux (Kali/Debian/Ubuntu)"
echo "Current OS: $OSTYPE"
echo ""
echo "To build on Windows, use WSL:"
echo " 1. Open WSL (Kali/Ubuntu)"
echo " 2. cd /mnt/c/Users/Vicky/Downloads/Backup/waymap-main_2"
echo " 3. ./build_debian.sh"
exit 1
fi
# Install build dependencies if not already installed
echo "Checking for build dependencies..."
if ! dpkg -l | grep -q debhelper; then
echo "Installing build dependencies..."
sudo apt update
sudo apt install -y debhelper dh-python python3-all python3-setuptools python3-pkg-resources python3-sphinx
fi
# Set executable permissions
echo "Setting executable permissions..."
chmod +x debian/rules
chmod +x debian/waymap.postinst
chmod +x debian/waymap.prerm
# Remove executable permissions from config files
chmod -x debian/install debian/docs debian/manpages debian/links debian/watch 2>/dev/null || true
# Check if we're on a Windows filesystem (WSL)
if [[ "$(pwd)" == /mnt/* ]]; then
echo "Detected Windows filesystem (WSL). Copying to native Linux filesystem for build..."
ORIGINAL_DIR="$(pwd)"
BUILD_DIR="/tmp/waymap-build-$$"
mkdir -p "$BUILD_DIR"
cp -r . "$BUILD_DIR/"
cd "$BUILD_DIR"
echo "Working in: $BUILD_DIR"
fi
# Clean previous builds
echo "Cleaning previous builds..."
rm -f ../waymap_*.deb ../waymap_*.tar.xz ../waymap_*.dsc ../waymap_*.changes
rm -f ../waymap_*.orig.tar.gz
rm -rf debian/.debhelper/
# Build the package
echo "Building package..."
dpkg-buildpackage -us -uc
# Copy results back if we were on WSL
if [[ -n "$BUILD_DIR" ]]; then
echo "Copying build results back..."
# Files are in parent directory of build dir
cp ../waymap_*.deb ../waymap_*.tar.xz ../waymap_*.dsc ../waymap_*.changes "$ORIGINAL_DIR/" || echo "Warning: Some files may not have been copied"
cd "$ORIGINAL_DIR"
rm -rf "$BUILD_DIR"
echo "Cleanup complete."
echo "Package files are now in: $ORIGINAL_DIR"
fi
echo ""
echo "=============================================="
echo "Build completed successfully!"
echo ""
echo "Package files created in parent directory:"
echo " - waymap_8.2.0-1_all.deb (install with: sudo dpkg -i waymap_8.2.0-1_all.deb)"
echo " - waymap_8.2.0-1.dsc"
echo " - waymap_8.2.0-1.tar.xz"
echo ""
echo "To install the package:"
echo " sudo dpkg -i waymap_8.2.0-1_all.deb"
echo ""
echo "To test the installation:"
echo " waymap --version"
echo " waymap --help"