diff --git a/CMakeLists.txt b/CMakeLists.txt index 43149c13..a16e7959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -315,4 +315,20 @@ message("") message("-------------------------------------------------------------------------") message("") +#--- cpack specific info ...................................................... +file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} PROJECT_SOURCE_DIR_NATIVE) +file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} PROJECT_BINARY_DIR_NATIVE) +string(REPLACE "\\" "\\\\" PROJECT_SOURCE_DIR_NATIVE_D ${PROJECT_SOURCE_DIR_NATIVE}) +string(REPLACE "\\" "\\\\" PROJECT_BINARY_DIR_NATIVE_D ${PROJECT_BINARY_DIR_NATIVE}) + +configure_file(${CMAKE_SOURCE_DIR}/cmake/CPackOptions.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CPackOptions.cmake @ONLY) +set (CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackOptions.cmake") +#set (CPACK_GENERATOR TGZ) # not use ZIP on UNIX as problem with symlinks +#set (CPACK_SOURCE_GENERATOR TGZ) # not use ZIP on UNIX as problem with symlinks +if (UNIX) +# set (CPACK_GENERATOR ${CPACK_GENERATOR};RPM) +endif () +# Include of CPack must always be last +include(CPack) + #--- end ---------------------------------------------------------------------- diff --git a/cmake/CPackOptions.cmake.in b/cmake/CPackOptions.cmake.in new file mode 100644 index 00000000..4a7c278b --- /dev/null +++ b/cmake/CPackOptions.cmake.in @@ -0,0 +1,33 @@ +# musrfit - cpack + +include(CPackComponent) + +set (CPACK_PACKAGE_NAME "musrfit-root6") +set (CPACK_PACKAGE_VENDOR "Paul Scherrer Institute - LMU - LEM") +set (CPACK_PACKAGE_DIRECTOR "@CMAKE_CURRENT_BINARY_DIR@/pack") +set (CPACK_PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@") +set (CPACK_PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@") +set (CPACK_PACKAGE_VERSION_PATCH "@PROJECT_VERSION_PATCH@") +set (CPACK_PACKAGE_CONTACT "") +set (CPACK_PACKAGE_DESCRIPTION_FILE "@PROJECT_SOURCE_DIR@/README.md") +set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "musrfit - muSR data analysis package") +set (CPACK_PACKAGE_HOMEPAGE_URL "http://lmu.web.psi.ch/musrfit/user/html/index.html") +set (CPACK_PACKAGE_CHECKSUM "MD5") +set (CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/COPYING") +set (CPACK_RESOURCE_FILE_README "@PROJECT_SOURCE_DIR@/README.md") +set (CPACK_RESOURCE_FILE_WELCOME "@PROJECT_SOURCE_DIR@/cmake/welcome.txt") + +# we do not have any absolute paths, so do not need DESTDIR +set (CPACK_SET_DESTDIR "OFF") +set (CPACK_PACKAGE_RELOCATABLE "true") + +if (${CPACK_GENERATOR} STREQUAL "RPM") + set (CPACK_RPM_FILE_NAME "RPM-DEFAULT") + set (CPACK_RPM_PACKAGE_RELEASE "1") + set (CPACK_RPM_PACKAGE_LICENSE "@PROJECT_SOURCE_DIR@/COPYING") + set (CPACK_RPM_PACKAGE_VENDOR "Paul Scherrer Institute - LMU - LEM") +endif () + +if (${CPACK_GENERATOR} STREQUAL "DEB") + # to be populated yet +endif () diff --git a/cmake/musrfit-root6.spec.in b/cmake/musrfit-root6.spec.in new file mode 100644 index 00000000..da5f7054 --- /dev/null +++ b/cmake/musrfit-root6.spec.in @@ -0,0 +1,101 @@ +Name: musrfit-root6 +Version: 1.4 +Release: 1%{?dist} +Summary: musrfit - muSR data analysis package + +License: GPLv2 +URL: http://lmu.web.psi.ch/musrfit/user/html/index.html +Source0: https://gitlab.psi.ch/nemu/musrfit/repository/%{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: libtool +BuildRequires: gcc +BuildRequires: make +BuildRequires: hdf-devel hdf5-devel +BuildRequires: mxml-devel +BuildRequires: fftw3-devel +BuildRequires: boost-devel +BuildRequires: gsl-devel +BuildRequires: libxml2-devel +BuildRequires: root +BuildRequires: root-io-xml +BuildRequires: root-mathmore +BuildRequires: root-minuit2 +BuildRequires: qt5-qtbase-devel qt5-qtsvg-devel qt5-qtwebkit-devel +BuildRequires: nexus +Requires: hdf hdf5 +Requires: mxml +Requires: fftw3 +Requires: gsl +Requires: boost-devel +Requires: libxml2 +Requires: root +Requires: root-io-xml +Requires: root-mathmore +Requires: root-minuit2 +Requires: qt5-qtbase qt5-qtsvg qt5-qtwebkit +Requires: nexus + +%description +This is a data analysis package to analyze time differential muSR and beta-NMR data. Currently it allows the following things: +- setting up most commonly used fitting functions for muSR and beta-NMR +- fitting data, including global fits +- showing the fit results and the residuals +- showing the Fourier transform of the data +- extracting easily the fitting parameters to be used in other programs (gnuplot, qtiplot/origin, ...) +- allows to generate fitting input files for follow-up runs +- allows to generate global fitting input files based on a single run template +- allows to implement more sophisticated user functions (e.g. GL vortex lattice, Meissner screening including low-energy muon stopping profiles) + +Currently supported platforms: +- Linux +- Mac OS X +- Windows - not really, only for the very brave ones + + +%prep +%setup -q -n %{name}-%{version} + + +%build +##æs35 ./autogen.sh +# DOCDIR is needed to be set here. BMWlibs still makes troubles +%cmake -DASlibs=1 -DBMWlbis=1 -Dnexus=1 DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/musrfit +%cmake --build ./ --clean-first -- -j8 +##æs35 %configure --enable-ASlibs --enable-BMWlibs --enable-NeXus DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/musrfit +##æs35 %make_build + + +%install +# INSTALL_ROOT is needed for Qt applications +rm -rf $RPM_BUILD_ROOT +%make_install INSTALL_ROOT=%{buildroot} + +%files +%_prefix/bin/any2many +%_prefix/bin/dump_header +%_prefix/bin/msr2data +%_prefix/bin/msr2msr +%_prefix/bin/mupp +%_prefix/bin/mupp_plot +%_prefix/bin/musredit +%_prefix/bin/musrfit +%_prefix/bin/musrFT +%_prefix/bin/musrRootValidation +%_prefix/bin/musrStep +%_prefix/bin/musrt0 +%_prefix/bin/musrview +%_prefix/bin/musrWiz +%_prefix/bin/write_musrRoot_runHeader +%_prefix/include/* +%_prefix/lib64/* +%license COPYING +%doc %_prefix/share/doc/musrfit + + + +%changelog +* Thu Dec 20 2018 Andreas Suter - 1.4-1 +- adopted to cmake +* Wed Oct 25 2017 Andreas Suter - 1.2-1 +- first spec file for musrfit-root6 diff --git a/cmake/welcome.txt b/cmake/welcome.txt new file mode 100644 index 00000000..c8836b44 --- /dev/null +++ b/cmake/welcome.txt @@ -0,0 +1 @@ +Welcome to the musrfit package