Blob Blame History Raw
##This macro enables/disables pyOpenMS python bindings
%ifarch %{arm}
%global with_pyOpenMS 0
%else
%global with_pyOpenMS 1
%endif

Name:      openms
Summary:   LC/MS data management and analyses
Version:   1.11.1
Release:   9%{?dist}
License:   BSD
URL:       http://open-ms.sourceforge.net/
Source0:   http://sourceforge.net/projects/open-ms/files/OpenMS/OpenMS-%{version}/OpenMS-%{version}.tar.gz

##TOPPView, TOPPAS, INIFileEditor .desktop and icon files
Source1:   TOPPView.xpm
Source2:   TOPPAS.xpm
Source3:   toppview.desktop
Source4:   toppas.desktop
Source5:   INIFileEditor.xpm
Source6:   inifileeditor.desktop

BuildRequires: qt-devel >= 4.7, qt-x11, qtwebkit-devel
BuildRequires: cmake >= 2.8 
BuildRequires: libsvm-devel, gsl-devel, glpk-devel, xerces-c-devel
BuildRequires: boost-devel, seqan-devel, openmpi-devel
BuildRequires: zlib-devel, bzip2-devel, tbb-devel
BuildRequires: desktop-file-utils, XTandem

## Build documentation
## Doxygen useful only on SVN versions  
#BuildRequires: doxygen
BuildRequires: dos2unix, graphviz, texlive, ImageMagick

##Xvfb is needed to run a virtual X server used by some tests
BuildRequires: xorg-x11-server-Xvfb

%if 0%{?with_pyOpenMS}
BuildRequires: python-setuptools, python2-devel, numpy 
BuildRequires: python-nose, autowrap, Cython
%endif

Requires: XTandem
Requires: %{name}-data = %{version}-%{release}

##Fixing Cython 0.20 compatibility
##https://github.com/OpenMS/OpenMS/commit/32643435f91f18a2c311211a6ac2629f3bafdbb1
Patch0: %{name}-fixCython0.2-compatibility.patch

##Fixing pyOpenMS build without contrib
##https://github.com/OpenMS/OpenMS/commit/7e85e1ed12601e852eb0dc25e285a889304cf08e
Patch1: %{name}-fix-pyOpenMSbuild.patch  

##Use 'setuptools' instead of 'distribute' downloaded/built separately
Patch2: %{name}-setuptools.patch  

##Make versioned libraries
Patch3: %{name}-lib-soname.patch

##Fixe problems with ">>" generated in nested C++ templates 
##https://github.com/OpenMS/OpenMS/commit/5635b5f12334ef295b491b536e8ff26855bc5793
Patch4: %{name}-nestedC++templates.patch

##OpenMS libraries need these additional QT libs
Patch5: %{name}-fix_QtCore_QtGui_finding.patch

%description
OpenMS is an open-source C++ library for LC/MS data management and analyses.
It offers an infrastructure for the rapid development 
of mass spectrometry related software.
It comes with a vast variety ready-to-use tools for proteomics and 
metabolomics data analysis (TOPPTools) and powerful 2D and 
3D visualization(TOPPView).
OpenMS offers analyses for various quantitation protocols, 
including label-free quantitation, SILAC, iTRAQ, SRM, SWATH.
OpenMS supports the Proteomics Standard Initiative (PSI) formats for MS data.

The OpenMS Proteomics Pipeline is a pipeline for 
the analysis of HPLC-MS data. 
It consists of several small applications that 
can be chained to create analysis pipelines tailored 
for a specific problem.

The TOPP tools are divided into several subgroups:
 - Graphical Tools
 - File Handling
 - Signal Processing and Preprocessing
 - Quantitation
 - Map Alignment
 - Protein/Peptide Identification
 - Protein/Peptide Processing
 - Targeted Experiments
 - Peptide Property Prediction
 - Misc

%package tools
Summary: OpenMS tools
Requires: %{name}-data = %{version}-%{release}
%description tools
Besides TOPP, OpenMS offers a range of other tools. 
They are not included in TOPP as they are not part of 
typical analysis pipelines, but they still might be 
very helpful to you.

