12345678910111213141516171819202122232425262728293031323334 |
- #!/bin/bash
- set -e
- PROJECT_PATH=$(cd `dirname $0`; pwd)
- APP_NAME="${PROJECT_PATH##*/}"
- VERSION=`cat VERSION`
- make version=$VERSION
- SPEC_FILE=app.spec
- APP_SERVICE=conf/app.service
- SH_APP=sh/app
- TOOLS_ROOT=`pwd`
- BUILD="${TOOLS_ROOT}/build"
- sed -e "s/%APP_NAME%/$APP_NAME/g" ${APP_SERVICE}.in > conf/${APP_NAME}.service
- sed -e "s/%APP_NAME%/$APP_NAME/g" ${SH_APP}.in > ${SH_APP}
- mkdir -p $BUILD/buildroot/{BUILD,RPMS,S{RPMS,PECS,OURCES}}
- rm -f $BUILD/buildroot/SOURCES/*.tgz
- tar czf $BUILD/buildroot/SOURCES/${APP_NAME}-$VERSION.tgz * .[!.]*
- sed -e "s/%VERSION%/$VERSION/g" ${SPEC_FILE}.in > ${SPEC_FILE}
- sed -i "s/%APP_NAME%/$APP_NAME/g" ${SPEC_FILE}
- sed -i "s/%$APP_NAME%/$APP_NAME/g" ${SPEC_FILE}
- rpmbuild -bb ${SPEC_FILE} --define "_topdir $BUILD/buildroot/"
- rm -rf ./dist
- mkdir ./dist
- cp -rf $BUILD/buildroot/RPMS/* ./dist
- rm -rf $BUILD
|