%define major            0
%define libname          MG5_aMC
%undefine __brp_mangle_shebangs 
%undefine _debugsource_packages

Name:          MG5_aMC
Version:       2.7.2
Release:       1%{?dist}

Summary:       MG5_aMC is a multi-purpose particle physics event generator.
License:       http://www.opensource.org/licenses/UoI-NCSA.php
Source0:       http://madgraph.physics.illinois.edu/Downloads/%{name}_v%{version}.tar.gz
Url:           http://amcatnlo.web.cern.ch/amcatnlo/list_refs.htm
BuildRequires: gcc-gfortran gcc-c++
Prefix: %{_prefix}

%if  %{?rhel}%{!?rhel:0} >= 8
BuildRequires: platform-python-devel
%endif
%if %{?fedora}%{!?fedora:0} >=31
BuildRequires: python3-devel
%endif

%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8
Requires: python2 csh
BuildRequires: python2 python2-devel 
%else
Requires: python 
BuildRequires: python python-devel python3-devel 
%endif


%description

Registered 2009-09-15 by Michel Herquet

MadGraph5_aMC@NLO is a framework that aims at providing all the elements 
necessary for SM and BSM phenomenology, such as the computations of 
cross sections, the generation of hard events and their matching with 
event generators, and the use of a variety of tools relevant to event 
manipulation and analysis. Processes can be simulated to LO accuracy 
for any user-defined Lagrangian, and the NLO accuracy in the case of 
QCD corrections to SM processes. Matrix elements at the tree- and 
one-loop-level can also be obtained.
MadGraph5_aMC@NLO is the new version of both MadGraph5 and aMC@NLO that 
unifies the LO and NLO lines of development of automated tools within 
the MadGraph family. It therefore supersedes all the MadGraph5 1.5.x 
versions and all the beta versions of aMC@NLO.
The standard reference for the use of the code is: J. Alwall et al, 
"The automated computation of tree-level and next-to-leading order 
differential cross sections, and their matching to parton shower 
simulations", arXiv:1405.0301 [hep-ph]. A more complete list of 
references can be found here: 
http://amcatnlo.web.cern.ch/amcatnlo/list_refs.htm

%prep
%setup -q  -n MG5_aMC_v2_7_2
%build

%install

mkdir -p $RPM_BUILD_ROOT/%_bindir
mkdir -p $RPM_BUILD_ROOT/%_datadir/MG5_aMC/
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8
mkdir -p $RPM_BUILD_ROOT/%{python2_sitearch}
pathfix.py -pn -i %{__python2}  ./bin/m*
pathfix.py -pn -i %{__python2}  ./
cp bin/* $RPM_BUILD_ROOT/%_bindir
cp -r aloha vendor madgraph input Template MadSpin  mg5decay  models $RPM_BUILD_ROOT/%{python2_sitearch}
cp VERSION $RPM_BUILD_ROOT/%_datadir/MG5_aMC/
rm -rf $RPM_BUILD_ROOT/%{python2_sitearch}/madgraph/VERSION
cp VERSION $RPM_BUILD_ROOT/%{python2_sitearch}/madgraph
%else
mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}
cp bin/* $RPM_BUILD_ROOT/%_bindir
cp -r aloha vendor madgraph input Template MadSpin  mg5decay  models $RPM_BUILD_ROOT/%{python_sitearch}
rm -rf $RPM_BUILD_ROOT/%{python_sitearch}/madgraph/VERSION
cp VERSION $RPM_BUILD_ROOT/%{python_sitearch}/madgraph
%endif 

%files -n %{libname}
%_bindir/mg*
/usr/share/*
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8
%{python2_sitearch}/*
%else
%{python_sitearch}/*
%endif

%changelog
* Wed Dec 11 2019 Andrii Verbytskyi 2.6.7
+ Simplified