|
| 1 | +SET PGDIRSRC=Z:\extension-packaging\pg_probackup\windows\postgresql |
| 2 | +SET PGDIR=Z:\inst\ |
| 3 | +SET PGDIRSRC=Z:\pgwininstall\builddir\postgresql\postgresql-11.2.1 |
| 4 | +SET PGDIR=Z:\Program Files\PostgresProEnterprise\11 |
| 5 | +SET APPVERSION=2.1.1 |
| 6 | +SET PG_REG_KEY=SOFTWARE\PostgresPro\X64\PostgresProEnterprise\11\Installations\postgresql-11 |
| 7 | +SET PG_DEF_BRANDING=PostgresPro Enterprise 11 |
| 8 | +SET PRODUCT_NAME=PostgresProEnterprise |
| 9 | +SET BITS=64bit |
| 10 | +SET PGVER=11.1.1 |
| 11 | +SET EDITION=vanilla |
| 12 | +SET APPVERSION=2.1.1 |
| 13 | +SET PRODUCT_NAME=PostgreSQL |
| 14 | + |
| 15 | +SET PERL5LIB=. |
| 16 | + |
| 17 | +rem GOTO :INS |
| 18 | +SET LIB=%LIB%%PGDIR%\lib; |
| 19 | +SET INCLUDE=%INCLUDE%%PGDIR%\include\server;%PGDIR%\include\server\port\win32;%PGDIR%\include\server\port\win32_msvc;%PGDIR%\include;addsrc\;src\; |
| 20 | +set CPU=AMD64 |
| 21 | +REM GOTO :INS |
| 22 | +SET ARCHIVE=pg_probackup-%APPVERSION%.tar.gz |
| 23 | +IF NOT exist .\pg_probackup ( |
| 24 | +echo Download sources ... |
| 25 | +git clone https://github.com/postgrespro/pg_probackup.git -b %APPVERSION% || goto :ERROR |
| 26 | +REM wget -O "%ARCHIVE%" "http://localrepo.l.postgrespro.ru/tarballs/extensions/%ARCHIVE%" || goto :ERROR |
| 27 | +REM MKDIR .\pg_probackup |
| 28 | +REM tar xf %ARCHIVE% -C .\pg_probackup |
| 29 | +) |
| 30 | + |
| 31 | +perl genres.pl "pg_probackup for PostgreSQL" %APPVERSION% exe || GOTO :ERROR |
| 32 | +cp win32ver.rc ./pg_probackup |
| 33 | +cp win32.ico ./pg_probackup |
| 34 | +CD pg_probackup |
| 35 | +mkdir addsrc |
| 36 | +cp "%PGDIRSRC%/src/backend/access/transam/xlogreader.c" addsrc || goto :ERROR |
| 37 | +cp "%PGDIRSRC%/src/backend/utils/hash/pg_crc.c" addsrc || goto :ERROR |
| 38 | +cp "%PGDIRSRC%/src/bin/pg_basebackup/receivelog.c" addsrc || goto :ERROR |
| 39 | +cp "%PGDIRSRC%/src/bin/pg_basebackup/receivelog.h" addsrc || goto :ERROR |
| 40 | +cp "%PGDIRSRC%/src/bin/pg_basebackup/streamutil.c" addsrc || goto :ERROR |
| 41 | +cp "%PGDIRSRC%/src/bin/pg_basebackup/streamutil.h" addsrc || goto :ERROR |
| 42 | +cp "%PGDIRSRC%/src/bin/pg_basebackup/walmethods.c" addsrc |
| 43 | +cp "%PGDIRSRC%/src/bin/pg_basebackup/walmethods.h" addsrc |
| 44 | +cp "%PGDIRSRC%/src/bin/pg_rewind/datapagemap.c" addsrc || goto :ERROR |
| 45 | +cp "%PGDIRSRC%/src/bin/pg_rewind/datapagemap.h" addsrc || goto :ERROR |
| 46 | +cp "%PGDIRSRC%/src/bin/pg_rewind/logging.h" addsrc || goto :ERROR |
| 47 | +cp "%PGDIRSRC%/src/timezone/strftime.c" addsrc || goto :ERROR |
| 48 | +cp "%PGDIRSRC%/src/timezone/private.h" addsrc || goto :ERROR |
| 49 | + |
| 50 | +cp "%PGDIRSRC%/src/interfaces/libpq/pthread-win32.c" addsrc || goto :ERROR |
| 51 | +cp "%PGDIRSRC%/src/interfaces/libpq/pqexpbuffer.h" addsrc || goto :ERROR |
| 52 | +cp "%PGDIRSRC%/src/interfaces/libpq/libpq-int.h" addsrc || goto :ERROR |
| 53 | +cp "%PGDIRSRC%/src/port/pthread-win32.h" addsrc || goto :ERROR |
| 54 | +mkdir addsrc\port |
| 55 | +cp "%PGDIRSRC%/src/port/pthread-win32.h" addsrc/port/ || goto :ERROR |
| 56 | + |
| 57 | +rc.exe win32ver.rc |
| 58 | +CL /MD /O2 src\*.c src\utils\*.c addsrc\*.c /DWIN32 /DFRONTEND /Fepg_probackup.exe /link ws2_32.lib advapi32.lib libpq.lib libpgport.lib libintl.lib zdll.lib iconv.lib libpgcommon.lib win32ver.res || goto :ERROR |
| 59 | +rem libecpg.lib -> libpgtypes.lib libpgfeutils.lib |
| 60 | +mkdir .\..\out |
| 61 | +mkdir .\..\out\bin |
| 62 | +copy pg_probackup.exe .\..\out\bin |
| 63 | + |
| 64 | +mkdir .\..\out_full |
| 65 | +copy pg_probackup.exe .\..\out_full |
| 66 | +cp "%PGDIR%/bin/libpq.dll" ./../out_full |
| 67 | +cp "%PGDIR%/bin/zlib1.dll" ./../out_full |
| 68 | +cp "%PGDIR%/bin/libintl.dll" ./../out_full |
| 69 | +cp "%PGDIR%/bin/libeay32.dll" ./../out_full |
| 70 | +cp "%PGDIR%/bin/libiconv.dll" ./../out_full |
| 71 | +cp "%PGDIR%/bin/ssleay32.dll" ./../out_full |
| 72 | +rem copy C:\Windows\System32\msvcr120.dll .\..\out_full |
| 73 | + |
| 74 | +rem SET ZIP_FILE=%PRODUCT_NAME%_%PGVER%_%BITS%_Pg_probackup%APPVERSION%.zip |
| 75 | +SET ZIP_FILE=pg-probackup-%EDITION%-%PG_MAJOR_VERSION%-%APPVERSION%-%BITS%.zip |
| 76 | +rem 7z.exe a .\..\out\pg_probackup.zip .\..\out\*.* -r |
| 77 | +7z.exe a .\..\%ZIP_FILE% .\..\out\*.* -r |
| 78 | + |
| 79 | +goto :DONE |
| 80 | + |
| 81 | +:ERROR |
| 82 | +ECHO Failed with error #%errorlevel%. |
| 83 | +EXIT /b %errorlevel% |
| 84 | + |
| 85 | +:DONE |
| 86 | +ECHO Done. |
0 commit comments