ccp4 stable port information

Package: ccp4
Version: 6.0.2
Revision: 7
GCC: 4
Source: ftp://ftp.ccp4.ac.uk/ccp4/%v/source/ccp4-%v-core-src.tar.gz
Source-MD5: a47ae8b8e6fa76eef7f17baa85e8dc16
SourceDirectory: ccp4-%v
Source2: ftp://ftp.ccp4.ac.uk/ccp4/%v/source/phaser-1.3.3-cctbx-src.tar.gz
Source2-MD5: edff4d201e7b6d987c05efcf965f6023
Source3: http://chemistry.ucsc.edu/~wgscott/xtal/xtalfink/XCCPJiffy-custom.gz
Source3-MD5: 21568dd2475505929573a3fd452c538f
Source4: http://chemistry.ucsc.edu/~wgscott/xtal/xtalfink/ccp4_i686-apple-darwin8.6.1_libtool.gz
Source4-MD5: e40104835406c75c8aee16471b2dd06e
# The follwing are CCP4-issued version-specific patch files from the website at
# http://www.ccp4.ac.uk/problems.php#ccp4-6.0.2
Source5: ftp://ftp.ccp4.ac.uk/ccp4/%v/patches/topp.f-r1.16.2.5-r1.16.2.6.diff
Source5-MD5: a23e9886620886a694295ac2e671156a
Source6: ftp://ftp.ccp4.ac.uk/ccp4/%v/patches/scala.f-r1.101.2.3-r1.101.2.4.diff
Source6-MD5: 0c78e93e77c892d071ed0732f7a89102
Source7: ftp://ftp.ccp4.ac.uk/ccp4/%v/patches/util_windows.tcl-r1.27-r1.27.2.1.diff
Source7-MD5: 52ac21688c047287d4fcbbd1aaaea774
Source8: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/amore.f-r1.115-r1.116.diff
Source8-MD5: 26a124b160c4215d6b20749f20932920
Source9: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/crystal.C-r1.5-r1.6.diff
Source9-MD5: 5c62b4a7399aded0f0c896c4315cfff6
Source10: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/export-r1_12.tcl
Source10-MD5: 984f7305ba151d961bef2ac25b1b9925
Source11: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/export-r1_6.def
Source11-MD5: 3babc1ee652fed6d2bb976bde41450a8
Source12: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/mtz2various-r1_132.f
Source12-MD5: 7ed02a1cd000a912ecef8a61a59d8560
Source13: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/mtz2various-r1_40.html
Source13-MD5: fa9127eaceeb3e20328400a5add6b042
Source14: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/fft.f-r1.98-r1.100.diff
Source14-MD5: 6471fce214ad8e3a1345fce4ce3ccf5b
Source15: ftp://ftp.ccp4.ac.uk/ccp4/6.0.2/patches/rstats.f-r1.39-r1.40.diff
Source15-MD5: 05578c1bfd0eeb3a554170ae02b85ea9
#
DescPort: <<
CCP4 is designed to compile with gfortran on OS X >= 10.4 by default.
Jack Howarth has provided multiple improvements in the patch file to
address several bugs and to permit optimization with gfortran at -O3.

Users typically install all of the ccp4 files into /xtal/ccp4-%v or
into /usr/local/xtal/ccp4-%v. In the present case, these files are
installed into %p/share/xtal/ccp4-%v. The library files are installed
into the directory %p/lib/ccp4-%v and this directory is symbolically
linked to %p/share/xtal/ccp4-%v/lib which is the canonical location.
Dynamic libraries are provided in the ccp4-shlibs splitoff package, and
static libraries are provided in the ccp4-dev splitoff package. The
configure files are patched so that the full path to the dynamic
libraries is hard-coded, per fink policy. This obviates the need to
set the DYLD_LIBRARY_PATH environment variable, which should remain
unset. The appropriate shell startup files are automatically sourced
when %p/bin/init.(c)sh is invoked upon shell startup; there is no
need to do so manually. The actual files are located in $CCP4/include.

Although phaser is built, the cctbx files are not installed in $CLIB.
If needed, please install the cctbx fink package.

The ccp4i mail utility by default will only work on machines that run
a mail server. As a workaround, a public domain perl script called
osx_ccp4_mail is installed that glues the ccp4i mail button to the
Apple OS X Mail.app.

Further adaptations are commented in place in the patch, configure and
install scripts below. Relevant patches specific to this version that
are issued by CCP4 are now downloaded and applied individually, helping
to keep the ccp4.patch file from growing metastatically and also to
permit the user to verify that the latest patches have been applied.
These start with Source5 (above) and are applied individually at the
end of the PatchScript field.
<<
Depends: <<
x11,
tcltk,
blt,
gcc42-shlibs,
fftw-shlibs, %N-shlibs (= %v-%r)
<<
BuildDepends: <<
gcc42,
f2c,
fort77,
tcltk-dev,
fftw
<<
Replaces: <<
mosflm (<= 6.2.3-2),
mosflm-small (<= 6.2.3-2),
refmac (<= 5.2),
ccp4-shlibs (<= 6.0.1-9999),
ccp4 (<= 6.0.1-9999),
ccp4-dev (<= 6.0.1-9999),
bundle-ccp4-intel,
clipper-bin,
ccp4-gfortran,
ccp4-gfortran-dev,
bundle-ccp4-powerpc
<<
Conflicts: <<
ccp4-shlibs (<= 6.0.1-9999) ,
ccp4 (<= 6.0.1-9999),
ccp4-dev (<= 6.0.1-9999),
bundle-ccp4-intel,
bundle-ccp4-powerpc,
ccp4-gfortran,
ccp4-gfortran-dev
<<
NoSetCPPFLAGS: true
NoSetLDFLAGS: true
#
################################################################################
PatchScript: <<
#!/bin/zsh -efv
#
umask 0022

# Now apply the primary patch
sed 's|@PREFIX@|%p|g' <%a/%n.patch | patch -p1
# setup script for tcsh, zsh and bash users
export TEMPXTAL=$PWD:h
#
perl -pi.bak -e 's|/xtal|\$TEMPXTAL|g' include/ccp4.setup* # build prefix (changed in install)
perl -pi.bak -e 's|/prefix|%p|g' include/ccp4.setup* # location of tcktk, blt
perl -pi.bak -e 's|/usr/local/bin|%p/bin|g' include/ccp4.setup* # same
perl -pi.bak -e 's|limit stacksize 65536|limit stacksize unlimited|g' include/ccp4.setup* # same
#
perl -pi.bak -e 's|SW_PREFIX|%p|g' **/configure # location of tcktk, blt
cp include/ccp4.setup-dist include/ccp4.setup
rm -f include/ccp4.setup-bash **/configure.bak include/ccp4.setup*.bak
#
# Set up XCCPJiffy wrapper scripts in $CCP4/etc
# These are small wrapper scripts for xplot84driver and xloggraph generated by the patch
chmod a+x etc/x*
# Fix the dylib install path in configure
perl -pi.bak -e 's|\$rpath|%p/lib/ccp4-%v|g' **/configure
# We need the mmdbold clipper libraries built for COOT:
perl -pi.bak -e 's|enable_mmdbold=no|enable_mmdbold=yes|g' lib/clipper/configure*
#
# Now apply all patches issued by CCP4 subsequent to the %v release:
/usr/bin/patch src/topp_/topp.f ../topp.f-r1.16.2.5-r1.16.2.6.diff
/usr/bin/patch src/scala_/scala.f ../scala.f-r1.101.2.3-r1.101.2.4.diff
/usr/bin/patch ccp4i/src/util_windows.tcl ../util_windows.tcl-r1.27-r1.27.2.1.diff
/usr/bin/patch src/amore.f ../amore.f-r1.115-r1.116.diff
/usr/bin/patch src/bp3_/crystal.C ../crystal.C-r1.5-r1.6.diff
/usr/bin/patch src/fft.f ../fft.f-r1.98-r1.100.diff
/usr/bin/patch src/rstats.f ../rstats.f-r1.39-r1.40.diff
cp ../export-r1_12.tcl ccp4i/tasks/export.tcl
cp ../export-r1_6.def ccp4i/tasks/export.def
cp ../mtz2various-r1_132.f src/mtz2various.f
cp ../mtz2various-r1_40.html html/mtz2various.html
#
<<
################################################################################
CompileScript: <<
#!/bin/zsh -efv
umask 0022

# The build will fail if Norton Auto-Protect is running.
# Check to see if it is, and abort the installation with a
# warning to the user.
if [[ $(ps axww | grep NortonAutoProtect | wc -l) -gt 1 ]];then
print "\e[1m******************************************************************************************************"
print "******************************************************************************************************"
print "******************************************************************************************************"
print ""
print "Norton AutoProtect must be suspended during CCP4 installation. Please do so now and then try again."
print ""
print "******************************************************************************************************"
print "******************************************************************************************************"
print "******************************************************************************************************\e[0m"
sleep 15
return 1000
fi


# These are required for the build environment
export TEMPXTAL=$PWD:h
source include/ccp4.setup-zsh
export DYLD_LIBRARY_PATH=$CLIB
export rpath=%p/lib/ccp4-%v
export RPATH=%p/lib/ccp4-%v

if [[ $(sw_vers -productVersion) < 10.5 ]]; then
# # The cctbx sub-package requires us to use the system's own Python
export PATH=/System/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH
export PYTHONHOME="/System/Library/Frameworks/Python.framework/Versions/Current"
export PYTHONPATH="/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.3"
fi

# gfortran is actually used by default, but to ensure the right thing happens, specify it.

# Disable building of pdb_extract and phaser in 10.5. CCP4 6.1 will fix this.

if [[ $(sw_vers -productVersion) < 10.5 ]]; then
FC="%p/lib/gcc4.2/bin/gfortran" F_LIBS="-L%p/lib/gcc4.2/lib" ./configure --with-shared-libs --with-fftw=%p --with-x Darwin
else
FC="%p/lib/gcc4.2/bin/gfortran" F_LIBS="-L%p/lib/gcc4.2/lib" ./configure --disable-pdb_extract --disable-cctbx --disable-phaser --with-shared-libs --with-fftw=%p --with-x Darwin
fi

# fix some post-configure bugs by getting rid of -lg2c
perl -pi.bak -e 's|-lg2c||g' x-windows/**/*akefile*



if [[ $(uname -p) != powerpc ]];then
perl -pi.bak -e 's|%p/lib/gcc4.2/bin/||g' lib/clipper/**/Makefile*
# Replace the ccp4 libtool file with one that works and compiles cpirate:
cp ../ccp4_i686-apple-darwin8.6.1_libtool.gz lib/clipper/libtool.gz
mv -f lib/clipper/libtool lib/clipper/libtool-dist
gunzip lib/clipper/libtool.gz
chmod a+x lib/clipper/libtool
fi

( cd x-windows/XCCPJIFFY; perl -pi.bak -e 's|-lgfortran|-lgfortran -L%p/lib/gcc4.2/lib |g' *akefile* ) || exit 1
if [[ $(sw_vers -productVersion) < 10.5 ]]; then
:
else
perl -pi.bak -e 's|-lcrt1.10.5.o||g' **/*akefile
perl -pi.bak -e 's|-lcrt1.o||g' **/*akefile
fi

#################
make
make install
#################

# xloggraph will fail, but we will link it with fort77 below
#
# Make wrappers for xplot84driver and xloggraph, so rename the executables
cd x-windows/XCCPJIFFY
cp xplot84driver $CBIN/xplot84driver.exe
rm -f $CBIN/xplot84driver
#
# Manually link xloggraph with fort77 (fails in make)
echo ""
echo "**********************************************************************"
echo "Re-linking xloggraph with fort77. Ignore previous error messages."
echo "**********************************************************************"
echo ""
#
perl -pi.bak -e 's|FC = g77 -fno-second-underscore||g' Makefile
make -i xloggraph 2>/dev/null
fort77 -o xloggraph msg_box.o ZDr2d.o EditString.o hardcopy_ctrl.o xloggraph.o log_file.o tom_fortran_interface.o bits_and_pieces.o graphics.o -g -Os -I/usr/include/X11R6 -L/usr/X11R6/lib -lXaw -lXmu -lXt -lSM -lICE -lXpm -lXext -lX11 -lm -lgfortran -L%p/lib/gcc4.2/lib

#
sleep 10
#
cp xloggraph $CBIN/xloggraph.exe
if [[ -x $CBIN/xloggraph ]];then
rm -f $CBIN/xloggraph
fi
cd ../..
#
# Cleanup:
#
# make realclean
/bin/rm -f **/*.o
/bin/rm -f **/*.bak
/bin/rm -Rf src
/bin/rm -Rf x-windows/libjwc/libjwc_c
/bin/rm -Rf x-windows/libjwc/libjwc_f
/bin/rm -Rf x-windows/xdl_view/src
# remove redundant library junk
/bin/rm -Rf lib/cctbx
/bin/rm -Rf lib/**/.libs
/bin/rm -f lib/ccif/libccif.dylib
/bin/rm -f lib/src/libccp4c.dylib
/bin/rm -f lib/src/libmmdb.dylib
#/bin/rm -R unsupported
/bin/rm -R testcomp*
/bin/rm -R BINARY*
cd $CLIB
/bin/rm -f **/*.c
/bin/rm -f **/*.f
/bin/rm -f **/*.cpp
echo "Compile Phase Completed!"
echo "There are $(command ls -1 $CBIN | wc -l) programs in $CBIN; "
echo "there should be 200"
<<
################################################################################
InstallScript: <<
#!/bin/zsh -efv

umask 0022
export TEMPXTAL=$PWD:h
source include/ccp4.setup-zsh
export DYLD_LIBRARY_PATH=$CLIB
ORIGDIR=$(dirname $PWD)
# Change environment scripts to match final installation
perl -pi -e 's|\$TEMPXTAL|%p/share/xtal|g' include/ccp4.setup* # install prefix
#
#
cp ../XCCPJiffy-custom.gz XCCPJiffy.gz ; gunzip XCCPJiffy.gz; chmod a+x XCCPJiffy
perl -pi -e 's|5.0.1|%v|g' XCCPJiffy
mv -f XCCPJiffy lib/X11/app-defaults/XCCPJiffy
#
perl -pi.bak -e 's|/src/fink.build/ccp4-%v-%r|/share/xtal|g' bin/clipper-config
rm -f bin/clipper-config.bak
perl -pi.bak -e 's|lclipper |lclipper-core |g' bin/clipper-config
rm -f bin/clipper-config.bak
perl -pi.bak -e 's|lib/lib -lrfftw -lfftw |lib/ccp4-%v -lsrfftw -lsfftw |g' bin/clipper-config
rm -f bin/clipper-config.bak
#
# Fix path in libfoo.la libtool files:
#
perl -pi.bak -e 's|/src/fink.build/ccp4-%v-%r/ccp4-%v/lib|/lib/ccp4-%v|g' lib/**/*.la
rm -f lib/**/*.la.bak
#
# Now install:
#
mkdir -p %i/lib
cp -R lib %i/lib/ccp4-%v
mkdir -p %i/bin
#
mkdir -p %i/share/xtal/ccp4-%v/help
mkdir -p %i/share/man/man1
# set up man pages in a fink-compliant manner
cd $PWD/doc
mv rasmol.doc eightbit_rasmol.doc
foreach docfilepage ( *.doc )
cp ${docfilepage} %i/share/man/man1/${docfilepage:r}.1
cp ${docfilepage} %i/share/xtal/ccp4-%v/help/${docfilepage:r}
end
# back to build directory
cd ..
#
/bin/rm -rf lib
cp -R * %i/share/xtal/ccp4-%v/.
ln -s %p/lib/ccp4-%v %i/share/xtal/ccp4-%v/lib
#
# making scripts for %p/etc/profile.d
mkdir -p %i/etc/profile.d
#
echo "source %p/share/xtal/ccp4-%v/include/ccp4.setup" > %i/etc/profile.d/ccp4.csh
echo "setenv CLIB %p/lib/ccp4-%v " >> %i/etc/profile.d/ccp4.csh
#

