|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +set -exu # Strict shell (w/o -o pipefail) |
| 4 | + |
| 5 | +if type dnf; then |
| 6 | + PM_SYNC='dnf makecache' |
| 7 | + PM_INSTALL_NAME='dnf -qy install' |
| 8 | + PM_INSTALL_FILE='dnf -qy install' |
| 9 | + PKG_GLOB='php-tarantool-*.x86_64.rpm' |
| 10 | +elif type yum; then |
| 11 | + PM_SYNC='yum makecache' |
| 12 | + PM_INSTALL_NAME='yum -qy install' |
| 13 | + PM_INSTALL_FILE='yum -qy install' |
| 14 | + PKG_GLOB='php-tarantool-*.x86_64.rpm' |
| 15 | +elif type apt-get; then |
| 16 | + PM_SYNC='apt-get update' |
| 17 | + PM_INSTALL_NAME='apt-get -qy install' |
| 18 | + PM_INSTALL_FILE='dpkg -i' |
| 19 | + PKG_GLOB='php7.?-tarantool*_amd64.deb' |
| 20 | + # Prevent packages like tzdata from asking configuration |
| 21 | + # parameters interactively. |
| 22 | + # See https://github.com/packpack/packpack/issues/7 |
| 23 | + export DEBIAN_FRONTEND=noninteractive |
| 24 | +else |
| 25 | + echo "No suitable package manager found" |
| 26 | + exit 1 |
| 27 | +fi |
| 28 | + |
| 29 | +# Update available packages list. |
| 30 | +${PM_SYNC} |
| 31 | + |
| 32 | +# Install php interpreter. |
| 33 | +${PM_INSTALL_NAME} php |
| 34 | + |
| 35 | +# Install php-tarantool package. |
| 36 | +${PM_INSTALL_FILE} build/${PKG_GLOB} |
| 37 | + |
| 38 | +# A kind of very minimaliztic test. Verify that Tarantool instance |
| 39 | +# can be created. It means that we at least install the dynamic |
| 40 | +# library and php configuration file into right places. |
| 41 | +php -r "new Tarantool('127.0.0.1', 3301);" |
0 commit comments