~veebers/pbuilderjenkins/nux

« back to all changes in this revision

Viewing changes to Builder.sh

  • Committer: Christopher Lee
  • Date: 2012-07-27 00:15:49 UTC
  • Revision ID: chris.lee@canonical.com-20120727001549-3q4bn950s42fkplt
Further additions (stolen, err, taken from mmrazik)

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
rm -rf "$work_dir"
68
68
mkdir "$work_dir"
69
69
 
70
 
# veebers: skipped a bunch of the example, this was within the chrooted section:
71
 
export BUILD_DIR=$(readlink -f ".")
72
 
export RESULT_DIR=$result_dir
73
 
 
74
 
cd "$hook_dir"
75
 
"./D00dependency_hooks"
76
 
 
77
 
#cd "$trunk_dir"
78
 
# Prepare  . . .
79
 
#cd "$hook_dir"
80
 
"./B00build_hooks"
 
70
if [ -z "$target_branch" ]; then
 
71
    # pull main branch and merge in packaging branch
 
72
    bzr branch $main_branch "$work_dir/trunk"
 
73
    #cd "$work_dir/trunk"
 
74
        cd "$work_dir"
 
75
else
 
76
    bzr branch "$target_branch" "$work_dir/trunk"
 
77
    cd "$work_dir/trunk"
 
78
    bzr merge "$main_branch"
 
79
        cd "$work_dir"
 
80
fi
 
81
 
 
82
bzr checkout "$packaging_branch" packaging
 
83
if [ -d 'packaging/debian' ]; then
 
84
    #mv packaging/debian .
 
85
    mv packaging/debian trunk/debian
 
86
    cd "$work_dir/trunk"
 
87
else
 
88
    echo "Packaging branch doesn't include packaging information. Aborting"
 
89
    exit 1
 
90
fi
 
91
 
 
92
# deal with autogen
 
93
 
 
94
# This is potentially dangerous
 
95
# but we force a native source format
 
96
# to prevent from dpkg-buildpackage bailing out
 
97
if [ -f "debian/source/format" ]; then
 
98
    sed -i 's/quilt/native/g' debian/source/format 
 
99
else
 
100
    mkdir -p debian/source 
 
101
    echo '3.0 (native)' > debian/source/format
 
102
fi    
 
103
 
 
104
# Extract some packaging information
 
105
version=`dpkg-parsechangelog | awk '/^Version/ {print $2}' | sed -e "s/\(.*\)-[0-9]ubuntu.*/\1/"`+bzr${trunkrev}
 
106
version=${version}ubuntu0+${packaging_rev}
 
107
sourcename=`dpkg-parsechangelog | awk '/^Source/ {print $2}'`
 
108
# Generate the actual source package
 
109
cd ..
 
110
tar -czf ${sourcename}_${version}.orig.tar.gz trunk
 
111
 
 
112
cd trunk
 
113
 
 
114
 
 
115
if [ -z "$chrooted" ]; then
 
116
    trunk_dir=$(readlink -f ".")
 
117
 
 
118
    export BUILD_DIR=$(readlink -f ".")
 
119
    export RESULT_DIR=$result_dir
 
120
 
 
121
    cd "$hook_dir"
 
122
    "./D00dependency_hooks"
 
123
 
 
124
    cd "$trunk_dir"
 
125
 
 
126
    #sed -i 's/\({GTEST_TEST_COMMAND[_a-zA-Z]*}\)/\1 --gtest_output=xml:.\//' tests/CMakeLists.txt
 
127
 
 
128
    #head -n19 CMakeLists.txt > a.txt
 
129
    #cat >> a.txt <<EOF
 
130
#option (USE_GCOV "Use coverage profiling for this build" ON)
 
131
#if (USE_GCOV)
 
132
#    set (CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -O0 --coverage ")
 
133
#endif (USE_GCOV)
 
134
#EOF
 
135
    #tail -n+20 CMakeLists.txt >> a.txt
 
136
    #mv a.txt CMakeLists.txt
 
137
 
 
138
    mk-build-deps --install --tool 'apt-get -y --force-yes' --build-dep debian/control
 
139
    export DEB_CXXFLAGS_STRIP="-O2"
 
140
    export DEB_CPPFLAGS_STRIP="-O2"
 
141
    export DEB_CFLAGS_STRIP="-O2"
 
142
    export DEB_FFLAGS_STRIP="-O2"
 
143
    yes | debuild -uc -us -d
 
144
 
 
145
    cd "$hook_dir"
 
146
    "./B00build_hooks"
 
147
else
 
148
        echo "Would use pdbuilder"
 
149
fi
 
150
 
 
151
rm -f -- "ReportDir"
81
152