echo "if [ -z \$ZSH_NAME ];then " > %i/etc/profile.d/ccp4.sh
echo " source %p/share/xtal/ccp4-%v/include/ccp4.setup-sh " >> %i/etc/profile.d/ccp4.sh
echo "else " >> %i/etc/profile.d/ccp4.sh
echo " source %p/share/xtal/ccp4-%v/include/ccp4.setup-zsh" >> %i/etc/profile.d/ccp4.sh
echo "fi " >> %i/etc/profile.d/ccp4.sh
echo "export CLIB=%p/lib/ccp4-%v " >> %i/etc/profile.d/ccp4.sh
#
chmod a+x %i/etc/profile.d/ccp4.*
#
chmod a+x %i/share/xtal/ccp4-%v/ccp4i/etc/osx_ccp4_mail
#
# chmod a+x %i/share/xtal/ccp4-%v/etc/ccp4help
#
ranlib %i/lib/ccp4-%v/*.a
ranlib %i/lib/ccp4-%v/**/*.a
#
<<
################################################################################
PostInstScript: <<
# Make the user read the license conditions
more %p/share/xtal/ccp4-%v/conditions.txt
<<
################################################################################
################################################################################
SplitOff: <<
Package: %N-shlibs
Description: CCP4 dynamic libraries
Files:<<
lib/ccp4-%v/*.dylib
<<
Shlibs: <<
%p/lib/ccp4-%v/libccif.dylib 0.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libccp4c.dylib 0.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-ccp4.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-ccp4.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-ccp4.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-cif.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-cif.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-cif.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-cns.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-cns.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-cns.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-contrib.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-contrib.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-contrib.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-core.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-core.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-core.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-minimol.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-minimol.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-minimol.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-mmdb.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-mmdb.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-mmdb.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-mmdbold.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-mmdbold.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-mmdbold.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-phs.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-phs.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libclipper-phs.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libjwc_c.0.1.1.dylib 2.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libjwc_c.0.dylib 2.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libjwc_c.dylib 2.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libmmdb.dylib 0.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libssm.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libssm.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libssm.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libxdl_view.2.0.0.dylib 3.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libxdl_view.2.dylib 3.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libxdl_view.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libxdl_viewextra.0.0.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libxdl_viewextra.0.dylib 1.0.0 %n (>= 6.0.2-1)
%p/lib/ccp4-%v/libxdl_viewextra.dylib 1.0.0 %n (>= 6.0.2-1)
<<
DocFiles: CHANGES COPYING INSTALL INSTALL.html INSTALL.ps README PROBLEMS academic_software_licence.pdf
<<
################################################################################
################################################################################
SplitOff2: <<
Package: %N-dev
BuildDependsOnly: true
Description: CCP4 static libraries and libtool files
Files:<<
lib/ccp4-%v/*.a
lib/ccp4-%v/*.la
<<
DocFiles: CHANGES COPYING INSTALL INSTALL.html INSTALL.ps README PROBLEMS academic_software_licence.pdf
<<
################################################################################
Description: Macromolecular crystallography package
DescDetail: <<
The CCP4 macromolecular crystallography suite has approximately
200 programs and utilities. This version includes the Clipper
libraries. Current phaser and cctbx programs are available as
separate fink packages.

Type "ccp4help" for a summary listing of all ccp4 programs.
Type "ccp4help foo" for a detailed description of program "foo."

Invoke optional ccp4i gui for the first run using "sudo ccp4i"
on 10.4, or "sudo -s" followed by "ccp4i" on 10.5 to permit
global configuration. Thereafter, you can invoke ccp4i without sudo.

This version compiles with the Apple Lapack/Blas framework.
License agreement is part of configure file -- print out form and mail in,
additional comments at http://sage.ucsc.edu/xtal/ccp4.html

CCP4 files will be installed under /sw/share/xtal/ccp4-6.0.2
This revision includes all available CCP4 patches as of June 28, 2007.
and new bash and zsh command completions specific to ccp4.

A new version of phaser (2.1.1) is available separately in fink as
a package called, imaginatively, phaser.

A new version of cctbx is available in fink from the cctbx package.

A new version of pointless is available as a separate fink package
of that name.

The ccp4-associated chooch package is available separately via fink.

The latest version of mosflm is available in two forms from fink; the
standard large form, and a special small display useful for 13 inch
laptop displays.

The ccp4-associated molecular graphics display program coot is also
available as a fink package.

Thanks to Jack Howarth for many helpful improvements.
<<
DocFiles: <<
README CHANGES COPYING PROBLEMS INSTALL INSTALL.html INSTALL.ps
ccp4i_installation.html academic_software_licence.pdf
academic_software_licence.ps.gz academic_software_licence.rtf
<<
Homepage: http://www.ccp4.ac.uk
License: Commercial
Maintainer: W. G. Scott

ccp4 stable port .patch

diff -ruN ccp4-6.0.2-orig/ccp4i/etc/configure.def.dist ccp4-6.0.2/ccp4i/etc/configure.def.dist
--- ccp4-6.0.2-orig/ccp4i/etc/configure.def.dist 2006-11-21 12:32:49.000000000 -0800
+++ ccp4-6.0.2/ccp4i/etc/configure.def.dist 2006-11-21 13:07:41.000000000 -0800
@@ -55,8 +55,8 @@
MESSAGE _text ""
BLT_LIBRARY _text ""
MENU_LENGTH _positiveint 25
-HYPERTEXT_VIEWER _text netscape
-START_NETSCAPE _text netscape
+HYPERTEXT_VIEWER _text open
+START_NETSCAPE _text open
O_MAPMAN _text mapman
MAPMAN_MAXSIZE _positiveint 4194304
QUANTA_MBKALL _text mbkall
diff -ruN ccp4-6.0.2-orig/ccp4i/etc/osx_ccp4_mail ccp4-6.0.2/ccp4i/etc/osx_ccp4_mail
--- ccp4-6.0.2-orig/ccp4i/etc/osx_ccp4_mail 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.2/ccp4i/etc/osx_ccp4_mail 2006-11-21 13:08:18.000000000 -0800
@@ -0,0 +1,164 @@
+#!/usr/bin/perl
+# Drop-in replacement for /usr/bin/mail that uses Mail.app (via an
+# applescript) rather than sendmail to send mail. Unlike /usr/bin/mail,
+# you can't use it for reading mail.
+#
+# usage: mail []
+# options:
+# -v be verbose
+# -g activate Mail.app to approve the message
+# -F specify the From: address
+# -b specify Bcc: recipients in a comma-separated list
+# -c specify Cc: recipients in a comma-separated list
+# -s specify the message subject
+#
+# The body of the message is read from standard input.
+#
+# Author: Nathaniel Nystrom
+# This software is in the public domain.
+#
+# Version 1.0, 21 Aug 2003 -- initial version
+# Version 1.0.1, 22 Aug 2003 -- fixes some quoting problems
+# Version 1.0.2, 23 Aug 2003 -- removed -R option; |reply to|
+# is a property of _incoming_ messages
+# Version 1.0.3, 17 Sep 2003 -- fixed escaping of \ in message body;
+# escape the subject too
+
+use strict;
+$|++;
+
+my ($verbose, $gui);
+my ($from, @to, @cc, @bcc, $subject, $body);
+my $prog;
+($prog = $0) =~ s|.*/||;
+
+while (@ARGV) {
+ my $arg = shift @ARGV;
+
+ if ($arg eq '-v') {
+ $verbose++;
+ }
+ elsif ($arg eq '-g') {
+ $gui++;
+ }
+ elsif ($arg eq '-F') {
+ $from = shift @ARGV || &usage("missing sender");
+ }
+ elsif ($arg eq '-i' || $arg eq '-l' || $arg eq '-n') {
+ # ignore; for /usr/bin/mail compatibility
+ }
+ elsif ($arg eq '-N' || $arg eq '-f' || $arg eq '-u') {
+ &usage("invalid option $arg; $prog cannot be used for reading mail");
+ }
+ elsif ($arg eq '-s') {
+ $subject = shift @ARGV || &usage("missing subject");
+ }
+ elsif ($arg eq '-c') {
+ my $list = shift @ARGV || &usage("missing Cc list");
+ @cc = split /\s*,\s*/, $list;
+ }
+ elsif ($arg eq '-b') {
+ my $list = shift @ARGV || &usage("missing Bcc list");
+ @bcc = split /\s*,\s*/, $list;
+ }
+ elsif ($arg =~ /^-/) {
+ &usage("invalid option $arg");
+ }
+ else {
+ @to = ($arg, @ARGV);
+ last;
+ }
+}
+
+&usage("missing recipients") unless @to;
+
+unless (defined $subject) {
+ print "Subject: ";
+ $subject = || '';
+ chomp $subject;
+}
+
+$body = '';
+
+while () {
+ $body .= $_;
+}
+
+$body = &escape($body);
+$subject = &escape($subject);
+
+my $script = <<"EOS";
+tell application "Mail"
+ set newMessage to make new outgoing message
+ tell newMessage
+ set subject to "$subject"
+ set content to "$body"
+EOS
+
+for (@to) { $script .= &recipient('to', $_); }
+for (@cc) { $script .= &recipient('cc', $_); }
+for (@bcc) { $script .= &recipient('bcc', $_); }
+
+my $visible = $gui ? "true" : "false";
+my $activate = $gui ? "activate" : "send newMessage";
+my $fromln = $from ? "set sender to \"$from\"" : "";
+
+$script .= <<"EOS";
+ $fromln
+ set visible to $visible
+ end tell
+ $activate
+end tell
+EOS
+
+if ($verbose >= 1) {
+ print "From: $from\n" if $from;
+ print "To: ", join(',', @to), "\n" if @to;
+ print "Cc: ", join(',', @cc), "\n" if @cc;
+ print "Bcc: ", join(',', @bcc), "\n" if @bcc;
+
+ if ($verbose >= 2) {
+ print "Script >>>\n";
+ print $script;
+ print "<<<\n";
+ print "\n";
+ print $body;
+ }
+}
+
+open(SCRIPT, "| osascript > /dev/null") || die "Couldn't fork osascript: $!\n";
+print SCRIPT $script;
+close SCRIPT;
+
+exit 0;
+
+sub escape {
+ my $x = shift;
+ $x =~ s/\\/\\\\/gm;
+ $x =~ s/"/\\"/gm;
+ $x =~ s/\n/\\n/gm;
+ $x;
+}
+
+sub recipient {
+ my ($type,$addr) = @_;
+ return <<"EOS"
+ make new $type recipient at end of $type recipients with properties {address: "$addr"}
+EOS
+}
+
+sub usage {
+ my $error = shift;
+ print STDERR "Error: $error\n" if $error;
+ print STDERR <<"EOS";
+usage: $prog []
+ options:
+ -v be verbose
+ -g activate Mail.app to approve the message
+ -F specify the From: address
+ -b specify Bcc: recipients in a comma-separated list
+ -c specify Cc: recipients in a comma-separated list
+ -s specify the message subject
+EOS
+ exit 1;
+}
diff -ruN ccp4-6.0.2-orig/ccp4i/src/local.tcl ccp4-6.0.2/ccp4i/src/local.tcl
--- ccp4-6.0.2-orig/ccp4i/src/local.tcl 2006-11-21 12:32:56.000000000 -0800
+++ ccp4-6.0.2/ccp4i/src/local.tcl 2006-11-21 13:10:06.000000000 -0800
@@ -34,7 +34,7 @@
#d_arg mail_address Mail addressee

return [expr {1 - [catch \
- "exec Mail -s \"$subject\" $mail_address < $tmp_file" ]}]
+ "exec osx_ccp4_mail -s \"$subject\" $mail_address < $tmp_file" ]}]
}

#d_index_title Interaction with Netscape
diff -ruN ccp4-6.0.2-orig/configure ccp4-6.0.2/configure
--- ccp4-6.0.2-orig/configure 2006-11-21 12:35:50.000000000 -0800
+++ ccp4-6.0.2/configure 2006-11-21 13:27:28.000000000 -0800
@@ -2301,17 +2301,17 @@
fi # CXX_LIBS

#defaults
- FOPTIM=${FOPTIM:-"-O2"}
- COPTIM=${COPTIM:-"-O2"}
- CXXOPTIM=${CXXOPTIM:-"-O2"}
+ FOPTIM=${FOPTIM:-"-O3"}
+ COPTIM=${COPTIM:-"-O3 -ffast-math"}
+ CXXOPTIM=${CXXOPTIM:-"-O3 -ffast-math"}
INSTALL_DATA=${INSTALL_DATA:-"cp"}
INSTALL_PROGRAM=${INSTALL_PROGRAM:-"cp"}
SETFLAGS=${SETFLAGS:-"sftools_FLAGS='$XFFLAGS $FOPTIM' \
- refmac5_FLAGS='$XFFLAGS -O1' \
+ refmac5_FLAGS='$XFFLAGS -O3' \
arp_waters_FLAGS='$XFFLAGS $FOPTIM -fforce-mem' \
- mplot_FLAGS='$XFFLAGS -O1' \
- molrep_FLAGS='$XFFLAGS -O1' \
- xdlmapman_FLAGS='$XFFLAGS -O1'"}
+ mplot_FLAGS='$XFFLAGS -O3' \
+ molrep_FLAGS='$XFFLAGS -O3' \
+ xdlmapman_FLAGS='$XFFLAGS -O3'"}
XDL_LIB=${XDL_LIB:-"-L${CCP4_LIB} -lxdl_view"}
XWIN_LIB=${XWIN_LIB:-"-L/usr/X11R6/lib -lXt -lSM -lX11 -lICE"}
XTYPE=${XTYPE:-"LINUX"}
@@ -2323,8 +2323,8 @@
XMKMF="IMAKECPP=/usr/bin/cpp xmkmf"
if test "$shared_lib" = yes; then
SHARED_LIB_CFLAGS=${SHARED_LIB_CFLAGS:-'-fPIC -fno-common'}
- SHARE_LIB='${CC} -dynamiclib -flat_namespace -undefined suppress ${SHARED_LIB_CFLAGS} -install_name libmmdb.dylib -all_load libmmdb.a -o libmmdb.dylib -lstdc++; ${CC} -dynamiclib -flat_namespace -undefined suppress ${SHARED_LIB_CFLAGS} -install_name libccp4c.dylib -all_load libccp4c.a -o libccp4c.dylib'
- SHARE_INST='${INSTALL_DATA} `pwd`/libmmdb.dylib ${libdir}/libmmdb.dylib; ${INSTALL_DATA} `pwd`/libccp4c.dylib ${libdir}/libccp4c.dylib'
+ SHARE_LIB='${CC} -dynamiclib -single_module -undefined dynamic_lookup ${SHARED_LIB_CFLAGS} -install_name ${RPATH}/libmmdb.dylib -all_load libmmdb.a -o libmmdb.dylib -lstdc++; ${CC} -dynamiclib -single_module -undefined dynamic_lookup ${SHARED_LIB_CFLAGS} -install_name ${RPATH}/libccp4c.dylib -all_load libccp4c.a -o libccp4c.dylib'
+ SHARE_INST='${INSTALL_DATA} `pwd`/libmmdb.dylib ${libdir}/libmmdb.dylib; ${INSTALL_DATA} `pwd`/libccp4c.dylib ${libdir}/libccp4c.dylib'
fi
#need -lcc_dynamic to get restFP and saveFP for g77 3.4 under darwin 7
case `$FC --version` in
diff -ruN ccp4-6.0.2-orig/etc/xloggraph ccp4-6.0.2/etc/xloggraph
--- ccp4-6.0.2-orig/etc/xloggraph 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.2/etc/xloggraph 2006-11-21 13:30:53.000000000 -0800
@@ -0,0 +1,6 @@
+#!/bin/zsh
+export XUSERFILESEARCHPATH=$CLIB/X11/app-defaults/XCCPJiffy
+xloggraph.exe "$@" &
+export XUSERFILESEARCHPATH=""
+print "Plot button sends pdf to Preview. Print or save pdf in Preview window."
+exit 0
diff -ruN ccp4-6.0.2-orig/etc/xplot84 ccp4-6.0.2/etc/xplot84
--- ccp4-6.0.2-orig/etc/xplot84 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.2/etc/xplot84 2006-11-21 13:31:20.000000000 -0800
@@ -0,0 +1,6 @@
+#!/bin/zsh
+export XUSERFILESEARCHPATH=$CLIB/X11/app-defaults/XCCPJiffy
+xplot84driver.exe "$@" &
+export XUSERFILESEARCHPATH=""
+print "Plot button sends pdf to Preview. Print or save pdf in Preview window."
+exit 0
diff -ruN ccp4-6.0.2-orig/etc/xplot84driver ccp4-6.0.2/etc/xplot84driver
--- ccp4-6.0.2-orig/etc/xplot84driver 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.2/etc/xplot84driver 2006-11-21 13:31:20.000000000 -0800
@@ -0,0 +1,6 @@
+#!/bin/zsh
+export XUSERFILESEARCHPATH=$CLIB/X11/app-defaults/XCCPJiffy
+xplot84driver.exe "$@" &
+export XUSERFILESEARCHPATH=""
+print "Plot button sends pdf to Preview. Print or save pdf in Preview window."
+exit 0
diff -ruN ccp4-6.0.2-orig/include/ccp4.setup-bash ccp4-6.0.2/include/ccp4.setup-bash
--- ccp4-6.0.2-orig/include/ccp4.setup-bash 2006-11-21 12:35:39.000000000 -0800
+++ ccp4-6.0.2/include/ccp4.setup-bash 2006-11-21 13:35:28.000000000 -0800
@@ -196,27 +196,27 @@

# LD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.so)
# at runtime
-if test "$LD_LIBRARY_PATH"; then
- if [ $ccp4_first_in_path -eq 1 ]; then
- setenv LD_LIBRARY_PATH ${CLIB}:${LD_LIBRARY_PATH}
- else
- setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${CLIB}
- fi
-else
- setenv LD_LIBRARY_PATH ${CLIB}
-fi
-
-# DYLD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.dylib)
-# at runtime (used on Mac OS X)
-if test "$DYLD_LIBRARY_PATH"; then
- if [ $ccp4_first_in_path -eq 1 ]; then
- setenv DYLD_LIBRARY_PATH ${CLIB}:${DYLD_LIBRARY_PATH}
- else
- setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:${CLIB}
- fi
-else
- setenv DYLD_LIBRARY_PATH ${CLIB}
-fi
+#if test "$LD_LIBRARY_PATH"; then
+# if [ $ccp4_first_in_path -eq 1 ]; then
+# setenv LD_LIBRARY_PATH ${CLIB}:${LD_LIBRARY_PATH}
+# else
+# setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${CLIB}
+# fi
+#else
+# setenv LD_LIBRARY_PATH ${CLIB}
+#fi
+#
+## DYLD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.dylib)
+## at runtime (used on Mac OS X)
+#if test "$DYLD_LIBRARY_PATH"; then
+# if [ $ccp4_first_in_path -eq 1 ]; then
+# setenv DYLD_LIBRARY_PATH ${CLIB}:${DYLD_LIBRARY_PATH}
+# else
+# setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:${CLIB}
+# fi
+#else
+# setenv DYLD_LIBRARY_PATH ${CLIB}
+#fi

### XAPPLRESDIR ###

@@ -234,11 +234,11 @@
# not be set at the time this file is read. Thus edit this part as
# appropriate. (SunOS will normally want to use /usr/openwin or $OPENWINHOME
# instead of /usr; others may want /usr/local/lib or somw such):
-if test "$XUSERFILESEARCHPATH"; then
- setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:$XUSERFILESEARCHPATH
-else
- setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:/usr/lib/X11/app-defaults
-fi
+#if test "$XUSERFILESEARCHPATH"; then
+# setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:$XUSERFILESEARCHPATH
+#else
+# setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:/usr/lib/X11/app-defaults
+#fi

### TRAPPFE ###
# TRAPFPE is set to ensure (in collaboration with -lfpe) an abort on floating
@@ -361,13 +361,3 @@
unset alias # clean up
fi # ksh test

-# Set-up cctbx environment
-test -r $CCP4/lib/cctbx/cctbx_build/setpaths.sh && . $CCP4/lib/cctbx/cctbx_build/setpaths.sh
-
-# Set-up phaser environment
-if ( test -d $CCP4/src/phaser) ; then
- phaser_mtype=`$CCP4/src/phaser/bin/machine_type`
- phaser_version=`grep PHASER_VERSION $CCP4/src/phaser/conf/version | awk '{print $3}'`
- phaser_setup_file="${CCP4}/src/phaser/phaser-${phaser_version}/build/${phaser_mtype}/setpaths.sh"
- test -r $phaser_setup_file && . $phaser_setup_file
-fi
diff -ruN ccp4-6.0.2-orig/include/ccp4.setup-dist ccp4-6.0.2/include/ccp4.setup-dist
--- ccp4-6.0.2-orig/include/ccp4.setup-dist 2006-11-21 12:35:39.000000000 -0800
+++ ccp4-6.0.2/include/ccp4.setup-dist 2006-11-21 13:38:50.000000000 -0800
@@ -107,7 +107,7 @@
setenv CBIN $CCP4/bin
setenv CLIB $CCP4/lib

- setenv CCP4_BROWSER netscape
+ setenv CCP4_BROWSER open

if (${?MANPATH}) then
if ($ccp4_first_in_path) then
@@ -183,28 +183,28 @@

# LD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.so)
# at runtime
-if (${?LD_LIBRARY_PATH}) then
- if ($ccp4_first_in_path) then
- setenv LD_LIBRARY_PATH ${CLIB}:${LD_LIBRARY_PATH}:${CCP4}/extralib
- else
- setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${CLIB}:${CCP4}/extralib
- endif
-else
- setenv LD_LIBRARY_PATH ${CLIB}:${CCP4}/extralib
-endif
-
-# DYLD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.dylib)
-# at runtime (used on Mac OS X)
-if (${?DYLD_LIBRARY_PATH}) then
- if ($ccp4_first_in_path) then
- setenv DYLD_LIBRARY_PATH ${CLIB}:${CCP4}/extralib:${DYLD_LIBRARY_PATH}
- else
- setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:${CLIB}:${CCP4}/extralib
- endif
-else
- setenv DYLD_LIBRARY_PATH ${CLIB}:${CCP4}/extralib
-endif
-
+# if (${?LD_LIBRARY_PATH}) then
+# if ($ccp4_first_in_path) then
+# setenv LD_LIBRARY_PATH ${CLIB}:${LD_LIBRARY_PATH}:${CCP4}/extralib
+# else
+# setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${CLIB}:${CCP4}/extralib
+# endif
+# else
+# setenv LD_LIBRARY_PATH ${CLIB}:${CCP4}/extralib
+# endif
+#
+# # DYLD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.dylib)
+# # at runtime (used on Mac OS X)
+# if (${?DYLD_LIBRARY_PATH}) then
+# if ($ccp4_first_in_path) then
+# setenv DYLD_LIBRARY_PATH ${CLIB}:${CCP4}/extralib:${DYLD_LIBRARY_PATH}
+# else
+# setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:${CLIB}:${CCP4}/extralib
+# endif
+# else
+# setenv DYLD_LIBRARY_PATH ${CLIB}:${CCP4}/extralib
+# endif
+#
### XAPPLRESDIR ###

# If you want to use xloggraph/xplot84driver, you need to get the application
@@ -221,11 +221,11 @@
# not be set at the time this file is read. Thus edit this part as
# appropriate. (SunOS will normally want to use /usr/openwin or $OPENWINHOME
# instead of /usr; others may want /usr/local/lib or somw such):
-if ($?XUSERFILESEARCHPATH) then
- setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:$XUSERFILESEARCHPATH
-else
- setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:/usr/lib/X11/app-defaults
-endif
+# if ($?XUSERFILESEARCHPATH) then
+# setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:$XUSERFILESEARCHPATH
+# else
+# setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:/usr/lib/X11/app-defaults
+# endif

### TRAPPFE ###
# TRAPFPE is set to ensure (in collaboration with -lfpe) an abort on floating
@@ -349,13 +349,13 @@
alias lbin 'pushd $CBIN>/dev/null'
#

-# Set-up cctbx environment
-if (-e $CCP4/lib/cctbx/cctbx_build/setpaths.csh) source $CCP4/lib/cctbx/cctbx_build/setpaths.csh
-
-# Set-up phaser environment
-if (-d $CCP4/src/phaser) then
- set phaser_mtype = `$CCP4/src/phaser/bin/machine_type`
- set phaser_version = `grep PHASER_VERSION $CCP4/src/phaser/conf/version | awk '{print $3}'`
- set phaser_setup_file = "${CCP4}/src/phaser/phaser-${phaser_version}/build/${phaser_mtype}/setpaths.csh"
- if (-e $phaser_setup_file) source $phaser_setup_file
-endif
+# # Set-up cctbx environment
+# if (-e $CCP4/lib/cctbx/cctbx_build/setpaths.csh) source $CCP4/lib/cctbx/cctbx_build/setpaths.csh
+#
+# # Set-up phaser environment
+# if (-d $CCP4/src/phaser) then
+# set phaser_mtype = `$CCP4/src/phaser/bin/machine_type`
+# set phaser_version = `grep PHASER_VERSION $CCP4/src/phaser/conf/version | awk '{print $3}'`
+# set phaser_setup_file = "${CCP4}/src/phaser/phaser-${phaser_version}/build/${phaser_mtype}/setpaths.csh"
+# if (-e $phaser_setup_file) source $phaser_setup_file
+# endif
diff -ruN ccp4-6.0.2-orig/include/ccp4.setup-sh ccp4-6.0.2/include/ccp4.setup-sh
--- ccp4-6.0.2-orig/include/ccp4.setup-sh 2006-11-21 12:35:39.000000000 -0800
+++ ccp4-6.0.2/include/ccp4.setup-sh 2006-11-21 14:25:30.000000000 -0800
@@ -99,7 +99,8 @@
export CBIN=$CCP4/bin
export CLIB=$CCP4/lib

- export CCP4_BROWSER=mozilla
+ # export CCP4_BROWSER=mozilla
+ CCP4_BROWSER="" ; export CCP4_BROWSER=open
export MANPATH=$CCP4/man:$MANPATH # edit this if necessary
export MCTYPE=unix # (only for Laue)
# ;;
@@ -118,8 +119,8 @@
export CLASSPATH=$CBIN:$CLASSPATH # edit this if necessary

### PLOT_COMMAND PRINT_COMMAND for the XCCPJIFFY programs to compile ###
-export PLOT_COMMAND='lp -s'
-export PRINT_COMMAND='lp -s'
+export PLOT_COMMAND='lpr'
+export PRINT_COMMAND='lpr'

# HARVESTHOME specifies location of harvesting files (defaults to $HOME)
export HARVESTHOME=$HOME
@@ -131,58 +132,7 @@

export CCP4_OPEN=UNKNOWN

-### BINSORT_MEM ###
-# BINSORT_MEM is workspace used by the binsort program. In principle this
-# value is machine-dependent. It may benefit from being enlarged, but values
-# higher than 2M have been reported to cause excessive paging on some systems.
-# You might like to experiment with a program such as fft with different
-# values -- 102400 (bytes) is the default. csh's `time' command can tell you
-# about paging.
-#
-# export BINSORT_MEM=8388608
-
-# LD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.so)
-# at runtime
-if test "LD_LIBRARY_PATH"; then
- if test $ccp4_first_in_path -eq 1; then
- export LD_LIBRARY_PATH=$CLIB:$LD_LIBRARY_PATH:$CCP4/extralib
- else
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CLIB:$CCP4/extralib
- fi
-else
- export LD_LIBRARY_PATH=$CLIB:$CCP4/extralib
-fi
-
-# DYLD_LIBRARY_PATH specifies where to find dynamic libraries
-# (e.g. libccp4.dylib) at runtime
-if test "DYLD_LIBRARY_PATH"; then
- if test $ccp4_first_in_path -eq 1; then
- export DYLD_LIBRARY_PATH=$CLIB:$CCP4/extralib:$DYLD_LIBRARY_PATH
- else
- export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$CLIB:$CCP4/extralib
- fi
-else
- export DYLD_LIBRARY_PATH=$CLIB:$CCP4/extralib
-fi
-
-### XAPPLRESDIR ###
-
-# If you want to use xloggraph/xplot84driver, you need to get the application
-# defaults picked up somehow. As distributed, the file can't just live in an
-# application defaults directory since it requires reading by xrdb to sort out
-# the differences for monochrome displays. At Daresbury a version of the file
-# assuming a monochrome display is kept in the directory
-# $CCP4_LIB/X11/app-defaults and this is picked up through the
-# XUSERFILESEARCHPATH environment variable. That means you only see black and
-# white on a colour display. Alternatively you might make sure that it is
-# read by xrdb on startup of the X Windows system or delegate the
-# responsibility to users to run it. There are disadvantages to putting an
-# invocation of xrdb in here, one being that the correct value of DISPLAY may
-# not be set at the time this file is read. Thus edit this part as
-# appropriate. (SunOS will normally want to use /usr/openwin or $OPENWINHOME
-# instead of /usr; others may want /usr/local/lib or somw such):
-
-export XAPPLRESDIR=/sw/etc/app-defaults/
+

### TRAPPFE ###
# TRAPFPE is set to ensure (in collaboration with -lfpe) an abort on floating
@@ -237,20 +187,20 @@
# binaries of the same name. Put ccp4 stuff after the current path to avoid
# confusion with `.' or whatever in the path:
#
-# This construct prevents the path getting longer each time ccp4.setup is
-# executed (A. Perrakis)
-ccp4pathlist="${CCP4}/etc ${CBIN} ${CCP4I_TOP}/bin "
-#
-for dir in ${ccp4pathlist}
-do
- if [ `expr ":${PATH}:" : ".*:${dir}:"` -eq 0 ]; then
- if test $ccp4_first_in_path -eq 1; then
- PATH=${dir}:${PATH}
- else
- PATH=${PATH}:${dir}
- fi
- fi
-done
+# # This construct prevents the path getting longer each time ccp4.setup is
+# # executed (A. Perrakis)
+ PATH=${PATH}:${CCP4}/etc:${CBIN}:${CCP4I_TOP}/bin ; export PATH
+# #
+# for dir in ${ccp4pathlist}
+# do
+# if [ `expr ":${PATH}:" : ".*:${dir}:"` -eq 0 ]; then
+# if test $ccp4_first_in_path -eq 1; then
+# PATH=${dir}:${PATH}
+# else
+# PATH=${PATH}:${dir}
+# fi
+# fi
+# done

