Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem Install Postgres Pro for Windows from https://postgrespro.com/products/postgrespro/download/10.3.2
- SET PGPATH=C:\Program Files\PostgresPro\10
- cd /D c:\
- SET MD=c:\msys32
- rmdir /S /Q %MD%
- mkdir %MD%
- mkdir %MD%\src
- powershell -Command "((new-object net.webclient).DownloadFile('https://www.7-zip.org/a/7za920.zip', '%TEMP%\7z.zip'))"
- powershell -Command "$shell = New-Object -ComObject Shell.Application; $zip_src = $shell.NameSpace('%TEMP%\7z.zip'); $zip_dest = $shell.NameSpace('%TEMP%'); $zip_dest.CopyHere($zip_src.Items(), 1044)"
- powershell -Command "((new-object net.webclient).DownloadFile('http://repo.msys2.org/distrib/i686/msys2-base-i686-20161025.tar.xz', '%TEMP%\msys.tar.xz'))"
- %TEMP%\7za.exe x %TEMP%\msys.tar.xz -so | %TEMP%\7za.exe x -aoa -si -ttar >%TEMP%/7z-msys.log
- REM First run is performed to setup the environment
- %MD%\usr\bin\bash --login -i -c exit
- @echo off
- echo ^
- PGPATH=$(echo "%PGPATH%" ^| sed -e "s@c:\\\\@/c/@i" -e "s@\\\\@/@g"); ^
- if file "$PGPATH/bin/postgres.exe" ^| grep '80386. for MS Windows$'; then ^
- bitness=32; gcc=mingw-w64-i686-gcc; host=i686-w64-mingw32; ^
- else ^
- bitness=64; gcc=mingw-w64-x86_64-gcc; host=x86_64-w64-mingw32; ^
- fi ^&^& ^
- pacman --noconfirm -S tar make diffutils perl git bison flex patch $gcc ^&^& ^
- export PATH=/mingw$bitness/bin:/usr/bin/core_perl:$PATH ^&^& ^
- cd /src ^&^& ^
- wget http://repo.postgrespro.ru/pgpro-10/src/postgrespro-standard-10.3.2.tar.bz2 ^&^& ^
- tar fax postgres*.tar.bz2 ^&^& ^
- cd postgres*/ ^&^& ^
- ./configure --host=$host ^&^& ^
- make -j4 ^&^& ^
- make install ^&^& ^
- export PATH=/usr/local/pgsql/bin:$PATH ^&^& ^
- which pg_config ^&^& ^
- pg_config ^&^& ^
- cd /src ^&^& ^
- git clone https://github.com/postgrespro/pg_tsparser.git ^&^& ^
- cd pg_tsparser* ^&^& ^
- sed -i -s 's/\(OBJS = tsparser.o\) \$(WIN32RES)/\1/' Makefile ^&^& ^
- sed -i -s 's/^\(PGFILEDESC =\)/# \1/' Makefile ^&^& ^
- make USE_PGXS=1 ^&^& ^
- make USE_PGXS=1 install ^&^& ^
- cp *.dll "$PGPATH/lib/" ^&^& ^
- cp *.{sql,control} "$PGPATH/share/extension/" ^&^& ^
- make USE_PGXS=1 installcheck ^
- > %MD%\src\make_check.sh
- %MD%\usr\bin\bash --login -i /src/make_check.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement