Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/2 add support for native package builds #21

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions container/bin/build_source
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ main() (

if [[ "$source" = "git+"* ]]; then
git_source "${source#git+}"
elif [[ "$source" = "native" ]]; then
native_source
else
apt_source "$source"
fi
Expand All @@ -39,8 +41,10 @@ main() (
pkg="$(dpkg-parsechangelog --show-field Source)"
version="$(dpkg-parsechangelog --show-field Version)"
version_orig="${version%-*}"
xz < ../orig.tar > "../${pkg}_${version_orig}.orig.tar.xz"
rm ../orig.tar
if [ -f ../orig.tar ]; then
xz < ../orig.tar > "../${pkg}_${version_orig}.orig.tar.xz"
rm ../orig.tar
fi

dpkg-source --build .

Expand All @@ -65,11 +69,17 @@ apt_source() (
orig=(*.orig.tar.*)
debian=(*.debian.tar.*)
dsc=(*.dsc)
auto_decompress "$orig" > orig.tar
mkdir src
tar -C src -x --strip-components 1 < orig.tar
auto_decompress "$debian" | tar -C src -xv
rm "$orig" "$debian" "$dsc"
dpkg-source --extract "$dsc" src
if [ -f "$orig" ]; then
auto_decompress "$orig" > orig.tar
rm $orig
else
rm *.tar.*
fi
if [ -f $debian ]; then
rm "$debian"
fi
rm "$dsc"
)

git_source() (
Expand All @@ -80,6 +90,11 @@ git_source() (
tar -x < orig.tar
)

native_source() (
echo "Native package build."
cp -r /input src
)

auto_decompress() (
case "${1##*.}" in
gz)
Expand Down