Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e691829

Browse files
committed
WIP
1 parent c839300 commit e691829

24 files changed

+158
-180
lines changed

Readme.md

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Directory contains various build scripts.
1515
* 7-Zip
1616
* NSIS
1717
* HTML Help Workshop (for PgAdmin documentation, included in Visual Studio)
18+
* .NET 3.5 (for pg_probackup only)
19+
* WiX toolset (for pg_probackup only)
1820

1921
## Patches
2022

@@ -35,3 +37,9 @@ If you want to use GIT:
3537

3638
* GIT_BRANCH=[git branch name] -- if you sets this variables we will download source from git
3739
* GIT_PATH=[git path] -- git URL, git://git.postgresql.org/git/postgresql.git by default
40+
41+
### probackup build
42+
You can specify several environmental variables depending on desirable result:
43+
44+
* PROBACKUP_VERSION=[2.1.3/2.1.5] - pg_probackup full version
45+

build/helpers/probackup.cmd

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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.

build/helpers/probackup_installer.cmd

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
echo.
2+
echo Building Installer...
3+
4+
5+
>Files.wxs ECHO ^<^?xml version="1.0" encoding="UTF-8"?^>
6+
>>Files.wxs ECHO ^<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"^>
7+
>>Files.wxs ECHO ^<^?include Variables.wxi?^>
8+
>>Files.wxs ECHO ^<Fragment^>
9+
>>Files.wxs ECHO ^<DirectoryRef Id = "INSTALLLOCATION"^>
10+
>>Files.wxs ECHO ^<^Directory Id="BIN" Name="bin"^>
11+
>>Files.wxs ECHO ^<^Component Id="ProductComponent" Guid="$(var.ComponentCode)" Win64="$(var.Win64)"^>
12+
perl genfilelist.pl ./out/bin/*.* Files.wxs
13+
>>Files.wxs ECHO ^<^/Component^>
14+
>>Files.wxs ECHO ^<^/Directory^>
15+
>>Files.wxs ECHO ^<^/DirectoryRef^>
16+
>>Files.wxs ECHO ^<^/Fragment^>
17+
>>Files.wxs ECHO ^<^/Wix^>
18+
19+
SET WIXDIR=C:\Program Files (x86)\WiX Toolset v3.11\bin
20+
perl regenguids.pl Variables.wxi
21+
move Variables.wxi.out Variables.wxi
22+
echo on
23+
"%WIXDIR%\candle" -nologo -dAPPVERSION="%APPVERSION%" -dPG_REG_KEY="%PG_REG_KEY%" -dPG_DEF_BRANDING="%PG_DEF_BRANDING%" Product.wxs Files.wxs || goto :ERROR
24+
25+
rem SET INS_FILE=pg-probackup-%EDITION%-%PG_MAJOR_VERSION%-%APPVERSION%-%BITS%.msi
26+
SET INS_FILE=pg-probackup-%EDITION%-%PG_MAJOR_VERSION%-%APPVERSION%.msi
27+
28+
"%WIXDIR%\light" -sice:ICE03 -sice:ICE25 -sice:ICE82 -sw1101 -nologo -ext WixUIExtension -cultures:ru-ru -o %INS_FILE% Files.wixobj Product.wixobj || goto :ERROR
29+
30+
echo.
31+
echo Building Full Installer...
32+
33+
>Files.wxs ECHO ^<^?xml version="1.0" encoding="UTF-8"?^>
34+
>>Files.wxs ECHO ^<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"^>
35+
>>Files.wxs ECHO ^<^?include Variables.wxi?^>
36+
>>Files.wxs ECHO ^<Fragment^>
37+
>>Files.wxs ECHO ^<DirectoryRef Id = "INSTALLLOCATION"^>
38+
>>Files.wxs ECHO ^<^Component Id="ProductComponent" Guid="$(var.ComponentCode)" Win64="$(var.Win64)"^>
39+
perl genfilelist.pl ./out_full/*.* Files.wxs
40+
>>Files.wxs ECHO ^<^/Component^>
41+
>>Files.wxs ECHO ^<^/DirectoryRef^>
42+
>>Files.wxs ECHO ^<^/Fragment^>
43+
>>Files.wxs ECHO ^<^/Wix^>
44+
"%WIXDIR%\candle" -nologo -dAPPVERSION="%APPVERSION%" -dPG_REG_KEY="%PG_REG_KEY%" -dPG_DEF_BRANDING="%PG_DEF_BRANDING%" Product_separate.wxs Files.wxs || goto :ERROR
45+
46+
rem SET INS_FILE=pg-probackup-%EDITION%-%PG_MAJOR_VERSION%-%APPVERSION%-%BITS%-standalone.msi
47+
SET INS_FILE=pg-probackup-%EDITION%-%PG_MAJOR_VERSION%-%APPVERSION%-standalone-en.msi
48+
49+
"%WIXDIR%\light" -sice:ICE03 -sice:ICE25 -sice:ICE82 -sw1101 -nologo -ext WixUIExtension -cultures:en-us -o %INS_FILE% Files.wixobj Product_separate.wixobj || goto :ERROR
50+
51+
SET INS_FILE=pg-probackup-%EDITION%-%PG_MAJOR_VERSION%-%APPVERSION%-standalone-ru.msi
52+
53+
"%WIXDIR%\light" -sice:ICE03 -sice:ICE25 -sice:ICE82 -sw1101 -nologo -ext WixUIExtension -cultures:ru-ru -o %INS_FILE% Files.wixobj Product_separate.wixobj || goto :ERROR
54+
55+
56+
goto :DONE
57+
58+
59+
:ERROR
60+
ECHO Failed with error #%errorlevel%.
61+
EXIT /b %errorlevel%
62+
63+
:DONE
64+
ECHO Done.
File renamed without changes.

pg_probackup/build_pro_backup.bat

-136
This file was deleted.

pg_probackup/build_separate.bat

-20
This file was deleted.

pg_probackup/clean.bat

-14
This file was deleted.

pg_probackup/config.cmd

-10
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)