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:   2.0.0
Release:   6%{?dist}
License:   BSD
URL:       http://open-ms.sourceforge.net/
Source0:   https://github.com/OpenMS/OpenMS/archive/Release2.0.0.tar.gz#/OpenMS-Release%{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, wildmagic5-devel
BuildRequires: zlib-devel, bzip2-devel, tbb-devel, eigen3-devel
BuildRequires: desktop-file-utils, XTandem

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

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

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

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

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

##Remove -O0 flag for tests compiling
Patch2: %{name}-remove_testflag.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 python2-openms
Summary: OpenMS Python2 bindings
BuildRequires: python-setuptools, python2-devel, numpy 
BuildRequires: python-nose, autowrap, Cython
Requires: %{name}-data = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python2-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 header files
%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-Release%{version}
rm -rf cmake/MacOSX

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

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

%patch2 -p0

%build

export LDFLAGS="%{__global_ldflags} -Wl,--as-needed"
%cmake -Wno-dev \
 -DCMAKE_COLOR_MAKEFILE:BOOL=ON \
 -DCMAKE_CXX_FLAGS_RELEASE:STRING="-Wno-cpp $RPM_OPT_FLAGS" -DCMAKE_C_FLAGS_RELEASE:STRING="-Wno-cpp $RPM_OPT_FLAGS" \
 -DCMAKE_VERBOSE_MAKEFILE=TRUE -DCMAKE_PREFIX_PATH=%{_prefix} \
 -DENABLE_SVN=OFF -DCMAKE_BUILD_TYPE=Release -DBOOST_USE_STATIC=OFF \
 -DCMAKE_SKIP_RPATH:BOOL=TRUE -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
 -DMT_ENABLE_OPENMP=ON -DENABLE_GCC_WERROR:BOOL=OFF \
 -DXTANDEM_BINARY=%{_bindir}/tandem \
 -DBOOST_USE_STATIC:BOOL=OFF -DBoost_INCLUDE_DIR:PATH=%{_includedir} \
 -DBoost_IOSTREAMS_LIBRARY_RELEASE:FILEPATH=%{_libdir}/libboost_iostreams.so \
 -DBoost_MATH_C99_LIBRARY_RELEASE:FILEPATH=%{_libdir}/libboost_math_c99.so \
 -DBoost_REGEX_LIBRARY_RELEASE:FILEPATH=%{_libdir}/libboost_regex.so \
 -DENABLE_TUTORIALS:BOOL=ON -DENABLE_UNITYBUILD:BOOL=OFF \
 -DHAS_XSERVER:BOOL=ON \
 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -DINSTALL_BIN_DIR:PATH=bin -DINSTALL_CMAKE_DIR:PATH=%{_lib}/cmake/OpenMS \
 -DINSTALL_DOC_DIR:PATH=share/doc/OpenMS -DINSTALL_INCLUDE_DIR:PATH=include \
 -DINSTALL_LIB_DIR:PATH=%{_lib}/OpenMS -DINSTALL_SHARE_DIR:PATH=share/OpenMS \
 -DPACKAGE_TYPE:STRING=none -DWITH_GUI:BOOL=ON \
 -DXercesC_INCLUDE_DIRS:PATH=%{_includedir}/xercesc \
 -DXercesC_LIBRARY_RELEASE:FILEPATH=%{_libdir}/libxerces-c.so \
%if 0%{?with_pyOpenMS}
 -DPYOPENMS=ON -DPYTHON_EXECUTABLE:FILEPATH=%{__python2} \
 -DCYTHON_EXECUTABLE:FILEPATH=%{_bindir}/cython .
%else
 -DPYOPENMS=OFF .
%endif

%if 0%{?with_pyOpenMS}
make %{?_smp_mflags} OpenMS TOPP UTILS GUI pyopenms
%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

%install
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH
xvfb-run -a make install DESTDIR=%{buildroot}

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

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

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

##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}

##Install Tutorials executable
mkdir -p %{buildroot}%{_bindir}
cp -a bin/Tutorial_* %{buildroot}%{_bindir}

%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
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 -R TOPP_ -E TOPP_XTandemAdapter_ --force-new-ctest-process %{?_smp_mflags}
xvfb-run -a ctest -R OpenMS_ --force-new-ctest-process %{?_smp_mflags}

##pyOpenMS tests including mem leak
%if 0%{?with_pyOpenMS}
cd pyOpenMS
%{__python2} ./run_memleaks.py
#%%{__python2} ./run_nose.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}/FeatureFinderIsotopeWavelet
%{_bindir}/FeatureFinderMetabo
%{_bindir}/FeatureFinderMRM 
%{_bindir}/IsobaricAnalyzer
%{_bindir}/ITRAQAnalyzer
%{_bindir}/ProteinQuantifier 
%{_bindir}/ProteinResolver
%{_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
%{_bindir}/FeatureFinderIdentification
%{_bindir}/FeatureFinderMultiplex
%{_bindir}/FidoAdapter
%{_bindir}/LowMemPeakPickerHiRes
%{_bindir}/LowMemPeakPickerHiRes_RandomAccess
%{_bindir}/MRMTransitionGroupPicker
%{_bindir}/MSGFPlusAdapter
%{_bindir}/MetaboliteSpectralMatcher
%{_bindir}/OpenSwathWorkflow
%{_bindir}/PeakPickerIterative
%{_bindir}/RTAnnotator
%{_bindir}/SimpleSearchEngine
%{_bindir}/TopPerc
%{_datadir}/applications/toppas.desktop
%{_datadir}/applications/toppview.desktop
%{_datadir}/applications/inifileeditor.desktop
%{_datadir}/icons/TOPP/
%{_libdir}/OpenMS/

%files tools
%{_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
%license LICENSE
%doc CHANGELOG AUTHORS README
%{_includedir}/OpenMS/

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

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

%changelog
* Fri May 01 2015 Antonio Trande <sagitter@fedoraproject.org> 2.0.0-6
- Source archive re-compressed by upstream
- Sym-linked the library pyopenms/libSuperHirn.so

* Fri May 01 2015 Antonio Trande <sagitter@fedoraproject.org> 2.0.0-5
- SPEC cleanups

* Thu Apr 30 2015 Antonio Trande <sagitter@fedoraproject.org> 2.0.0-4
- Patched pyOpenMS version definition
- Removed 'pyopenms_bdist_egg' make target

* Thu Apr 30 2015 Antonio Trande <sagitter@fedoraproject.org> 2.0.0-3
- PyOpenMS is still compiled against Python2 on Linux

* Mon Apr 13 2015 Antonio Trande <sagitter@fedoraproject.org> 2.0.0-2
- Fix make test

* Sat Apr 11 2015 Antonio Trande <sagitter@fedoraproject.org> 2.0.0-1
- Update to the release 2.0

* Mon Jan 26 2015 Petr Machata <pmachata@redhat.com> - 1.11.1-12
- Rebuild for boost 1.57.0

* Sat Dec 13 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-11
- Parallel make disabled

* Fri Dec 12 2014 Antonio Trande <sagitter@fedoraproject.org> 1.11.1-10
- Parallel make just on Fedora 20+

* 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