Changeset 913


Ignore:
Timestamp:
05/22/13 19:00:22 (7 years ago)
Author:
olahaye
Message:

[rpm&deb packaging] Now fixes the VERSION outside current directory (can be SVN)
This avoids .in files and let generate tarballs and packages (binary and sources) without any VERSION values.
make deb or rpm or install even from svn is now safe from "sed -i -e"

Location:
branches/1.0
Files:
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/1.0/Makefile

    r911 r913  
    3636tarball:        tarball-gzip tarball-bzip
    3737
    38 tarball-gzip:   ${REQUIRED} ./pkg/rpm/jobmonarch.spec ./debian/changelog
    39         mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}
    40         ( rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \
     38$(TMPDIR)/.monarch_buildroot: ${REQUIRED} Makefile
     39        @mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}
     40        @( rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \
    4141        . ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION} )
    42         ( cd ${TMPDIR}/.monarch_buildroot; tar zcvf ganglia_jobmonarch-${VERSION}.tar.gz ./ganglia_jobmonarch-${VERSION} )
    43         mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.gz ..
     42        @sed -i -e 's|__VERSION__|$(VERSION)|g' -e 's/__RELEASE__/$(RELEASE)/g' \
     43                ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}/jobmond/jobmond.py \
     44                ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}/jobarchived/jobarchived.py \
     45                ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}/web/addons/job_monarch/version.php \
     46                ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}/pkg/rpm/jobmonarch.spec \
     47                ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}/debian/changelog
    4448
    45 tarball-bzip:   ${REQUIRED} ./pkg/rpm/jobmonarch.spec ./debian/changelog
    46         mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}
    47         ( rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \
    48         . ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION} )
    49         ( cd ${TMPDIR}/.monarch_buildroot; tar jcvf ganglia_jobmonarch-${VERSION}.tar.bz2 ./ganglia_jobmonarch-${VERSION} )
    50         mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.bz2 ..
    5149
    52 rpmspec: ./pkg/rpm/jobmonarch.spec
     50tarball-gzip:   $(TMPDIR)/.monarch_buildroot ${REQUIRED}
     51        @( cd ${TMPDIR}/.monarch_buildroot; tar zcf ganglia_jobmonarch-${VERSION}.tar.gz ./ganglia_jobmonarch-${VERSION} )
     52        @mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.gz ..
     53        @rm -rf ${TMPDIR}/.monarch_buildroot
     54        @echo "Wrote: ../ganglia_jobmonarch-${VERSION}.tar.gz"
    5355
    54 ./pkg/rpm/jobmonarch.spec: pkg/rpm/jobmonarch.spec.in Makefile
    55         sed -e 's/__VERSION__/${VERSION}/g' -e 's/__RELEASE__/${RELEASE}/g' ./pkg/rpm/jobmonarch.spec.in > ./pkg/rpm/jobmonarch.spec
    56         @if test -r /etc/debian_version; then \
    57                 sed -i -e '/BuildRequires/d' ./pkg/rpm/jobmonarch.spec; \
    58         fi
     56tarball-bzip:   $(TMPDIR)/.monarch_buildroot ${REQUIRED}
     57        @( cd ${TMPDIR}/.monarch_buildroot; tar jcf ganglia_jobmonarch-${VERSION}.tar.bz2 ./ganglia_jobmonarch-${VERSION} )
     58        @mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.bz2 ..
     59        @rm -rf ${TMPDIR}/.monarch_buildroot
     60        @echo "Wrote: ../ganglia_jobmonarch-${VERSION}.tar.bz2"
    5961
    6062rpm: tarball-bzip
    61         rpmbuild -tb ../ganglia_jobmonarch-${VERSION}.tar.bz2
     63        # Binary package will reflect most distro where ganglia default location is /usr/share/ganglia
     64        rpmbuild -tb --define '%custom_web_prefixdir /usr/share/ganglia' ../ganglia_jobmonarch-${VERSION}.tar.bz2
    6265
    6366srpm: tarball-bzip
     
    6669debchangelog: ./debian/changelog
    6770
    68 ./debian/changelog: ./debian/changelog.in Makefile
    69         sed -e 's/__VERSION__/${VERSION}/g' -e 's/__RELEASE__/${RELEASE}/g' ./debian/changelog.in > ./debian/changelog
    70 
    71 deb: ${REQUIRED} ./debian ./debian/changelog
    72         dpkg-buildpackage -b -uc -us
     71deb: ${REQUIRED} $(TMPDIR)/.monarch_buildroot ./debian
     72        @( cd ${TMPDIR}/.monarch_buildroot; dpkg-buildpackage -b -uc -us )
     73        @rm -rf ${TMPDIR}/.monarch_buildroot
     74        @echo "Wrote:"
     75        @ls -1 ${TMPDIR}/jobmonarch*$(VERSION)*.deb
    7376
    7477install:  ${REQUIRED}
     
    158161clean:
    159162        @rm -rf ${TMPDIR}/.monarch_buildroot
    160         @rm -rf ./pkg/rpm/jobmonarch.spec
    161163        @(cd ./debian; rm -rf files *.log *.substvars jobmonarch/ jobmonarch-jobmond/ jobmonarch-jobarchived/ jobmonarch-webfrontend/ tmp/)
    162164        @rm -f web/addons/job_monarch/conf.php
  • branches/1.0/jobarchived/jobarchived.py

    r895 r913  
    2424import getopt, syslog, ConfigParser, sys
    2525
    26 VERSION='1.1'
     26VERSION='__VERSION__'
    2727
    2828def usage( ver ):
  • branches/1.0/jobmond/jobmond.py

    r903 r913  
    3131from glob import glob
    3232
    33 VERSION='1.1'
     33VERSION='__VERSION__'
    3434
    3535def usage( ver ):
  • branches/1.0/web/addons/job_monarch/version.php

    r895 r913  
    2222 */
    2323
    24 $monarchversion = "1.1";
     24$monarchversion = "__VERSION__";
    2525?>
Note: See TracChangeset for help on using the changeset viewer.