[pythia8/el5] Initial commit after review

Mattias Ellert ellert at fedoraproject.org
Thu Jun 6 08:51:12 UTC 2013


commit 7badc08706f39fce35f71a2ff617b49af2924e0a
Author: Mattias Ellert <mattias.ellert at fysast.uu.se>
Date:   Thu Jun 6 10:48:48 2013 +0200

    Initial commit after review

 .gitignore                  |    1 +
 pythia8-fix-soname.patch    |   92 ++++++++++++++++++++++
 pythia8-hepmc-version.patch |   22 +++++
 pythia8-xmldir.patch        |   11 +++
 pythia8.spec                |  178 +++++++++++++++++++++++++++++++++++++++++++
 sources                     |    1 +
 6 files changed, 305 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..17d6b36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/*.tgz
diff --git a/pythia8-fix-soname.patch b/pythia8-fix-soname.patch
new file mode 100644
index 0000000..9e85e1d
--- /dev/null
+++ b/pythia8-fix-soname.patch
@@ -0,0 +1,92 @@
+diff -ur pythia8176.orig/Makefile pythia8176/Makefile
+--- pythia8176.orig/Makefile	2013-04-18 23:16:15.000000000 +0200
++++ pythia8176/Makefile	2013-05-23 04:44:09.403414002 +0200
+@@ -37,18 +37,15 @@
+ # Location of libraries to be built.
+ ifeq ($(SHAREDLIBS),yes)
+   targets=$(LIBDIRARCH)/libpythia8.a
+-  targets+=$(LIBDIR)/libpythia8.$(SHAREDSUFFIX)
+-  targets+=$(LIBDIRARCH)/liblhapdfdummy.a
+-  targets+=$(LIBDIR)/liblhapdfdummy.$(SHAREDSUFFIX)
++  targets+=$(LIBDIR)/libpythia.$(SHAREDSUFFIX).8
+ else
+   targets=$(LIBDIRARCH)/libpythia8.a
+-  targets+=$(LIBDIRARCH)/liblhapdfdummy.a
+ endif
+ 
+ ifneq (x$(HEPMCLOCATION),x)
+  targets+=$(LIBDIRARCH)/libhepmcinterface.a
+  ifeq ($(SHAREDLIBS),yes)
+-  targets+=$(LIBDIR)/libhepmcinterface.$(SHAREDSUFFIX)
++  targets+=$(LIBDIR)/libhepmcinterface.$(SHAREDSUFFIX).8
+  endif
+ endif
+ 
+@@ -68,14 +65,6 @@
+ 	@mkdir -p $(MYTMPDIR)/archive
+ 	$(CXX) $(CXXFLAGS) -c -I$(INCDIR) $< -o $@
+ 
+-$(MYTMPDIR)/%.o : lhapdfdummy/%.cc
+-	@mkdir -p $(MYTMPDIR)
+-	$(CXX) $(CXXFLAGS) $(CXXFLAGSSHARED) -c -I$(INCDIR) $< -o $@
+-
+-$(MYTMPDIR)/archive/%.o : lhapdfdummy/%.cc
+-	@mkdir -p $(MYTMPDIR)/archive
+-	$(CXX) $(CXXFLAGS) -c -I$(INCDIR) $< -o $@
+-
+ # Creating the dependency files *.d
+ # The compiler with option -M is used to build the dependency strings. They
+ # are further edited with sed (stream editor). The first sed command adds the
+@@ -104,25 +93,18 @@
+ objects := $(patsubst $(SRCDIR)/%.cc,$(MYTMPDIR)/%.o,$(wildcard $(SRCDIR)/*.cc))
+ objectsarch := $(patsubst $(SRCDIR)/%.cc,$(MYTMPDIR)/archive/%.o,$(wildcard $(SRCDIR)/*.cc))
+ 
+-$(LIBDIR)/libpythia8.$(SHAREDSUFFIX): $(objects)
++$(LIBDIR)/libpythia.$(SHAREDSUFFIX): $(LIBDIR)/libpythia.$(SHAREDSUFFIX).8
++
++$(LIBDIR)/libpythia.$(SHAREDSUFFIX).8: $(objects)
+ 	@mkdir -p $(LIBDIR)
+-	$(CXX) $(LDFLAGSSHARED) -o $@ $(objects) $(LDFLAGLIBNAME),$(notdir $@)
++	$(CXX) $(LDFLAGSSHARED) -o $@ $(objects) $(LDFLAGLIBNAME),$(notdir $@) -lLHAPDF
++	ln -s $(notdir $@) $(LIBDIR)/libpythia8.$(SHAREDSUFFIX)
++	ln -s $(notdir $@) $(LIBDIR)/libpythia.$(SHAREDSUFFIX)
+ 
+ $(LIBDIRARCH)/libpythia8.a: $(objectsarch)
+ 	@mkdir -p $(LIBDIRARCH)
+ 	ar cru $@ $(objectsarch)
+ 
+-objdum := $(patsubst lhapdfdummy/%.cc,$(MYTMPDIR)/%.o,$(wildcard lhapdfdummy/*.cc))
+-objdumarch := $(patsubst lhapdfdummy/%.cc,$(MYTMPDIR)/archive/%.o,$(wildcard lhapdfdummy/*.cc))
+-
+-$(LIBDIR)/liblhapdfdummy.$(SHAREDSUFFIX): $(objdum)
+-	@mkdir -p $(LIBDIR)
+-	$(CXX) $(LDFLAGSSHARED) -o $@ $(objdum) $(LDFLAGLIBNAME),$(notdir $@)
+-
+-$(LIBDIRARCH)/liblhapdfdummy.a: $(objdumarch)
+-	@mkdir -p $(LIBDIRARCH)
+-	ar cru $@ $(objdumarch)
+-
+ deps := $(patsubst $(SRCDIR)/%.cc,$(MYTMPDIR)/%.d,$(wildcard $(SRCDIR)/*.cc))
+ depsarch := $(patsubst $(SRCDIR)/%.cc,$(MYTMPDIR)/archive/%.d,$(wildcard $(SRCDIR)/*.cc))
+ 
+@@ -169,9 +151,10 @@
+    objectsI := $(patsubst hepmcinterface/%.cc,$(MYTMPDIR)/%.o,$(wildcard hepmcinterface/*.cc))
+    objectsIarch := $(patsubst hepmcinterface/%.cc,$(MYTMPDIR)/archive/%.o,$(wildcard hepmcinterface/*.cc))
+ 
+-   $(LIBDIR)/libhepmcinterface.$(SHAREDSUFFIX) : $(objectsI)
++   $(LIBDIR)/libhepmcinterface.$(SHAREDSUFFIX).8 : $(objectsI) $(LIBDIR)/libpythia.$(SHAREDSUFFIX)
+ 	@mkdir -p $(LIBDIR)
+-	$(CXX) $(LDFLAGSSHARED) $(objectsI) -o $@ $(LDFLAGLIBNAME),$(notdir $@)
++	$(CXX) $(LDFLAGSSHARED) $(objectsI) -o $@ $(LDFLAGLIBNAME),$(notdir $@) -lHepMC -L$(LIBDIR) -lpythia
++	ln -s $(notdir $@) $(LIBDIR)/libhepmcinterface.$(SHAREDSUFFIX)
+ 
+    $(LIBDIRARCH)/libhepmcinterface.a : $(objectsIarch)
+ 	@mkdir -p $(LIBDIRARCH)
+@@ -247,7 +230,6 @@
+ 	cd htmldoc; rm -f *~; rm -f \#*; cd -
+ 	cd phpdoc; rm -f *~; rm -f \#*; cd -
+ 	cd hepmcinterface; rm -f *~; rm -f \#*; cd -
+-	cd lhapdfdummy; rm -f *~; rm -f \#*; cd -
+ 	cd examples; rm -f *~; rm -f \#*; rm -f core*; rm -f config.*; cd -
+ 	cd rootexamples; rm -f *~; rm -f \#*; rm -f core*; rm -f config.*; cd -
+ 
diff --git a/pythia8-hepmc-version.patch b/pythia8-hepmc-version.patch
new file mode 100644
index 0000000..397c1ad
--- /dev/null
+++ b/pythia8-hepmc-version.patch
@@ -0,0 +1,22 @@
+--- a/configure
++++ b/configure
+@@ -104,18 +104,7 @@
+ if [ "x${HEPMCVERSION}" = "x" ] ; then
+   if [ "x${HEPMCLOCATION}" != "x" ] ; then
+ #                                            try to find out which HepMC version
+-    test1=`echo $HEPMCLOCATION | grep \/1.`
+-    test2=`echo $HEPMCLOCATION | grep \/2.`
+-    echo $test1
+-    echo $test2
+-    if [ "x${test1}" != "x" ] ; then
+-      echo "Warning: HepMC 1 cannot be used anymore; Please use HepMC 2"
+-      echo "         The interface will not be built"
+-      export HEPMCLOCATION=
+-    fi
+-    if [ "x${test2}" != "x" ] ; then
+-      export HEPMCVERSION=2.`echo $HEPMCLOCATION | awk -F \/2. '{print $2}' | awk -F \/ '{print $1}'`
+-    fi
++    export HEPMCVERSION=`grep 'define HEPMC_VERSION' ${HEPMCLOCATION}/include/HepMC/HepMCDefs.h | awk '{print $3}' | tr -d '"'`
+   fi
+ fi
+ if [ "x${HEPMCVERSION}" != "x" ] ; then
diff --git a/pythia8-xmldir.patch b/pythia8-xmldir.patch
new file mode 100644
index 0000000..0eb0fe7
--- /dev/null
+++ b/pythia8-xmldir.patch
@@ -0,0 +1,11 @@
+--- a/include/Pythia.h
++++ b/include/Pythia.h
+@@ -48,7 +48,7 @@
+ public:
+ 
+   // Constructor. (See Pythia.cc file.)
+-  Pythia(string xmlDir = "../xmldoc", bool printBanner = true);
++  Pythia(string xmlDir = "/usr/share/pythia8-data/xmldoc", bool printBanner = true);
+ 
+   // Destructor. (See Pythia.cc file.)
+   ~Pythia();
diff --git a/pythia8.spec b/pythia8.spec
new file mode 100644
index 0000000..0f4fc47
--- /dev/null
+++ b/pythia8.spec
@@ -0,0 +1,178 @@
+Name:		pythia8
+Version:	8.1.76
+Release:	3%{?dist}
+Summary:	Pythia Event Generator for High Energy Physics
+Group:		System Environment/Libraries
+
+License:	GPLv2
+URL:		http://home.thep.lu.se/~torbjorn/Pythia.html
+Source0:	http://home.thep.lu.se/~torbjorn/pythia8/pythia8176.tgz
+Patch0:		%{name}-fix-soname.patch
+Patch1:		%{name}-hepmc-version.patch
+Patch2:		%{name}-xmldir.patch
+
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires:	lhapdf-devel%{?_isa}
+BuildRequires:	HepMC-devel%{?_isa}
+BuildRequires:	dos2unix
+Requires:	%{name}-data = %{version}-%{release}
+
+%description
+PYTHIA is a program for the generation of high-energy physics events, i.e.
+for the description of collisions at high energies between elementary
+particles such as e⁺, e⁻, p and p̄ in various combinations. It contains
+theory and models for a number of physics aspects, including hard and soft
+interactions, parton distributions, initial and final-state parton showers,
+multiple interactions, fragmentation and decay.
+
+%package devel
+Summary:	Pythia 8 Development Files
+Group:		Development/Libraries
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+Requires:	lhapdf-devel%{?_isa}
+
+%description devel
+This package provides development files for Pythia 8.
+
+%package hepmcinterface
+Summary:	Pythia 8 HepMC Interface
+Group:		System Environment/Libraries
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+
+%description hepmcinterface
+This package provides the HepMC interface for Pythia 8.
+
+%package hepmcinterface-devel
+Summary:	Pythia 8 HepMC Interface Development Files
+Group:		Development/Libraries
+Requires:	%{name}-hepmcinterface%{?_isa} = %{version}-%{release}
+Requires:	%{name}-devel%{?_isa} = %{version}-%{release}
+Requires:	HepMC-devel%{?_isa}
+
+%description hepmcinterface-devel
+This package provides development files for the HepMC interface for
+Pythia 8.
+
+%package data
+Summary:	Pythia 8 Data Files
+Group:		Applications/Engineering
+%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
+BuildArch:	noarch
+%endif
+
+%description data
+This package provides XML data files for Pythia 8.
+
+%package examples
+Summary:	Pythia 8 Example Source Files
+Group:		Documentation
+%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
+BuildArch:	noarch
+%endif
+
+%description examples
+This package provides example source files for Pythia 8.
+
+%package doc
+Summary:	Pythia 8 Documentation
+Group:		Documentation
+%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
+BuildArch:	noarch
+%endif
+
+%description doc
+This package provides documentation for Pythia 8.
+
+%prep
+%setup -q -n pythia8176
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+# Use the real lhapdf library
+rm -rf lhapdfdummy
+
+# Remove DOS end-of-line
+dos2unix examples/softsusy.spc xmldoc/mrstlostarstar.00.dat \
+	 phpdoc/pythia.css htmldoc/pythia.css include/History.h
+
+%build
+export USRCXXFLAGS="%{optflags}"
+export USRLDFLAGSSHARED="%{?__global_ldflags} -Wl,-z,defs"
+%configure --enable-shared --with-hepmc=/usr
+make %{?_smp_mflags}
+
+%install
+rm -rf %{buildroot}
+
+mkdir -p %{buildroot}%{_libdir}
+install -m 755 lib/libpythia.so.8 %{buildroot}%{_libdir}/libpythia.so.%{version}
+ln -s libpythia.so.%{version} %{buildroot}%{_libdir}/libpythia.so.8
+ln -s libpythia.so.%{version} %{buildroot}%{_libdir}/libpythia8.so
+ln -s libpythia.so.%{version} %{buildroot}%{_libdir}/libpythia.so
+install -m 755 lib/libhepmcinterface.so.8 %{buildroot}%{_libdir}/libhepmcinterface.so.%{version}
+ln -s libhepmcinterface.so.%{version} %{buildroot}%{_libdir}/libhepmcinterface.so.8
+ln -s libhepmcinterface.so.%{version} %{buildroot}%{_libdir}/libhepmcinterface.so
+
+mkdir -p %{buildroot}%{_includedir}/%{name}
+install -m 644 -p include/* %{buildroot}%{_includedir}/%{name}
+
+mkdir -p %{buildroot}%{_datadir}/%{name}-data/xmldoc
+install -m 644 -p xmldoc/*.xml %{buildroot}%{_datadir}/%{name}-data/xmldoc
+install -m 644 -p xmldoc/*.dat %{buildroot}%{_datadir}/%{name}-data/xmldoc
+install -m 644 -p xmldoc/*.data %{buildroot}%{_datadir}/%{name}-data/xmldoc
+install -m 644 -p xmldoc/*.pds %{buildroot}%{_datadir}/%{name}-data/xmldoc
+install -m 644 -p xmldoc/*.tbl %{buildroot}%{_datadir}/%{name}-data/xmldoc
+
+%clean
+rm -rf %{buildroot}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%post hepmcinterface -p /sbin/ldconfig
+
+%postun hepmcinterface -p /sbin/ldconfig
+
+%files
+%{_libdir}/libpythia.so.*
+%doc AUTHORS COPYING GUIDELINES
+
+%files devel
+%{_libdir}/libpythia.so
+%{_libdir}/libpythia8.so
+%{_includedir}/%{name}
+%exclude %{_includedir}/%{name}/HepMCInterface.h
+%doc CODINGSTYLE
+
+%files hepmcinterface
+%{_libdir}/libhepmcinterface.so.*
+
+%files hepmcinterface-devel
+%{_libdir}/libhepmcinterface.so
+%{_includedir}/%{name}/HepMCInterface.h
+
+%files data
+%{_datadir}/%{name}-data
+%doc COPYING
+
+%files examples
+%doc COPYING examples/*.cc examples/*.cmnd examples/*.lhe examples/*.spc examples/outref
+
+%files doc
+%doc COPYING htmldoc/*.html htmldoc/*.css htmldoc/*.gif htmldoc/*.pdf
+
+%changelog
+* Fri May 31 2013 Mattias Ellert <mattias.ellert at fysast.uu.se> - 8.1.76-3
+- Remove DOS end-of-line
+
+* Thu May 23 2013 Mattias Ellert <mattias.ellert at fysast.uu.se> - 8.1.76-2
+- Fix race condition in Makefile
+- Add isa to dependencies
+
+* Sat May 18 2013 Mattias Ellert <mattias.ellert at fysast.uu.se> - 8.1.76-1
+- New upstream release
+
+* Wed Nov 14 2012 Mattias Ellert <mattias.ellert at fysast.uu.se> - 8.1.70-1
+- Initial build
diff --git a/sources b/sources
index e69de29..8379cb4 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+62dd1eacb6f5929b7d87b33d2ffd581a  pythia8176.tgz


More information about the scm-commits mailing list