diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a674cdb2eb04ce8620b0e76522afd3723706b49c..bd22078f7e1fb3a7802e98f2ca22cc080feeaf02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: gitlab-registry.cern.ch/scouting-demonstrator/scouting-docker-images/scdaq-builder:1.0.0 +image: gitlab-registry.cern.ch/scouting-demonstrator/scouting-docker-images/scdaq-builder:1.0.1 build_rpm_tag: stage: build diff --git a/scripts/scdaqrpm.sh b/scripts/scdaqrpm.sh index 362cbadcc4812b7d14c9df77411ba632ee8e53a5..885613408826b98d834ad07ffbb27893dfc6bd64 100755 --- a/scripts/scdaqrpm.sh +++ b/scripts/scdaqrpm.sh @@ -24,6 +24,11 @@ BASEDIR=$PWD PARAMCACHE="paramcache" NLINES=1 ASK="1" +RAWVER=$(git describe --tags || echo 'v0.0.0') # If git describe fails, we set a default version number. +VER=$(echo ${RAWVER} | sed 's/^v//' | awk '{split($0,a,"-"); print a[1]}') +REL=$(git rev-list HEAD | wc -l | tr -d ' ') + +echo "Version $VER, release $REL" if [ -n "$1" ]; then if [ "$1" = "--batch" ]; then @@ -95,21 +100,19 @@ rm -rf /tmp/$PACKAGENAME-build-tmp echo "creating new build area" mkdir /tmp/$PACKAGENAME-build-tmp cd /tmp/$PACKAGENAME-build-tmp -#mkdir BUILD -#mkdir RPMS TOPDIR=$PWD echo "working in $PWD" #ls -# we are done here, write the specs and make the fu***** rpm +# we are done here, write the specs and make the rpm cat >scoutdaq.spec <<EOF Name: $PACKAGENAME$pkgsuffix -Version: 0.1.0 -Release: 0%{?dist} -Summary: scouting daq +Version: $VER +Release: $REL +Summary: L1 Scouting DAQ License: gpl -Group: DAQ -Packager: meschi +Group: CMS/L1Scouting +Packager: scouter Source: none %define _tmppath $TOPDIR/scdaq-build BuildRoot: %{_tmppath} @@ -118,16 +121,13 @@ AutoReqProv: no Provides:/opt/scdaq Requires: tbb boost-thread libcurl -Obsoletes: scdaq %description scouting daq %prep -echo "PIPPPPPPPPO" echo $RPM_SOURCE_DIR -echo "PIPPOOOOOOOOO" echo $BASEDIR cp -R $BASEDIR/src SOURCES/ @@ -163,7 +163,6 @@ echo "Copying files to their destination" cp $BASEDIR/init.d/runSCdaq.service usr/lib/systemd/system/runSCdaq.service cp $BASEDIR/init.d/scoutboardResetServer.service usr/lib/systemd/system/scoutboardResetServer.service cp -R $BASEDIR/* opt/scdaq -echo "PIPPOOOOOOOOOOO" pwd cp $TOPDIR/RPMBUILD/BUILD/SOURCES/scdaq opt/scdaq/bin/ cp -R $BASEDIR/etc/scdaq/scdaq.conf etc/scdaq/