Changeset 841 for branches/1.0/Makefile


Ignore:
Timestamp:
04/25/13 16:54:27 (11 years ago)
Author:
olahaye
Message:

[Makefile/rpm packaging] Reworked rpm packaging. Still need to fix %post for
systemd enabled system (normal script hangs).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/Makefile

    r840 r841  
    22#
    33TMPDIR = /tmp
    4 DESTDIR = /usr/local
     4
     5# Where to install
     6DESTDIR =
     7
     8# Install prefix
     9PREFIX = /usr/local
     10
     11# What is the location of the Ganglia web frontend
     12# i.e.: where to we install Job Monarch's web frontend addon
     13#
     14GANGLIA_ROOT = $(PREFIX)/ganglia
     15
     16# Where jobarchived RRDS are stored
     17JOBARCHIVE_RRDS = $(PREFIX)/jobmonarch
    518
    619# Clear this if you don't want to use ${FAKEROOT}
    720#
    821FAKEROOT = fakeroot
    9 
    10 # What is the location of the Ganglia web frontend
    11 # i.e.: where to we install Job Monarch's web frontend addon
    12 #
    13 WEBDIR = /var/www/ganglia
    1422
    1523VERSION = 1.0
     
    2533tarball:        tarball-gzip tarball-bzip
    2634
    27 tarball-gzip:   ${REQUIRED} rpmspec
     35tarball-gzip:   ${REQUIRED} ./pkg/rpm/jobmonarch.spec
    2836        mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}
    2937        ( rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \
     
    3240        mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.gz ..
    3341
    34 tarball-bzip:   ${REQUIRED} rpmspec
     42tarball-bzip:   ${REQUIRED} ./pkg/rpm/jobmonarch.spec
    3543        mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}
    3644        ( rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \
     
    3947        mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.bz2 ..
    4048
    41 rpmspec: pkg/rpm/jobmonarch.spec.in
    42         sed -e 's/__VERSION__/$(VERSION)/g' -e 's/__RELEASE__/$(RELEASE)/g' ./pkg/rpm/jobmonarch.spec.in > jobmonarch.spec
     49rpmspec: ./pkg/rpm/jobmonarch.spec
    4350
    44 debpkgdir: pkg/deb/debian
    45         rsync -a --exclude=.svn pkg/deb/debian debian
     51./pkg/rpm/jobmonarch.spec: pkg/rpm/jobmonarch.spec.in
     52        sed -e 's/__VERSION__/$(VERSION)/g' -e 's/__RELEASE__/$(RELEASE)/g' ./pkg/rpm/jobmonarch.spec.in > ./pkg/rpm/jobmonarch.spec
     53
     54debian: pkg/deb/debian
     55        rsync -a --exclude=.svn pkg/deb/debian ./
    4656        sed -i -e 's/^Version:.*$//Version: $(VERSION)-$(RELEASE)/g' ./debian/control
    4757
     
    4959        rpmbuild -tb ../ganglia_jobmonarch-${VERSION}.tar.bz2
    5060
    51 deb: debpkgdir
     61deb: debian
    5262        dpkg-buildpackage -b
    5363
    5464install:
    55         # Files in SBIN_DIR
    56         install -m 0755 -d $(DESTDIR)/usr/sbin
    57         install -m 0755 jobmond/jobmond.py $(DESTDIR)/usr/sbin/
    58         install -m 0755 jobarchived/jobarchived.py $(DESTDIR)/usr/sbin/
    59         (cd $(DESTDIR)/usr/sbin/; ln -s jobmond.py jobmond; ln -s jobarchived.py jobarchived)
    60         #
    61         # Files specific to distros if /etc/sysconfig => rpm else (/etc/default => debian)
    62         if test -d /etc/sysconfig; then \
     65        @#
     66        @# Set the correct GANGLIA_PATH.
     67        @#
     68        @echo "\nUsing $(GANGLIA_ROOT) as Ganglia root installation path. If it's not what"
     69        @echo "you want, use make GANGLIA_ROOT=/path/to/your/ganglia/root ."
     70        @sed -i -e 's|/var/www/ganglia/|$(GANGLIA_ROOT)/|g' web/addons/job_monarch/conf.php
     71        @#
     72        @# Set the correct JOBARCHIVE_RRDS in jobarchve.conf and ganglia conf.php
     73        @#
     74        @echo "\nUsing $(JOBARCHIVE_RRDS) as jobarchive path to  store rrds files. If it's not what"
     75        @echo "you want, use make JOBARCHIVE_RRDS=/path/to/you/jobarchived/rrdsfiles ."
     76        @sed -i -e 's|/var/lib/jobarchive|$(JOBARCHIVE_RRDS)|g' jobarchived/jobarchived.conf web/addons/job_monarch/conf.php
     77        @#
     78        @# Files in SBIN_DIR
     79        @#
     80        @echo "\nInstalling jobmond.py and jobarchived.py to $(PREFIX)/sbin"
     81        @install -m 0755 -d $(DESTDIR)$(PREFIX)/sbin
     82        @install -m 0755 jobmond/jobmond.py $(DESTDIR)$(PREFIX)/sbin/
     83        @install -m 0755 jobarchived/jobarchived.py $(DESTDIR)$(PREFIX)/sbin/
     84        @(cd $(DESTDIR)$(PREFIX)/sbin/; ln -s jobmond.py jobmond; ln -s jobarchived.py jobarchived)
     85        @#
     86        @# Files specific to distros if /etc/sysconfig => rpm else (/etc/default => debian)
     87        @#
     88        @echo "\nInstalling service files in $(DESTDIR)/etc"
     89        @if test -d /etc/sysconfig; then \
    6390                install -m 0755 -d $(DESTDIR)/etc/rc.d/init.d; \
    6491                install -m 0755 pkg/rpm/init.d/jobmond $(DESTDIR)/etc/rc.d/init.d/; \
     
    75102                install -m 0755 pkg/deb/default/jobarchived $(DESTDIR)/etc/default; \
    76103        fi
    77         #
    78         # Files in /etc
    79         #
    80         install -m 0644 jobmond/jobmond.conf $(DESTDIR)/etc; \
    81         install -m 0644 jobarchived/jobarchived.conf $(DESTDIR)/etc; \
    82         #
    83         # Files in /usr/share
    84         #
    85         install -m 0755 -d $(DESTDIR)/usr/share/jobarchived/
    86         install -m 0755 jobarchived/job_dbase.sql $(DESTDIR)/usr/share/jobarchived/
    87         #
    88         # Create the /var/lib/jobarchive directory where rrds are stored.
    89         #
    90         install -m 0755 -d $(DESTDIR)/var/lib/jobarchive/
    91         #
    92         # Files for ganglia (adapt to rpm or deb or unknown ganglia packaging)
    93         #
    94         if test -d /etc/sysconfig; then \
    95                 install -m 0755 -d $(DESTDIR)/usr/share/ganglia; \
    96                 (cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)/usr/share/ganglia); \
    97         elif test -d /etc/default; then \
    98                 install -m 0755 -d $(DESTDIR)/usr/share/ganglia-webfrontend; \
    99                 (cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)/usr/share/ganglia-webfrontend); \
    100         else \
    101                 install -m 0755 -d $(DESTDIR)/$(WEBDIR); \
    102                 (cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)/$(WEBDIR)); \
    103         fi
    104 
     104        @#
     105        @# Files in /etc
     106        @#
     107        @echo "\nInstalling config files jobmond.conf jobarchived.conf in $(DESTDIR)/etc"
     108        @install -m 0644 jobmond/jobmond.conf $(DESTDIR)/etc
     109        @install -m 0644 jobarchived/jobarchived.conf $(DESTDIR)/etc
     110        @#
     111        @# Files in /usr/share
     112        @#
     113        @echo "\nInstalling job_dbase.sql in $(PREFIX)/share/jobarchived"
     114        @install -m 0755 -d $(DESTDIR)$(PREFIX)/share/jobarchived
     115        @install -m 0755 jobarchived/job_dbase.sql $(DESTDIR)$(PREFIX)/share/jobarchived/
     116        @#
     117        @# Create the /var/lib/jobarchive directory where rrds are stored.
     118        @#
     119        @echo "\nCreating the directory where RRDs will be stored: $(JOBARCHIVE_RRDS)"
     120        @install -m 0755 -d $(DESTDIR)$(JOBARCHIVE_RRDS)
     121        @#
     122        @# Files for ganglia (adapt to rpm or deb or unknown ganglia packaging)
     123        @#
     124        @echo "\nInstalling Ganglia web interface to $(GANGLIA_ROOT) ."
     125        @install -m 0755 -d $(DESTDIR)$(GANGLIA_ROOT)
     126        @(cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)$(GANGLIA_ROOT)/)
     127        @#
     128        @echo "\nInstallation complete.\n"
    105129
    106130deb-webfrontend:        ${REQUIRED}
    107131        mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/DEBIAN >/dev/null
    108         mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${WEBDIR} >/dev/null
     132        mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${GANGLIA_ROOT} >/dev/null
    109133        ( cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \
    110         . ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${WEBDIR} )
     134        . ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${GANGLIA_ROOT} )
    111135        ( cd pkg/deb/web/DEBIAN; \
    112136        rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \
     
    165189clean:
    166190        rm -rf ${TMPDIR}/.monarch_buildroot
    167         rm -rf ./jobmonarch.spec
     191        rm -rf ./pkg/rpm/jobmonarch.spec
    168192        rm -rf ./debian
Note: See TracChangeset for help on using the changeset viewer.