Skip to content

Commit

Permalink
ubuntu20 and redhat8
Browse files Browse the repository at this point in the history
  • Loading branch information
msciabarra committed Oct 15, 2023
1 parent 0bc44c6 commit 254aaf5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
21 changes: 13 additions & 8 deletions bin/linux/nuvfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,30 @@ tasks:

download:
- curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh | GH=mh-cbon/go-bin-deb sh -xe
- sudo apt-get -y install alien rpm
- sudo apt-get -y install alien

assemble:
- rm -r deb-build-{{.ARCH}}
- go-bin-deb generate -a {{.ARCH}} --version {{.VERSION}} --wd deb-build-{{.ARCH}}
- task: assemble-rpm

assemble-rpm:
- |
export VERSION="{{.VERSION}}"
export VER="${VERSION%%-*}"
export ARCH="{{.ARCH}}"
case "$ARCH" in
arm64) export TGT="arm64" ;;
amd64) export TGT="x86_64" ;;
esac
export VERSION="{{.VERSION}}"
export VER="${VERSION%%-*}"
case "$(lsb_release -rs)" in
20.*) IMG="rockylinux:8" ;;
22.*) IMG="rockylinux:9" ;;
esac
cd $NUV_ROOT/linux
sudo alien --to-rpm nuv_${VERSION}_${ARCH}.deb --scripts --generate
cd nuv-${VER}
sudo mv nuv-${VER}-*.spec ../nuv.spec
sudo rpmbuild --target=$TGT --buildroot=$NUV_ROOT/linux/nuv-${VER} -bb ../nuv.spec
cd ..
sudo alien --to-rpm "nuv_${VERSION}_${ARCH}.deb" --scripts --generate
sudo mv nuv-${VER}/nuv-${VER}-*.spec nuv.spec
cat rpmbuild.sh | docker run -i -v $PWD:/mnt "$IMG" env VER=$VER TGT=$TGT bash -
sudo mv nuv-${VER}-*.$TGT.rpm nuv_${VERSION}_${ARCH}.rpm
clean: rm -r *.deb *.rpm deb-build-{{.ARCH}}
Expand Down
3 changes: 3 additions & 0 deletions bin/linux/rpmbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dnf install -y rpm-build rpmdevtools
cd /mnt/nuv-$VER
rpmbuild --target=$TGT --buildroot=/mnt/nuv-$VER -bb /mnt/nuv.spec
11 changes: 9 additions & 2 deletions bin/nuvfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,16 @@ tasks:
- ./nuv linux build ARCH=amd64
- ./nuv linux build ARCH=arm64
- |
for FILE in linux/*.deb linux/*.rpm
for FILE in linux/*.deb
do
NEW="$(echo $FILE | sed 's/\(.*\)\(\.[a-zA-Z0-9]*\)$/\1_glibc2.31\2/')"
NEW="$(echo $FILE | sed 's/\(.*\)\(\.[a-zA-Z0-9]*\)$/\1_ubuntu20\2/')"
mv "$FILE" "$NEW"
echo "renamed $FILE to $NEW"
done
- |
for FILE in linux/*.rpm
do
NEW="$(echo $FILE | sed 's/\(.*\)\(\.[a-zA-Z0-9]*\)$/\1_redhat8\2/')"
mv "$FILE" "$NEW"
echo "renamed $FILE to $NEW"
done
Expand Down

0 comments on commit 254aaf5

Please sign in to comment.