Use a new Debian package generation method (#5)

* Build .deb packages for some architectures on CI to publish on GitHub

* Add release binaries to archive root, update Cargo.toml

* Simplify Debian package building using cargo-deb tooling

* Update LICENSE file copyright statement

* Update Travis CI script to properly build Debian release packages

* Remove obsolete Debian package files

* Update Cargo.toml and Cargo.lock, add create_deb prototype for source package
This commit is contained in:
Tim Visée 2018-06-01 00:04:13 +02:00 committed by GitHub
parent 8e80fa09c3
commit 58103f9e30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 81 additions and 42 deletions

View file

@ -73,8 +73,17 @@ jobs:
# GitHub binary release for Linux on x86/x86_64 # GitHub binary release for Linux on x86/x86_64
- stage: release - stage: release
rust: stable rust: stable
env: TARGET=x86_64-unknown-linux-gnu TARGET_SIMPLE=linux-x64 DEB_ARCH=amd64 env: TARGET=x86_64-unknown-linux-gnu TARGET_SIMPLE=linux-x64 DEB=y
cache: cargo cache: cargo
install: &install-github-release
- |
if [ ! $TARGET == "x86_64-unknown-linux-gnu" ] && [ ! $TARGET == "x86_64-apple-darwin" ]; then
cargo install cross
fi
- |
if [ -n "$DEB" ]; then
cargo install cargo-deb
fi
script: &script-github-release script: &script-github-release
- | - |
if [ $TARGET == "x86_64-unknown-linux-gnu" ] || [ $TARGET == "x86_64-apple-darwin" ]; then if [ $TARGET == "x86_64-unknown-linux-gnu" ] || [ $TARGET == "x86_64-apple-darwin" ]; then
@ -88,8 +97,8 @@ jobs:
fi fi
- tar -czvf ./ffsend-$TRAVIS_TAG-$TARGET_SIMPLE.tar.gz ffsend - tar -czvf ./ffsend-$TRAVIS_TAG-$TARGET_SIMPLE.tar.gz ffsend
- | - |
if [ -n "$DEB_ARCH" ]; then if [ -n "$DEB" ]; then
./pkg/create_deb cargo deb --verbose
fi fi
- mv ./ffsend ./ffsend-$TRAVIS_TAG-$TARGET_SIMPLE - mv ./ffsend ./ffsend-$TRAVIS_TAG-$TARGET_SIMPLE
deploy: &deploy-github-release deploy: &deploy-github-release
@ -99,7 +108,7 @@ jobs:
overwrite: true overwrite: true
file_glob: true file_glob: true
file: file:
- ffsend_*.deb - target/debian/ffsend_*.deb
- ffsend-$TRAVIS_TAG-$TARGET_SIMPLE.tar.gz - ffsend-$TRAVIS_TAG-$TARGET_SIMPLE.tar.gz
- ffsend-$TRAVIS_TAG-$TARGET_SIMPLE - ffsend-$TRAVIS_TAG-$TARGET_SIMPLE
on: on:
@ -107,10 +116,9 @@ jobs:
branch: master branch: master
- stage: release - stage: release
rust: stable rust: stable
env: TARGET=i686-unknown-linux-gnu TARGET_SIMPLE=linux-i386 DEB_ARCH=i386 env: TARGET=i686-unknown-linux-gnu TARGET_SIMPLE=linux-i386 DEB=y
cache: cargo cache: cargo
install: &install-github-release-cross install: *install-github-release
- cargo install cross
script: *script-github-release script: *script-github-release
deploy: *deploy-github-release deploy: *deploy-github-release
@ -119,21 +127,21 @@ jobs:
rust: stable rust: stable
env: TARGET=aarch64-unknown-linux-gnu TARGET_SIMPLE=linux-aarch64 env: TARGET=aarch64-unknown-linux-gnu TARGET_SIMPLE=linux-aarch64
cache: cargo cache: cargo
install: *install-github-release-cross install: *install-github-release
script: *script-github-release script: *script-github-release
deploy: *deploy-github-release deploy: *deploy-github-release
- stage: release - stage: release
rust: stable rust: stable
env: TARGET=arm-unknown-linux-gnueabi TARGET_SIMPLE=linux-arm env: TARGET=arm-unknown-linux-gnueabi TARGET_SIMPLE=linux-arm
cache: cargo cache: cargo
install: *install-github-release-cross install: *install-github-release
script: *script-github-release script: *script-github-release
deploy: *deploy-github-release deploy: *deploy-github-release
- stage: release - stage: release
rust: stable rust: stable
env: TARGET=armv7-unknown-linux-gnueabihf TARGET_SIMPLE=linux-armv7 env: TARGET=armv7-unknown-linux-gnueabihf TARGET_SIMPLE=linux-armv7
cache: cargo cache: cargo
install: *install-github-release-cross install: *install-github-release
script: *script-github-release script: *script-github-release
deploy: *deploy-github-release deploy: *deploy-github-release
@ -143,6 +151,7 @@ jobs:
os: osx os: osx
env: TARGET=x86_64-apple-darwin TARGET_SIMPLE=osx-x64 env: TARGET=x86_64-apple-darwin TARGET_SIMPLE=osx-x64
cache: cargo cache: cargo
install: *install-github-release
script: *script-github-release script: *script-github-release
deploy: *deploy-github-release deploy: *deploy-github-release

23
Cargo.lock generated
View file

@ -65,7 +65,7 @@ dependencies = [
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.9.1" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -379,7 +379,7 @@ version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"arrayref 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "arrayref 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"derive_builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "derive_builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -389,7 +389,7 @@ dependencies = [
"mime_guess 2.0.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"reqwest 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -496,7 +496,7 @@ name = "hyper"
version = "0.11.27" version = "0.11.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -976,7 +976,7 @@ dependencies = [
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.8.5" version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -995,7 +995,7 @@ dependencies = [
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1515,10 +1515,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "0.5.1" version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1629,7 +1630,7 @@ dependencies = [
"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" "checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1"
"checksum backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbdd17cd962b570302f5297aea8648d5923e22e555c2ed2d8b2e34eca646bf6d" "checksum backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbdd17cd962b570302f5297aea8648d5923e22e555c2ed2d8b2e34eca646bf6d"
"checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" "checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e"
"checksum base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9263aa6a38da271eec5c91a83ce1e800f093c8535788d403d626d8d5c3f8f007" "checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
@ -1733,7 +1734,7 @@ dependencies = [
"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7"
"checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
"checksum reqwest 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)" = "241faa9a8ca28a03cbbb9815a5d085f271d4c0168a19181f106aa93240c22ddb" "checksum reqwest 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2abe46f8e00792693a2488e296c593d1f4ea39bb1178cfce081d6793657575e4"
"checksum rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d127299b02abda51634f14025aec43ae87a7aa7a95202b6a868ec852607d1451" "checksum rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d127299b02abda51634f14025aec43ae87a7aa7a95202b6a868ec852607d1451"
"checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649" "checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
@ -1794,7 +1795,7 @@ dependencies = [
"checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7" "checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7"
"checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea" "checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
"checksum uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc7e3b898aa6f6c08e5295b6c89258d1331e9ac578cc992fb818759951bdc22" "checksum uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e1436e58182935dcd9ce0add9ea0b558e8a87befe01c1a301e6020aeb0876363"
"checksum vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ed0f6789c8a85ca41bbc1c9d175422116a9869bd1cf31bb08e1493ecce60380" "checksum vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ed0f6789c8a85ca41bbc1c9d175422116a9869bd1cf31bb08e1493ecce60380"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum version-compare 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "78068add8bf1e4d37d13fa5867182fe4c03f8e525c831053733f83aaba942d37" "checksum version-compare 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "78068add8bf1e4d37d13fa5867182fe4c03f8e525c831053733f83aaba942d37"

View file

@ -22,6 +22,25 @@ exclude = [
"res/*", "res/*",
] ]
[package.metadata.deb]
section = "utility"
extended-description = """\
Easily and securely share files and directories from the command line through
a safe, private and encrypted link using a single simple command. \
Files are shared using the Send service and may be up to 2GB. \
Others are able to download these files with this tool, \
or through their webbrowser.\n\
\n\
All files are always encrypted on the client, \
and secrets are never shared with the remote host. \
An optional password may be specified, and a default file lifetime of 1 \
(up to 20) download or 24 hours is enforced to ensure your stuff does not \
remain online forever. This provides a secure platform to share your files."""
priority = "standard"
license-file = ["LICENSE", "3"]
depends = "$auto, xclip"
maintainer-scripts = "pkg/deb"
[badges] [badges]
travis-ci = { repository = "timvisee/ffsend", branch = "master" } travis-ci = { repository = "timvisee/ffsend", branch = "master" }

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (C) 2018 Tim Visee. <https://timvisee.com/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.

View file

@ -24,14 +24,36 @@ if [[ ! -f "$DIR/../ffsend" ]]; then
exit 1 exit 1
fi fi
# Copy the binary into the package directory # Create an application directory, copy the binary into it
mkdir -p $DIR/deb/usr/bin mkdir -p $DIR/ffsend-$VERSION
cp $DIR/../ffsend $DIR/deb/usr/bin/ffsend cp $DIR/../ffsend $DIR/ffsend-$VERSION/ffsend
# Update version and architecture in the control file # Create an application tarbal
sed -i "/Version:\.*/c\\Version: $VERSION" $DIR/deb/DEBIAN/control cd $DIR/..
sed -i "/Architecture:\.*/c\\Architecture: $DEB_ARCH" $DIR/deb/DEBIAN/control git archive --format tar.gz -o $DIR/ffsend-$VERSION/ffsend-$VERSION.tar.gz $TRAVIS_TAG
# Change into the app directory
cd $DIR/ffsend-$VERSION
# Build the debian package # Build the debian package
echo "Building debian package..." # TODO: define GPG?
dpkg-deb --verbose --build $DIR/deb . dh_make -e "timvisee@gmail.com" -c gpl3 -f ffsend-$VERSION.tar.gz -s -y
rm *.ex README.Debian README.source
# Remove the project tar ball, we're not using it anymore
rm $DIR/ffsend-$VERSION/ffsend-$VERSION.tar.gz
# TODO: configure the debian/control file
# TODO: configure copyright file
# # Update version and architecture in the control file
# sed -i "/Version:\.*/c\\Version: $VERSION" $DIR/deb/DEBIAN/control
# sed -i "/Architecture:\.*/c\\Architecture: $DEB_ARCH" $DIR/deb/DEBIAN/control
# # Build the debian package
# echo "Building debian package..."
# dpkg-deb --verbose --build $DIR/deb .

View file

@ -1,11 +0,0 @@
Package: ffsend
Version: TODO
Section: utils
Priority: standard
Architecture: TODO
Recommends: xclip
Maintainer: Tim Visée <timvisee@gmail.com>
Description: easily and securely share files from the CLI using Send
Easily and securely share files from the command line.
A fully featured Firefox Send client.
Homepage: https://github.com/timvisee/ffsend

View file

@ -1 +0,0 @@
Some file contents

Binary file not shown.