summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-rpm-package20
1 files changed, 6 insertions, 14 deletions
diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index c9f4e10..6edd039 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -185,11 +185,15 @@ build_packages() {
git clone --local "$PROJECT_DIR" "$TEMP_DIR/$PROJECT/"
cd $TEMP_DIR
rm -Rf "$PROJECT/.git"
+ cp $PROJECT/$PROJECT.spec .
+ UPSTREAM_VERSION=$(cat $PROJECT.spec | egrep "^Version:.*" | awk '{ print $2 }')
+ GITREV=$(cd $PROJECT && gitrevno && cd - 1>/dev/null)
+
mv $TEMP_DIR/$PROJECT $TEMP_DIR/$PROJECT-$UPSTREAM_VERSION
- tar -czf ~/rpmbuild/SOURCES/$PROJECT-$UPSTREAM_VERSION.tar.gz $TEMP_DIR/$PROJECT-$UPSTREAM_VERSION
- cp $PROJECT/$PROJECT.spec ..
+ tar -czf ~/rpmbuild/SOURCES/$PROJECT-$UPSTREAM_VERSION.tar.gz $PROJECT-$UPSTREAM_VERSION
cd && rm $TEMP_DIR/$PROJECT -Rf
+
cat "$PROJECT_DIR/RPM_BUILDS_FOR" | egrep -v '(^$|^#.*$)' | while read line; do
l_DIST="$(echo ${line/: /:} | cut -d":" -f1 | tr [:upper:] [:lower:])"
l_CODENAMES="${CODENAMES:-$(echo ${line/: /:} | cut -d":" -f2- | tr [:upper:] [:lower:])}"
@@ -198,18 +202,6 @@ build_packages() {
test -z $CODENAMES || echo $line | grep $CODENAMES || break
- TEMP_DIR="$(mktemp -d --tmpdir=$TEMP_BASE)"
- mkdir -p "$TEMP_DIR/$PROJECT"
- chmod 2770 "$TEMP_DIR" -Rf
-
- cd "$PROJECT_DIR"
- git clone --local "$PROJECT_DIR" "$TEMP_DIR/$PROJECT/"
- cd "$TEMP_DIR/$PROJECT"
- git checkout $CHECKOUT || git checkout master
-
- GITREV=$(gitrevno)
- UPSTREAM_VERSION=$(cat $PROJECT.spec | egrep "^Version:.*" | awk '{ print $2 }')
-
# modify the section for non-main package builds
### TODO: How to host different builds (releases / nightlies in the same repository???)