Update of /cvsroot/env-switcher/default-manpath/dist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18637/dist Added Files: .cvsignore Makefile.am Makefile.options VERSION buildrpm.sh get_morpm_version modules-default-manpath-oscar.spec Log Message: First cut --- NEW FILE: .cvsignore --- Makefile Makefile.in install-sh missing mkinstalldirs --- NEW FILE: Makefile.am --- # -*- makefile -*- # # Copyright (c) 2005 The Trustees of Indiana University. # All rights reserved. # # This file is part of the modules-default-manpath-oscar software # package. For license information, see the LICENSE file in the # top-level directory of the modules-default-manpath-oscar source # distribution. # # $Id: Makefile.am,v 1.1 2005/02/28 23:15:21 jsquyres Exp $ # include $(top_srcdir)/dist/Makefile.options EXTRA_DIST = Makefile.options VERSION get_morpm_version --- NEW FILE: Makefile.options --- # -*- makefile -*- # # Copyright (c) 2002 The Trustees of Indiana University. # All rights reserved. # # This file is part of the modules-oscar software package. For # license information, see the LICENSE file in the top-level directory # of the modules-oscar source distribution. # # $Id: Makefile.options,v 1.1 2005/02/28 23:15:33 jsquyres Exp $ # AUTOMAKE_OPTIONS = foreign --- NEW FILE: VERSION --- major=1 minor=0 release=0 alpha=0 beta=0 --- NEW FILE: buildrpm.sh --- #!/bin/sh -f # # Copyright (c) 2005 The Trustees of Indiana University. # All rights reserved. # # This file is part of the modules-default-manpath-oscar software # package. For license information, see the LICENSE file in the # top-level directory of the modules-default-manpath-oscar source # distribution. # # $Id: buildrpm.sh,v 1.1 2005/02/28 23:15:33 jsquyres Exp $ # # # Setup # specfile="modules-default-manpath-oscar.spec" oscar_target="noarch" # # get the tarball name # tarball="$1" if test "$tarball" = ""; then echo "Usage: buildrpm.sh <modules_default_manpath_oscar_tarball>" exit 1 fi if test ! -f $tarball; then echo "Can't find $tarball" exit 1 fi echo "--> Found tarball: $tarball" # # Extract the version number from the tarball # morpm_version="`./get_morpm_version ..`" echo "--> Buidling modules OSCAR RPM version $morpm_version" # # do we have the spec files? # for file in $specfile; do if test ! -f $file; then echo "Can't find $file file" exit 1 fi echo "--> Found specfile: $file" done # # Find where the top RPM-building directory is # rpmtopdir="`grep %_topdir $HOME/.rpmmacros | awk '{ print $2 }'`" if test "$rpmtopdir" != ""; then if test ! -d "$rpmtopdir"; then mkdir -p "$rpmtopdir" mkdir -p "$rpmtopdir/BUILD" mkdir -p "$rpmtopdir/RPMS" mkdir -p "$rpmtopdir/RPMS/i386" mkdir -p "$rpmtopdir/RPMS/i586" mkdir -p "$rpmtopdir/RPMS/i686" mkdir -p "$rpmtopdir/RPMS/noarch" mkdir -p "$rpmtopdir/RPMS/athlon" mkdir -p "$rpmtopdir/SOURCES" mkdir -p "$rpmtopdir/SPECS" mkdir -p "$rpmtopdir/SRPMS" fi need_root=0 elif test -d /usr/src/RPM; then need_root=1 rpmtopdir="/usr/src/RPM" else need_root=1 rpmtopdir="/usr/src/redhat" fi echo "--> Found RPM top dir: $rpmtopdir" # # If we're not root, try to sudo # if test "$need_root" = "1" -a "`whoami`" != "root"; then echo "--> Trying to sudo: \"$0 $*\"" echo "------------------------------------------------------------" sudo -u root sh -c "$0 $tarball" echo "------------------------------------------------------------" echo "--> sudo finished" exit 0 fi # # make sure we have write access to the directories we need # if test ! -w $rpmtopdir/SOURCES ; then echo "Problem creating rpms: You do not have a $rpmtopdir directory" echo "tree or you do not have write access to the $rpmtopdir directory" echo "tree. Please remedy and try again." exit 1 fi echo "--> Have write access to $rpmtopdir/SOURCES" # # move the tarball file to the rpm directory # dir="$rpmtopdir/SOURCES" for file in $tarball; do echo "--> Copying $file to $dir" cp $file $dir b="`basename $file`" if test ! -f $dir/$b; then echo "Couldn't copy $file to $dir" exit 1 fi echo "--> Copied $file to $dir" done # # Copy the specfile # specdest="$rpmtopdir/SPECS/$specfile" rm -f $specdest sed -e 's/@MORPM_VERSION@/'$morpm_version/ $specfile > $specdest if test ! -f $specdest; then echo "Couldn't copy $specfile to $rpmtopdor/SPECS" exit 1 fi echo "--> Copied $specfile to $rpmtopdir/SPECS" # # build the OSCAR RPM # rpm_cmd="rpmbuild" echo "--> Building the OSCAR RPM" cmd="$rpm_cmd -ba --target=$oscar_target $specdest" echo "--> $cmd" eval $cmd if test $? != 0; then echo "*** FAILURE BUILDING OSCAR RPM!" echo "Aborting" exit 1 fi # # Remove the build trees # dir="$rpmtopdir/BUILD/`basename $tarball`" dir="`echo $dir | sed -e 's/.tar.gz$//'`" echo "--> removing directory: $dir" rm -rf $dir # # All done # cat <<EOF ------------------------------------------------------------------------------ ==== FINISHED BUILDING OSCAR RPM ==== ------------------------------------------------------------------------------ A copy of the tarball is located in: $rpmtopdir/SOURCES/ The completed rpms are located in: $rpmtopdir/RPMS/$oscar_target/ The sources rpms are located in: $rpmtopdir/SRPMS/ The spec files are located in: $rpmtopdir/SPECS/ ------------------------------------------------------------------------------ EOF --- NEW FILE: get_morpm_version --- #!/bin/sh # # Copyright (c) 2002 The Trustees of Indiana University. # All rights reserved. # # This file is part of the modules-oscar software package. For # license information, see the LICENSE file in the top-level directory # of the modules-oscar source distribution. # # $Id: get_morpm_version,v 1.1 2005/02/28 23:15:33 jsquyres Exp $ # srcdir="$1/dist" option="$2" if test "$srcdir" = ""; then option="--help" else MAJOR_VERSION="`cat $srcdir/VERSION | grep major | cut -d= -f2`" MINOR_VERSION="`cat $srcdir/VERSION | grep minor | cut -d= -f2`" RELEASE_VERSION="`cat $srcdir/VERSION | grep release | cut -d= -f2`" ALPHA_VERSION="`cat $srcdir/VERSION | grep alpha | cut -d= -f2`" BETA_VERSION="`cat $srcdir/VERSION | grep beta | cut -d= -f2`" if test "$RELEASE_VERSION" != "0" -a "$RELEASE_VERSION" != ""; then VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION" else VERSION="$MAJOR_VERSION.$MINOR_VERSION" fi if test "`expr $ALPHA_VERSION \> 0`" = "1"; then VERSION="${VERSION}a$ALPHA_VERSION" elif test "`expr $BETA_VERSION \> 0`" = "1"; then VERSION="${VERSION}b$BETA_VERSION" fi if test "$option" = ""; then option="--full" fi fi case "$option" in --full|-v|--version) echo $VERSION ;; --major) echo $MAJOR_VERSION ;; --minor) echo $MINOR_VERSION ;; --release) echo $RELEASE_VERSION ;; --alpha) echo $ALPHA_VERSION ;; --beta) echo $BETA_VERSION ;; -h|--help) cat <<EOF $0 <srcdir> [<option>] <srcdir> - Top-level directory of the LAM source tree <option> - One of: --full - Full version number --major - Major version number --minor - Minor version number --release - Release version number --alpha - Alpha version number --beta - Beta version nmumber --help - This message EOF esac exit 0 --- NEW FILE: modules-default-manpath-oscar.spec --- # # Copyright (c) 2005 The Trustees of Indiana University. # All rights reserved. # # This file is part of the modules-default-manpath-oscar software # package. For license information, see the LICENSE file in the # top-level directory of the modules-default-manpath-oscar source # distribution. # # $Id: modules-default-manpath-oscar.spec,v 1.1 2005/02/28 23:15:33 jsquyres Exp $ # ############################################################################# # # Helpful Defines # ############################################################################# %define _moddir /opt/modules/oscar-modulefiles/default-manpath # Added to get around RPM 4.2 debugging additions (starting in RH 8.0) %define debug_package %{nil} %define __check_files %{nil} ############################################################################# # # Preamble Section # ############################################################################# Summary: Modules default manpath package Name: modules-default-manpath-oscar Version: @MORPM_VERSION@ Release: 1 License: BSD Group: Applications/Environment Source0: modules-default-manpath-oscar-@MORPM_VERSION@.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root Packager: Open Cluster Group / OSCAR working group AutoReqProv: no Requires: modules-oscar Requires: %__cp %__mkdir %__chmod %__cat %description A "feature" of the man command in Linux is that whenever you add something to MANPATH, it stops looking in the /etc/man.config file to find the default paths where to look for man pages. This RPM contains a modulefile that will be loaded by default on OSCAR clusters that manually reads all the MANPATH entries from /etc/man.config and adds them to the MANPATH environment variable. ############################################################################# # # Prep Section # ############################################################################# %prep %setup -q -n modules-default-manpath-oscar-@MORPM_VERSION@ # Otherwise, this directory shows up on security reports chmod -R o-w $RPM_BUILD_DIR/modules-default-manpath-oscar-@MORPM_VERSION@ ############################################################################# # # Build Section # ############################################################################# ############################################################################# # # Install Section # ############################################################################# %install # Nothing to build -- just some files to install # Install the "default-manpath" modulefile and set its default version env | sort | egrep -i 'RPM|root' destdir="$RPM_BUILD_ROOT/%{_moddir}" %__mkdir_p "$destdir" %__chmod 0755 "$destdir" srcdir="$RPM_BUILD_DIR/modules-default-manpath-oscar-@MORPM_VERSION@" %__cp "$srcdir/src/default-manpath.tcl" "$destdir/@MORPM_VERSION@" %__cat > "$destdir/.version" << EOF #%Module set ModulesVersion @MORPM_VERSION@ EOF unset destdir ############################################################################# # # Files Section # ############################################################################# %files %defattr(-,root,root) %doc README.OSCAR AUTHORS.OSCAR LICENSE.OSCAR %{_moddir} ############################################################################# # # ChangeLog # ############################################################################# %changelog * Mon Feb 28 2005 Jeff Squyres <jsq...@la...> - First version |