Hi,

Here is a new c3 spec file that fixes some issues like contrib binaries present 
in 2 packages. It also cleans the structure. use of correct macros like 
%_bindir instead od a bad / prefix used with hardcoded paths.

Olivier.

--
   Olivier LAHAYE
   CEA DRT/LIST/DCSI/DIR
# $Id: c3.spec.in 196 2011-01-25 07:35:13Z tjn $

%define   name        c3
%define   ver         @C3_VERSION@
%define   rel         2
#%define   prefix      /opt/c3-5
#%define   profiled    /etc/profile.d


Summary: Cluster Command and Control (C3) - command line tool suite  
Name: %{name}
Version: %{ver}
Release: %{rel}
License: freely distributable
Group: Application/System
Source0: %{name}-%{ver}.tar.gz
Packager: Thomas Naughton <naught...@ornl.gov>
URL: http://www.csm.ornl.gov/torc/C3/
AutoReqProv: no
Requires: rsync
Requires: perl
Requires: python >= 2.4
BuildRoot: %{_tmppath}/%{name}-%{ver}-root
BuildArch: noarch

%description
The Cluster Command and Control (C3) tool suite offers a command line
interface for system and user administration tasks on a cluster. 




%package ckillnode
Summary: Cluster Command and Control (C3) - ckillnode
Group: Application/System

%description ckillnode
The Cluster Command and Control (C3) - 'ckillnode' command used 
on client nodes in conjunction with 'ckill' from headnode.  

NOTE: Only needed on client nodes.



#%package profiled
#Summary: Cluster Command and Control (C3) - profile.d scripts
#Group: Application/System
#Requires: c3 >= 5
#
#%description profiled
#The Cluster Command and Control (C3) tool suite offers a command line
#interface for system and user administration tasks on a cluster. 
#
#Scripts for PATHing information placed in the '/etc/profile.d/' area.


%package c3cmd-filter
Summary: Cluster Command and Control (C3) - c3cmd-filter
Group: Application/System
Requires: perl

%description c3cmd-filter
The Cluster Command and Control (C3) - 'c3cmd-filter' command used
on client nodes in conjunction with cexec commands from headnode.

Used with C3 in order for nodes to convey error results back to the 
controlling C3 command when only STDOUT/STDERR is available for 
communication.  Use of the '--pipe' option is recommended.
   Success - nothing is printed or displayed to output
   Failure - the error string from the open() or the cmd itself
             is displayed

Example:  # cexec --pipe c3cmd-filter COMMAND

%package contrib
Summary: Cluster Command and Control (c3) - c3-contrib
Group: Application/System
Requires: perl

%description contrib
The Cluster Command and Control (C3) - contrib scripts


#---------------------------------------------------------------------
# Prep install section
#---------------------------------------------------------------------

%prep

# Get rid of any previously built stuff that might cause problems.
# (only worried about things in RPM-land '/usr/src/redhat/' here)
%__rm -rf $RPM_BUILD_ROOT

# Actually do the untar/gzip stuff
%setup -n %{name}-%{ver}




#---------------------------------------------------------------------
# Build section
#---------------------------------------------------------------------

%build
if [ -x ./configure ]; then
    %configure
else
    ./autogen.sh && %configure
fi

%__mkdir -p $RPM_BUILD_ROOT/%{profiled}

%__make install-c3cmd-filter DESTDIR=$RPM_BUILD_ROOT \
        BINDIR=$RPM_BUILD_ROOT/usr/bin

%__make install-c3 DESTDIR=$RPM_BUILD_ROOT \
        BINDIR=$RPM_BUILD_ROOT/usr/bin \
        MANDIR=$RPM_BUILD_ROOT/usr/share/man \
        DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/c3

%__make install-ckillnode DESTDIR=$RPM_BUILD_ROOT \
        BINDIR=$RPM_BUILD_ROOT/usr/bin

%__make install-contrib DESTDIR=$RPM_BUILD_ROOT\
        BINDIR=$RPM_BUILD_ROOT/usr/bin CONTRIBDIR=$RPM_BUILD_ROOT/usr/bin

#%__mv   $RPM_BUILD_ROOT/usr/bin/c3.*h $RPM_BUILD_ROOT/etc/profile.d

