-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from kushaldas/adding_just
Adding just
- Loading branch information
Showing
3 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Creates the source tarball | ||
sdist: | ||
./scripts/create-sourcetarball |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
tumpa (0.1.0+buster+nmu1) UNRELEASED; urgency=medium | ||
tumpa (0.1.0+buster+nmu1) UNSTABLE; urgency=medium | ||
|
||
* Non-maintainer upload. | ||
* check changelog.md | ||
* | ||
|
||
-- Kushal Das <[email protected]> Fri, 01 Jan 2021 19:13:51 +0530 | ||
-- Kushal Das <[email protected]> Sun, 03 Jan 2021 09:20:51 +0530 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
# Amazing magic from Conor Schaefer | ||
function build_source_tarball() { | ||
PKG_NAME="tumpa" | ||
build_dir="/tmp/${PKG_NAME}" | ||
rm -rf "$build_dir" | ||
|
||
|
||
# Copy the source from current directory into build dir | ||
cp -r . $build_dir/ | ||
(cd "$build_dir" && LC_ALL="C.UTF-8" python setup.py sdist) | ||
|
||
# Initial tarball will contain timestamps from NOW, let's repack | ||
# with timestamps from the changelog, which is static. | ||
raw_tarball="$(find "${build_dir}/dist/" | grep -P '\.tar.gz$' | head -n1)" | ||
dch_time="$(date "+%Y-%m-%d %H:%M:%S %z" -d@$(dpkg-parsechangelog --file packaging/debian/changelog -STimestamp)) " | ||
(cd "$build_dir" && tar -xzf "dist/$(basename $raw_tarball)") | ||
tarball_basename="$(basename "$raw_tarball")" | ||
# Repack with tar only, so env vars are respected | ||
(cd "$build_dir" && tar -cf "${tarball_basename%.gz}" --mode=go=rX,u+rw,a-s --mtime="$dch_time" --sort=name --owner=root:0 --group=root:0 "${tarball_basename%.tar.gz}" 1>&2) | ||
# Then gzip it separately, so we can pass args | ||
(cd "$build_dir" && gzip --no-name "${tarball_basename%.gz}") | ||
(cd "$build_dir" && mv "$tarball_basename" dist/) | ||
echo "$raw_tarball" | ||
} | ||
|
||
build_source_tarball |