-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Now you can easily build a .deb file for Debian installations. - Bug fixes & performance improvements. Signed-off-by: Boudjada Yasser <by.root96@gmail.com>
- Loading branch information
1 parent
dd8abab
commit a514d3f
Showing
8 changed files
with
110 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/sh | ||
|
||
appname="hiphp" # Replace with your app name | ||
file_path="version.txt" | ||
version=$(head -n 1 "$file_path") | ||
|
||
script_path=$(dirname "$(readlink -f "$0")") | ||
|
||
#version="2.0" # Replace with your app version | ||
|
||
# Create a temporary directory to build the .deb package | ||
tmp_dir="$(mktemp -d)" | ||
deb_dir="$tmp_dir/$appname-$version" | ||
mkdir -p "$deb_dir/DEBIAN" | ||
mkdir -p "$deb_dir/usr/share/$appname" | ||
mkdir -p "$deb_dir/usr/share/applications" | ||
mkdir -p "$deb_dir/usr/local/bin" | ||
mkdir -p "$deb_dir/usr/share/hiphp/hiphp/" | ||
mkdir -p "$deb_dir/usr/share/hiphp/hiphp-desktop/" | ||
mkdir -p "$deb_dir/usr/share/hiphp/hiphp-tk/" | ||
mkdir -p "$deb_dir/usr/share/hiphp/hiphp-linux/" | ||
mkdir -p "$deb_dir/usr/share/hiphp/install/" | ||
|
||
# Copy necessary files and folders to the .deb package directory | ||
cp -r ./hiphp/* "$deb_dir/usr/share/hiphp/hiphp/" | ||
cp -r ./hiphp-desktop/* "$deb_dir/usr/share/hiphp/hiphp-desktop/" | ||
cp -r ./hiphp-tk/* "$deb_dir/usr/share/hiphp/hiphp-tk/" | ||
cp ./hiphp-linux/requirements-linux.txt "$deb_dir/usr/share/hiphp/hiphp-linux/" | ||
cp ./main.py "$deb_dir/usr/share/hiphp/main.py" | ||
cp -r ./install/* "$deb_dir/usr/share/hiphp/install/" | ||
cp ./requirements.txt "$deb_dir/usr/share/hiphp/requirements.txt" | ||
|
||
# Generate the control file for the .deb package | ||
control_file="$deb_dir/DEBIAN/control" | ||
echo "Package: $appname" > "$control_file" | ||
echo "Version: $version" >> "$control_file" | ||
echo "Architecture: all" >> "$control_file" | ||
echo "Maintainer: Your Name <your@email.com>" >> "$control_file" | ||
echo "Description: Your application description" >> "$control_file" | ||
|
||
# Add post-installation script to install dependencies and perform additional operations | ||
postinst_file="$deb_dir/DEBIAN/postinst" | ||
echo "#!/bin/sh" > "$postinst_file" | ||
echo "set -e" >> "$postinst_file" | ||
echo "" >> "$postinst_file" | ||
echo "mkdir -p /usr/share/$appname" >> "$postinst_file" | ||
echo "# Perform additional operations" >> "$postinst_file" | ||
echo "cp /usr/share/$appname/install/hiphp.desktop /usr/share/applications/$appname.desktop" >> "$postinst_file" | ||
echo "cp /usr/share/$appname/install/hiphp.sh /usr/local/bin/$appname" >> "$postinst_file" | ||
echo "cp /usr/share/$appname/main.py /usr/share/$appname/hiphp.py" >> "$postinst_file" | ||
echo "cp /usr/share/$appname/install/$appname.png /usr/share/$appname/$appname.png" >> "$postinst_file" | ||
echo "" >> "$postinst_file" | ||
echo "# Install dependencies" >> "$postinst_file" | ||
echo "pip install -r /usr/share/$appname/requirements.txt" >> "$postinst_file" | ||
echo "pip install -r /usr/share/$appname/hiphp-linux/requirements-linux.txt" >> "$postinst_file" | ||
echo "" >> "$postinst_file" | ||
echo "exit 0" >> "$postinst_file" | ||
|
||
# Make post-installation script executable | ||
chmod +x "$postinst_file" | ||
|
||
# Build the .deb package | ||
cd "$tmp_dir" | ||
deb_file="$appname-$version.deb" | ||
dpkg-deb --build "$appname-$version" | ||
|
||
cp "$appname-$version.deb" "$script_path" | ||
|
||
# Clean up temporary files and directories | ||
rm -rf "$tmp_dir" | ||
|
||
echo "The .deb package has been created: $deb_file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,5 @@ | |
# | | # | ||
|
||
#START{ | ||
__version__="0.3.3" | ||
__version__="0.3.4" | ||
#}END. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.3.3 | ||
0.3.4 |