Browse Source

Merge pull request #144 from gierens/deb-package

Adds debian/ubuntu installation via .deb package
Christina Sørensen 2 năm trước cách đây
mục cha
commit
3d45ad67cc
5 tập tin đã thay đổi với 167 bổ sung4 xóa
  1. 5 4
      .gitignore
  2. 11 0
      README.md
  3. 29 0
      deb.asc
  4. 118 0
      devtools/deb-package.sh
  5. 4 0
      man/eza_colors-explanation.5.md

+ 5 - 4
.gitignore

@@ -10,10 +10,11 @@ target
 
 # Compiled artifacts
 # (see devtools/*-package-for-*.sh)
-/exa-linux-x86_64
-/exa-linux-x86_64-*.zip
-/exa-macos-x86_64
-/exa-macos-x86_64-*.zip
+/eza-linux-x86_64
+/eza-linux-x86_64-*.zip
+/eza-macos-x86_64
+/eza-macos-x86_64-*.zip
+/eza_*_amd64.deb
 /MD5SUMS
 /SHA1SUMS
 

+ 11 - 0
README.md

@@ -103,6 +103,17 @@ For `nix-env` users:
 nix-env -i eza
 ```
 
+### Debian and Ubuntu
+Eza is available from [deb.gierens.de](http://deb.gierens.de). The GPG public
+key is in this repo under [deb.asc](/deb.asc).
+
+To install eza from this repo use:
+```bash
+wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo tee /etc/apt/trusted.gpg.d/gierens.asc
+echo "deb http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
+sudo apt update
+sudo apt install -y eza
+```
 
 
 ---

+ 29 - 0
deb.asc

@@ -0,0 +1,29 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mQINBGTejj8BEAC3Qdi6up8rkFvekeuZiGpuC5OTic+Nd/x6zacrtDKJwdVa6fw3
+tVydFW1ELcw33ifWDztvgENqvgMuhcB/lnoDnaAhK8nzT0l+r0gQ7JptPH+8XsZx
+PuIFRxgUkS6M45jrZApu/c3/PX3akiBuBnibd+sik72pVSi9pYm00I/yY/+u9Vvo
+u4vy/PG/y4Kp1+ewbVyOnaTQoiJXgqceUYqNfhShcN7dssa/Td6G0xPhS1XeQZ81
+QW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01cYu97DjtdQ54FGtI4r1kOyh/BO7mI0omoJ
+hFunhQKKM8q1xUyIs3RvYALuM5VzEWCHwXBYdiNWYDVBC/sNje67A8SXXXjJLhcr
+9cCpJ5AUmkrLoQvgdewMpuIlmtPRbdv8hkmOUDPkD58AcDirvggXp63IiWlFYQ9C
+EoDLfUYQ6aJmw1fRI8/QsP3Q50aN6dkZRsDCcpxoNX9YzuU6+o1ha+ZNRpmfJvZg
+ULP33eq15gJlsGrxo2HZ+f6w4pFFy4juDQ==
+=MX5x
+-----END PGP PUBLIC KEY BLOCK-----

+ 118 - 0
devtools/deb-package.sh

@@ -0,0 +1,118 @@
+#!/bin/bash
+
+if [ -z "$1" ]
+  then
+    echo "Usage: deb-package.sh <version>"
+    echo ""
+    echo "Package the given version number into a .deb package."
+    echo "Example: deb-package.sh 0.10.7"
+    exit 1
+fi
+
+DESTDIR=/usr/bin
+DOCDIR=/usr/share/man/
+NAME="eza"
+VERSION=$1
+ARCH="amd64"
+DEB_TMP_DIR="${NAME}_${VERSION}_${ARCH}"
+DEB_PACKAGE="${NAME}_${VERSION}_${ARCH}.deb"
+
+read -r -d '' DEB_CONTROL << EOM
+Package: ${NAME}
+Version: ${VERSION}
+Section: utils
+Priority: optional
+Architecture: ${ARCH}
+Depends: libc6
+Maintainer: Sandro-Alessio Gierens <sandro@gierens.de>
+Description: Modern replacement for ls
+ eza is a modern replacement for ls.  It uses colours for information by
+ default, helping you distinguish between many types of files, such as whether
+ you are the owner, or in the owning group.
+ .
+ It also has extra features not present in the original ls, such as viewing the
+ Git status for a directory, or recursing into directories with a tree view.
+EOM
+
+read -r -d '' DEB_COPYRIGHT << EOM
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: ${NAME}
+Upstream-Contact: Christina Sørensen <christina@cafkafk.com>
+Source: https://github.com/eza-community/eza/releases
+
+Files: *
+License: MIT
+Copyright: 2023 Christina Sørensen <christina@cafkafk.com>
+
+Files: debian/*
+License: MIT
+Copyright: 2023 Christina Sørensen <christina@cafkafk.com>
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+EOM
+
+# create temporary build directory
+mkdir -p ${DEB_TMP_DIR}
+
+# create directory structure
+mkdir -p ${DEB_TMP_DIR}${DESTDIR}
+mkdir -p ${DEB_TMP_DIR}${DOCDIR}
+mkdir -p ${DEB_TMP_DIR}${DOCDIR}/man1
+mkdir -p ${DEB_TMP_DIR}${DOCDIR}/man5
+mkdir -p ${DEB_TMP_DIR}/DEBIAN
+mkdir -p ${DEB_TMP_DIR}/usr/share/doc/${NAME}
+
+# fix directory permissions
+chmod 755 -R ${DEB_TMP_DIR}
+
+# binary
+cp target/release/${NAME} ${DEB_TMP_DIR}${DESTDIR}
+chmod 755 ${DEB_TMP_DIR}${DESTDIR}/${NAME}
+
+# man page
+gzip -cn9 target/man/eza.1 > ${DEB_TMP_DIR}${DOCDIR}man1/eza.1.gz
+gzip -cn9 target/man/eza_colors.5 > ${DEB_TMP_DIR}${DOCDIR}man5/eza_colors.5.gz
+gzip -cn9 target/man/eza_colors-explanation.5 > ${DEB_TMP_DIR}${DOCDIR}man5/eza_colors-explanation.5.gz
+chmod 644 ${DEB_TMP_DIR}${DOCDIR}/**/*.gz
+
+# control file
+touch ${DEB_TMP_DIR}/DEBIAN/control
+echo "${DEB_CONTROL}" > ${DEB_TMP_DIR}/DEBIAN/control
+chmod 644 ${DEB_TMP_DIR}/DEBIAN/control
+
+# changelog
+cp CHANGELOG.md ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog
+gzip -cn9 ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog > ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz
+rm ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog
+chmod 644 ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz
+
+# copyright file
+touch ${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright
+echo "${DEB_COPYRIGHT}" > ${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright
+chmod 644 ${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright
+
+# build package
+dpkg-deb --build --root-owner-group ${DEB_TMP_DIR}
+
+# clean up
+rm -rf ${DEB_TMP_DIR}
+
+# test package
+lintian ${DEB_PACKAGE}

+ 4 - 0
man/eza_colors-explanation.5.md

@@ -1,3 +1,7 @@
+# Name
+
+eza_colors-explanation — more details on customizing eza colors
+
 # Eza Color Explanation
 
 eza provides its own built\-in set of file extension mappings that cover a large range of common file extensions, including documents, archives, media, and temporary files.