156
156
# Print the summary of findings
157
157
echo " The package root directory is : ${GIT_ROOT} "
158
158
echo " The package build directory is : ${BUILD_ROOT} "
159
- echo " The Fledge required version : ${fledge_version} "
160
- echo " The Fledge service ${service_name} version is : ${version} "
159
+ echo " The Fledge required version : ${fledge_version} "
160
+ echo " The Fledge service ${service_name} version is : ${version} "
161
161
echo " The architecture is set as : ${arch} "
162
162
echo " The package will be built in : ${archive} /${architecture} "
163
163
echo " The package name is : ${package_name} "
187
187
if [ -d " ${package_name} " ]; then
188
188
rm -rf ${package_name} *
189
189
fi
190
- mkdir " ${package_name} "
190
+ mkdir -p " ${package_name} "
191
191
192
192
# Populate the package directory with RPM files
193
193
echo -n " Populating the package and updating version file..."
@@ -211,35 +211,35 @@ EOF
211
211
sed -i -f /tmp/sed.script.$$ SPECS/service.spec
212
212
rm /tmp/sed.script.$$
213
213
214
- mkdir BUILDROOT
214
+ # RPM file structure
215
+ echo " Copying artifacts..."
216
+ mkdir -p BUILDROOT
215
217
cd BUILDROOT
216
218
mkdir -p ${package_name} -1.${arch}
217
219
cd ${package_name} -1.${arch}
218
-
219
220
mkdir -p usr/local/fledge
220
221
cd usr/local/fledge
221
222
if [ " ${service_name} " = " notification" ]; then
222
223
mkdir -p plugins/notificationDelivery
223
224
mkdir -p plugins/notificationRule
225
+ mkdir -p python/fledge/plugins/notificationDelivery
226
+ mkdir -p python/fledge/plugins/notificationRule
224
227
fi
225
228
mkdir -p ${install_dir}
226
229
cp -R --preserve=links ${GIT_ROOT} /build/C/${install_dir} /notification/fledge* " ${install_dir} /"
227
230
echo " Done."
228
-
229
231
cd ..
230
232
find -L . -type f -exec echo ' %{install_path}/' {} \; >> ../../../../SPECS/service.spec
231
233
cd " ${BUILD_ROOT} "
232
- echo " Building the package..."
234
+ echo " Building the RPM package..."
233
235
rpmbuild --define " _topdir ${BUILD_ROOT} /${package_name} " --noclean -bb ${BUILD_ROOT} /${package_name} /SPECS/service.spec
234
236
echo " Building Complete."
235
-
236
237
# Full Package name
237
238
fullname=" ${package_name} -1.${arch} .rpm"
238
-
239
239
# Move final package and its spec file to archive/arch directory
240
240
cp ${BUILD_ROOT} /${package_name} /RPMS/${arch} /${fullname} ${archive} /${arch} /${fullname}
241
241
cp ${BUILD_ROOT} /${package_name} /SPECS/service.spec ${archive} /${arch}
242
-
242
+ # Remove /tmp cloned directory
243
243
rm -rf /tmp/${REPO_NAME}
244
244
exit 0
245
245
done
0 commit comments