Skip to content

Commit 9d89e4a

Browse files
authored
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
1 parent ecb2da1 commit 9d89e4a

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

etc/ci/before_deploy.sh

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,28 @@ make_deb() {
6161

6262
homepage="https://github.com/dandavison/delta"
6363
maintainer="Dan Davison <dandavison7@gmail.com>"
64+
copyright_years="2019 - "$(date "+%Y")
6465

6566
case $TARGET in
6667
x86_64*)
6768
architecture=amd64
6869
gcc_prefix=""
70+
library_dir=""
6971
;;
7072
i686*)
7173
architecture=i386
7274
gcc_prefix=""
75+
library_dir=""
7376
;;
7477
aarch64*)
7578
architecture=arm64
7679
gcc_prefix="aarch64-linux-gnu-"
80+
library_dir="-l/usr/aarch64-linux-gnu/lib"
7781
;;
7882
arm*hf)
7983
architecture=armhf
8084
gcc_prefix="arm-linux-gnueabihf-"
85+
library_dir="-l/usr/arm-linux-gnueabihf/lib"
8186
;;
8287
*)
8388
echo "make_deb: skipping target '${TARGET}'" >&2
@@ -99,16 +104,22 @@ make_deb() {
99104
install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
100105
"${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"
101106

107+
# Work out shared library dependencies
108+
# dpkg-shlibdeps requires debian/control file. Dummy it and clean up
109+
mkdir "./debian"
110+
touch "./debian/control"
111+
depends="$(dpkg-shlibdeps $library_dir -O "$tempdir/usr/bin/$PROJECT_NAME" 2> /dev/null | sed 's/^shlibs:Depends=//')"
112+
rm -rf "./debian"
113+
102114
# readme and license
103-
install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
104-
install -Dm644 LICENSE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE"
105-
cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF
115+
install -Dm644 README.md "$tempdir/usr/share/doc/$dpkgname/README.md"
116+
cat > "$tempdir/usr/share/doc/$dpkgname/copyright" <<EOF
106117
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
107118
Upstream-Name: $PROJECT_NAME
108119
Source: $homepage
109120
110121
Files: *
111-
Copyright: $maintainer
122+
Copyright: $copyright_years $maintainer
112123
License: MIT
113124
114125
License: MIT
@@ -136,6 +147,7 @@ License: MIT
136147
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
137148
DEALINGS IN THE SOFTWARE.
138149
EOF
150+
chmod 644 "$tempdir/usr/share/doc/$dpkgname/copyright"
139151

140152
# Control file
141153
mkdir "$tempdir/DEBIAN"
@@ -146,9 +158,12 @@ Section: utils
146158
Priority: optional
147159
Maintainer: Dan Davison <dandavison7@gmail.com>
148160
Architecture: $architecture
161+
Depends: $depends
149162
Provides: $PROJECT_NAME
150163
Conflicts: $conflictname
151-
Description: A syntax highlighter for git.
164+
Description: Syntax highlighter for git.
165+
Delta provides language syntax-highlighting, within-line insertion/deletion
166+
detection, and restructured diff output for git on the command line.
152167
EOF
153168

154169
fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"

0 commit comments

Comments
 (0)