dominic a révisé ce gist 1 week ago. Aller à la révision
Aucun changement
dominic a révisé ce gist 1 week ago. Aller à la révision
3 files changed, 202 insertions
README.md(fichier créé)
| @@ -0,0 +1,45 @@ | |||
| 1 | + | # Zen Browser Debian | |
| 2 | + | This repository contains unofficial deb packages of the [zen browser](https://zen-browser.app/). As well as | |
| 3 | + | instructions on how to build the deb packages from the official tarballs. | |
| 4 | + | ||
| 5 | + | It is basically an attempt to reverse engineer the provided install script | |
| 6 | + | for the zen browser, found at the link below, for the purpose of creating deb packages. | |
| 7 | + | [https://updates.zen-browser.app/install.sh](https://updates.zen-browser.app/install.sh) | |
| 8 | + | ||
| 9 | + | ## Steps to recreate | |
| 10 | + | 1. Clone this repository and enter the folder | |
| 11 | + | ```bash | |
| 12 | + | git clone https://github.com/sh4r10/zen-browser-debian.git && cd zen-browser-debian | |
| 13 | + | ``` | |
| 14 | + | ||
| 15 | + | 2. Get the latest official tarball for the zen-browser from [here](https://github.com/zen-browser/desktop/releases). | |
| 16 | + | ```bash | |
| 17 | + | wget https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-x86_64.tar.xz | |
| 18 | + | ``` | |
| 19 | + | ||
| 20 | + | 3. Look through the variables at the top of the create-zen-deb.sh script, you | |
| 21 | + | should only really need to change the version and possibly the tarball name | |
| 22 | + | ```bash | |
| 23 | + | PACKAGE_NAME="zen-browser" | |
| 24 | + | VERSION="1.11.2b" | |
| 25 | + | ARCH="amd64" | |
| 26 | + | TARBALL="zen.linux-x86_64.tar.xz" | |
| 27 | + | BUILD_DIR="${PACKAGE_NAME}_${VERSION}" | |
| 28 | + | INSTALL_DIR="$BUILD_DIR/opt/zen" | |
| 29 | + | BIN_DIR="$BUILD_DIR/usr/local/bin" | |
| 30 | + | DESKTOP_DIR="$BUILD_DIR/usr/local/share/applications" | |
| 31 | + | ``` | |
| 32 | + | ||
| 33 | + | 4. Run the script | |
| 34 | + | ```bash | |
| 35 | + | ./create-zen-deb.sh | |
| 36 | + | ``` | |
| 37 | + | If everything goes to plan, you should now have .deb file in your folder. This | |
| 38 | + | can then be installed with dpkg or uploaded to an apt repo. | |
| 39 | + | ||
| 40 | + | ``` | |
| 41 | + | dpkg -i name-of-file.deb | |
| 42 | + | ``` | |
| 43 | + | ||
| 44 | + | You can also download an already built deb file from the releases section and | |
| 45 | + | install it in the same way. | |
create-zen-deb.sh(fichier créé)
| @@ -0,0 +1,121 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | set -euo pipefail | |
| 3 | + | ||
| 4 | + | # Check the TARBALL has been downloaded. | |
| 5 | + | ||
| 6 | + | TARBALL="zen.linux-x86_64.tar.xz" | |
| 7 | + | ||
| 8 | + | if [ ! -e "${TARBALL}" ]; then | |
| 9 | + | echo "error: $0: Did not find the required tarball." | |
| 10 | + | echo | |
| 11 | + | echo "Please get the offical tarball '${TARBALL}' from" | |
| 12 | + | echo | |
| 13 | + | echo " https://github.com/zen-browser/desktop/releases" | |
| 14 | + | echo | |
| 15 | + | exit 1 | |
| 16 | + | fi | |
| 17 | + | ||
| 18 | + | ||
| 19 | + | # === CONFIG === | |
| 20 | + | PACKAGE_NAME="zen-browser" | |
| 21 | + | VERSION=$(tar -xJf ${TARBALL} --to-stdout zen/application.ini | grep '^Version=' | cut -d'=' -f2) | |
| 22 | + | ARCH="amd64" | |
| 23 | + | BUILD_DIR="${PACKAGE_NAME}_${VERSION}" | |
| 24 | + | INSTALL_DIR="$BUILD_DIR/opt/zen" | |
| 25 | + | BIN_DIR="$BUILD_DIR/usr/local/bin" | |
| 26 | + | DESKTOP_DIR="$BUILD_DIR/usr/local/share/applications" | |
| 27 | + | ICON_BASE="$BUILD_DIR/usr/share/icons/hicolor" | |
| 28 | + | ||
| 29 | + | # === CLEAN UP OLD BUILDS === | |
| 30 | + | rm -rf "$BUILD_DIR" | |
| 31 | + | mkdir -p "$INSTALL_DIR" "$BIN_DIR" "$DESKTOP_DIR" | |
| 32 | + | ||
| 33 | + | # === EXTRACT THE TARBALL === | |
| 34 | + | echo "Extracting tarball..." | |
| 35 | + | tar -xf "$TARBALL" | |
| 36 | + | mv zen/* "$INSTALL_DIR" | |
| 37 | + | ||
| 38 | + | # === CREATE EXECUTABLE WRAPPER === | |
| 39 | + | echo "Creating wrapper script..." | |
| 40 | + | cat <<EOF > "$BIN_DIR/zen" | |
| 41 | + | #!/bin/bash | |
| 42 | + | /opt/zen/zen "\$@" | |
| 43 | + | EOF | |
| 44 | + | chmod +x "$BIN_DIR/zen" | |
| 45 | + | ||
| 46 | + | # === INSTALL ICONS === | |
| 47 | + | echo "Copying icons..." | |
| 48 | + | for size in 16 32 48 64 128; do | |
| 49 | + | mkdir -p "$ICON_BASE/${size}x${size}/apps" | |
| 50 | + | cp "$INSTALL_DIR/browser/chrome/icons/default/default${size}.png" \ | |
| 51 | + | "$ICON_BASE/${size}x${size}/apps/zen.png" | |
| 52 | + | done | |
| 53 | + | ||
| 54 | + | # === CREATE .desktop FILE === | |
| 55 | + | echo "Creating .desktop file..." | |
| 56 | + | cat <<EOF > "$DESKTOP_DIR/zen.desktop" | |
| 57 | + | [Desktop Entry] | |
| 58 | + | Name=Zen Browser | |
| 59 | + | Comment=Experience tranquillity while browsing the web without people tracking you! | |
| 60 | + | Keywords=web;browser;internet | |
| 61 | + | Exec=/opt/zen/zen %u | |
| 62 | + | Icon=zen | |
| 63 | + | Terminal=false | |
| 64 | + | StartupNotify=true | |
| 65 | + | StartupWMClass=zen | |
| 66 | + | NoDisplay=false | |
| 67 | + | Type=Application | |
| 68 | + | MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; | |
| 69 | + | Categories=Network;WebBrowser; | |
| 70 | + | Actions=new-window;new-private-window;profile-manager-window; | |
| 71 | + | ||
| 72 | + | [Desktop Action new-window] | |
| 73 | + | Name=Open a New Window | |
| 74 | + | Exec=/opt/zen/zen --new-window %u | |
| 75 | + | ||
| 76 | + | [Desktop Action new-private-window] | |
| 77 | + | Name=Open a New Private Window | |
| 78 | + | Exec=/opt/zen/zen --private-window %u | |
| 79 | + | ||
| 80 | + | [Desktop Action profile-manager-window] | |
| 81 | + | Name=Open the Profile Manager | |
| 82 | + | Exec=/opt/zen/zen --ProfileManager | |
| 83 | + | EOF | |
| 84 | + | ||
| 85 | + | # === CREATE DEBIAN CONTROL FILE === | |
| 86 | + | echo "Creating control file..." | |
| 87 | + | mkdir -p "$BUILD_DIR/DEBIAN" | |
| 88 | + | cat <<EOF > "$BUILD_DIR/DEBIAN/control" | |
| 89 | + | Package: $PACKAGE_NAME | |
| 90 | + | Version: $VERSION | |
| 91 | + | Section: web | |
| 92 | + | Priority: optional | |
| 93 | + | Architecture: $ARCH | |
| 94 | + | Maintainer: Shariq Shahbaz <iamsh4r10@gmail.com> | |
| 95 | + | Description: Zen Browser - A privacy-focused browser that helps you browse in peace. | |
| 96 | + | EOF | |
| 97 | + | ||
| 98 | + | # === POSTINST TO UPDATE ICON CACHE === | |
| 99 | + | cat <<'EOF' > "$BUILD_DIR/DEBIAN/postinst" | |
| 100 | + | #!/bin/bash | |
| 101 | + | set -e | |
| 102 | + | if command -v gtk-update-icon-cache &>/dev/null; then | |
| 103 | + | gtk-update-icon-cache -f /usr/share/icons/hicolor | |
| 104 | + | fi | |
| 105 | + | EOF | |
| 106 | + | chmod +x "$BUILD_DIR/DEBIAN/postinst" | |
| 107 | + | ||
| 108 | + | # Avoid dpkg-build failing due to control directory not | |
| 109 | + | # having other rX permissions. | |
| 110 | + | ||
| 111 | + | chmod -R a+rX $BUILD_DIR | |
| 112 | + | ||
| 113 | + | # === BUILD THE DEB PACKAGE === | |
| 114 | + | echo "Building .deb package..." | |
| 115 | + | dpkg-deb --build --root-owner-group "$BUILD_DIR" | |
| 116 | + | ||
| 117 | + | # === FINAL CLEANUP === | |
| 118 | + | echo "Final cleanup..." | |
| 119 | + | rm -rf zen "$BUILD_DIR" | |
| 120 | + | ||
| 121 | + | echo "Done! Output: ${BUILD_DIR}.deb" | |
get-zen-install-deb.sh(fichier créé)
| @@ -0,0 +1,36 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # | |
| 3 | + | # Time-stamp: <Tuesday 2025-07-29 08:40:45 +1000 Graham Williams> | |
| 4 | + | # | |
| 5 | + | # Download the current distribution of zen for Linux, create the .deb | |
| 6 | + | # and then install the .deb. | |
| 7 | + | ||
| 8 | + | set -euo pipefail | |
| 9 | + | ||
| 10 | + | # Make a dated backup of any previously downloaded distribution file. | |
| 11 | + | ||
| 12 | + | if [ -e zen.linux-x86_64.tar.xz ]; then | |
| 13 | + | mv zen.linux-x86_64.tar.xz zen.linux-x86_64.tar.xz.$(date +'%Y%m%d') | |
| 14 | + | fi | |
| 15 | + | ||
| 16 | + | # Download the latest release of zen. | |
| 17 | + | ||
| 18 | + | wget --quiet --show-progress \ | |
| 19 | + | https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-x86_64.tar.xz \ | |
| 20 | + | -O zen.linux-x86_64.tar.xz | |
| 21 | + | ||
| 22 | + | # wget --quiet --show-progress \ | |
| 23 | + | # https://github.com/zen-browser/desktop/releases/download/twilight/zen.linux-x86_64.tar.xz \ | |
| 24 | + | # -O zen.linux-x86_64.tar.xz | |
| 25 | + | ||
| 26 | + | # Extract the version from the downloaded file. | |
| 27 | + | ||
| 28 | + | VERSION=$(tar -xJf zen.linux-x86_64.tar.xz --to-stdout zen/application.ini | grep '^Version=' | cut -d'=' -f2) | |
| 29 | + | ||
| 30 | + | # Create the .deb package. | |
| 31 | + | ||
| 32 | + | bash create-zen-deb.sh | |
| 33 | + | ||
| 34 | + | # Install the .deb package locally. | |
| 35 | + | ||
| 36 | + | sudo dpkg -i zen-browser_${VERSION}.deb | |