## Copy the build distribution to target install dir.  The files must
## exist in the desired location (path) when RPM checks the filelist. This
## is greatly simplified by using the BuildRoot (chroot sort of thing) method.
#%__mkdir -p $RPM_BUILD_ROOT/%{prefix}
#%__mkdir -p $RPM_BUILD_ROOT/%{profiled}
#%__mkdir -p $RPM_BUILD_ROOT/usr/bin
#
#%__cp -Rf $RPM_BUILD_DIR/%{name}-%{ver}/* \
#	  $RPM_BUILD_ROOT/%{prefix}
#
## Move executables from 'src/' to top-level, and remove 'src/' sub-dir 
#%__mv -f $RPM_BUILD_ROOT/%{prefix}/src/* \
#	  $RPM_BUILD_ROOT/%{prefix}
#
#/bin/rmdir $RPM_BUILD_ROOT/%{prefix}/src/
#
#%__cp -Rf $RPM_BUILD_DIR/%{name}-%{ver}/src/c3.sh \
#	  $RPM_BUILD_ROOT/%{profiled}
#
#%__cp -Rf $RPM_BUILD_DIR/%{name}-%{ver}/src/c3.csh \
#	  $RPM_BUILD_ROOT/%{profiled}
#
#%__cp -f $RPM_BUILD_DIR/%{name}-%{ver}/contrib/c3cmd-filter \
#	  $RPM_BUILD_ROOT/usr/bin/c3cmd-filter
#
#%__cp -f $RPM_BUILD_DIR/%{name}-%{ver}/src/ckillnode \
#	  $RPM_BUILD_ROOT/usr/bin/ckillnode

#---------------------------------------------------------------------
# Clean section
#---------------------------------------------------------------------

%clean
# Get rid of any tmp files in RPM land, ie. '/usr/src/redhat/BUILD/...'
%__rm -rf $RPM_BUILD_DIR/%{name}-%{ver}
%__rm -rf $RPM_BUILD_ROOT



