Advertisement
Guest User

Untitled

a guest
May 8th, 2018
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rem Install Postgres Pro for Windows from https://postgrespro.com/products/postgrespro/download/10.3.2
  2. SET PGPATH=C:\Program Files\PostgresPro\10
  3.  
  4. cd /D c:\
  5. SET MD=c:\msys32
  6. rmdir /S /Q %MD%
  7. mkdir %MD%
  8. mkdir %MD%\src
  9.  
  10. powershell -Command "((new-object net.webclient).DownloadFile('https://www.7-zip.org/a/7za920.zip', '%TEMP%\7z.zip'))"
  11. 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)"
  12. powershell -Command "((new-object net.webclient).DownloadFile('http://repo.msys2.org/distrib/i686/msys2-base-i686-20161025.tar.xz', '%TEMP%\msys.tar.xz'))"
  13. %TEMP%\7za.exe x %TEMP%\msys.tar.xz -so | %TEMP%\7za.exe  x -aoa -si -ttar >%TEMP%/7z-msys.log
  14.  
  15. REM First run is performed to setup the environment
  16. %MD%\usr\bin\bash --login -i -c exit
  17.  
  18. @echo off
  19. echo ^
  20. PGPATH=$(echo "%PGPATH%" ^| sed -e "s@c:\\\\@/c/@i" -e "s@\\\\@/@g"); ^
  21. if file "$PGPATH/bin/postgres.exe" ^| grep '80386. for MS Windows$'; then ^
  22. bitness=32; gcc=mingw-w64-i686-gcc; host=i686-w64-mingw32; ^
  23. else ^
  24. bitness=64; gcc=mingw-w64-x86_64-gcc; host=x86_64-w64-mingw32; ^
  25. fi ^&^& ^
  26. pacman --noconfirm -S tar make diffutils perl git bison flex patch $gcc ^&^& ^
  27. export PATH=/mingw$bitness/bin:/usr/bin/core_perl:$PATH ^&^& ^
  28. cd /src ^&^& ^
  29. wget http://repo.postgrespro.ru/pgpro-10/src/postgrespro-standard-10.3.2.tar.bz2 ^&^& ^
  30. tar fax postgres*.tar.bz2 ^&^& ^
  31. cd postgres*/ ^&^& ^
  32. ./configure --host=$host ^&^& ^
  33. make -j4 ^&^& ^
  34. make install ^&^& ^
  35. export PATH=/usr/local/pgsql/bin:$PATH ^&^& ^
  36. which pg_config ^&^& ^
  37. pg_config ^&^& ^
  38. cd /src ^&^& ^
  39. git clone https://github.com/postgrespro/pg_tsparser.git ^&^& ^
  40. cd pg_tsparser* ^&^& ^
  41. sed -i -s 's/\(OBJS = tsparser.o\) \$(WIN32RES)/\1/' Makefile ^&^& ^
  42. sed -i -s 's/^\(PGFILEDESC =\)/# \1/' Makefile ^&^& ^
  43. make USE_PGXS=1 ^&^& ^
  44. make USE_PGXS=1 install ^&^& ^
  45. cp *.dll "$PGPATH/lib/" ^&^& ^
  46. cp *.{sql,control} "$PGPATH/share/extension/" ^&^& ^
  47. make USE_PGXS=1 installcheck ^
  48.  
  49. > %MD%\src\make_check.sh
  50. %MD%\usr\bin\bash --login -i /src/make_check.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement