Follow-up to my note below: Attached is a better spec file
(cctbx_r2.spec) for building cctbx RPMs, where I've cleaned the build
procedure by using cctbx_sources/libtbx/configure.py in a
post-processing step, rather than the weird hack of building in the
system-wide /usr/local space; see the ChangeLog and spec file for more.
Many thanks to Ralf for helpful advice.
enjoy,
cam
=== Cameron Mura wrote (on 07/27/2009 06:47 PM): ===
Hi all,
In case it's of interest, I've attached a spec file that works for
building a cctbx RPM on Fedora 10 (nothing really F10-specific, so may
work on other distros/releases too).
Please note that it works by playing the dangerous (and extremely
ugly) game of moving the RPM build into the system-wide tree, so it
builds "in situ" in /usr/local/cctbx instead of in the RPM default
locale (/my/rpm/BUILDROOT/usr/local/cctbx). On the same note, the
patch which is referenced in the spec file
('cctbx_bundle_StrucBio.patch') is just a small snippet that edits the
head of 'cctbx_install_script.csh' to explicitly control the build
path (i.e., override $cwd by explicitly setting something like 'set
install_root="/usr/local/cctbx/2009_02_15_2320"', or wherever you'd
like cctbx to live...). Probably a much cleaner procedure would be to
use the libtbx/configure.py approach in a post-processing step; let me
know if anyone pkg's an RPM that way. :-)
Enjoy,
Cam
------------------------------------------------------------------------
_______________________________________________
cctbxbb mailing list
[email protected]
http://www.phenix-online.org/mailman/listinfo/cctbxbb
#-------------------------------------------------------------------------------
# Cameron Mura ; 27jul09;
#-------------------------------------------------------------------------------
%define debug_package %{nil}
Name: cctbx
Version: 2009_02_15_2320
Release: 2
Summary: Computational Crystallography Toolbox
License: Open Source (BSD-like)
Group: Applications/Engineering
URL: http://cctbx.sourceforge.net
Source0: %{name}_bundle_%{version}.tar.gz
Source1: ccp4_mon_lib.tar.gz
Packager: Cameron Mura
#Patch0: cctbx_bundle_StrucBio.patch
BuildRoot: /var/tmp/%{name}-buildroot
%description
The Computational Crystallography Toolbox (cctbx) is being developed as the
open source component of the PHENIX system. The goal of the PHENIX project is
to advance automation of macromolecular structure determination. PHENIX depends
on the cctbx, but not vice versa. This hierarchical approach enforces a clean
design as a reusable library. The cctbx is therefore also useful for
small-molecule crystallography and even general scientific applications. The
cctbx is designed with an open and flexible architecture to promote
extendability and easy incorporation into other software environments. The
package is organized as a set of ISO C++ classes with Python bindings. This
organization combines the computational efficiency of a strongly typed compiled
language with the convenience and flexibility of a dynamically typed scripting
language in a strikingly uniform and very maintainable way. Note that CCTBX is
developed under an open source (BSD-like) license; for addition information,
see http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/cctbx/LICENSE_2_0.txt.
%prep
%setup -a 0 -c
%build
./cctbx_install_script.csh /usr/bin/python 8
. ./cctbx_build/setpaths.sh
cp %{SOURCE1} .
libtbx.unpack_in_sources %{SOURCE1}
%install
[ $RPM_BUILD_ROOT != "/" ] && rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/%{name}/%{version}
mkdir -p $RPM_BUILD_ROOT/etc/profile.d
echo '. "/usr/local/%{name}/%{version}/cctbx_build/setpaths.sh"' \
> $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh
echo 'source "/usr/local/%{name}/%{version}/cctbx_build/setpaths.csh"' \
> $RPM_BUILD_ROOT/etc/profile.d/%{name}.csh
cp -R cctbx_sources cctbx_install_script.csh cctbx_build ${RPM_BUILD_ROOT}/usr/local/%{name}/%{version}/.
cp -R %{SOURCE1} ${RPM_BUILD_ROOT}/usr/local/%{name}/%{version}/.
%clean
[ $RPM_BUILD_ROOT != "/" ] && rm -rf $RPM_BUILD_ROOT
%post
# update paths and clean-up/regenerate byte-compiled (.pyc) python modules:
cd /usr/local/%{name}/%{version}/cctbx_build
/usr/bin/python /usr/local/%{name}/%{version}/cctbx_sources/libtbx/configure.py \
fftw3tbx rstbx smtbx mmtbx clipper
cd /usr/local/%{name}/%{version}
find . -iname "*.pyc" -exec /bin/rm "{}" \;
/usr/local/cctbx/2009_02_15_2320/cctbx_build/bin/libtbx.py_compile_all
#. /etc/profile.d/cctbx.sh
#libtbx.unpack_in_sources ccp4_mon_lib.tar.gz
%preun
#%{__rm} -f /usr/local/bin/rasmol
%files
%defattr(-,root,root)
#%doc ChangeLog.txt ChangeLog.html INSTALL* NOTICE README*
/usr/local/%{name}/%{version}
/etc/profile.d/%{name}.sh
/etc/profile.d/%{name}.csh
%changelog
* Mon Jul 27 2009 Cameron Mura