-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_python_deb.sh
More file actions
executable file
·55 lines (43 loc) · 1.59 KB
/
build_python_deb.sh
File metadata and controls
executable file
·55 lines (43 loc) · 1.59 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
#!/bin/bash
# By Pytel
# This script builds deb package for Python 3.11 for the Nokia N900
source .config
PYTHON_DEB_FOLDER="python_${PYTHON_VERSION}_armhf"
BIN_FOLDER="$PYTHON_DEB_FOLDER/usr/bin"
BIN_FILE="python3.11"
DEB_FILE="python_${PYTHON_VERSION}_armhf.deb"
if [ ! -d "$PYTHON_DEB_FOLDER/DEBIAN" ]; then
mkdir -p "$PYTHON_DEB_FOLDER/DEBIAN"
echo -e "${Yellow}Created directory $PYTHON_DEB_FOLDER/DEBIAN${NC}"
fi
if [ ! -d "$BIN_FOLDER" ]; then
mkdir -p "$BIN_FOLDER"
echo -e "${Yellow}Created directory $BIN_FOLDER${NC}"
fi
if [ ! -f "$PYTHON_DEB_FOLDER/DEBIAN/control" ]; then
echo -e "${Red}Error: control file not found in $PYTHON_DEB_FOLDER/DEBIAN!${NC}"
exit 1
fi
if [ ! -f "$BIN_FOLDER/$BIN_FILE" ]; then
echo -e "${Red}Error: $BIN_FILE not found in $BIN_FOLDER!${NC}"
echo -e "${Cyan}Please run compile_python.sh first to build Python 3.11!${NC}"
echo -e "And move all the compiled bin files: $BIN_FILE to $BIN_FOLDER"
exit 1
fi
echo -e "${Cyan}Setting permissions for package files...${NC}"
chmod 755 "$BIN_FOLDER/$BIN_FILE"
chmod 644 "$PYTHON_DEB_FOLDER/DEBIAN"/*
echo -e "${Cyan}Building Debian package for Python ${PYTHON_VERSION}...${NC}"
dpkg-deb --build $PYTHON_DEB_FOLDER
if [ $? -ne 0 ]; then
echo -e "${Red}Error building Debian package!${NC}"
exit 1
fi
echo -e "${Green}Debian package built successfully!${NC}"
echo -e "${Cyan}Debian package location: $DEB_FILE${NC}"
echo -e "${Cyan}Package information:${NC}"
dpkg-deb --info $DEB_FILE
echo -e "${Cyan}Package contents:${NC}"
dpkg-deb --contents $DEB_FILE
echo -e "${Green}Done!${NC}"
# END