File geant4-vmc.spec of Package geant4-vmc

#
# spec file for package geant4-vmc
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define libversion 6.1.1
%define tagname 6-1-p1
%define sourcename geant4_vmc-%{tagname}

Name:           geant4-vmc
Version:        6.1.p1
Release:        0
License:        GPL-3.0-only
Summary:        The Virtual Montecarlo backend for Root VMC
Group:          Productivity/Scientific/Physics
URL:            https://vmc-project.github.io/
Source0:        https://github.com/vmc-project/geant4_vmc/archive/v%{tagname}.tar.gz#/geant4_vmc-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  geant4-devel
BuildRequires:  libxerces-c-devel
BuildRequires:  root6-devel
BuildRequires:  vmc-devel
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5Gui)
BuildRequires:  cmake(Qt5OpenGL)
BuildRequires:  cmake(Qt5PrintSupport)
BuildRequires:  cmake(Qt5Widgets)

%description
Geant4 VMC provides the Geant4 backend for Root VMC

%package devel
Summary:        The Virtual Montecarlo backend for Root VMC - development files
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description devel
Geant4 VMC provides the Geant4 backend for Root VMC - development files

%package examples
Summary:        The Virtual Montecarlo backend for Root VMC - example files
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description examples
Geant4 VMC provides the Geant4 backend for Root VMC - example files


%prep
%setup -q -n %sourcename

%build
%cmake \
      -DGeant4VMC_USE_GEANT4_G3TOG4:BOOL=ON \
      -DGeant4VMC_BUILD_G4Root_TEST:BOOL=ON \
      -DGeant4VMC_BUILD_EXAMPLES:BOOL=OFF \
      %{nil}

%cmake_build

%install
%cmake_install

# Remove some duplicate (and hidden) READMEs
find %{buildroot}%{_datadir}/Geant4VMC-%{libversion}/examples -iname .README.txt -print -delete

%fdupes %{buildroot}%{_includedir}
%fdupes %{buildroot}%{_datadir}/Geant4VMC-%{libversion}/examples

%check
%ctest

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%{_libdir}/libgeant4vmc.so
%{_libdir}/libg4root.so

%files devel
%{_includedir}/g4root/
%{_includedir}/geant4vmc/
%{_libdir}/Geant4VMC-%{libversion}/
%{_libdir}/G4Root-%{libversion}/
%{_libdir}/*.pcm
%{_libdir}/*.rootmap

%files examples
%{_datadir}/Geant4VMC-%{libversion}/
%{_bindir}/NoviceExample.gdml
%{_bindir}/OpNovice*
# Macros
%{_bindir}/*.mac

%changelog
openSUSE Build Service is sponsored by