-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild-linux-x64.sh
95 lines (66 loc) · 4.47 KB
/
build-linux-x64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
################################################################################
# Build preparation
################################################################################
_prep_Npgsql_linux_x64() {
# Enter the source directory and cleanup if required
cd $WD/Npgsql/source
if [ -e Npgsql.linux-x64 ];
then
echo "Removing existing Npgsql.linux-x64 source directory"
rm -rf Npgsql.linux-x64 || _die "Couldn't remove the existing Npgsql.linux-x64 source directory (source/Npgsql.linux-x64)"
fi
echo "Creating staging directory ($WD/Npgsql/source/Npgsql.linux-x64)"
mkdir -p $WD/Npgsql/source/Npgsql.linux-x64 || _die "Couldn't create the Npgsql.linux-x64 directory"
# Grab a copy of the source tree
cp -R Mono2.0/* Npgsql.linux-x64 || _die "Failed to copy the source code (source/Npgsql-$PG_VERSION_Npgsql)"
chmod -R ugo+w Npgsql.linux-x64 || _die "Couldn't set the permissions on the source directory"
# Remove any existing staging directory that might exist, and create a clean one
if [ -e $WD/Npgsql/staging/linux-x64 ];
then
echo "Removing existing staging directory"
rm -rf $WD/Npgsql/staging/linux-x64 || _die "Couldn't remove the existing staging directory"
fi
echo "Creating staging directory ($WD/Npgsql/staging/linux-x64)"
mkdir -p $WD/Npgsql/staging/linux-x64 || _die "Couldn't create the staging directory"
chmod ugo+w $WD/Npgsql/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory"
}
################################################################################
# PG Build
################################################################################
_build_Npgsql_linux_x64() {
cd $WD
}
################################################################################
# PG Build
################################################################################
_postprocess_Npgsql_linux_x64() {
cp -R $WD/Npgsql/source/Npgsql.linux-x64/* $WD/Npgsql/staging/linux-x64 || _die "Failed to copy the Npgsql Source into the staging directory"
chmod -R ugo+rx $WD/Npgsql/staging/linux-x64/docs
cd $WD/Npgsql
# Setup the installer scripts.
mkdir -p staging/linux-x64/installer/npgsql || _die "Failed to create a directory for the install scripts"
cp scripts/linux/removeshortcuts.sh staging/linux-x64/installer/npgsql/removeshortcuts.sh || _die "Failed to copy the removeshortcuts script (scripts/linux/removeshortcuts.sh)"
chmod ugo+x staging/linux-x64/installer/npgsql/removeshortcuts.sh
cp scripts/linux/createshortcuts.sh staging/linux-x64/installer/npgsql/createshortcuts.sh || _die "Failed to copy the createshortcuts.sh script (scripts/linux/createshortcuts.sh)"
chmod ugo+x staging/linux-x64/installer/npgsql/createshortcuts.sh
# Setup Launch Scripts
mkdir -p staging/linux-x64/scripts || _die "Failed to create a directory for the launch scripts"
cp scripts/linux/launchbrowser.sh staging/linux-x64/scripts/launchbrowser.sh || _die "Failed to copy the launchbrowser script (scripts/linux/launchbrowser.sh)"
chmod ugo+x staging/linux-x64/scripts/launchbrowser.sh
# Setup the Npgsql xdg Files
mkdir -p staging/linux-x64/scripts/xdg || _die "Failed to create a directory for the launch scripts"
cp resources/xdg/pg-launchDocsAPI.desktop staging/linux-x64/scripts/xdg/pg-launchDocsAPI.desktop || _die "Failed to copy the xdg files "
cp resources/xdg/pg-launchUserManual.desktop staging/linux-x64/scripts/xdg/pg-launchUserManual.desktop || _die "Failed to copy the xdg files "
cp resources/xdg/pg-npgsql.directory staging/linux-x64/scripts/xdg/pg-npgsql.directory || _die "Failed to copy the xdg files "
cp resources/xdg/pg-postgresql.directory staging/linux-x64/scripts/xdg/pg-postgresql.directory || _die "Failed to copy the xdg files "
# Copy in the menu pick images
mkdir -p staging/linux-x64/scripts/images || _die "Failed to create a directory for the menu pick images"
cp resources/*.png staging/linux-x64/scripts/images || _die "Failed to copy the menu pick images (resources/*.png)"
mkdir -p staging/linux-x64/installer/xdg || _die "Failed to create a directory for the menu pick xdg files"
# Copy in installation xdg Files
cp -R $WD/scripts/xdg/xdg* staging/linux-x64/installer/xdg || _die "Failed to copy the xdg files "
# Build the installer
"$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer"
cd $WD
}