#---------------------------------------------------------------------
# Pre-un(install) section
#---------------------------------------------------------------------
%preun
%__rm -f %{_bindir}/*.pyc



#---------------------------------------------------------------------
# Post-un(install) section
#---------------------------------------------------------------------
%postun



#---------------------------------------------------------------------
# Files section
#
#  List all files that will make it to the target machine here.  Note,
#  that listing the entire dir, gets all the files withing.  The %doc
#  files are treated special and copied into the system doc area (eg. share).
#---------------------------------------------------------------------

%files
%defattr(-,root,root)
%doc INSTALL README ChangeLog
%doc doc/KNOWN_BUGS doc/README.devel doc/README.scale 
%doc doc/README.c3_com_obj doc/README.c3_file_obj
%{_bindir}/*
%exclude %{_bindir}/add_user
%exclude %{_bindir}/c3_conf_manager
%exclude %{_bindir}/enable_clusters
%exclude %{_bindir}/push_passwd
%exclude %{_bindir}/sync_date
%exclude %{_bindir}/ckillnode
%exclude %{_bindir}/c3cmd-filter
%{_datadir}


%files ckillnode
%defattr(-,root,root)
%{_bindir}/ckillnode


#%files profiled
#%defattr(-,root,root)
#%{profiled}

%files c3cmd-filter
%defattr(755,root,root)
%{_bindir}/c3cmd-filter

%files contrib
%defattr(755,root,root)
%{_bindir}/add_user
%{_bindir}/c3_conf_manager
%{_bindir}/enable_clusters
%{_bindir}/push_passwd
%{_bindir}/sync_date

#---------------------------------------------------------------------
# ChangeLog section
#---------------------------------------------------------------------
%changelog
* Wed Oct 10 2012  16:12:19PM    Olivier Lahaye <olivier.lah...@cea.fr>
- Reworked spec file (use of %_bindir, avoid contrib binaries to be in main pkg

* Fri Jan 21 2011  16:44:19PM    Thomas Naughton <naught...@ornl.gov>
- (5.1) Adjust python requires line to be .ge. python-2.4

* Wed Aug 25 2010  15:41:01PM    Geoffroy Vallee  <valle...@ornl.gov>
- Support the creation of a c3-contrib RPM.

* Wed Apr 15 2009  15:30:37PM    Geoffroy Vallee  <valle...@ornl.gov>
- Make sure the produced RPMs are noarch.

* Thu Mar 05 2009  17:49:40PM    Geoffroy Vallee  <valle...@ornl.gov>
- Enable the installation of C3 directly in the system (binaries in /usr/bin
and so on), rather than in /opt/c3-x.

* Thu Jul 26 2007  17:21:14PM    Thomas Naughton  <naught...@ornl.gov>
- (5.0.1b3-1) Add csh MANPATH from Bernard Li

* Tue Jul 10 2007  00:57:14AM    Thomas Naughton  <naught...@ornl.gov>
- (5.0b1-1) Misc updates to match new file locations.  Using autoconf
   to fill in version.  (TODO: make better use of new Makefile)

* Fri Oct 31 2003  15:50:11PM    Thomas Naughton  <naught...@ornl.gov>
- (4.0.1-2) Adding new 'c3cmd-filter' pkg.

* Wed Dec 04 2002  01:36:38AM    Thomas Naughton  <naught...@ornl.gov>
- (3.1-3) Overhaul the RPM spec stuffo.  
  Consolidate 'c3, -profiled, -ckillnode' RPMs into a single SPEC file.
- Fix path for ckillnode, change to also be '/opt/c3-3'.
- Additionally, this is using the newer version of 'ckillnode' that was
  in the 3.1.1 tarball.

* Wed May 29 2002  11:15:18AM    Thomas Naughton  <naught...@ornl.gov>
- (3.1-2) Changed the pre-reqs to be '/usr/bin/python2' to work better 
  w/ OSCAR and non-RedHat based systems that don't use the "Python" (1.x) 
  and "Python2" (2.x) RPM naming for co-existence.

* Thu May 16 2002  21:00:32PM    modified by:  tjn <naught...@ornl.gov>
- Upgraded to c3-3.1                  (BRANCH-TAG=branch-c3-3-1, rel=1)
- LAM/MPI rocks (http://www.lam-mpi.org/)  THANKS JEFF!  :)
  Jeff Squyres fixed things up to use BuildRoot, which fixed lots! 
- Added the %preun to get rid of the *.pyc files (pre-compiled bytecode).
- Moved the 'profile.d' stuff to a seperate RPM "c3-profiled".  This 
  cleans things up here and also allows for use of switcher only w/o 
  the profile.d/ scripts (partially OSCAR related).
- Fixed the '-U' & '-e' errors for similarly named files.
- Cleaning things up, everything stays in '/opt/c3-3' (ie. %{prefix} )
  including the Man pages, Brian moved mans to the more std man/manN/ form.
- Removed the postun stuff that breaks stuff!  Bad tjn...
- Misc clean ups and added *many* more comments.
- Generate these as noarch.
- Generate these w/ Python2 deps

* Tue May 14 2002  10:25:23AM    modified by:  tjn <naught...@ornl.gov>
- Adding this to a CVS repository...not changing the rel# (2.7.2-4)

* Mon Apr 01 2002  10:21:34AM    modified by:  tjn <naught...@ornl.gov>
- Using RPM provided macros for cat, cp & rm until I upgrade the entire RPM
  see also: /usr/lib/rpm/macros
- Also removed echo to STDOUT, assume users can edit c3.conf and created
  a 'c3-ckillnode-2.7.2-X' RPM for use on client nodes.
- On a related note, I created a c3-ckillnode RPM for use on clients.

* Thu Dec 13 2001  09:35:50AM    modified by:  tjn <naught...@ornl.org>
- Changed the c3.conf stuff to only create a new if one doesn't exist.

* Wed Dec 12 2001  11:18:02AM    modified by:  tjn <naught...@ornl.org>
- removed some of the extra stuff printed upon 'rpm -ivh' & added 'Requires:'.

* Tue Dec 11 2001  13:28:32PM    modified by:  tjn <naught...@ornl.org>
- fixed problem related to only c3.1 man page being install.

* Fri Aug 24 2001  10:25:55AM    modified by:  tjn <naught...@ornl.gov>
- changed the name for the Source1 & Source2 to be specific to version

* Tue Jul 31 2001  14:06:02PM    modified by:  tjn <naught...@ornl.gov>
- check for exiting defs on the /etc/profile.d/  files
  (this also required me to change the echo of the contents to actual a copy!)

* Tue Jun 19 2001 Thomas Naughton <naughtont...@ornl.gov>
- Creation of initial c3-2.7.2 rpm
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to