Skip to content

Commit

Permalink
Add support for native builds (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
alee-ntap authored Nov 23, 2023
1 parent 8b356c0 commit bacc01c
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions container/bin/build_source
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ main() (

if [[ "$source" = "git+"* ]]; then
git_source "${source#git+}"
elif [[ "$source" = "native" ]]; then
native_source
else
apt_source "$source"
fi
Expand All @@ -46,8 +48,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 @@ -72,11 +76,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 @@ -87,6 +97,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

0 comments on commit bacc01c

Please sign in to comment.