# Optional (useful) additional environment variables
export CCP4=$CCP4
@@ -302,13 +252,13 @@
alias lgnoms='pushd $CCP4_MASTER/laue/gnom/src>/dev/null'
alias lbin='pushd $CBIN>/dev/null'

-# Set-up cctbx environment
-test -r $CCP4/lib/cctbx/cctbx_build/setpaths.sh && . $CCP4/lib/cctbx/cctbx_build/setpaths.sh
-
-# Set-up phaser environment
-if ( test -d $CCP4/src/phaser) ; then
- phaser_mtype=`$CCP4/src/phaser/bin/machine_type`
- phaser_version=`grep PHASER_VERSION $CCP4/src/phaser/conf/version | awk '{print $3}'`
- phaser_setup_file="${CCP4}/src/phaser/phaser-${phaser_version}/build/${phaser_mtype}/setpaths.sh"
- test -r $phaser_setup_file && . $phaser_setup_file
-fi
+# # Set-up cctbx environment
+# test -r $CCP4/lib/cctbx/cctbx_build/setpaths.sh && . $CCP4/lib/cctbx/cctbx_build/setpaths.sh
+#
+# # Set-up phaser environment
+# if ( test -d $CCP4/src/phaser) ; then
+# phaser_mtype=`$CCP4/src/phaser/bin/machine_type`
+# phaser_version=`grep PHASER_VERSION $CCP4/src/phaser/conf/version | awk '{print $3}'`
+# phaser_setup_file="${CCP4}/src/phaser/phaser-${phaser_version}/build/${phaser_mtype}/setpaths.sh"
+# test -r $phaser_setup_file && . $phaser_setup_file
+# fi
diff -ruN ccp4-6.0.2-orig/include/ccp4.setup-zsh ccp4-6.0.2/include/ccp4.setup-zsh
--- ccp4-6.0.2-orig/include/ccp4.setup-zsh 2006-11-21 12:35:39.000000000 -0800
+++ ccp4-6.0.2/include/ccp4.setup-zsh 2006-11-21 14:33:38.000000000 -0800
@@ -70,7 +70,7 @@
# but note the SGI distributed version of Tcl/Tk is not
# appropriate version

-export CCP4I_TCLTK=/prefix/bin
+export CCP4I_TCLTK=@PREFIX@/bin

# CCP4I_HELP - directory contain ccp4i help - default is $CCP4I_TOP/help
export CCP4I_HELP=$CCP4I_TOP/help
@@ -122,13 +122,14 @@


if [[ $(uname) = Darwin ]]; then
- export CCP4_BROWSER=open # open in OS X default browser
+ CCP4_BROWSER="" ; export CCP4_BROWSER=open # open in OS X default browser
elif [[ $(uname) = Linux ]];then
- export CCP4_BROWSER=konqueror
- # export CCP4_BROWSER=mozilla # specify favorite browser
- # export CCP4_BROWSER=netscape
+ CCP4_BROWSER="" ; export CCP4_BROWSER=firefox
+ # CCP4_BROWSER="" ; export CCP4_BROWSER=konqueror
+ # CCP4_BROWSER="" ; export CCP4_BROWSER=mozilla # specify favorite browser
+ # CCP4_BROWSER="" ; export CCP4_BROWSER=netscape
else
- export CCP4_BROWSER=netscape
+ CCP4_BROWSER="" ; export CCP4_BROWSER=netscape
fi

MANPATH=$CCP4/man:$MANPATH # edit this if necessary
@@ -175,67 +176,6 @@
# export BINSORT_MEM=8388608


-# If installed via fink, skip this bit:
-
-if [[ -z $SWPREFIX ]];then
- if [[ -d /sw/bin/fink-virtual-pkgs ]];then
- SWPREFIX=$(dirname $(dirname $(which /sw/bin/fink-virtual-pkgs)))
- fi
-fi
-
-if [[ -z $SWPREFIX || $CCP4_MASTER != $SWPREFIX/share/xtal ]];then
-
- # LD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.so)
- # at runtime
-
- if test "$LD_LIBRARY_PATH"; then
- if [[ $ccp4_first_in_path == 1 ]]; then
- export LD_LIBRARY_PATH=$CLIB:$LD_LIBRARY_PATH
- else
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CLIB
- fi
- else
- export LD_LIBRARY_PATH=$CLIB
- fi
- # DYLD_LIBRARY_PATH specifies where to find dynamic libraries
- # (e.g. libccp4.dylib) at runtime
- if test "$DYLD_LIBRARY_PATH"; then
- if [[ $ccp4_first_in_path == 1 ]]; then
- export DYLD_LIBRARY_PATH=$CLIB:$DYLD_LIBRARY_PATH
- else
- export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$CLIB
- fi
- else
- export DYLD_LIBRARY_PATH=$CLIB
- fi
-
- ### XAPPLRESDIR ###
-
- # If you want to use xloggraph/xplot84driver, you need to get the application
- # defaults picked up somehow. As distributed, the file can't just live in an
- # application defaults directory since it requires reading by xrdb to sort out
- # the differences for monochrome displays. At Daresbury a version of the file
- # assuming a monochrome display is kept in the directory
- # $CCP4_LIB/X11/app-defaults and this is picked up through the
- # XUSERFILESEARCHPATH environment variable. That means you only see black and
- # white on a colour display. Alternatively you might make sure that it is
- # read by xrdb on startup of the X Windows system or delegate the
- # responsibility to users to run it. There are disadvantages to putting an
- # invocation of xrdb in here, one being that the correct value of DISPLAY may
- # not be set at the time this file is read. Thus edit this part as
- # appropriate. (SunOS will normally want to use /usr/openwin or $OPENWINHOME
- # instead of /usr; others may want /usr/local/lib or somw such):
-
- if [[ -n "$XUSERFILESEARCHPATH" ]]; then
- XUSERFILESEARCHPATH=$CCP4_LIB/X11/app-defaults/%N:$XUSERFILESEARCHPATH
- else
- XUSERFILESEARCHPATH=$CCP4_LIB/X11/app-defaults/%N:/usr/lib/X11/app-defaults
- fi
-
- export XUSERFILESEARCHPATH
-
-fi
-
### TRAPPFE ###
# TRAPFPE is set to ensure (in collaboration with -lfpe) an abort on floating
# point exceptions under IRIX. It shouldn't cause harm on other systems, but
@@ -383,16 +323,16 @@
typeset -U manpath
typeset -U classpath

-# Set-up cctbx environment
-test -r $CCP4/lib/cctbx/cctbx_build/setpaths.sh && . $CCP4/lib/cctbx/cctbx_build/setpaths.sh
-
-# Set-up phaser environment
-if ( test -d $CCP4/src/phaser) ; then
- phaser_mtype=`$CCP4/src/phaser/bin/machine_type`
- phaser_version=`grep PHASER_VERSION $CCP4/src/phaser/conf/version | awk '{print $3}'`
- phaser_setup_file="${CCP4}/src/phaser/phaser-${phaser_version}/build/${phaser_mtype}/setpaths.sh"
- test -r $phaser_setup_file && . $phaser_setup_file
-fi
+# # Set-up cctbx environment
+# test -r $CCP4/lib/cctbx/cctbx_build/setpaths.sh && . $CCP4/lib/cctbx/cctbx_build/setpaths.sh
+#
+# # Set-up phaser environment
+# if ( test -d $CCP4/src/phaser) ; then
+# phaser_mtype=`$CCP4/src/phaser/bin/machine_type`
+# phaser_version=`grep PHASER_VERSION $CCP4/src/phaser/conf/version | awk '{print $3}'`
+# phaser_setup_file="${CCP4}/src/phaser/phaser-${phaser_version}/build/${phaser_mtype}/setpaths.sh"
+# test -r $phaser_setup_file && . $phaser_setup_file
+# fi



diff -ruN ccp4-6.0.2-orig/lib/ccif/configure ccp4-6.0.2/lib/ccif/configure
--- ccp4-6.0.2-orig/lib/ccif/configure 2006-11-21 12:35:37.000000000 -0800
+++ ccp4-6.0.2/lib/ccif/configure 2006-11-21 13:05:57.000000000 -0800
@@ -1873,8 +1873,8 @@
else
SHARED_LIB_PATH='DYLD_LIBRARY_PATH=`pwd`'
fi
- SHARED_LIB_CMD=' $(LD) -dylib -dynamic -flat_namespace \\\
- -undefined suppress -dylib_install_name $(SHARED_LIB_NAME) \\\
+ SHARED_LIB_CMD=' $(LD) -dylib -dynamic -single_module \\\
+ -undefined dynamic_lookup -dylib_install_name ${RPATH}/$(SHARED_LIB_NAME) \\\
-all_load $L \\\
-o $(SHARED_LIB_NAME) -ldylib1.o'
SHARED_LIB_EXPORTS_CMD=''
@@ -1890,8 +1890,8 @@
else
SHARED_LIB_PATH='DYLD_LIBRARY_PATH=`pwd`'
fi
- SHARED_LIB_CMD=' $(LD) -dylib -dynamic -flat_namespace \\\
- -undefined suppress -dylib_install_name $(SHARED_LIB_NAME) \\\
+ SHARED_LIB_CMD=' $(LD) -dylib -dynamic -single_module \\\
+ -undefined dynamic_lookup -dylib_install_name ${RPATH}/$(SHARED_LIB_NAME) \\\
-all_load $L \\\
-o $(SHARED_LIB_NAME) -ldylib1.o'
SHARED_LIB_EXPORTS_CMD=''
@@ -1907,9 +1907,9 @@
else
SHARED_LIB_PATH='DYLD_LIBRARY_PATH=`pwd`'
fi
- SHARED_LIB_CMD='$(CC) $(SHARED_LIB_CFLAGS) -dynamiclib -flat_namespace \\\
- -undefined suppress -install_name \\\
- $(SHARED_LIB_NAME) \\\
+ SHARED_LIB_CMD='$(CC) $(SHARED_LIB_CFLAGS) -dynamiclib -single_module \\\
+ -undefined dynamic_lookup -install_name \\\
+ ${RPATH}/$(SHARED_LIB_NAME) \\\
-all_load $L \\\
-o $(SHARED_LIB_NAME)'
SHARED_LIB_EXPORTS_CMD=''
diff -ruN ccp4-6.0.2-orig/lib/cctbx/ccp4_build ccp4-6.0.2/lib/cctbx/ccp4_build
--- ccp4-6.0.2-orig/lib/cctbx/ccp4_build 2006-11-21 12:35:30.000000000 -0800
+++ ccp4-6.0.2/lib/cctbx/ccp4_build 2006-11-21 13:54:47.000000000 -0800
@@ -1,53 +1,5 @@
-#! /bin/sh
+#! /bin/sh -ef

