%define build_java 0 %{?_with_java: %{expand: %%global build_java 1}} %define build_patented 0 %{?_with_patented: %{expand: %%global build_patented 1}} %define name itk %define version 2.0.1 %define release 1 %define libname %mklibname %{name} %define libname_devel %mklibname %{name} -d Summary: Medicine Insight Segmentation and Registration Name: %{name} Version: %{version} Release: %mkrel %{release} License: BSDish Group: Sciences/Other URL: http://www.itk.org Source0: http://belnet.dl.sourceforge.net/sourceforge/itk/InsightToolkit-%{version}.tar.bz2 Source1: http://belnet.dl.sourceforge.net/sourceforge/itk/ItkSoftwareGuide-2.0.0.pdf.bz2 Patch0: itk-python-numarray.patch.bz2 Patch1: itk-wrap-morpho.patch.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRequires: cmake >= 1.8.3 XFree86-devel png-devel tiff-devel zlib-devel gcc-c++ BuildRequires: cableswig python-numarray-devel python-devel tcl gcc3.3-c++ BuildRequires: graphviz doxygen perl %description ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %package -n %{libname} Group: System/Libraries Summary: Medicine Insight Segmentation and Registration Provides: %{name} = %{version}-%{release} Provides: InsightToolkit = %{version}-%{release} %description -n %{libname} ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %package -n %{libname_devel} Summary: ITK header files for building C++ code Group: Development/C++ Requires: gcc-c++ Requires: %{libname} = %{version} Provides: %{name}-devel = %{version}-%{release} %description -n %{libname_devel} ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %package examples Summary: C++, Tcl and Python example programs/scripts for ITK Group: Development/C++ Requires: %{name}-data = %{version} Requires: %{libname} = %{version} %description examples ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %package data Summary: These data are required to run various examples from the examples package Group: Development/C++ %description data ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %package doc Summary: Documentation for ITK Group: Development/C++ %description doc ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %package -n python-%{name} Summary: Python bindings for ITK Group: Development/Python Requires: python Requires: python-numarray Requires: %{name} = %{version} Obsoletes: %{name}-pyhon Provides: %{name}-pyhon %description -n python-%{name} ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %if %build_java %package -n java-%{name} Summary: Java bindings for ITK Group: Development/Java Requires: %{name} = %{version} Obsoletes: %{name}-java Provides: %{name}-java %description -n java-%{name} ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %endif %package -n tcl-%{name} Summary: TCL bindings for ITK Group: Development/Other Requires: %{name} = %{version} Requires: tcl Obsoletes: %{name}-tcl Provides: %{name}-tcl %description -n tcl-%{name} ITK is an open-source software system to support the Visible Human Project. Currently under active development, ITK employs leading-edge segmentation and registration algorithms in two, three, and more dimensions. The Insight Toolkit was developed by six principal organizations, three commercial (Kitware, GE Corporate R&D, and Insightful) and three academic (UNC Chapel Hill, University of Utah, and University of Pennsylvania). Additional team members include Harvard Brigham & Women's Hospital, University of Pittsburgh, and Columbia University. The funding for the project is from the National Library of Medicine at the National Institutes of Health. NLM in turn was supported by member institutions of NIH (see sponsors). %prep %setup -q -n InsightToolkit-%{version} # numarray patch %patch0 -p1 # morpho patch %patch1 -p1 cd Wrapping/CSwig/BasicFiltersA ./MakeConsistentWrappedClasses.sh cd - # doc bunzip2 %{SOURCE1} -c > ItkSoftwareGuide.pdf # remove CVS dirs, if exists find -name CVS -type d | xargs rm -rf %build PYTHON_INCLUDE_PATH=$(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'include', 'python' + sys.version[:3])") PYTHON_LIBRARY=$(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3], 'config/libpython' + sys.version[:3] + '.a')") CMAKE_CMD="cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_DOXYGEN:BOOL=ON \ -DCMAKE_CXX_FLAGS:STRING=$RPM_OPT_FLAGS \ -DCMAKE_C_FLAGS:STRING=$RPM_OPT_FLAGS \ -DITK_USE_SYSTEM_TIFF:BOOL=ON \ -DITK_USE_SYSTEM_PNG:BOOL=ON \ -DITK_USE_SYSTEM_ZLIB:BOOL=ON \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DITK_CSWIG_PYTHON:BOOL=ON \ -DITK_USE_PYTHON_NUMARRAY:BOOL=ON \ -DPYTHON_INCLUDE_PATH:PATH=$PYTHON_INCLUDE_PATH \ -DPYTHON_LIBRARY:FILEPATH=$PYTHON_LIBRARY \ -DITK_CSWIG_TCL:BOOL=ON \ " %if %build_java CMAKE_CMD="$CMAKE_CMD \ -DJAVA_INCLUDE_PATH:PATH=$JAVA_HOME/include \ -DJAVA_INCLUDE_PATH2:PATH=$JAVA_HOME/include/linux \ -DJAVA_AWT_INCLUDE_PATH:PATH=$JAVA_HOME/include \ -DJAVA_AWT_LIBRARY:PATH=$JAVA_HOME/jre/lib/i386/libawt.so \ -DVTK_WRAP_JAVA:BOOL=ON \ " %endif %if %build_patented CMAKE_CMD="$CMAKE_CMD \ -DITK_USE_PATENTED:BOOL=ON \ " %endif $CMAKE_CMD . # -DITK_USE_SYSTEM_VXL:BOOL=ON \ # -DBUILD_EXAMPLES:BOOL=ON \ # wrapper still needs gcc 3.3 compatibility export GCCXML_COMPILER=g++-%(gcc3.3-version) %make # test itk # make test # build docs mkdir -p Documentation/Doxygen doxygen doxygen.config # compile python modules export LIBPYTHONPATH=%(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3])") python $LIBPYTHONPATH/py_compile.py bin/*.py python $LIBPYTHONPATH/py_compile.py Wrapping/CSwig/Python/*.py python $LIBPYTHONPATH/py_compile.py Wrapping/CSwig/Python/InstallOnly/itkbase.py %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT echo "build_java=%{build_java}" make install DESTDIR=$RPM_BUILD_ROOT # install ld.so.conf path install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d cat > $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d/%{name}.conf <<_EOF %{_libdir}/InsightToolkit _EOF # install docs install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}-doc cp -a Documentation/Doxygen/html $RPM_BUILD_ROOT/%{_datadir}/%{name}-doc/api # install examples install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}-examples/ cp -a Testing $RPM_BUILD_ROOT/%{_datadir}/%{name}-examples/ cp -a Examples $RPM_BUILD_ROOT/%{_datadir}/%{name}-examples/ # get rid of unwanted files find $RPM_BUILD_ROOT/%{_datadir}/itk-examples/ -name "*.o" -exec rm {} \; find $RPM_BUILD_ROOT/%{_datadir}/itk-examples/ -name CMakeCache.txt -exec rm {} \; find $RPM_BUILD_ROOT/%{_datadir}/itk-examples/ -name Makefile -exec rm {} \; find $RPM_BUILD_ROOT/%{_datadir}/itk-examples/ -name DartTestfile.txt -exec rm {} \; find $RPM_BUILD_ROOT/%{_datadir}/itk-examples/ -name .NoDartCoverage -exec rm {} \; find $RPM_BUILD_ROOT/%{_datadir}/itk-examples/ -name "cmake.*" -exec rm {} \; #install data mv $RPM_BUILD_ROOT/%{_datadir}/itk-examples/Testing/Data $RPM_BUILD_ROOT/%{_datadir}/%{name}-data # install python rm -f $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/*.py cp bin/*.py $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/python cp bin/*.pyc $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/python cp Wrapping/CSwig/Python/*.py $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/python cp Wrapping/CSwig/Python/*.pyc $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/python cp Wrapping/CSwig/Python/InstallOnly/itkbase.py $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/python cp Wrapping/CSwig/Python/InstallOnly/itkbase.pyc $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/python export ITKPYTHONPATH=%(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3],'site-packages')") install -d -m 755 $RPM_BUILD_ROOT/$ITKPYTHONPATH cat > $RPM_BUILD_ROOT/$ITKPYTHONPATH/InsightToolkit.pth <<_EOF %{_libdir}/InsightToolkit/python _EOF #install tcl utils cp Wrapping/CSwig/Tcl/itkutils.tcl $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/tcl/ rm -f $RPM_BUILD_ROOT/%{_libdir}/InsightToolkit/itkwish %clean rm -rf $RPM_BUILD_ROOT %post -n %{libname} -p /sbin/ldconfig %post -n python-%{name} -p /sbin/ldconfig %post -n tcl-%{name} -p /sbin/ldconfig %if %build_java %post -n java-%{name} -p /sbin/ldconfig %endif %postun -n %{libname} -p /sbin/ldconfig %postun -n python-%{name} -p /sbin/ldconfig %postun -n tcl-%{name} -p /sbin/ldconfig %if %build_java %postun -n java-%{name} -p /sbin/ldconfig %endif %files -n %{libname} %defattr(0644,root,root,0755) %doc README.html %doc Documentation/DeveloperList.txt %doc Copyright/* %{_libdir}/InsightToolkit/libITKAlgorithms.so %{_libdir}/InsightToolkit/libITKBasicFilters.so %{_libdir}/InsightToolkit/libITKCommon.so %{_libdir}/InsightToolkit/libITKDICOMParser.so %{_libdir}/InsightToolkit/libITKEXPAT.so %{_libdir}/InsightToolkit/libITKFEM.so %{_libdir}/InsightToolkit/libITKIO.so %{_libdir}/InsightToolkit/libITKMetaIO.so %{_libdir}/InsightToolkit/libitknetlib.so %{_libdir}/InsightToolkit/libITKNrrdIO.so %{_libdir}/InsightToolkit/libITKNumerics.so %{_libdir}/InsightToolkit/libITKStatistics.so %{_libdir}/InsightToolkit/libitksys.so %{_libdir}/InsightToolkit/libitkvcl.so %{_libdir}/InsightToolkit/libitkvnl_algo.so %{_libdir}/InsightToolkit/libitkvnl_inst.so %{_libdir}/InsightToolkit/libitkvnl.so %{_libdir}/InsightToolkit/libitkjpeg12.so %{_libdir}/InsightToolkit/libitkjpeg16.so %{_libdir}/InsightToolkit/libitkjpeg8.so %{_libdir}/InsightToolkit/libITKSpatialObject.so %{_libdir}/InsightToolkit/libitkgdcm.so %{_sysconfdir}/ld.so.conf.d/%{name}.conf %files -n %{libname_devel} %defattr(0644,root,root,0755) %{_includedir}/InsightToolkit %{_libdir}/InsightToolkit/*.cmake %files doc %defattr(0644,root,root,0755) %doc Documentation/InsightDeveloperStart.pdf %doc Documentation/Style.pdf %doc ItkSoftwareGuide.pdf %{_datadir}/%{name}-doc %files examples %defattr(0644,root,root,0755) %{_datadir}/%{name}-examples/Examples %{_datadir}/%{name}-examples/Testing %files data %defattr(0644,root,root,0755) %{_datadir}/%{name}-data %files -n python-%{name} %defattr(0644,root,root,0755) %{_libdir}/InsightToolkit/*Python.so %{_libdir}/InsightToolkit/python %(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3],'site-packages', 'InsightToolkit.pth')") %files -n tcl-%{name} %defattr(0644,root,root,0755) %attr(755,root,root) %{_bindir}/itkwish %{_libdir}/InsightToolkit/tcl %{_libdir}/InsightToolkit/*Tcl.so %if %build_java %files -n java-%{name} %defattr(0644,root,root,0755) %{_libdir}/InsightToolkit/java %{_libdir}/InsightToolkit/*Java.so %endif %changelog * Thu Mar 24 2005 Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr> 2.0.1-1mdk - New release 2.0.1 - Use mkrel - add "--with patented" switch - fix wrong tcl group * Wed Mar 02 2005 Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr> 2.0.0-2mdk - add morpho filters in wrappers (patch1) - fix some lint * Sun Feb 13 2005 Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr> 2.0.0-1mdk - 2.0.0 - add wrappers * Mon Jan 31 2005 Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr> 1.10.0-0.cvs20050131.1mdk - 1.10.0 cvs - build still fail with wrapper so no wrapper avaible :-( - add doc and devel packages - use libitk name - initial contrib release * Mon Sep 27 2004 Fabrice Bellet <Fabrice.Bellet@creatis.insa-lyon.fr> 1.8.1-2 - add an example packages. * Wed Sep 22 2004 Fabrice Bellet <Fabrice.Bellet@creatis.insa-lyon.fr> 1.8.1-1 - update to version 1.8.1. * Thu Sep 09 2004 Fabrice Bellet <Fabrice.Bellet@creatis.insa-lyon.fr> 1.8.0-2 - fix CC and CXX to be consistent with the VTK package. * Wed Sep 08 2004 Fabrice Bellet <Fabrice.Bellet@creatis.insa-lyon.fr> 1.8.0-1 - update to version 1.8.0. * Thu May 27 2004 Fabrice Bellet <Fabrice.Bellet@creatis.insa-lyon.fr> 1.6.0-3 - rebuild for Fedora Core 2 - debuginfo rebuild * Mon Feb 23 2004 Fabrice Bellet <Fabrice.Bellet@creatis.insa-lyon.fr> 1.6.0-2 - update to version 1.6.0. * Wed Oct 29 2003 Fabrice Bellet <Fabrice.Bellet@creatis.insa-lyon.fr> - initial release 1.4.0.