The UTILS tools are divided into several subgroups:
 - Maintenance
 - Signal Processing and Preprocessing
 - File handling
 - Algorithm evaluation
 - Peptide identification
 - Quantitation
 - Misc
 - Metabolite identification
 - Quality control

%if 0%{?with_pyOpenMS}
%package -n python-openms
Summary: OpenMS Python2 bindings
Requires: %{name}-data = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python-openms
This package contains Python bindings for a large part of the OpenMS library
for mass spectrometry based proteomics.  It thus provides providing facile 
access to a feature-rich, open-source algorithm library 
for mass-spectrometry based proteomics analysis. 
These Python bindings allow raw access to the data-structures and algorithms 
implemented in OpenMS, specifically those for file access 
(mzXML, mzML, TraML, mzIdentML among others), basic signal processing 
(smoothing, filtering, de-isotoping and peak-picking) and complex data analysis 
(including label-free, SILAC, iTRAQ and SWATH analysis tools).
%endif

%package devel
Summary: OpenMS headers files
Requires: %{name}-data = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
OpenMS development files.

%package doc
Summary: OpenMS documentation
BuildArch: noarch
%description doc
HTML documentation and PDF tutorials of OpenMS.

%package tutorials
Summary: OpenMS tutorials
Requires: %{name}-data = %{version}-%{release}
%description tutorials
OpenMS executable tutorials.

%package data
Summary: The OpenMS data files
BuildArch: noarch
%description data
The OpenMS data files

%prep
%setup -q -n OpenMS-%{version}
rm -rf cmake/MacOSX

## Remove bundled files
rm -rf contrib/patches
rm -rf contrib/src

## Strip all .png files 
## 'iCCP: known incorrect sRGB profile' warnings
find . -type f -name "*.png" -exec convert {} -strip {} \;

## Convert file to Unix format
dos2unix share/OpenMS/OpenMS_DB.sql
dos2unix share/OpenMS/CV/psi-mzdata.obo
dos2unix doc/html/style_ini.css

##Remove spurious executable permissions
for i in `find include/OpenMS -perm /111 -type f \( -name "*" \)`; do
chmod a-x $i
done
for i in `find share/OpenMS -perm /111 -type f \( -name "*.xsd" -o -name "*.graphml" \
 -o -name "*.sql" -o -name "*.obo" -o -name "*.model" -o -name "*.C" -o -name "*.h" \)`; do
chmod a-x $i
done
for i in `find doc -perm /111 -type f \( -name "*.css" \)`; do
chmod a-x $i
done

%if 0%{?with_pyOpenMS}
%patch0 -p0
%patch1 -p0
%endif

%patch2 -p0
%patch3 -p0
%patch4 -p2
%patch5 -p0

%build

export LDFLAGS="%{__global_ldflags} -Wl,--as-needed"
%cmake -Wno-dev \
 -DCMAKE_COLOR_MAKEFILE:BOOL=ON \
 -DCMAKE_CXX_FLAGS_RELEASE:STRING="$RPM_OPT_FLAGS" -DCMAKE_C_FLAGS_RELEASE:STRING="$RPM_OPT_FLAGS" \
 -DCMAKE_VERBOSE_MAKEFILE=TRUE -DCMAKE_FIND_ROOT_PATH=%{_prefix} \
 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -DENABLE_SVN=OFF -DCMAKE_BUILD_TYPE=Release -DBOOST_USE_STATIC=OFF \
 -DCMAKE_SKIP_RPATH=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
 -DMT_ENABLE_TBB:BOOL=ON -DMT_TBB_INCLUDE_DIR=%{_includedir}/tbb \
 -DMT_TBB_LIBRARY_DIR=%{_libdir} \
 -DMT_ENABLE_OPENMP=ON -DMT_ENABLE_CUDA=OFF \
 -DXTANDEM_BINARY=%{_bindir}/tandem \
%if 0%{?with_pyOpenMS}
 -DPYOPENMS=ON .
%else
 -DPYOPENMS=OFF .
%endif