-usage='echo "Usage: ccp4_build [--help] [--libdir=DIR]" '
-
-if ( eval test -d cctbx_build || eval mkdir cctbx_build ) ; then :
-else
- eval echo "! No directory cctbx_build and can\'t create it."
- exit 1
-fi
-
-cctbxopts="--command_version_suffix=ccp4-6.0 --build=release"
-for arg
-do
-
- case $arg in
-
- -help | --help | -h | help)
- eval $usage; exit 0;;
-
- -libdir=* | --libdir=* | --libdi=* | --libd=* | --lib=* | --li=* | --l=*)
- libdir=`echo $arg | sed 's/[-a-z_]*=//'` ; break;;
-
- # all other arguments passed to cctbx build
- *)
- cctbxopts="$cctbxopts $arg" ;;
-
- esac
-
-done
-
-if ( eval test -z \"\$CCP4\" ) ; then
- echo "! Please set CCP4 environment, e.g. source ccp4.setup "
- exit 1
-else true; fi
-
-libdir=${libdir:-$CCP4_LIB}
-
-echo "Changing directory to cctbx_build"
-cd cctbx_build
-
-echo "Running libtbx/configure.py"
-python ../cctbx_sources/libtbx/configure.py $cctbxopts ccp4io=${CCP4} mmtbx
-
-echo "Running setpaths.sh"
-. ./setpaths.sh
-
-echo "Building cctbx"
-libtbx.scons .
-
-# sunos 32 vs 64
-# use of sunos compilers
-# installation ??
+echo "Skipping final build of cctbx"
+echo "Install fink's cctbx package if you need this"

diff -ruN ccp4-6.0.2-orig/lib/cctbx/cctbx_install_script.csh ccp4-6.0.2/lib/cctbx/cctbx_install_script.csh
--- ccp4-6.0.2-orig/lib/cctbx/cctbx_install_script.csh 2006-11-21 12:35:30.000000000 -0800
+++ ccp4-6.0.2/lib/cctbx/cctbx_install_script.csh 2006-11-21 13:56:24.000000000 -0800
@@ -1,232 +1,6 @@
-#! /bin/csh -f
+#! /bin/csh -ef

-set install_root="$cwd"
-set bundle="cctbx"
-set sources="$cwd/${bundle}_sources"
-set build="$cwd/${bundle}_build"
-set prefer_usr_bin_python=0
+echo "Skipping final build of cctbx"
+echo "Install fink's cctbx package if you need this"

-unalias cat
-unalias cd
-unalias grep
-unalias ls
-unalias mkdir
-
-unsetenv PYTHONHOME
-
-if (-f "$sources/TAG") then
- echo "Build tag:"
- cat "$sources/TAG"
-endif
-
-if (-d "$sources/boost") then
- set have_sources=1
-else
- set have_sources=0
-endif
-
-set python_exe=None
-set build_mode=release
-
-if ("`uname`" == "Darwin") then
- set python_exe="/Library/Frameworks/Python.framework/Versions/2.3/bin/python"
- if (! -x "$python_exe") then
- set python_exe="/System$python_exe"
- endif
- "$python_exe" -V
- if ($status != 0) then
- echo "Under Mac OS 10 Python 2.3 must be pre-installed."
- echo "Please refer to the following web page for more information:"
- echo "http://cci.lbl.gov/cctbx_build/mac_os_x_notes.html"
- exit 1
- endif
-endif
-
-if ($have_sources == 0) then
-
- if (-d "$build/python") then
- set python_exe="$build/python/bin/python"
- endif
- if ($prefer_usr_bin_python) then
- if ("$python_exe" == None && -x /usr/bin/python) then
- /usr/bin/python -V |& head -1
- if ($status == 0) then
- set python_exe=/usr/bin/python
- endif
- endif
- endif
- if ("$python_exe" == None) then
- python -V |& head -1
- if ($status == 0) then
- set python_exe=python
- endif
- endif
- if (! $prefer_usr_bin_python) then
- if ("$python_exe" == None && -x /usr/bin/python) then
- /usr/bin/python -V |& head -1
- if ($status == 0) then
- set python_exe=/usr/bin/python
- endif
- endif
- endif
-
-else
-
- if ($#argv == 0) then
- echo -n "Please enter the number of available CPU's [1]: "
- set n_cpu_s=(`echo "$<"`)
- if ($#n_cpu_s > 1) then
- echo "Not a number! Please try again."
- exit 1
- else if ($#n_cpu_s == 0) then
- set n_cpu_s=1
- else
- set n_cpu_s="$n_cpu_s[1]"
- endif
- else if ($#argv == 1) then
- set n_cpu_s="$1"
- else
- echo "usage: $0 number_of_cpu_s"
- exit 1
- endif
- echo "Number of available CPU's: $n_cpu_s"
- if ("$n_cpu_s" == "0") exit 0
-
- if ("$python_exe" == None) then
-
- set python_sources=(`ls | grep Python-`)
- if ($#python_sources == 0) then
- set python_sources=None
- else if ($#python_sources == 1) then
- set python_sources="$python_sources[1]"
- else
- echo "ERROR: Multiple Python source code directories."
- echo " Move or remove all but one directory."
- exit 1
- endif
-
- if ("$python_sources" == None) then
-
- echo "Trying to find a pre-installed Python:"
- set python_exe=None
- if (-x "$build/python/bin/python") then
- "$build/python/bin/python" -V |& head -1
- if ($status == 0) then
- set python_exe="$build/python/bin/python"
- endif
- endif
- if ("$python_exe" == None) then
- python -V |& head -1
- if ($status == 0) then
- set python_exe=python
- endif
- endif
- if ("$python_exe" == None) then
- python2 -V |& head -1
- if ($status == 0) then
- set python_exe=python2
- endif
- endif
- if ("$python_exe" == None && -x /usr/bin/python) then
- /usr/bin/python -V |& head -1
- if ($status == 0) then
- set python_exe=/usr/bin/python
- endif
- endif
- if ("$python_exe" != None) then
- set python_version=(`"$python_exe" -V |& tr "." " "`)
- if ("$python_version[2]") then
- set minor=`echo "$python_version[3]" | cut -c-1`
- if ($minor < 2 || ($minor == 2 && $#python_version == 3)) then
- echo "A more recent Python version is required (2.2.1 or higher)."
- set python_exe=None
- endif
- endif
- endif
- if ("$python_exe" == None) then
- echo ""
- echo "Cannot find a Python interpreter."
- echo ""
- echo "Please download an installer with Python included"
- echo "or add a matching Python to the PATH environment variable."
- echo ""
- echo "Installation aborted."
- exit 1
- endif
-
- else
-
- echo "Installing $python_sources from sources"
- mkdir -p "$build"
- cd "$build"
- cd ..
- cd "$python_sources"
- set py_install_log="../py_install_log"
- echo "Configuring Python"
- ./configure --prefix="$build/python" >& "$py_install_log"
- echo "Compiling Python. This may take a while."
- make >>& "$py_install_log"
- echo "Installing Python"
- make install >>& "$py_install_log"
- echo "Done installing Python."
- cd "$install_root"
- set python_exe="$build/python/bin/python"
- "$python_exe" -V
- if ($status != 0) then
- echo "ERROR: Python installation failed."
- echo "Please check the log file for errors:"
- echo " $py_install_log"
- exit 1
- endif
-
- endif
-
- endif
-
- mkdir -p "$build"
-
-endif
-
-echo ""
-echo "Precompiling all .py files. This may take a minute or two."
-"$python_exe" "$sources/libtbx/libtbx/command_line/py_compile_all.py"
-
-echo ""
-cd "$build"
-echo "Configuring $bundle build directory"
-"$python_exe" "$sources/libtbx/configure.py" --build="$build_mode" mmtbx clipper
-source setpaths_all.csh
-
-if ($have_sources != 0) then
- echo ""
- echo "Installing $bundle modules. This may take a while."
- libtbx.scons -j "$n_cpu_s" .
-endif
-
-set test_py="$BOOST_ADAPTBX_DIST/tst_rational.py"
-if (-f "$test_py") then
- echo ""
- echo "Running a selected test"
- set cmd='libtbx.python "'"$test_py"'"'
- echo "$cmd"
- eval $cmd
-endif
-
-cat << EOT
-
-***
-*** csh and tcsh users:
-*** To use this installation in a new shell or process run the command:
-***
-*** source "$LIBTBX_BUILD/setpaths.csh"
-***
-*** You may want to add this line to your .cshrc file.
-***
-*** sh and bash users:
-*** To use this installation in a new shell or process run the command:
-***
-*** . "$LIBTBX_BUILD/setpaths.sh"
-***
-*** You may want to add this line to your .profile or .bashrc file.
-***
-EOT
+
\ No newline at end of file
diff -ruN ccp4-6.0.2-orig/lib/clipper/clipper/mmdb/Makefile.in ccp4-6.0.2/lib/clipper/clipper/mmdb/Makefile.in
--- ccp4-6.0.2-orig/lib/clipper/clipper/mmdb/Makefile.in 2006-11-21 12:35:30.000000000 -0800
+++ ccp4-6.0.2/lib/clipper/clipper/mmdb/Makefile.in 2006-11-21 12:40:37.000000000 -0800
@@ -143,7 +143,7 @@
LTLIBRARIES = $(lib_LTLIBRARIES)

libclipper_mmdb_la_LDFLAGS =
-libclipper_mmdb_la_LIBADD =
+libclipper_mmdb_la_LIBADD = $(MMDB_LIBS)
am_libclipper_mmdb_la_OBJECTS = clipper_mmdb.lo
libclipper_mmdb_la_OBJECTS = $(am_libclipper_mmdb_la_OBJECTS)

diff -ruN ccp4-6.0.2-orig/lib/fftw/configure ccp4-6.0.2/lib/fftw/configure
--- ccp4-6.0.2-orig/lib/fftw/configure 2006-11-21 12:35:37.000000000 -0800
+++ ccp4-6.0.2/lib/fftw/configure 2006-11-21 13:58:21.000000000 -0800
@@ -1907,7 +1907,8 @@
enableval="$enable_shared"
p=${PACKAGE-default}
case $enableval in
- yes) enable_shared=yes ;;
+ # brute force it not to build shared fftw libs
+ yes) enable_shared=no ;;
no) enable_shared=no ;;
*)
enable_shared=no
@@ -1916,7 +1917,7 @@
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
- enable_shared=yes
+ enable_shared=no
fi
done
IFS="$lt_save_ifs"
diff -ruN ccp4-6.0.2-orig/src/refmac5_/make_unix_ccp4.f ccp4-6.0.2/src/refmac5_/make_unix_ccp4.f
--- ccp4-6.0.2-orig/src/refmac5_/make_unix_ccp4.f 2006-11-21 12:33:10.000000000 -0800
+++ ccp4-6.0.2/src/refmac5_/make_unix_ccp4.f 2006-11-21 12:44:43.000000000 -0800
@@ -82,10 +82,11 @@
C
INTEGER*4 IH(7)
C ******
- CHARACTER CID*10
+ CHARACTER CID*10,CID2*8
c --------------------------------

CALL UTIME(CID)
+ CALL DATE_AND_TIME(DATE=CID2)

c UTIME - Get current time hh:mm:ss
c Input: none
@@ -96,13 +97,14 @@
cpjx the date as hh:mm:ss

READ(CID,'(I2,1X,I2,1X,I2,2X)') IH(4),IH(3),IH(2)
+ READ(CID2,'(I4,I2,I2)') IYR,IMON,IDAY

- CALL IDATE(IMON,IDAY,IYR)
- IF(IYR.GE.99) THEN
- IYR=IYR+1900
- ELSE
- IYR=IYR+2000
- ENDIF
+# CALL IDATE(IMON,IDAY,IYR)
+# IF(IYR.GE.99) THEN
+# IYR=IYR+1900
+# ELSE
+# IYR=IYR+2000
+# ENDIF
IH(5)=IDAY
IH(6)=IMON
IH(7)=IYR

ccp4 _unstable_ port information

Package: ccp4
Version: 6.0.99e
Revision: 7
Distribution: 10.5
GCC: 1
Source: ftp://ftp.%n.ac.uk/%n/6.1/%n-%v-core-src.tar.gz
Source-MD5: f36be231a4c89f53eafc1c281d07ad47
SourceDirectory: %n-%v
Source2: http://chemistry.ucsc.edu/~wgscott/xtal/xtalfink/XCCPJiffy-custom.gz
Source2-MD5: 21568dd2475505929573a3fd452c538f
Source3: ftp://ftp.ccp4.ac.uk/ccp4/6.1/ccp4-6.0.99e-phaser-src.tar.gz
Source3-MD5: 10ea5d1115b19110fa5c0111de766f6d
#
DescPort: <<
CCP4 is designed to compile with gfortran on OS X >= 10.4 by default.
Jack Howarth has provided multiple improvements in the patch file to
address several bugs and to permit optimization with gfortran at -O3.

Users typically install all of the ccp4 files into /xtal/ccp4-%v or
into /usr/local/xtal/ccp4-%v. In the present case, these files are
installed into %p/share/xtal/ccp4-%v. The library files are installed
into the directory %p/lib/ccp4-%v and this directory is symbolically
linked to %p/share/xtal/ccp4-%v/lib which is the canonical location.
Dynamic libraries are provided in the ccp4-shlibs splitoff package, and
static libraries are provided in the ccp4-dev splitoff package. The
configure files are patched so that the full path to the dynamic
libraries is hard-coded, per fink policy. This obviates the need to
set the DYLD_LIBRARY_PATH environment variable, which should remain
unset. The appropriate shell startup files are automatically sourced
when %p/bin/init.(c)sh is invoked upon shell startup; there is no
need to do so manually. The actual files are located in $CCP4/include.

If needed, please install the phaser, pointless and cctbx fink packages.

The ccp4i mail utility by default will only work on machines that run
a mail server. As a workaround, a public domain perl script called
osx_ccp4_mail is installed that glues the ccp4i mail button to the
Apple OS X Mail.app.

Further adaptations are commented in place in the patch, configure and
install scripts below. Relevant patches specific to this version that
are issued by CCP4 are now downloaded and applied individually, helping
to keep the ccp4.patch file from growing metastatically and also to
permit the user to verify that the latest patches have been applied.
These start with Source2 (above) and are applied individually at the
end of the PatchScript field.

Clipper libraries are not behaving properly when linked to fink fftw
so we return to the option of having ccp4 build its own private fftw.
Yes, I hate it too, but now all the examples pass the run-all test.
<<
Depends: x11, tcltk, blt, gcc43-shlibs, %N-shlibs (= %v-%r)
BuildDepends: gcc43, f2c, fort77, tcltk-dev
BuildConflicts: gpp4-dev, gpp4, ssm, ssm-dev, mmdb, mmdb-dev, clipper, clipper-bin, clipper-dev, ccp4-onlylibs-dev
Replaces: phaser (<= 2.1.4-1), pointless (<= 1.2.18-1), mosflm (<= 7.0.3-3), mosflm-small (<= 7.0.3-3), refmac (<= 5.4-4), ccp4-shlibs (<= 6.0.2-9999), ccp4 (<= 6.0.2-9999), ccp4-dev (<= 6.0.2-9999), bundle-ccp4-intel, clipper-bin, ccp4-gfortran, ccp4-gfortran-dev, bundle-ccp4-powerpc
Conflicts: <<
mosflm (<= 7.0.3-3),
mosflm-small (<= 7.0.3-3),
refmac (<= 5.4-4),
ccp4-shlibs (<= 6.0.2-9999) ,
ccp4 (<= 6.0.2-9999),
ccp4-dev (<= 6.0.2-9999),
bundle-ccp4-intel,
bundle-ccp4-powerpc,
ccp4-gfortran,
ccp4-gfortran-dev,
phaser (<= 2.1.4-1),
pointless (<= 1.2.18-1)
<<
NoSetCPPFLAGS: true
NoSetLDFLAGS: true
#
################################################################################
PatchScript: <<
#!/bin/zsh -efv
#
umask 0022

# Now apply the primary patch
sed 's|@PREFIX@|%p|g' <%a/%n.patch | patch -p1
# setup script for tcsh, zsh and bash users
export TEMPXTAL=$PWD:h
#
perl -pi.bak -e 's|/xtal|\$TEMPXTAL|g' include/ccp4.setup* # build prefix (changed in install)
perl -pi.bak -e 's|/prefix|%p|g' include/ccp4.setup* # location of tcktk, blt
perl -pi.bak -e 's|/usr/local/bin|%p/bin|g' include/ccp4.setup* # same
perl -pi.bak -e 's|limit stacksize 65536|limit stacksize unlimited|g' include/ccp4.setup* # same
perl -pi.bak -e 's|ccp4_first_in_path=1|ccp4_first_in_path=0|g' include/ccp4.setup*
perl -pi.bak -e 's|ccp4_first_in_path\ =\ 1|ccp4_first_in_path\ =\ 0|g' include/ccp4.setup*
perl -pi.bak -e 's|setenv GFORTRAN_UNBUFFERED_ALL Y|# setenv GFORTRAN_UNBUFFERED_ALL Y|g' include/ccp4.setup*
perl -pi.bak -e 's|export GFORTRAN_UNBUFFERED_ALL|# export GFORTRAN_UNBUFFERED_ALL|g' include/ccp4.setup*

#
cp include/ccp4.setup-dist include/ccp4.setup
rm -f include/ccp4.setup-sh include/ccp4.setup*.bak
#
# Set up XCCPJiffy wrapper scripts in $CCP4/etc
# These are small wrapper scripts for xplot84driver and xloggraph generated by the patch
chmod a+x etc/x*
# Fix the dylib install path in configure
perl -pi.bak -e 's|\$rpath|%p/lib/ccp4-%v|g' **/configure
<<
################################################################################
CompileScript: <<
#!/bin/zsh -efv
umask 0022

# The build will fail if Norton Auto-Protect is running.
# Check to see if it is, and abort the installation with a
# warning to the user.
if [[ $(ps axww | grep NortonAutoProtect | wc -l) -gt 1 ]];then
print "\e[1m******************************************************************************************************"
print "******************************************************************************************************"
print "******************************************************************************************************"
print ""
print "Norton AutoProtect must be suspended during CCP4 installation. Please do so now and then try again."
print ""
print "******************************************************************************************************"
print "******************************************************************************************************"
print "******************************************************************************************************\e[0m"
sleep 15
return 1000
fi


# These are required for the build environment
export TEMPXTAL=$PWD:h
export CCP4_VERSION=""
export CCP4_MASTER=""
export BLTWISHPREFIX=""
export CCP4=""

source $PWD/include/ccp4.setup-zsh
[[ -d $CCP4 ]] || exit 1
export DYLD_LIBRARY_PATH=$CLIB
export GFORTRAN_UNBUFFERED_ALL="Y"
export rpath=%p/lib/ccp4-%v
export RPATH=%p/lib/ccp4-%v

# === CONFIGURE ===>
# FC="%p/lib/gcc4.3/bin/gfortran" F_LIBS="-L%p/lib/gcc4.3/lib" ./configure --with-shared-libs --with-x --with-fftw=%p Darwin
FC="%p/lib/gcc4.3/bin/gfortran" F_LIBS="-L%p/lib/gcc4.3/lib" ./configure --with-shared-libs --with-x Darwin
#
# fix some post-configure bugs by getting rid of -lg2c
perl -pi.bak -e 's|-lg2c||g' x-windows/**/*akefile*
( cd x-windows/XCCPJIFFY; perl -pi.bak -e 's|-lgfortran|-lgfortran -L%p/lib/gcc4.3/lib |g' *akefile* ) || exit 1
if [[ $(sw_vers -productVersion) < 10.5 ]]; then
:
else
perl -pi.bak -e 's|-lcrt1.10.5.o||g' **/*akefile
perl -pi.bak -e 's|-lcrt1.o||g' **/*akefile
fi

#################
make
make install
#################

# xloggraph will fail, but we will link it with fort77 below
#
# Make wrappers for xplot84driver and xloggraph, so rename the executables
cd x-windows/XCCPJIFFY

make msg_box.o ZDr2d.o EditString.o hardcopy_ctrl.o xloggraph.o log_file.o tom_fortran_interface.o bits_and_pieces.o graphics.o
gcc -o xplot84driver xplot84driver.o plot84_file.o msg_box.o ZDr2d.o EditString.o hardcopy_ctrl.o -Os -I/usr/include/X11R6 -L/usr/X11/lib -lXaw -lXmu -lXt -lSM -lICE -lXpm -lXp -lXext -lX11 -lm -L/%p/lib/gcc4.3/lib -lgfortran
cp xplot84driver $CBIN/xplot84driver.exe
if [[ -x $CBIN/xplot84driver ]];then
rm -f $CBIN/xplot84driver
fi
make xccpjiffy2idraw
cp xccpjiffy2idraw $CBIN/.
cd ..
make xdlmapman xdldataman
cp xdlmapman $CBIN/.
cp xdldataman $CBIN/.
#
# Manually link xloggraph with fort77 (fails in make)
echo ""
echo "**********************************************************************"
echo "Re-linking xloggraph with fort77. Ignore previous error messages."
echo "**********************************************************************"
echo ""
#
cd XCCPJIFFY
fort77 -o xloggraph msg_box.o ZDr2d.o EditString.o hardcopy_ctrl.o xloggraph.o log_file.o tom_fortran_interface.o bits_and_pieces.o graphics.o -g -Os -I/usr/include/X11R6 -L/usr/X11R6/lib -lXaw -lXmu -lXt -lSM -lICE -lXpm -lXext -lX11 -lm -lgfortran -L%p/lib/gcc4.3/lib

#
sleep 10
#
cp xloggraph $CBIN/xloggraph.exe
if [[ -x $CBIN/xloggraph ]];then
rm -f $CBIN/xloggraph
fi
cd ../..
#
# Cleanup:

# Get rid of the corrupting influence of ccp4's own xml2-config:
if [[ -x $CBIN/xml2-config ]];then
/bin/rm -f $CBIN/xml2-config
fi
#

# make realclean
/bin/rm -f **/*.o
/bin/rm -f **/*.bak
/bin/rm -Rf src
/bin/rm -Rf x-windows/libjwc/libjwc_c
/bin/rm -Rf x-windows/libjwc/libjwc_f
/bin/rm -Rf x-windows/xdl_view/src
# remove redundant library junk
/bin/rm -Rf lib/cctbx
/bin/rm -Rf lib/**/.libs
/bin/rm -f lib/ccif/libccif.dylib
/bin/rm -f lib/src/libccp4c.dylib
/bin/rm -f lib/src/libmmdb.dylib
#/bin/rm -R unsupported
/bin/rm -R testcomp*
/bin/rm -R BINARY*
cd $CLIB
/bin/rm -f **/*.c
/bin/rm -f **/*.f
/bin/rm -f **/*.cpp
<<
################################################################################
InstallScript: <<
#!/bin/zsh -efv

umask 0022
export TEMPXTAL=$PWD:h
source $PWD/include/ccp4.setup-zsh
export DYLD_LIBRARY_PATH=$CLIB
ORIGDIR=$(dirname $PWD)
# Change environment scripts to match final installation
perl -pi -e 's|\$TEMPXTAL|%p/share/xtal|g' include/ccp4.setup* # install prefix
#
#
cp ../XCCPJiffy-custom.gz XCCPJiffy.gz ; gunzip XCCPJiffy.gz; chmod a+x XCCPJiffy
perl -pi -e 's|5.0.1|%v|g' XCCPJiffy
mv -f XCCPJiffy lib/X11/app-defaults/XCCPJiffy
#
perl -pi.bak -e 's|/src/fink.build/ccp4-%v-%r|/share/xtal|g' bin/clipper-config
rm -f bin/clipper-config.bak
perl -pi.bak -e 's|lclipper |lclipper-core |g' bin/clipper-config
rm -f bin/clipper-config.bak
perl -pi.bak -e 's|lib/lib -lrfftw -lfftw |lib/ccp4-%v -lsrfftw -lsfftw |g' bin/clipper-config
rm -f bin/clipper-config.bak
#
# Fix path in libfoo.la libtool files:
#
perl -pi.bak -e 's|/src/fink.build/ccp4-%v-%r/ccp4-%v/lib|/lib/ccp4-%v|g' lib/**/*.la
perl -pi.bak -e 's|/src/fink.build/ccp4-%v-%r/ccp4-%v/src|/share/xtal/ccp4-%v/src|g' lib/python2.5/site-packages/libxml2mod.la
rm -f lib/**/*.la.bak
#
# Now install:
#
mkdir -p %i/lib
cp -R lib %i/lib/ccp4-%v
mkdir -p %i/bin
#
mkdir -p %i/share/xtal/ccp4-%v/help
mkdir -p %i/share/man/man1
# set up man pages in a fink-compliant manner
cd $PWD/doc
mv rasmol.doc eightbit_rasmol.doc
foreach docfilepage ( *.doc )
cp ${docfilepage} %i/share/man/man1/${docfilepage:r}.1
cp ${docfilepage} %i/share/xtal/ccp4-%v/help/${docfilepage:r}
end
# back to build directory
cd ..
#
/bin/rm -rf lib
cp -R * %i/share/xtal/ccp4-%v/.
ln -s %p/lib/ccp4-%v %i/share/xtal/ccp4-%v/lib
#
# making scripts for %p/etc/profile.d
mkdir -p %i/etc/profile.d
#
echo "source %p/share/xtal/ccp4-%v/include/ccp4.setup" > %i/etc/profile.d/ccp4.csh
echo "setenv CLIB %p/lib/ccp4-%v " >> %i/etc/profile.d/ccp4.csh
#

echo "if [ -z \$ZSH_NAME ];then " > %i/etc/profile.d/ccp4.sh
echo " source %p/share/xtal/ccp4-%v/include/ccp4.setup-bash " >> %i/etc/profile.d/ccp4.sh
echo "else " >> %i/etc/profile.d/ccp4.sh
echo " source %p/share/xtal/ccp4-%v/include/ccp4.setup-zsh" >> %i/etc/profile.d/ccp4.sh
echo "fi " >> %i/etc/profile.d/ccp4.sh
echo "export CLIB=%p/lib/ccp4-%v " >> %i/etc/profile.d/ccp4.sh
#
chmod a+x %i/etc/profile.d/ccp4.*
#
chmod a+x %i/share/xtal/ccp4-%v/ccp4i/etc/osx_ccp4_mail
#
# chmod a+x %i/share/xtal/ccp4-%v/etc/ccp4help
#
ranlib %i/lib/ccp4-%v/*.a
ranlib %i/lib/ccp4-%v/**/*.a
#
<<
################################################################################
PostInstScript: <<
# Make the user read the license conditions
more %p/share/xtal/ccp4-%v/conditions.txt
<<
################################################################################
################################################################################
SplitOff: <<
Package: %N-shlibs
Description: CCP4 dynamic libraries
Files:<<
lib/ccp4-%v/*.*.dylib
lib/ccp4-%v/libccif.dylib
lib/ccp4-%v/libccp4c.dylib
lib/ccp4-%v/libmmdb.dylib
<<
Shlibs: <<
%p/lib/ccp4-%v/libDiffractionImage.0.dylib 1.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libccif.dylib 0.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libccp4c.dylib 0.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-ccp4.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-cif.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-cns.0.dylib 1.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-contrib.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-core.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-minimol.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-mmdb.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libclipper-phs.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libcord.1.dylib 2.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libgc.1.dylib 2.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libjwc_c.0.dylib 2.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libmmdb.dylib 0.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libssm.0.dylib 1.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libxdl_view.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libxdl_viewextra.0.dylib 1.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libxml2.2.dylib 9.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/libfftw.2.dylib 3.0.0 %n (>= 6.0.99e-1)
%p/lib/ccp4-%v/librfftw.2.dylib 3.0.0 %n (>= 6.0.99e-1)
<<
DocFiles: CHANGES COPYING INSTALL INSTALL.html INSTALL.ps README PROBLEMS academic_software_licence.pdf
<<
################################################################################
################################################################################
SplitOff2: <<
Package: %N-dev
BuildDependsOnly: true
Conflicts: gpp4-dev, ssm-dev, mmdb-dev, clipper-dev, ccp4-onlylibs-dev
Replaces: gpp4-dev, ssm-dev, mmdb-dev, clipper-dev, ccp4-onlylibs-dev
Description: CCP4 static libraries and libtool files
Files:<<
lib/ccp4-%v/*.a
lib/ccp4-%v/*.la
<<
DocFiles: CHANGES COPYING INSTALL INSTALL.html INSTALL.ps README PROBLEMS academic_software_licence.pdf
<<
################################################################################
Description: Macromolecular crystallography package
DescDetail: <<
The CCP4 macromolecular crystallography suite has approximately
200 programs and utilities. This version includes the Clipper
libraries. Current phaser and cctbx programs are available as
separate fink packages.

Type "ccp4help" for a summary listing of all ccp4 programs.
Type "ccp4help foo" for a detailed description of program "foo."

Invoke optional ccp4i gui for the first run using "sudo ccp4i"
on 10.4, or "sudo /bin/zsh" followed by "source /sw/bin/init.sh ; ccp4i"
on 10.5 to permit global configuration. Thereafter, you can invoke
ccp4i without sudo.

This version compiles with the Apple Lapack/Blas framework.
License agreement is part of configure file -- print out form and mail in,
additional comments at http://sage.ucsc.edu/xtal/ccp4.html

CCP4 files will be installed under /sw/share/xtal/ccp4-6.0.99
This revision includes all available CCP4 patches as of June 28, 2007.
and new bash and zsh command completions specific to ccp4.

The ccp4-associated molecular graphics display program coot is also
available as a fink package. It builds against the GPL gpp4 libraries
rather than those of this package.

Thanks to Jack Howarth for many helpful improvements.
<<
DocFiles: <<
README CHANGES COPYING PROBLEMS INSTALL INSTALL.html INSTALL.ps
ccp4i_installation.html academic_software_licence.pdf
academic_software_licence.ps.gz academic_software_licence.rtf
<<
Homepage: http://www.ccp4.ac.uk
License: Commercial
Maintainer: W. G. Scott

ccp4 _unstable_ port .patch

Binary files ccp4-6.0.99e-orig/.DS_Store and ccp4-6.0.99e/.DS_Store differ
Binary files ccp4-6.0.99e-orig/ccp4i/.DS_Store and ccp4-6.0.99e/ccp4i/.DS_Store differ
diff -ruN ccp4-6.0.99e-orig/ccp4i/etc/configure.def.dist ccp4-6.0.99e/ccp4i/etc/configure.def.dist
--- ccp4-6.0.99e-orig/ccp4i/etc/configure.def.dist 2008-04-09 13:03:01.000000000 -0700
+++ ccp4-6.0.99e/ccp4i/etc/configure.def.dist 2008-07-29 19:18:23.000000000 -0700
@@ -61,8 +61,8 @@
MESSAGE _text ""
BLT_LIBRARY _text ""
MENU_LENGTH _positiveint 25
-HYPERTEXT_VIEWER _text firefox
-START_NETSCAPE _text netscape
+HYPERTEXT_VIEWER _text Safari
+START_NETSCAPE _text open
O_MAPMAN _text mapman
MAPMAN_MAXSIZE _positiveint 4194304
QUANTA_MBKALL _text mbkall
diff -ruN ccp4-6.0.99e-orig/ccp4i/etc/osx_ccp4_mail ccp4-6.0.99e/ccp4i/etc/osx_ccp4_mail
--- ccp4-6.0.99e-orig/ccp4i/etc/osx_ccp4_mail 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.99e/ccp4i/etc/osx_ccp4_mail 2008-07-29 18:56:44.000000000 -0700
@@ -0,0 +1,164 @@
+#!/usr/bin/perl
+# Drop-in replacement for /usr/bin/mail that uses Mail.app (via an
+# applescript) rather than sendmail to send mail. Unlike /usr/bin/mail,
+# you can't use it for reading mail.
+#
+# usage: mail []
+# options:
+# -v be verbose
+# -g activate Mail.app to approve the message
+# -F specify the From: address
+# -b specify Bcc: recipients in a comma-separated list
+# -c specify Cc: recipients in a comma-separated list
+# -s specify the message subject
+#
+# The body of the message is read from standard input.
+#
+# Author: Nathaniel Nystrom
+# This software is in the public domain.
+#
+# Version 1.0, 21 Aug 2003 -- initial version
+# Version 1.0.1, 22 Aug 2003 -- fixes some quoting problems
+# Version 1.0.2, 23 Aug 2003 -- removed -R option; |reply to|
+# is a property of _incoming_ messages
+# Version 1.0.3, 17 Sep 2003 -- fixed escaping of \ in message body;
+# escape the subject too
+
+use strict;
+$|++;
+
+my ($verbose, $gui);
+my ($from, @to, @cc, @bcc, $subject, $body);
+my $prog;
+($prog = $0) =~ s|.*/||;
+
+while (@ARGV) {
+ my $arg = shift @ARGV;
+
+ if ($arg eq '-v') {
+ $verbose++;
+ }
+ elsif ($arg eq '-g') {
+ $gui++;
+ }
+ elsif ($arg eq '-F') {
+ $from = shift @ARGV || &usage("missing sender");
+ }
+ elsif ($arg eq '-i' || $arg eq '-l' || $arg eq '-n') {
+ # ignore; for /usr/bin/mail compatibility
+ }
+ elsif ($arg eq '-N' || $arg eq '-f' || $arg eq '-u') {
+ &usage("invalid option $arg; $prog cannot be used for reading mail");
+ }
+ elsif ($arg eq '-s') {
+ $subject = shift @ARGV || &usage("missing subject");
+ }
+ elsif ($arg eq '-c') {
+ my $list = shift @ARGV || &usage("missing Cc list");
+ @cc = split /\s*,\s*/, $list;
+ }
+ elsif ($arg eq '-b') {
+ my $list = shift @ARGV || &usage("missing Bcc list");
+ @bcc = split /\s*,\s*/, $list;
+ }
+ elsif ($arg =~ /^-/) {
+ &usage("invalid option $arg");
+ }
+ else {
+ @to = ($arg, @ARGV);
+ last;
+ }
+}
+
+&usage("missing recipients") unless @to;
+
+unless (defined $subject) {
+ print "Subject: ";
+ $subject = || '';
+ chomp $subject;
+}
+
+$body = '';
+
+while () {
+ $body .= $_;
+}
+
+$body = &escape($body);
+$subject = &escape($subject);
+
+my $script = <<"EOS";
+tell application "Mail"
+ set newMessage to make new outgoing message
+ tell newMessage
+ set subject to "$subject"
+ set content to "$body"
+EOS
+
+for (@to) { $script .= &recipient('to', $_); }
+for (@cc) { $script .= &recipient('cc', $_); }
+for (@bcc) { $script .= &recipient('bcc', $_); }
+
+my $visible = $gui ? "true" : "false";
+my $activate = $gui ? "activate" : "send newMessage";
+my $fromln = $from ? "set sender to \"$from\"" : "";
+
+$script .= <<"EOS";
+ $fromln
+ set visible to $visible
+ end tell
+ $activate
+end tell
+EOS
+
+if ($verbose >= 1) {
+ print "From: $from\n" if $from;
+ print "To: ", join(',', @to), "\n" if @to;
+ print "Cc: ", join(',', @cc), "\n" if @cc;
+ print "Bcc: ", join(',', @bcc), "\n" if @bcc;
+
+ if ($verbose >= 2) {
+ print "Script >>>\n";
+ print $script;
+ print "<<<\n";
+ print "\n";
+ print $body;
+ }
+}
+
+open(SCRIPT, "| osascript > /dev/null") || die "Couldn't fork osascript: $!\n";
+print SCRIPT $script;
+close SCRIPT;
+
+exit 0;
+
+sub escape {
+ my $x = shift;
+ $x =~ s/\\/\\\\/gm;
+ $x =~ s/"/\\"/gm;
+ $x =~ s/\n/\\n/gm;
+ $x;
+}
+
+sub recipient {
+ my ($type,$addr) = @_;
+ return <<"EOS"
+ make new $type recipient at end of $type recipients with properties {address: "$addr"}
+EOS
+}
+
+sub usage {
+ my $error = shift;
+ print STDERR "Error: $error\n" if $error;
+ print STDERR <<"EOS";
+usage: $prog []
+ options:
+ -v be verbose
+ -g activate Mail.app to approve the message
+ -F specify the From: address
+ -b specify Bcc: recipients in a comma-separated list
+ -c specify Cc: recipients in a comma-separated list
+ -s specify the message subject
+EOS
+ exit 1;
+}
diff -ruN ccp4-6.0.99e-orig/ccp4i/src/local.tcl ccp4-6.0.99e/ccp4i/src/local.tcl
--- ccp4-6.0.99e-orig/ccp4i/src/local.tcl 2008-03-07 07:38:59.000000000 -0800
+++ ccp4-6.0.99e/ccp4i/src/local.tcl 2008-07-29 19:19:47.000000000 -0700
@@ -34,7 +34,7 @@
#d_arg mail_address Mail addressee

return [expr {1 - [catch \
- "exec Mail -s \"$subject\" $mail_address < $tmp_file" ]}]
+ "exec osx_ccp4_mail -s \"$subject\" $mail_address < $tmp_file" ]}]
}

#d_index_title Interaction with Netscape
diff -ruN ccp4-6.0.99e-orig/configure ccp4-6.0.99e/configure
--- ccp4-6.0.99e-orig/configure 2008-07-22 03:00:42.000000000 -0700
+++ ccp4-6.0.99e/configure 2008-07-29 19:06:49.000000000 -0700
@@ -2354,7 +2354,7 @@
XMKMF="IMAKECPP=/usr/bin/cpp xmkmf"
if test "$shared_lib" = yes; then
SHARED_LIB_CFLAGS=${SHARED_LIB_CFLAGS:-'-fPIC -fno-common'}
- SHARE_LIB='${CC} -dynamiclib -flat_namespace -undefined suppress ${SHARED_LIB_CFLAGS} -install_name libmmdb.dylib -all_load libmmdb.a -o libmmdb.dylib -lstdc++; ${CC} -dynamiclib -flat_namespace -undefined suppress ${SHARED_LIB_CFLAGS} -install_name libccp4c.dylib -all_load libccp4c.a -o libccp4c.dylib'
+ SHARE_LIB='${CC} -dynamiclib -flat_namespace -undefined suppress ${SHARED_LIB_CFLAGS} -install_name ${RPATH}/libmmdb.dylib -all_load libmmdb.a -o libmmdb.dylib -lstdc++; ${CC} -dynamiclib -flat_namespace -undefined suppress ${SHARED_LIB_CFLAGS} -install_name ${RPATH}/libccp4c.dylib -all_load libccp4c.a -o libccp4c.dylib'
SHARE_INST='${INSTALL_DATA} `pwd`/libmmdb.dylib ${libdir}/libmmdb.dylib; ${INSTALL_DATA} `pwd`/libccp4c.dylib ${libdir}/libccp4c.dylib'
fi
#need -lcc_dynamic to get restFP and saveFP for g77 3.4 under darwin 7
@@ -2481,7 +2481,7 @@
LDCXXFLAGS="-lccp4c -lmmdb \$(XCIF_LIB) \$(XLAPACK_LIB) \$(C_LIBS) \$(XLDFLAGS)"
if test "$shared_lib" = yes; then
XLDFLAGS="-limf -lirc"
- SHARE_LIB=${SHARE_LIB:-'${LD} -dylib -dynamic -flat_namespace -undefined suppress -dylib_install_name libmmdb.dylib -all_load -o libmmdb.dylib libmmdb.a -lirc -limf -ldylib1.o; ${LD} -dylib -dynamic -flat_namespace -undefined suppress -dylib_install_name libccp4c.dylib -all_load -o libccp4c.dylib libccp4c.a -ldylib1.o;'}
+ SHARE_LIB=${SHARE_LIB:-'${LD} -dylib -dynamic -flat_namespace -undefined suppress -dylib_install_name ${RPATH}/libmmdb.dylib -all_load -o libmmdb.dylib libmmdb.a -lirc -limf -ldylib1.o; ${LD} -dylib -dynamic -flat_namespace -undefined suppress -dylib_install_name ${RPATH}/libccp4c.dylib -all_load -o libccp4c.dylib libccp4c.a -ldylib1.o;'}
SHARE_INST='$(INSTALL_DATA) `pwd`/libmmdb.dylib $(libdir)/libmmdb.dylib; $(INSTALL_DATA) `pwd`/libccp4c.dylib $(libdir)/libccp4c.dylib;'
LDCXXFLAGS="-lccp4c -lmmdb \$(XCIF_LIB) \$(XLAPACK_LIB) \$(C_LIBS) \$(XLDFLAGS) -lstdc++"
fi
diff -ruN ccp4-6.0.99e-orig/etc/xloggraph ccp4-6.0.99e/etc/xloggraph
--- ccp4-6.0.99e-orig/etc/xloggraph 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.99e/etc/xloggraph 2008-07-29 18:56:15.000000000 -0700
@@ -0,0 +1,6 @@
+#!/bin/zsh
+export XUSERFILESEARCHPATH=$CLIB/X11/app-defaults/XCCPJiffy
+xloggraph.exe "$@" &
+export XUSERFILESEARCHPATH=""
+print "Plot button sends pdf to Preview. Print or save pdf in Preview window."
+exit 0
diff -ruN ccp4-6.0.99e-orig/etc/xplot84 ccp4-6.0.99e/etc/xplot84
--- ccp4-6.0.99e-orig/etc/xplot84 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.99e/etc/xplot84 2008-07-29 18:55:56.000000000 -0700
@@ -0,0 +1,6 @@
+#!/bin/zsh
+export XUSERFILESEARCHPATH=$CLIB/X11/app-defaults/XCCPJiffy
+xplot84driver.exe "$@" &
+export XUSERFILESEARCHPATH=""
+print "Plot button sends pdf to Preview. Print or save pdf in Preview window."
+exit 0
diff -ruN ccp4-6.0.99e-orig/etc/xplot84driver ccp4-6.0.99e/etc/xplot84driver
--- ccp4-6.0.99e-orig/etc/xplot84driver 1969-12-31 16:00:00.000000000 -0800
+++ ccp4-6.0.99e/etc/xplot84driver 2008-07-29 18:55:56.000000000 -0700
@@ -0,0 +1,6 @@
+#!/bin/zsh
+export XUSERFILESEARCHPATH=$CLIB/X11/app-defaults/XCCPJiffy
+xplot84driver.exe "$@" &
+export XUSERFILESEARCHPATH=""
+print "Plot button sends pdf to Preview. Print or save pdf in Preview window."
+exit 0
diff -ruN ccp4-6.0.99e-orig/include/ccp4.setup-bash ccp4-6.0.99e/include/ccp4.setup-bash
--- ccp4-6.0.99e-orig/include/ccp4.setup-bash 2008-07-16 08:37:49.000000000 -0700
+++ ccp4-6.0.99e/include/ccp4.setup-bash 2008-07-29 19:33:11.000000000 -0700
@@ -1,9 +1,64 @@
#!/bin/bash
-# CCP4 setup file for bash or ksh (untested) users. -*- shell-script -*-
-# Actually, the aliases can't work asis in ksh. Should use builtins instead
-# and not worry about ease of keeping in step with the csh one.
+# [The above is just for emacs -- this file should not be executed.]
+
+# CCP4 setup file for bash users. -*- shell-script -*-
+# $Id: ccp4.setup-bash,v 1.91.2.3 2008/06/09 08:51:17 ccb Exp $
+
+###############################################################################
+
+# Edit this for the current version of ccp4:
+ # if [[ -z $CCP4_VERSION ]];then
+ CCP4_VERSION="ccp4-6.0.99e"
+ # fi
+
+###############################################################################
+
+# NOTE: You should not need to edit the rest of this file unless you want to over-ride the
+# following assignments of $CCP4_MASTER and $BLTWISHPREFIX
+
+# NOTE: If you have installed ccp4 on OS X with fink, you should not need to
+# change this file or to source it (fink takes care of sourcing it for you).
+
+ # CCP4_MASTER is the location of the top-level directory containing `ccp4'.
+ # Set it manually by uncommenting and editing the following line:
+
+ # export CCP4_MASTER="/xtal"
+
+ # or discover it from the source command if we have a current version of the bash shell
+
+ # if [[ -z "$CCP4_MASTER" ]];then
+ if [[ ${BASH_VERSION} > 3 ]];then
+ CCP4_MASTER="$(dirname $(dirname $(dirname ${BASH_SOURCE} )))"
+ else
+ # Attempt to this the hard way for older versions of bash
+ if [[ -d "/xtal/${CCP4_VERSION}" ]]; then
+ CCP4_MASTER="/xtal"
+ elif [[ -d "/usr/local/xtal/${CCP4_VERSION}" ]]; then
+ CCP4_MASTER="/usr/local/xtal"
+ elif [[ -d "/usr/local/${CCP4_VERSION}" ]]; then
+ CCP4_MASTER="/usr/local"
+ elif [[ -d "/usr/local/ccp4/${CCP4_VERSION}" ]]; then
+ CCP4_MASTER="/usr/local/ccp4"
+ elif [[ -d "/xtal/ccp4/${CCP4_VERSION}" ]]; then
+ CCP4_MASTER="/xtal/ccp4"
+ else
+ CCP4_MASTER=""
+ fi
+ fi
+ # fi
+
+ export CCP4_MASTER
+
+
+ # Discover where bltwish executable is located
+
+ if [[ -z $BLTWISHPREFIX && -x $(which bltwish) ]];then
+ BLTWISHPREFIX=$( dirname $( which bltwish ) )
+ fi
+
+###############################################################################
+

-# $Id: ccp4.setup-bash,v 1.92.2.2 2008/07/16 15:37:49 FR45 Exp $

# This file is site specific and may also contain machine-specifics. The CCP4
# administrator will have to edit this file and then have anyone who wants to
@@ -20,16 +75,6 @@
# three sections. You MUST check the first section. You may want to check
# the second. You don't need to look at the third.

-################### THIS SECTION SHOULDN'T NEED EDITING #####################
-
-# first emulate csh setenv and alias so we can keep the bash and csh
-# versions as similar as possible
-setenv () { export $1="$2" ; }
-# Note that bash has a (different) alias command so we need to undo this
-# later. I wonder if it is robust :-)
-if [ "`basename $SHELL`" != "ksh" ]; then # can't redefine alias in ksh
-alias () { eval `echo 'function '; echo $1; shift; echo '{ ' $*; echo '; }'` ; }
-fi

################### THIS SECTION MUST BE EDITED #####################

@@ -37,51 +82,66 @@
# This is usually the directory in which you ran the tar command to unpack the
# code, and is assumed to be shared between machines at a multi-machine site.

-setenv CCP4_MASTER /xtal
-setenv CCP4 $CCP4_MASTER/ccp4-6.0.99e
+# CCP4_MASTER="/xtal"; export CCP4_MASTER
+# CCP4="$CCP4_MASTER/ccp4-6.0.99e" ; export CCP4

# Check for existence of CCP4_MASTER
-if (! test -d $CCP4_MASTER) ; then
+if [[ ! -d $CCP4_MASTER ]] ; then
echo "********************* WARNING **********************"
echo "The directory $CCP4_MASTER"
echo "(assigned to CCP4_MASTER) does not exist."
echo "The CCP4 programs will not run correctly, and any"
echo "installation attempt will have errors or will fail."
echo "********************* WARNING **********************"
+else
+ if [[ -d "$CCP4_MASTER/$CCP4_VERSION" ]];then
+ CCP4="$CCP4_MASTER/$CCP4_VERSION" ; export CCP4
+ else
+ echo "The directory "$CCP4_MASTER/$CCP4_VERSION" cannot be found."
+ echo " Please check that "$CCP4_VERSION" is the right ccp4 version. "
+ fi
fi

+
# CCP4_SCR: a per-user directory for run-time-generated scratch
# files. A dedicated scratch filesystem is probably better than (/usr)/tmp
# BINSORT_SCR: a scratch directory for binsort's use; normally same as CCP4_SCR

-setenv CCP4_SCR /tmp/$USER
+export CCP4_SCR="/tmp/$USER"
# check to see if this exists and if not try to make it
test -d $CCP4_SCR || mkdir $CCP4_SCR
test -d $CCP4_SCR || \
echo "Unable to make CCP4_SCR. CCP4 progs will not run correctly."

-setenv BINSORT_SCR $CCP4_SCR
+export BINSORT_SCR="$CCP4_SCR"

### CCP4i setup - you may need to edit CCP4I_TCLTK ###
# CCP4I_TOP - the top directory of the interface
-setenv CCP4I_TOP ${CCP4}/ccp4i
+export CCP4I_TOP="${CCP4}/ccp4i"
# CCP4I_TCLTK - directory containing tclsh,wish and bltwish executables
# as used in $CCP4I_TOP/bin/ccp4i,ccp4ish,loggraph
# For 'standard' installations this is /usr/local/bin
# but note the SGI distributed version of Tcl/Tk is not
# appropriate version
-setenv CCP4I_TCLTK /usr/local/bin
+# export CCP4I_TCLTK="/usr/local/bin"
+if [[ -d "$BLTWISHPREFIX" && -x "$BLTWISHPREFIX/bltwish" ]]; then
+ export CCP4I_TCLTK="$BLTWISHPREFIX"
+else
+ echo " Cannot find bltwish executable. Please make sure it is in your \$PATH "
+fi
+
+
# CCP4I_HELP - directory contain ccp4i help - default is $CCP4I_TOP/help
-setenv CCP4I_HELP ${CCP4I_TOP}/help
+export CCP4I_HELP="${CCP4I_TOP}/help"

### Optional - setting http_proxy environment
-# The commented out 'setenv' line below may have to be declared to download
+# The commented out 'export' line below may have to be declared to download
# and edit protein sequences using the new "Import/Edit Protein Sequences"
# (This may also be required for remote job submission in arp/warp.)
# task. If so, uncomment this line and replace the example proxy URL with your
# relevant URL

-#setenv HTTP_PROXY wwwblah.blah.ac.uk:xxxx/blah.blah
+#export HTTP_PROXY wwwblah.blah.ac.uk:xxxx/blah.blah

################### NOVICE USERS STOP HERE #####################

@@ -97,12 +157,12 @@

# The following checks the CCP4 server for available updates, and reports back.
# Comment this line out if you find it annoying.
-eval python -V >& /dev/null && python $CCP4/etc/ccp4_updates.py -l
+# eval python -V >& /dev/null && python $CCP4/etc/ccp4_updates.py -l

# Set GFORTRAN_UNBUFFERED_ALL to either 1 or Y to ensure that the logfile
# output from programs compiled with Gfortran is in the correct order.
# Note that there will be some performance penalty for this.
-setenv GFORTRAN_UNBUFFERED_ALL Y
+export GFORTRAN_UNBUFFERED_ALL="Y"

# The commented-out switch statement below provides an example of how
# to use this file for several machines/architectures sharing $CCP4_MASTER.
@@ -123,83 +183,65 @@
# started with the alias ccp4help and will open the file
# $CHTML/INDEX.html.

-# case `hostname` in # edit this case statement if used
-# # for multiple systems
-# foo)
- setenv CBIN $CCP4/bin
- setenv CLIB $CCP4/lib
+
+ export CBIN="$CCP4/bin"
+ export CLIB="$CCP4/lib"

- setenv CCP4_BROWSER mozilla
+ CCP4_BROWSER=""; export CCP4_BROWSER="open"

if test "$MANPATH"; then
- if [ $ccp4_first_in_path -eq 1 ]; then
- setenv MANPATH ${CCP4}/man:${MANPATH}
+ if [[ $ccp4_first_in_path -eq 1 ]]; then
+ export MANPATH="${CCP4}/man:${MANPATH}"
else
- setenv MANPATH ${MANPATH}:${CCP4}/man
+ export MANPATH="${MANPATH}:${CCP4}/man"
fi
else
if [ $ccp4_first_in_path -eq 1 ]; then
- setenv MANPATH ${CCP4}/man:/usr/share/man
+ export MANPATH="${CCP4}/man:/usr/share/man"
else
- setenv MANPATH /usr/share/man:${CCP4}/man
+ export MANPATH="/usr/share/man:${CCP4}/man"
fi
fi
- setenv MCTYPE unix # (only for Laue)
-# ;;
-# *)
-# echo "CCP4 not implemented on this system"
-# exit 1
-# ;;
-# esac
-
-case `uname` in
-*Darwin* )
- ulimit -s 65536
- ;;
-* )
- ;;
-esac
+ export MCTYPE="unix" # (only for Laue)
+
+
+ if [[ $(uname) == Darwin && $(sw_vers -productVersion) < 10.5 ]];then
+ ulimit -s 65536
+ fi
+

