summaryrefslogtreecommitdiffstats
path: root/build/apt/do.sh
blob: 345cde0243892b105c61b991bf863302d549db2e (plain)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash

################################################################################
#
# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt)
#        http://www.pensec.it
#        mail@pensec.it
# 
# Diese Software wird ohne ausdrückliche oder implizierte Garantie
# bereitgestellt. Auf keinen Fall können die Autoren für irgendwelche Schäden,
# die durch die Benutzung dieser Software entstehen, haftbar gemacht werden.
# 
# Es ist dem Auftraggeber gestattet diese Software für jeden Zweck, inklusive
# kommerzieller Anwendungen, zu benutzten und zu verändern aber nicht
# weiterzuverbreiten, solange folgende Bedingungen erfüllt sind:
# 
#     1. Die Herkunft dieser Software darf nicht falsch dargestellt werden; Sie
#        dürfen nicht angeben, dass Sie die ursprüngliche Software geschrieben
#        haben. Wenn Sie diese Software in einem Produkt benutzten, würde eine
#        Erwähnung geschätzt werden, sie ist aber nicht erforderlich.
#     2. Veränderte Quelltextversionen müssen deutlich als solche
#        gekennzeichnet werden und dürfen nicht als die Originalsoftware
#        dargestellt werden.
#     3. Diese Notiz darf in den Quelltexten nicht verändert oder gelöscht
#        werden.
#
################################################################################



#####
#
# To build a Debian/Ubuntu package simply run this script. It will prompt you
# for the repository to build from.
#
# Dependencies: debconf (>= 0.2.17), dpkg, sun-java6-jdk, scala, mysql-client,
#     libmysql-java, bash, mercurial | git-core
#
#####



#####
#
# There has to be a better way of doing this ;-)
#
REPOSITORY_0_URL="https://etherpad.googlecode.com/hg/trunk"
REPOSITORY_0_NAME="deprecated"
REPOSITORY_0_TYPE="hg"
REPOSITORY_1_URL="git://github.com/ether/pad.git"
REPOSITORY_1_NAME="official"
REPOSITORY_1_TYPE="git"
REPOSITORY_2_URL="git://github.com/redhog/pad.git"
REPOSITORY_2_NAME="devel"
REPOSITORY_2_TYPE="git"
REPOSITORY_3_URL="git://github.com/johnyma22/pad.git"
REPOSITORY_3_NAME="johny"
REPOSITORY_3_TYPE="git"
REPOSITORY_4_URL="git://github.com/Pita/pad.git"
REPOSITORY_4_NAME="pita"
REPOSITORY_4_TYPE="git"
REPOSITORY_5_URL="./../../"
REPOSITORY_5_NAME="local"
REPOSITORY_5_TYPE="git"


# Tell the user his choises
echo "Please choose the repository to build a debian package from:"
echo ""

for i in {0..5}
do
	URL="REPOSITORY_${i}_URL"
	NAME="REPOSITORY_${i}_NAME"
	TYPE="REPOSITORY_${i}_TYPE"

	echo "	${i})	${!NAME}	${!URL}"
done
echo ""
read -p "Repository id: " REPOSITORY



# Test if user's too stupid to input correct number
URL="REPOSITORY_${REPOSITORY}_URL"
NAME="REPOSITORY_${REPOSITORY}_NAME"
TYPE="REPOSITORY_${REPOSITORY}_TYPE"

if [ "" == "${!URL}" ]; then
	echo "Invalid repository id \"${REPOSITORY}\""
	exit 1
fi


# Communicate repository details to build script
export REPOSITORY_URL="${!URL}"
export REPOSITORY_NAME="${!NAME}"
export REPOSITORY_TYPE="${!TYPE}"
#
#####



#####
#
# Is a complete rebuild necessary or is a simple update sufficient
#
echo ""
read -p "Purge before rebuild (yes/no) [n]: " REBUILD

if [ "y" == "${REBUILD}" ]; then
	echo "You answered \"${REBUILD}\", will purge before rebuilding"
	REBUILD="rebuild"
else
	echo "You answered \"${REBUILD}\", will try ${!TYPE} pull before rebuilding"
fi
#
#####



#####
#
# Tell user what we're going to to and then do it
#
echo ""
echo "Will build package etherpad-${!NAME} form ${!TYPE}:${!URL}, please be patient..."
echo ""

bash -c "./build/build.sh ${REBUILD}"
#
#####