%if 0%{?with_pyOpenMS}
make %{?_smp_mflags} OpenMS TOPP UTILS GUI pyopenms pyopenms_bdist_egg
%else
make %{?_smp_mflags} OpenMS TOPP UTILS GUI 
%endif


## Make HTML documentation (only on SVN versions)
## Make Tutorials
## Run a Virtual X server waiting 3 seconds before
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH
#xvfb-run -a make doc
xvfb-run -a make Tutorials_build

%install
#make install DESTDIR=%%{buildroot}
##Manual installation

mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}

install -pm 755 bin/* %{buildroot}%{_bindir}
install -pm 755 lib/libOpen* %{buildroot}%{_libdir}
cp -v -a include/OpenMS %{buildroot}%{_includedir}
cp -v -a share/OpenMS %{buildroot}%{_datadir}

##Install TOPPAS/TOPPView .png icons
mkdir -p %{buildroot}%{_datadir}/icons/TOPP/pixmaps
install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/icons/TOPP/pixmaps
install -pm 644 %{SOURCE2} %{buildroot}%{_datadir}/icons/TOPP/pixmaps
install -pm 644 %{SOURCE5} %{buildroot}%{_datadir}/icons/TOPP/pixmaps

##Install toppas/toppview/inifileeditor .desktop files
mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE3}
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE4}
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE6}

##Make symbolic links to the OpenMS libraries
ln -s -f %{_libdir}/libOpenMS.so.1.11.1 %{buildroot}%{_libdir}/libOpenMS.so
ln -s -f %{_libdir}/libOpenSwathAlgo.so.1.11.1 %{buildroot}%{_libdir}/libOpenSwathAlgo.so
ln -s -f %{_libdir}/libOpenMS_GUI.so.1.11.1 %{buildroot}%{_libdir}/libOpenMS_GUI.so

%if 0%{?with_pyOpenMS}
## pyOpenMS installation
pushd pyOpenMS
%{__python2} setup.py install --skip-build --root %{buildroot}

ln -s -f %{_libdir}/libOpenMS.so.1.11.1 %{buildroot}%{python2_sitearch}/pyopenms/libOpenMS.so
ln -s -f %{_libdir}/libOpenSwathAlgo.so.1.11.1 %{buildroot}%{python2_sitearch}/pyopenms/libOpenSwathAlgo.so

## Fix standard permissions 
chmod 0755 %{buildroot}%{python2_sitearch}/pyopenms/pyopenms.so
popd

## Remove duplicated data file directory
## and link to /usr/share/OpenMS
rm -rf %{python2_sitearch}/pyopenms/share/OpenMS
ln -s %{_datadir}/OpenMS %{buildroot}%{python2_sitearch}/pyopenms/share/OpenMS
%endif

%post 
/sbin/ldconfig
/bin/touch --no-create %{_datadir}/icons/TOPP &>/dev/null || :

%postun 
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/TOPP &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/TOPP &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/TOPP &>/dev/null || :

%check
## Make all test
#make test_build
#export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH
#export PATH=$PWD/bin:$PATH
#export OPENMS_DATA_PATH=$PWD/share/OpenMS:$OPENMS_DATA_PATH
## Run a Virtual X server waiting 3 seconds before
## starting tests
#xvfb-run -a ctest --force-new-ctest-process

##pyOpenMS tests including mem leak
%if 0%{?with_pyOpenMS}
cd pyOpenMS
%{__python2} ./run_nose.py
%{__python2} ./run_memleaks.py
%endif

%files
%{_bindir}/TOPPView
%{_bindir}/TOPPAS
%{_bindir}/INIFileEditor
%{_bindir}/DTAExtractor
%{_bindir}/FileConverter
%{_bindir}/FileInfo
%{_bindir}/FileMerger
%{_bindir}/IDMerger
%{_bindir}/IDRipper
%{_bindir}/IDFileConverter
%{_bindir}/MapStatistics
%{_bindir}/SpectraMerger
%{_bindir}/TextExporter
%{_bindir}/MzTabExporter
%{_bindir}/BaselineFilter
%{_bindir}/InternalCalibration
%{_bindir}/MapNormalizer
%{_bindir}/MassTraceExtractor
%{_bindir}/NoiseFilterGaussian
%{_bindir}/NoiseFilterSGolay
%{_bindir}/PeakPickerHiRes 
%{_bindir}/PeakPickerWavelet
%{_bindir}/PrecursorMassCorrector
%{_bindir}/HighResPrecursorMassCorrector
%{_bindir}/Resampler
%{_bindir}/SpectraFilterBernNorm
%{_bindir}/SpectraFilterMarkerMower
%{_bindir}/SpectraFilterNLargest
%{_bindir}/SpectraFilterNormalizer
%{_bindir}/SpectraFilterParentPeakMower
%{_bindir}/SpectraFilterScaler
%{_bindir}/SpectraFilterSqrtMower
%{_bindir}/SpectraFilterThresholdMower
%{_bindir}/SpectraFilterWindowMower
%{_bindir}/TOFCalibration
%{_bindir}/AdditiveSeries 
%{_bindir}/Decharger
%{_bindir}/EICExtractor 
%{_bindir}/FeatureFinderCentroided 
%{_bindir}/FeatureFinderRaw 
%{_bindir}/FeatureFinderIsotopeWavelet 
%{_bindir}/FeatureFinderMetabo
%{_bindir}/FeatureFinderMRM 
%{_bindir}/IsobaricAnalyzer 
%{_bindir}/ITRAQAnalyzer 
%{_bindir}/ProteinQuantifier 
%{_bindir}/ProteinResolver 
%{_bindir}/SILACAnalyzer
%{_bindir}/SeedListGenerator
%{_bindir}/TMTAnalyzer 
%{_bindir}/ConsensusMapNormalizer
%{_bindir}/MapAlignerIdentification 
%{_bindir}/MapAlignerPoseClustering 
%{_bindir}/MapAlignerSpectrum 
%{_bindir}/MapRTTransformer
%{_bindir}/FeatureLinkerLabeled
%{_bindir}/FeatureLinkerUnlabeled 
%{_bindir}/FeatureLinkerUnlabeledQT
%{_bindir}/CompNovo
%{_bindir}/CompNovoCID
%{_bindir}/InspectAdapter 
%{_bindir}/MascotAdapter
%{_bindir}/MascotAdapterOnline
%{_bindir}/MyriMatchAdapter
%{_bindir}/OMSSAAdapter
%{_bindir}/PepNovoAdapter
%{_bindir}/XTandemAdapter
%{_bindir}/SpecLibSearcher
%{_bindir}/ConsensusID
%{_bindir}/FalseDiscoveryRate
%{_bindir}/IDConflictResolver
%{_bindir}/IDFilter
%{_bindir}/IDMapper 
%{_bindir}/IDPosteriorErrorProbability
%{_bindir}/IDRTCalibration 
%{_bindir}/PeptideIndexer
%{_bindir}/ProteinInference
%{_bindir}/InclusionExclusionListCreator
%{_bindir}/PrecursorIonSelector
%{_bindir}/MRMMapper
%{_bindir}/OpenSwathDecoyGenerator
%{_bindir}/OpenSwathChromatogramExtractor 
%{_bindir}/OpenSwathAnalyzer
%{_bindir}/OpenSwathRTNormalizer
%{_bindir}/OpenSwathFeatureXMLToTSV
%{_bindir}/OpenSwathConfidenceScoring 
%{_bindir}/PTModel 
%{_bindir}/PTPredict
%{_bindir}/RTModel
%{_bindir}/RTPredict
%{_bindir}/GenericWrapper
%{_bindir}/ExecutePipeline 
%{_datadir}/applications/toppas.desktop
%{_datadir}/applications/toppview.desktop
%{_datadir}/applications/inifileeditor.desktop
%{_datadir}/icons/TOPP/
%{_libdir}/libOpen*.so.*

%files tools
%{_bindir}/DBExporter
%{_bindir}/DBImporter
%{_bindir}/FileFilter
%{_bindir}/IDDecoyProbability
%{_bindir}/IDEvaluatorGUI
%{_bindir}/OpenMSInfo
%{_bindir}/PILISIdentification
%{_bindir}/PILISModelCV
%{_bindir}/PILISModelTrainer
%{_bindir}/PILISSpectraGenerator
%{_bindir}/PhosphoScoring
%{_bindir}/INIUpdater 
%{_bindir}/RNPxlXICFilter 
%{_bindir}/FuzzyDiff 
%{_bindir}/XMLValidator 
%{_bindir}/SemanticValidator
%{_bindir}/CVInspector
%{_bindir}/IDSplitter 
%{_bindir}/ConvertTSVToTraML 
%{_bindir}/ConvertTraMLToTSV 
%{_bindir}/OpenSwathMzMLFileCacher
%{_bindir}/FFEval
%{_bindir}/IDEvaluator
%{_bindir}/LabeledEval 
%{_bindir}/MapAlignmentEvaluation 
%{_bindir}/RTEvaluation
%{_bindir}/TransformationEvaluation 
%{_bindir}/Digestor
%{_bindir}/DigestorMotif 
%{_bindir}/DecoyDatabase
%{_bindir}/SequenceCoverageCalculator
%{_bindir}/IDExtractor
%{_bindir}/IDMassAccuracy 
%{_bindir}/SpecLibCreator
%{_bindir}/RNPxl
%{_bindir}/ERPairFinder 
%{_bindir}/MRMPairFinder
%{_bindir}/FeatureFinderSuperHirn
%{_bindir}/ImageCreator
%{_bindir}/MassCalculator
%{_bindir}/MSSimulator
%{_bindir}/SvmTheoreticalSpectrumGeneratorTrainer
%{_bindir}/DeMeanderize
%{_bindir}/OpenSwathDIAPreScoring
%{_bindir}/OpenSwathRewriteToFeatureXML 
%{_bindir}/AccurateMassSearch
%{_bindir}/QCCalculator
%{_bindir}/QCImporter
%{_bindir}/QCEmbedder
%{_bindir}/QCExporter
%{_bindir}/QCExtractor
%{_bindir}/QCMerger
%{_bindir}/QCShrinker

%files data
%doc CHANGELOG AUTHORS README
%license LICENSE
%{_datadir}/OpenMS/

%files tutorials
%{_bindir}/Tutorial_*

%files devel
%{_libdir}/libOpen*.so
%{_includedir}/OpenMS/

%files doc
%license LICENSE
%doc doc/html
%doc doc/index.html
%doc doc/*.pdf

%if 0%{?with_pyOpenMS}
%files -n python-openms
%license pyOpenMS/License.txt
%doc pyOpenMS/README*
%{python2_sitearch}/pyopenms/
%{python2_sitearch}/pyopenms-1.11-py2.7.egg-info/
%endif

%changelog
* Mon Dec 08 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-9
- Fixed unused-direct-shlib-dependency warnings
- Fixed residual spurious executable permissions
- Avoided python shared object stripping
- Added a patch (Patch5) to detect additional QT libraries

* Fri Dec 05 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-8
- Fixed INIFileEditor .desktop file
- Fixed some spurious executable permissions

* Fri Dec 05 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-7
- Fixed some cmake options
- Fixed %%post/%%postun/%%posttrans
- Added TOPP and Tutorial tests
- Fixed iCPP warnings of the PNG files
- Built a noarch data sub-package
- python-openms's data file directory linked to /usr/share/OpenMS  
- TOPP tests disabled (some of them fail)

* Tue Oct 07 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-6
- Added conditional arch macro

* Mon Oct 06 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-5
- Included XTandem BR

* Mon Sep 29 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-4
- Added cmake's options for TBB
- Added nested C++ templates patch (Patch4)

* Mon Jun 30 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-3
- Added setuptools patch
- Added library patch
- pyOpenMS building enabled
- Performed pyOpenMS tests
- Added .desktop files and related .xpm icons

* Sun Jun 01 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-2
- Check disabled
- pyOpenMS building disabled
- Added a macro for pyOpenMS

* Thu May 22 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-1
- First package