# The following are for all systems
-setenv CCP4_LIB $CLIB
-setenv CCP4_BIN $CBIN
+export CCP4_LIB="$CLIB"
+export CCP4_BIN="$CBIN"

# CLASSPATH for Java
if test "$CLASSPATH"; then
- if [ $ccp4_first_in_path -eq 1 ]; then
- setenv CLASSPATH ${CBIN}:${CLASSPATH}
+ if [[ $ccp4_first_in_path -eq 1 ]]; then
+ export CLASSPATH="${CBIN}:${CLASSPATH}"
else
- setenv CLASSPATH ${CLASSPATH}:${CBIN}
+ export CLASSPATH="${CLASSPATH}:${CBIN}"
fi
else
if [ $ccp4_first_in_path -eq 1 ]; then
- setenv CLASSPATH ${CBIN}:.
+ export CLASSPATH="${CBIN}:."
else
- setenv CLASSPATH .:${CBIN}
+ export CLASSPATH=".:${CBIN}"
fi
fi

-#Python path for the subprocess fixed module
-
-if ($ccp4_first_in_path) then
- setenv PYTHONPATH ${CCP4}/share/python:${PYTHONPATH}
-else
- setenv PYTHONPATH ${PYTHONPATH}:${CCP4}/share/python
-fi
-
### PLOT_COMMAND PRINT_COMMAND for the XCCPJIFFY programs to compile ###
-setenv PLOT_COMMAND 'lp -s -dmicrolaser'
-setenv PRINT_COMMAND 'lp -s -denscript'
+export PLOT_COMMAND='lp -s -dmicrolaser'
+export PRINT_COMMAND='lp -s -denscript'

