diff options
author | chris48s <chris48s@users.noreply.github.com> | 2020-08-27 14:46:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 09:46:03 -0400 |
commit | 9d89e4a92f01bf52cc8f333b082836968db15575 (patch) | |
tree | fd3e9cebf9d1689d33524e3c31b38ac009c452ef /etc | |
parent | ecb2da1e271aa0daa6dd2ed4c6658d59347020e6 (diff) |
debian packaging fixes (#301)
* remove leading article from description
resolves description-synopsis-starts-with-article
https://lintian.debian.org/tags/description-synopsis-starts-with-article.html
* ensure copyright is mode 644
resolves non-standard-file-perm
https://lintian.debian.org/tags/non-standard-file-perm.html
* add Depends line
Use dpkg-shlibdeps to work out shared library dependencies
and include them in a "Depends:" line
resolves missing-depends-line
https://lintian.debian.org/tags/missing-depends-line.html
* remove duplicate LICENSE file
resolves extra-license-file
https://lintian.debian.org/tags/extra-license-file.html
* change docs dir name to match package name
i.e: docs go in
/usr/share/doc/git-delta
/usr/share/doc/git-delta-musl
etc
not /usr/share/doc/delta
* include years in copyright notice
This brings the copyright notice into line with the expected format
resolves copyright-without-copyright-notice
https://lintian.debian.org/tags/copyright-without-copyright-notice.html
* provide a multi-line description
resolves extended-description-is-empty
https://lintian.debian.org/tags/extended-description-is-empty.html
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/ci/before_deploy.sh | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/etc/ci/before_deploy.sh b/etc/ci/before_deploy.sh index c79b8c69..21f6490b 100755 --- a/etc/ci/before_deploy.sh +++ b/etc/ci/before_deploy.sh @@ -61,23 +61,28 @@ make_deb() { homepage="https://github.com/dandavison/delta" maintainer="Dan Davison <dandavison7@gmail.com>" + copyright_years="2019 - "$(date "+%Y") case $TARGET in x86_64*) architecture=amd64 gcc_prefix="" + library_dir="" ;; i686*) architecture=i386 gcc_prefix="" + library_dir="" ;; aarch64*) architecture=arm64 gcc_prefix="aarch64-linux-gnu-" + library_dir="-l/usr/aarch64-linux-gnu/lib" ;; arm*hf) architecture=armhf gcc_prefix="arm-linux-gnueabihf-" + library_dir="-l/usr/arm-linux-gnueabihf/lib" ;; *) echo "make_deb: skipping target '${TARGET}'" >&2 @@ -99,16 +104,22 @@ make_deb() { install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME" "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME" + # Work out shared library dependencies + # dpkg-shlibdeps requires debian/control file. Dummy it and clean up + mkdir "./debian" + touch "./debian/control" + depends="$(dpkg-shlibdeps $library_dir -O "$tempdir/usr/bin/$PROJECT_NAME" 2> /dev/null | sed 's/^shlibs:Depends=//')" + rm -rf "./debian" + # readme and license - install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md" - install -Dm644 LICENSE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE" - cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF + install -Dm644 README.md "$tempdir/usr/share/doc/$dpkgname/README.md" + cat > "$tempdir/usr/share/doc/$dpkgname/copyright" <<EOF Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: $PROJECT_NAME Source: $homepage Files: * -Copyright: $maintainer +Copyright: $copyright_years $maintainer License: MIT License: MIT @@ -136,6 +147,7 @@ License: MIT IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. EOF + chmod 644 "$tempdir/usr/share/doc/$dpkgname/copyright" # Control file mkdir "$tempdir/DEBIAN" @@ -146,9 +158,12 @@ Section: utils Priority: optional Maintainer: Dan Davison <dandavison7@gmail.com> Architecture: $architecture +Depends: $depends Provides: $PROJECT_NAME Conflicts: $conflictname -Description: A syntax highlighter for git. +Description: Syntax highlighter for git. + Delta provides language syntax-highlighting, within-line insertion/deletion + detection, and restructured diff output for git on the command line. EOF fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb" |