Commit 6f4b282c authored by Patrou, Maria's avatar Patrou, Maria
Browse files

Merge branch 'rpm_pkg' into 'master'

RPM package

See merge request !2
parents 193c5650 c369bfd7
Loading
Loading
Loading
Loading

drspine.spec

0 → 100644
+104 −0
Original line number Diff line number Diff line
%global srcname drspine
%global summary Data reduction software for the Neutron Spin Echo method.
%global _libdir %{_prefix}/lib
%define release 1
%define python3_pkgversion 3
%define __unzip /usr/bin/unzip
%define __copydir cp -a

Name:           %{srcname}
Version:        1.4.3
Release:        %{release}%{?dist}

Summary:        %{summary}
Group:          Development/Libraries

License:        MIT
URL:            https://code.ornl.gov/zp1/drspine/ 
Source0:        %{name}-%{version}.tar.gz
Source1:        appendix.zip
Source2:        cprotect.zip
Source3:        draftwatermark.zip
Source4:        relsize.zip

BuildRequires:  gcc, gcc-gfortran, libgfortran%{?_isa}, compat-libgfortran-48%{?_isa}, make, python%{python3_pkgversion}, python%{python3_pkgversion}-build, python%{python3_pkgversion}-pip, gr, python%{python3_pkgversion}-gr, texlive-collection-latex, texlive-bigfoot, texlive-mathtools, texlive-cm-super, texlive-epstopdf, texlive-kpathsea
Requires:       libgfortran%{?_isa}, compat-libgfortran-48%{?_isa}, python%{python3_pkgversion}, python%{python3_pkgversion}-build, python%{python3_pkgversion}-pip, gr, python%{python3_pkgversion}-gr, texlive-collection-latex, texlive-bigfoot, texlive-mathtools, texlive-cm-super, texlive-epstopdf, texlive-kpathsea,texlive-pgfplots, python%{python3_pkgversion}-ipython, python%{python3_pkgversion}-scipy, python%{python3_pkgversion}-numpy, python%{python3_pkgversion}-matplotlib  


%description
%{summary}

%prep
%setup -q
%{__unzip} -q %{SOURCE1}
%{__unzip} -q %{SOURCE2}
%{__unzip} -q %{SOURCE3}
%{__unzip} -q %{SOURCE4}

%build
# run make
%{__make} clean
%{__mkdir} -p %{_builddir}%{_datadir}/texmf/tex/latex/contrib

# copy the necessary latex packages to the global directory and the source code
pushd ./appendix
  latex ./appendix.ins
  %{__install} -m 644  appendix.sty  %{_builddir}%{_datadir}/texmf/tex/latex/contrib
  %{__install} -m 644  appendix.sty  %{_builddir}/%{name}-%{version}/doc
popd

pushd ./draftwatermark
  latex ./draftwatermark.ins
  %{__install} -m 644 draftwatermark.sty %{_builddir}%{_datadir}/texmf/tex/latex/contrib
  %{__install} -m 644 draftwatermark.sty %{_builddir}/%{name}-%{version}/doc
popd

pushd ./relsize
  %{__install} -m 644 relsize.sty %{_builddir}%{_datadir}/texmf/tex/latex/contrib
  %{__install} -m 644 relsize.sty %{_builddir}/%{name}-%{version}/doc
popd

pushd ./cprotect
  latex ./cprotect.dtx
  %{__install} -m 644 cprotect.sty %{_builddir}%{_datadir}/texmf/tex/latex/contrib
  %{__install} -m 644 cprotect.sty %{_builddir}/%{name}-%{version}/doc
popd

%{__make} INSTRUMENT=1 GRDIR=%{_usr}/gr  all

%install
#copy the latex in the build directory
%{__install} -d -m 0755 %{buildroot}%{_datadir}/texmf/tex/latex/contrib
%{__copydir} %{_builddir}%{_datadir}/texmf/tex/latex/contrib/* %{buildroot}%{_datadir}/texmf/tex/latex/contrib/
%make_install DESTDIR=%{buildroot}%{_prefix}

%check
#test after install step
%{__make} runtest

%post
mktexlsr %{_datadir}/texmf > /dev/null || :

%files
%doc README.md
%license LICENSE.drspine LICENSE.linenoise
# the files are in <pkg_name>/bin, <pkg_name>/lib, <pkg_name>/share
# the default macros point to  <pkg_name>/usr/bin, <pkg_name>/usr/lib, etc and cannot be used
%{_bindir}/drspine
%{_bindir}/drspine_activate.sh
%{_bindir}/drspine_create_env.sh
%{_bindir}/extract_figures
%{_bindir}/mxx
%{_bindir}/plain_figures
%{_libdir}/python/drspine/*
%{_libdir}/python/drspine-*.egg-info
%{_libdir}/libdrspine.a
%{_datadir}/drspine/*
%{_datadir}/texmf/tex/latex/contrib/*

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Fri Jun 27 2025 root
- package creation

rpmbuild_setup.sh

0 → 100755
+44 −0
Original line number Diff line number Diff line
#!/usr/bin/sh

dnf update
dnf install -y nano
dnf install -y tree
dnf install -y epel-release
dnf check-update
dnf config-manager --set-enabled crb && dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

dnf install -y zlib-devel
dnf install -y libjpeg-turbo
dnf install -y libjpeg-turbo-devel
dnf install -y gcc
dnf install -y python3-devel 
dnf install -y texlive-kpathsea
yum install -y libXt libXrender libXext mesa-libGL qt6-qtbase-gui
dnf install -y rpmdevtools rpmlint
dnf install -y git

#drspine requirements
dnf install -y python3 
dnf install -y make rpm-build python3-build python3-pip python-unversioned-command
dnf install -y python3-numpy
dnf install -y python3-scipy
dnf install -y python3-ipython.noarch
dnf install -y python3-matplotlib
dnf install -y gr-0.73.17-106.2.x86_64.rpm
dnf install -y python3-gr-1.27.0-105.17.x86_64.rpm
dnf install -y libgfortran
dnf install -y compat-libgfortran-48
dnf install -y gcc-gfortran
dnf install -y texlive-epstopdf.noarch
dnf install -y texlive-collection-latex
dnf install -y wget
dnf install -y texlive-bigfoot
dnf install -y texlive-mathtools
dnf install -y texlive-cm-super
dnf install -y texlive-pgfplots

#latex ctan files
wget https://mirrors.ctan.org/macros/latex/contrib/appendix.zip
wget https://mirrors.ctan.org/macros/latex/contrib/draftwatermark.zip
wget https://mirrors.ctan.org/macros/latex/contrib/relsize.zip
wget https://mirrors.ctan.org/macros/latex/contrib/cprotect.zip