# HARVESTHOME specifies location of harvesting files (defaults to $HOME)
-#setenv HARVESTHOME
+#export HARVESTHOME

### CCP4_OPEN ###
# CCP4_OPEN may be set to 'UNKNOWN' to stop open failures for files opened
# as NEW that already exist. Novices should use 'NEW' to avoid inadvertant
# over-writing of existing files, which is then treated as a fatal error.

-setenv CCP4_OPEN UNKNOWN
+export CCP4_OPEN="UNKNOWN"

### BINSORT_MEM ###
# BINSORT_MEM is workspace used by the binsort program. In principle this
@@ -209,64 +251,64 @@
# values -- 102400 (bytes) is the default. csh's `time' command can tell you
# about paging.
#
-# setenv BINSORT_MEM 8388608
+# export BINSORT_MEM="8388608"

# LD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.so)
# at runtime
-if test "$LD_LIBRARY_PATH"; then
- if [ $ccp4_first_in_path -eq 1 ]; then
- setenv LD_LIBRARY_PATH ${CLIB}:${LD_LIBRARY_PATH}
- else
- setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${CLIB}
- fi
-else
- setenv LD_LIBRARY_PATH ${CLIB}
-fi
-
-# DYLD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.dylib)
-# at runtime (used on Mac OS X)
-if test "$DYLD_LIBRARY_PATH"; then
- if [ $ccp4_first_in_path -eq 1 ]; then
- setenv DYLD_LIBRARY_PATH ${CLIB}:${DYLD_LIBRARY_PATH}
- else
- setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:${CLIB}
- fi
-else
- setenv DYLD_LIBRARY_PATH ${CLIB}
-fi
-
-### XAPPLRESDIR ###
-
-# If you want to use xloggraph/xplot84driver, you need to get the application
-# defaults picked up somehow. As distributed, the file can't just live in an
-# application defaults directory since it requires reading by xrdb to sort out
-# the differences for monochrome displays. At Daresbury a version of the file
-# assuming a monochrome display is kept in the directory
-# $CCP4_LIB/X11/app-defaults and this is picked up through the
-# XUSERFILESEARCHPATH environment variable. That means you only see black and
-# white on a colour display. Alternatively you might make sure that it is
-# read by xrdb on startup of the X Windows system or delegate the
-# responsibility to users to run it. There are disadvantages to putting an
-# invocation of xrdb in here, one being that the correct value of DISPLAY may
-# not be set at the time this file is read. Thus edit this part as
-# appropriate. (SunOS will normally want to use /usr/openwin or $OPENWINHOME
-# instead of /usr; others may want /usr/local/lib or some such):
-if test "$XUSERFILESEARCHPATH"; then
- setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:$XUSERFILESEARCHPATH
-else
- setenv XUSERFILESEARCHPATH $CCP4_LIB/X11/app-defaults/%N:/usr/lib/X11/app-defaults
-fi
-
-### TRAPPFE ###
-# TRAPFPE is set to ensure (in collaboration with -lfpe) an abort on floating
-# point exceptions under IRIX. It shouldn't cause harm on other systems, but
-# edit this to comment it out if necessary.
-setenv TRAP_FPE "OVERFL=ABORT; DIVZERO=ABORT; INVALID=ABORT"
-
-# The following can be used to put a message of the day to announce news about
-# CCP4 or whatever to CCP4 users. You might also want to edit this part to
-# have machine-specific messages dependent on `hostname`.
-test -r $CCP4/include/ccp4.msg && cat $CCP4/include/ccp4.msg
+##### if test "$LD_LIBRARY_PATH"; then
+##### if [[ $ccp4_first_in_path -eq 1 ]]; then
+##### export LD_LIBRARY_PATH="${CLIB}:${LD_LIBRARY_PATH}"
+##### else
+##### export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CLIB}"
+##### fi
+##### else
+##### export LD_LIBRARY_PATH="${CLIB}"
+##### fi
+#####
+##### # DYLD_LIBRARY_PATH specifies where to find dynamic libraries (e.g. libccp4.dylib)
+##### # at runtime (used on Mac OS X)
+##### if test "$DYLD_LIBRARY_PATH"; then
+##### if [[ $ccp4_first_in_path -eq 1 ]]; then
+##### export DYLD_LIBRARY_PATH="${CLIB}:${DYLD_LIBRARY_PATH}"
+##### else
+##### export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${CLIB}"
+##### fi
+##### else
+##### export DYLD_LIBRARY_PATH="${CLIB}"
+##### fi
+#####
+##### ### XAPPLRESDIR ###
+#####
+##### # If you want to use xloggraph/xplot84driver, you need to get the application
+##### # defaults picked up somehow. As distributed, the file can't just live in an
+##### # application defaults directory since it requires reading by xrdb to sort out
+##### # the differences for monochrome displays. At Daresbury a version of the file
+##### # assuming a monochrome display is kept in the directory
+##### # $CCP4_LIB/X11/app-defaults and this is picked up through the
+##### # XUSERFILESEARCHPATH environment variable. That means you only see black and
+##### # white on a colour display. Alternatively you might make sure that it is
+##### # read by xrdb on startup of the X Windows system or delegate the
+##### # responsibility to users to run it. There are disadvantages to putting an
+##### # invocation of xrdb in here, one being that the correct value of DISPLAY may
+##### # not be set at the time this file is read. Thus edit this part as
+##### # appropriate. (SunOS will normally want to use /usr/openwin or $OPENWINHOME
+##### # instead of /usr; others may want /usr/local/lib or some such):
+##### if test "$XUSERFILESEARCHPATH"; then
+##### export XUSERFILESEARCHPATH="$CCP4_LIB/X11/app-defaults/%N:$XUSERFILESEARCHPATH"
+##### else
+##### export XUSERFILESEARCHPATH="$CCP4_LIB/X11/app-defaults/%N:/usr/lib/X11/app-defaults"
+##### fi
+#####
+##### ### TRAPPFE ###
+##### # TRAPFPE is set to ensure (in collaboration with -lfpe) an abort on floating
+##### # point exceptions under IRIX. It shouldn't cause harm on other systems, but
+##### # edit this to comment it out if necessary.
+##### export TRAP_FPE="OVERFL=ABORT" ; export DIVZERO="ABORT" ; export INVALID="ABORT"
+#####
+##### # The following can be used to put a message of the day to announce news about
+##### # CCP4 or whatever to CCP4 users. You might also want to edit this part to
+##### # have machine-specific messages dependent on `hostname`.
+##### [[ -f "$CCP4/include/ccp4.msg" ]] && cat "$CCP4/include/ccp4.msg"

