Skip to content

Commit

Permalink
Adding build for arm and arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
jtyr committed Jan 13, 2018
1 parent 7ff19de commit 08bd69b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ deploy:
dist: ubuntu/xenial
skip_cleanup: true
local-dir: /tmp/gbt
package_glob: "*.deb"
package_glob: "*64.deb"
on:
tags: true
repo: jtyr/gbt
Expand Down
30 changes: 17 additions & 13 deletions dist/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
declare -a PLATFORMS=(
'darwin/amd64'
'linux/amd64'
'linux/arm'
'linux/arm64'
)

NAME='gbt'
Expand All @@ -14,7 +16,7 @@ gpg --import "$TRAVIS_BUILD_DIR/dist/gpg_key.priv"
echo -e '%_gpg_name Jiri Tyr (PKG) <[email protected]>\n%dist .el7' > ~/.rpmmacros

for P in "${PLATFORMS[@]}"; do
echo "Building $P"
echo "### Building $P"

PTMP="$TMP/$P/$NAME-$VER"
OS="${P%%/*}"
Expand All @@ -36,23 +38,25 @@ for P in "${PLATFORMS[@]}"; do
cd "$TRAVIS_BUILD_DIR/contrib"
ln -s "$PTMP" "$TRAVIS_BUILD_DIR/contrib/$NAME"
m4 -DVER="$VER" -DDATE="$(date '+%a, %d %b %Y %H:%M:%S %z')" debian/changelog.m4 > debian/changelog
dpkg-buildpackage -tc -b -kCA67951CD2BBE8AAE4210B72FB90C91F64BED28C
dpkg-buildpackage -a$ARCH -tc -b -kCA67951CD2BBE8AAE4210B72FB90C91F64BED28C
)
debsigs --sign=origin -k CA67951CD2BBE8AAE4210B72FB90C91F64BED28C "$TRAVIS_BUILD_DIR"/*.deb
mv "$TRAVIS_BUILD_DIR"/*.deb $TMP

# RPM
mkdir -p ~/rpmbuild/SOURCES
ln -s "$TMP/$PKG" ~/rpmbuild/SOURCES/
(
cd "$TRAVIS_BUILD_DIR/contrib/redhat"
m4 -DVER="$VER" -DDATE="$(date '+%a %b %d %Y')" gbt.spec.m4 > gbt.spec
rpmbuild -bb gbt.spec
)
echo -e '#!/usr/bin/expect -f\nspawn rpmsign --key-id CA67951CD2BBE8AAE4210B72FB90C91F64BED28C --addsign {*}$argv\nexpect -exact "Enter pass phrase: "\nsend -- "\\r"\nexpect eof' > ~/rpm-sign.exp
chmod +x ~/rpm-sign.exp
~/rpm-sign.exp ~/rpmbuild/RPMS/x86_64/*.rpm
mv ~/rpmbuild/RPMS/x86_64/*.rpm "$TMP"
if [ "$ARCH" = 'amd64' ]; then
mkdir -p ~/rpmbuild/SOURCES
ln -s "$TMP/$PKG" ~/rpmbuild/SOURCES/
(
cd "$TRAVIS_BUILD_DIR/contrib/redhat"
m4 -DVER="$VER" -DDATE="$(date '+%a %b %d %Y')" gbt.spec.m4 > gbt.spec
rpmbuild -bb gbt.spec
)
echo -e '#!/usr/bin/expect -f\nspawn rpmsign --key-id CA67951CD2BBE8AAE4210B72FB90C91F64BED28C --addsign {*}$argv\nexpect -exact "Enter pass phrase: "\nsend -- "\\r"\nexpect eof' > ~/rpm-sign.exp
chmod +x ~/rpm-sign.exp
~/rpm-sign.exp ~/rpmbuild/RPMS/x86_64/*.rpm
mv ~/rpmbuild/RPMS/x86_64/*.rpm "$TMP"
fi
fi
done

Expand Down

0 comments on commit 08bd69b

Please sign in to comment.