Commit 168632e2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add epm play mssql-server

parent 09038d9e
#!/bin/sh
# TODO: common place
fatal()
{
echo "FATAL: $*" >&2
exit 1
}
PKGNAME=mssql-server
if [ "$1" = "--remove" ] ; then
epm remove $PKGNAME mssql-tools msodbcsql17
echo
echo "Check data directory /var/opt/mssql if you need remove it too."
exit
fi
[ "$1" != "--run" ] && echo "MS SQL Server 2019 from the official site" && exit
[ "$($DISTRVENDOR -a)" != "x86_64" ] && echo "Only x86_64 is supported" && exit 1
if [ "$($DISTRVENDOR -d)" = "ALTLinux" ] ; then
serv mssql-server stop
epm install --repack https://packages.microsoft.com/rhel/8/mssql-server-2019/mssql-server-1*.x86_64.rpm || fatal
epm install --repack https://packages.microsoft.com/rhel/8/prod/mssql-tools-1*.x86_64.rpm
epm install --repack https://packages.microsoft.com/rhel/8/prod/msodbcsql17-1*.x86_64.rpm
sudo /opt/mssql/bin/mssql-conf setup accept-eula
epm install unixODBC
sudo odbcinst -i -d -f /opt/microsoft/msodbcsql17/etc/odbcinst.ini
sudo odbcinst -q -d
serv mssql-server on
cat <<EOF
Use follow command to check the connection to the MS SQL server:
$ /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -Q 'sp_databases'
EOF
exit
fi
fatal "We support only ALTLinux for now"
......@@ -5,9 +5,14 @@ BUILDROOT="$1"
SPEC="$2"
# we need libssl/libcrypto-devel due libssl.so/libcrypto.so using (ALT bug 35559)
REQUIRES="libssl-devel pbzip2 bzip2 gdb python-base libnuma libkrb5 libsss_nss_idmap cyrus-sasl2 libsasl2-plugin-gssapi procps"
REQUIRES="python3 pbzip2 bzip2 gdb libnuma libkrb5 libsss_nss_idmap cyrus-sasl2 libsasl2-plugin-gssapi procps"
subst "s|^\(Name: .*\)$|# FIXME: due libcrypto.so.10(libcrypto.so.10)(64bit) autoreqs\nAutoReq:yes,nolib\n# Converted from original package requires\nRequires:$REQUIRES\n\1|g" $SPEC
# ALT's su does not support -p last 20 years
subst "s|su -p |su |" $BUILDROOT/opt/mssql/lib/mssql-conf/invokesqlservr.sh
subst "1iAutoProv:no\nAutoReq:yes,nopython,nopython3\n# Converted from original package requires\nRequires:$REQUIRES\n" $SPEC
subst "s|Руѝѝкий|Русский|" $BUILDROOT/opt/mssql/lib/mssql-conf/loc/mo/mssql-conf-ru_RU.mo
# Set correct path to sysctl
subst 's|sysctl|/sbin/sysctl|' $BUILDROOT/opt/mssql/bin/crash-support-functions.sh
subst 's|/usr/bin/basename|/bin/basename|' $BUILDROOT/opt/mssql/bin/*.sh
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment