MSEL, NIST Center for Neutron Research Materials Science and Engineering Laboratory NIST Center for Neutron Research National Institute of Standards and Technology
Home Instruments Science Experiments SiteMap


Building the RPM file for GSAS with EXPGUI

Notes:

Steps to build a RPM file

  1. Place the following files in /usr/src/redhat/SOURCES:
    gsaskit.tar.gz
    This is the standard Linux GSAS distribution, as prepared by Bob Von Dreele at Los Alamos
    expgui_ALPHA.tar.gz
    This is the latest EXPGUI distribution, as prepared by Brian Toby at NIST
    gsas_patch
    This file contains patches that correct text files, these are created using the diff command. If this file is not needed, it can be empty (create using touch gsas_patch).
    gsasupdates.tar.gz
    This file contains updated programs and other files that cannot be patched. Create this file using
    cd /home/gsas
    tar cvzf /tmp/gsasupdates.tar.gz exe/exptool expgui/doc/notes.html
    
    Note that the path used when creating the tar file must be relative to the gsas directory. (e.g. it would not work to use cd /home/gsas/exe; tar cvzf /tmp/... exptool). If this file is not needed, it can be empty (create using touch gsasupdates.tar.gz).
    GSASManual.pdf
    readme.linux
    gsasnews.txt
    These are documentation files downloaded from Los Alamos

  2. Copy the gsas.spec file to /usr/src/redhat/SPECS
  3. Edit the first line of /usr/src/redhat/SPECS/gsas.spec to reflect the release date of the software and/or change the release number on line 2.
  4. Use command
         /mnt/62/bin/rpm -ba /usr/src/redhat/SPECS/gsas.spec
    to create /usr/src/redhat/SRPMS/GSAS-EXPGUI-y.m.d-x.src.rpm and /usr/src/redhat/RPMS/i386/GSAS-EXPGUI-y.m.d-x.i386.rpm
The file /usr/src/redhat/RPMS/i386/GSAS-EXPGUI-y.m.d-x.i386.rpm should be distributed.

The SPEC file


Summary:   The GSAS Package and EXPGUI front end
Name:      GSAS-EXPGUI
Version:   2001.9.25
Release:   1
Source0:    ftp://ftp.lanl.gov/public/gsas/linux/gsaskit.tar.gz
Source1:    ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/expgui_ALPHA.tar.gz
Source2:    ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/gsasupdates.tar.gz
Source3:    ftp://ftp.lanl.gov/public/gsas/manual/GSASManual.pdf
Source4:    ftp://ftp.lanl.gov/public/gsas/linux/readme.linux
Source5:    ftp://ftp.lanl.gov/public/gsas/gsasnews.txt
Copyright: GSAS (c) University of California; EXPGUI public domain
Group:     Crystallography
Requires:  tcl >= 8.0, tk >= 8.0, blt 
Packager:  Brian H. Toby 
URL:       http://www.ncnr.nist.gov/xtal/software/gsas.html
Prefix:    /home
%description
GSAS (General Structure Analysis System) is a crystallographic package for
structure refinement using powder and single crystal x-ray and neutron data.
Virtually all data types (CW, TOF, ED) are supported. 
GSAS is written by Allen C. Larson and Robert B. Von Dreele of Los Alamos
National Laboratory.

EXPGUI is a graphical user interface to the GSAS package, written by 
Brian H. Toby of the NIST Center for Neutron Research.

This contains the 2001 Jun 11 distribution of GSAS and v1.47 of EXPGUI.
%prep
rm -rf $RPM_BUILD_DIR/gsas
mkdir gsas
cd gsas
zcat $RPM_SOURCE_DIR/gsaskit.tar.gz | tar xvf -
cp $RPM_SOURCE_DIR/GSASManual.pdf .
cp $RPM_SOURCE_DIR/gsasnews.txt .
cp $RPM_SOURCE_DIR/readme.linux .
mkdir expgui
cd expgui
zcat $RPM_SOURCE_DIR/expgui_ALPHA.tar.gz | tar xvf -
cd ..
# apply patches & corrections
sed -e '1s/local\///' expgui/expgui > /tmp/x; mv /tmp/x expgui/expgui
sed -e '1s/local\///' expgui/excledt > /tmp/x; mv /tmp/x expgui/excledt
sed -e '1s/local\///' expgui/liveplot > /tmp/x; mv /tmp/x expgui/liveplot
sed -e '1s/local\///' expgui/lstview > /tmp/x; mv /tmp/x expgui/lstview
sed -e '1s/local\///' expgui/widplt  > /tmp/x; mv /tmp/x expgui/widplt
chmod +x expgui/expgui expgui/excledt  expgui/liveplot expgui/lstview expgui/widplt
# this patch was created using: diff -c gsas /home/gsas/gsas > /tmp/gsas_patch
# where /home/gsas/gsas is the corrected file
patch < $RPM_SOURCE_DIR/gsas_patch
# should I make this conditional if file exists?
zcat $RPM_SOURCE_DIR/gsasupdates.tar.gz | tar xvf -
chown -R root.root $RPM_BUILD_DIR/gsas

%build

%install
rm -rf /home/gsas
mkdir /home/gsas
cp -rp $RPM_BUILD_DIR/gsas /home/

%post
ln -sf $RPM_INSTALL_PREFIX/gsas/gsas /usr/bin/gsas
ln -sf $RPM_INSTALL_PREFIX/gsas/expgui/expgui /usr/bin/expgui

%clean
rm -rf $RPM_BUILD_DIR/gsas /home/gsas

%postun
rm -f /usr/bin/gsas /usr/bin/expgui

%files
%doc /home/gsas/expgui/doc/*
%doc /home/gsas/*.pdf
%doc /home/gsas/gsasnews.txt
%doc /home/gsas/readme.linux
/home/gsas/count
/home/gsas/gsas
/home/gsas/upcase
/home/gsas/data/*
/home/gsas/example/*
/home/gsas/exe/*
/home/gsas/macros/*
/home/gsas/pgl/*
/home/gsas/expgui/*.tcl
/home/gsas/expgui/BWidget-1.2.1/*
/home/gsas/expgui/example*
/home/gsas/expgui/expgui
/home/gsas/expgui/gsastcl*
/home/gsas/expgui/liveplot
/home/gsas/expgui/bkgedit
/home/gsas/expgui/excledt
/home/gsas/expgui/lstview
/home/gsas/expgui/spacegrp.ref
/home/gsas/expgui/widplt


Comments, corrections or questions: crystal@NIST.gov
Last modified 09-February-2005
$Revision: 1.4 $ $Date: 2002/04/12 19:06:39 $