|
72 | 72 | # Check if the default directory exists
|
73 | 73 | echo FLEDGE_ROOT = ${FLEDGE_ROOT}
|
74 | 74 | if [ "${FLEDGE_ROOT}" = "" ]; then
|
75 |
| -echo "Notification server cannot be compiled: FLEDGE_ROOT environment variable is not set." |
| 75 | +echo "${REPO_NAME} service cannot be compiled: FLEDGE_ROOT environment variable is not set." |
76 | 76 | echo "Specify the base directory for Fledge and set the variable with:"
|
77 | 77 | echo "export FLEDGE_ROOT=<basedir>"
|
78 | 78 | exit 1
|
79 | 79 | fi
|
80 | 80 |
|
81 | 81 | if [ ! -d "${FLEDGE_ROOT}" ]; then
|
82 |
| -echo "Notification server cannot be compiled: ${FLEDGE_ROOT} is not a valid directory." |
| 82 | +echo "${REPO_NAME} service cannot be compiled: ${FLEDGE_ROOT} is not a valid directory." |
83 | 83 | echo "Specify the base directory for Fledge and set the variable with:"
|
84 | 84 | echo "export FLEDGE_ROOT=<basedir>"
|
85 | 85 | exit 1
|
|
137 | 137 | pkg_name="${REPO_NAME}"
|
138 | 138 |
|
139 | 139 | if [ -f "${GIT_ROOT}/VERSION" ]; then
|
140 |
| - version=`cat "${GIT_ROOT}/VERSION" | tr -d ' ' | grep "notification_version" | head -1 | sed -e 's/\(.*\)version\([>=|>|<|<=|=]*\)\(.*\)/\3/g'` |
| 140 | + version=`cat "${GIT_ROOT}/VERSION" | tr -d ' ' | grep "${service_name}_version" | head -1 | sed -e 's/\(.*\)version\([>=|>|<|<=|=]*\)\(.*\)/\3/g'` |
141 | 141 | fledge_version=`cat ${GIT_ROOT}/VERSION| tr -d ' ' | grep 'fledge_version' | head -1 | sed -e 's/\(.*\)version\([>=|>|<|<=|=]*\)\(.*\)/\2 \3/g'`
|
142 | 142 | else
|
143 | 143 | echo Unable to determine version of package to create
|
|
207 | 207 | sed -i "s/fledge,/fledge ${fledge_version},/" SPECS/service.spec
|
208 | 208 | sed -i "s/fledge$/fledge ${fledge_version}/" SPECS/service.spec
|
209 | 209 | sed -i "s/__VCS__/${git_tag_info:1}/g" SPECS/service.spec
|
| 210 | + sed -i "s/__SERVICE_NAME__/${service_name}/g" SPECS/service.spec |
210 | 211 |
|
211 | 212 | cat > /tmp/sed.script.$$ << EOF
|
212 | 213 | /__DESCRIPTION__/ {
|
|
232 | 233 | mkdir -p python/fledge/plugins/notificationRule
|
233 | 234 | fi
|
234 | 235 | mkdir -p ${install_dir}
|
235 |
| - cp -R --preserve=links ${GIT_ROOT}/build/C/${install_dir}/notification/fledge* "${install_dir}/" |
| 236 | + cp -R --preserve=links ${GIT_ROOT}/build/C/${install_dir}/${service_name}/fledge* "${install_dir}/" |
236 | 237 | echo "Done."
|
237 | 238 | cd ..
|
238 | 239 | find -L . -type f -exec echo '%{install_path}/'{} \; >> ../../../../SPECS/service.spec
|
|
243 | 244 | # Full Package name
|
244 | 245 | fullname="${package_name}.${arch}.rpm"
|
245 | 246 | # Move final package and its spec file to archive/arch directory
|
246 |
| - cp ${BUILD_ROOT}/${package_name}/RPMS/${arch}/${fullname} ${archive}/${arch}/${fullname} |
247 |
| - cp ${BUILD_ROOT}/${package_name}/SPECS/service.spec ${archive}/${arch} |
| 247 | + mkdir -p "${archive}/$arch/${service_name}" |
| 248 | + cp ${BUILD_ROOT}/${package_name}/RPMS/${arch}/${fullname} ${archive}/${arch}/${service_name}/${fullname} |
| 249 | + cp ${BUILD_ROOT}/${package_name}/SPECS/service.spec ${archive}/${arch}/${service_name} |
248 | 250 | # Remove /tmp cloned directory
|
249 | 251 | rm -rf /tmp/${REPO_NAME}
|
250 | 252 | exit 0
|
|
0 commit comments