Fix static linux packaging

pull/9012/head
Mark Rushakoff 2017-10-25 16:20:21 -07:00
parent bbae6e7674
commit b4d56be43a
1 changed files with 21 additions and 3 deletions

View File

@ -47,7 +47,26 @@ PKG_ROOT="/pkg/$ARCHIVE_ROOT_NAME"
mkdir -p /ibin mkdir -p /ibin
(cd /ibin && tar xzf /influxdb-bin.tar.gz) (cd /ibin && tar xzf /influxdb-bin.tar.gz)
if [ "$OS" == "linux" ] || [ "$OS" == "darwin" ]; then if [ "$OS" == "linux" ] && [ "$STATIC" == "1" ]; then
# Static linux packages get only the binaries and the conf file in the root directory,
# plus the man pages in the full path.
rm -rf "$PKG_ROOT"
mkdir -p "$PKG_ROOT"
cp /ibin/* "$PKG_ROOT/"
cp /isrc/etc/config.sample.toml "$PKG_ROOT/influxdb.conf"
mkdir -p "$PKG_ROOT/usr/share/man/man1"
cp /isrc/man/*.1.gz "$PKG_ROOT/usr/share/man/man1"
# Creating tarball from /pkg, NOT from $PKG_ROOT, so that influxdb-$VERSION-1 directory is present in archive.
(cd /pkg && tar czf "/out/influxdb-${VERSION}-static_${OS}_${ARCH}.tar.gz" ./*)
(cd /out && for f in *.tar.gz; do
md5sum "$f" > "$f.md5"
sha256sum "$f" > "$f.sha256"
done)
elif [ "$OS" == "linux" ] || [ "$OS" == "darwin" ]; then
############################# #############################
####### Data packages ####### ####### Data packages #######
############################# #############################
@ -91,8 +110,7 @@ if [ "$OS" == "linux" ] || [ "$OS" == "darwin" ]; then
# Creating tarball from /pkg, NOT from $PKG_ROOT, so that influxdb-$VERSION-1 directory is present in archive. # Creating tarball from /pkg, NOT from $PKG_ROOT, so that influxdb-$VERSION-1 directory is present in archive.
(cd /pkg && tar czf $BIN_GZ_NAME ./*) (cd /pkg && tar czf $BIN_GZ_NAME ./*)
# don't need static install packages. if [ "$OS" == "linux" ] ; then
if [ "$OS" == "linux" ] && [ "$STATIC" != "1" ]; then
# Call fpm to build .deb and .rpm packages. # Call fpm to build .deb and .rpm packages.
for typeargs in "-t deb" "-t rpm --depends coreutils --depends shadow-utils"; do for typeargs in "-t deb" "-t rpm --depends coreutils --depends shadow-utils"; do
FPM_NAME=$( FPM_NAME=$(