Skip to content

Commit

Permalink
build: use --after-{install,remove} scripts
Browse files Browse the repository at this point in the history
Fixes iterative#1455

Signed-off-by: Ruslan Kuprieiev <[email protected]>
  • Loading branch information
efiop committed Dec 24, 2018
1 parent 12fde38 commit 65d74ee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/build_posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ else
fi

BUILD_DIR=build
BIN_DIR=$BUILD_DIR/$INSTALL_DIR/bin
LIB_DIR=$BUILD_DIR/$INSTALL_DIR/lib

print_error()
Expand Down Expand Up @@ -41,7 +40,15 @@ fpm_build()
{
print_info "Building $1..."
VERSION=$(python -c "import dvc; from dvc import VERSION; print(str(VERSION))")
fpm -s dir -f -t $1 $FPM_FLAGS -n dvc -v $VERSION -C $BUILD_DIR usr
fpm -s dir \
-f \
-t $1 \
$FPM_FLAGS \
-n dvc \
-v $VERSION \
--after-install scripts/fpm/after-install.sh \
--after-remove scripts/fpm/after-remove.sh \
-C $BUILD_DIR usr
}

cleanup()
Expand All @@ -67,7 +74,7 @@ install_dependencies()
echo "Unable to install fpm dependencies" && exit 1
fi

gem install --no-document fpm
sudo gem install --no-document fpm

print_info "Installing requirements..."
pip install -r requirements.txt
Expand All @@ -86,13 +93,6 @@ build_dvc()
--specpath $BUILD_DIR

$LIB_DIR/dvc/dvc --help

mkdir -p $BIN_DIR
pushd $BIN_DIR
ln -s ../lib/dvc/dvc dvc
popd

$BIN_DIR/dvc --help
}

cleanup
Expand Down
2 changes: 2 additions & 0 deletions scripts/fpm/after-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
ln -sf /usr/local/lib/dvc/dvc /usr/local/bin/dvc
2 changes: 2 additions & 0 deletions scripts/fpm/after-remove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
rm -rf /usr/local/bin/dvc

0 comments on commit 65d74ee

Please sign in to comment.