################### EXPERIENCED USERS STOP HERE #####################

@@ -274,36 +316,35 @@

### dbCCP4i database handler setup ###

-setenv DBCCP4I_TOP ${CCP4}/share/dbccp4i
+export DBCCP4I_TOP="${CCP4}/share/dbccp4i"

### IMOSFLM environment is now defined here

-setenv MOSFLM_EXEC ${CBIN}/ipmosflm
-setenv MOSFLM_WISH ${CCP4I_TCLTK}/wish
-setenv IMOSFLM_VERSION "0.6.1"
+export MOSFLM_EXEC="${CBIN}/ipmosflm"
+export MOSFLM_WISH="${CCP4I_TCLTK}/wish"
+export IMOSFLM_VERSION="0.6.1"


### MMCIFDIC is now defined here. cif_mmdic.lib is a binary file ===
# so on multiple installs it need to be unique and not in $CLIBD

-setenv MMCIFDIC $CLIB/cif_mmdic.lib
+export MMCIFDIC="$CLIB/cif_mmdic.lib"

### MOLREPLIB Point to the location of the files bs-zeros.dat ps.resource symlib.blc
# They are distributed with CCP4 in $CLIBD. This env must have the trailing \ or /

-setenv MOLREPLIB $CCP4/lib/data/monomers/
+export MOLREPLIB="$CCP4/lib/data/monomers/"

### CRANK points to location of Crank automation suite within ccp4i

-setenv CRANK $CCP4/ccp4i/crank
-setenv CCP4_CRANK 1
+export CRANK="$CCP4/ccp4i/crank"
+export CCP4_CRANK="1"

### XIA2 setup
# XIAROOT directory (default is under the share folder)

-if test -e $CCP4/share/XIAROOT/setup.sh
-then
-. $CCP4/share/XIAROOT/setup.sh
+if [[ -f "$CCP4/share/XIAROOT/setup.sh" ]]; then
+ source "$CCP4/share/XIAROOT/setup.sh"
fi

# Note: The PATH is updated with the xia2 Applications directory in the
@@ -312,108 +353,114 @@
### PISA_CONF_FILE is the config file needed to run the stand-alone PISA,
# though this can be set on the command line too.

-setenv PISA_CONF_FILE $CCP4/share/pisa/pisa.cfg
+export PISA_CONF_FILE="$CCP4/share/pisa/pisa.cfg"

### CLIBD_MON Point to the location of the dictionary files for REFMAC5
# They are distributed with CCP4 in $CLIBD/monomers. This env must have
# the trailing \ or /

-setenv CLIBD_MON $CCP4/lib/data/monomers/
+export CLIBD_MON="$CCP4/lib/data/monomers/"

### PUBLIC_FONT84, CCP4_HELPDIR, HELPDIR, MOSHELPFILE ###
# (essential for the relevant programs)
-setenv PUBLIC_FONT84 $CLIB/font84.dat # plot84 fonts [used by plot84lib]
+export PUBLIC_FONT84="$CLIB/font84.dat" # plot84 fonts [used by plot84lib]

# location of VMS-style help files required for mosflm [used by hlplib, chelp,
# chlp, (ip)mosflm]:
-setenv CCP4_HELPDIR $CCP4/help/ # NB trailing /
+export CCP4_HELPDIR="$CCP4/help/" # NB trailing /

# Rasmol path. Needed for prog. to find rasmol.hlp
-setenv RASMOLPATH $CCP4/x-windows/RasMol/src
+export RASMOLPATH="$CCP4/x-windows/RasMol/src"

-# CCP4 executables and scripts live in $CBIN and $CETC respectively; put them
-# on the path in an appropriate order for scripts to be used as wrappers for
-# binaries of the same name. Put ccp4 stuff after the current path to avoid
-# confusion with `.' or whatever in the path:
-#
-# This construct prevents the path getting longer each time ccp4.setup is
-# executed (A. Perrakis)
-ccp4pathlist="${CCP4}/etc ${CBIN} ${CCP4I_TOP}/bin ${DBCCP4I_TOP}/bin"
-#
-for dir in ${ccp4pathlist}; do
- if [ `expr ":${PATH}:" : ".*:${dir}:"` -eq 0 ]; then
- if [ $ccp4_first_in_path -eq 1 ]; then
- setenv PATH ${dir}:${PATH}
- else
- setenv PATH ${PATH}:${dir}
- fi
- fi
-done
+if [[ $ZSH_NAME != "zsh" ]];then
+
+ # This is specific to bash, so protect it from zsh users
+
+ # CCP4 executables and scripts live in $CBIN and $CETC respectively; put them
+ # on the path in an appropriate order for scripts to be used as wrappers for
+ # binaries of the same name. Put ccp4 stuff after the current path to avoid
+ # confusion with `.' or whatever in the path:
+ #
+ # This construct prevents the path getting longer each time ccp4.setup is
+ # executed (A. Perrakis)
+ #
+ ccp4pathlist="${CCP4}/etc ${CBIN} ${CCP4I_TOP}/bin ${DBCCP4I_TOP}/bin"
+ #
+ for dir in ${ccp4pathlist}; do
+ if [[ `expr ":${PATH}:" : ".*:${dir}:"` -eq 0 ]]; then
+ if [[ $ccp4_first_in_path -eq 1 ]]; then
+ export PATH="${dir}:${PATH}"
+ else
+ export PATH="${PATH}:${dir}"
+ fi
+ fi
+ done
+
+fi

# Optional (useful) additional environment variables
- setenv CCP4 $CCP4
- setenv CDOC $CCP4/doc
- setenv CHTML $CCP4/html
- setenv CETC $CCP4/etc
- setenv CEXAM $CCP4/examples
- setenv CINCL