diff --git a/Makefile.version b/Makefile.version index 46c7488c61ce6b44ea7ca66af30b9e478a0f4a13..00a57c8f92eb7e8550b6ce09cdb8788b8b38566b 100644 --- a/Makefile.version +++ b/Makefile.version @@ -3,7 +3,7 @@ export PROJECT=drspine export VERSION_MAJOR=1 export VERSION_MINOR=4 -export VERSION_RELEASE=3 +export VERSION_RELEASE=4 export PROJLIB=lib$(PROJECT).a export PROJARCH=$(PROJECT)-$(VERSION_MAJOR).$(VERSION_MINOR) diff --git a/drspine.spec b/drspine.spec index e09656c9e50a5822c1828e28d21e0e44403e1e63..5fdee4b0a26e7587635fba870a44697587ead580 100644 --- a/drspine.spec +++ b/drspine.spec @@ -2,20 +2,21 @@ %global summary Data reduction software for the Neutron Spin Echo method. %global _libdir %{_prefix}/lib %define release 1 -%define python3_pkgversion 3 +%define python3_pkgversion 3.9 %define __unzip /usr/bin/unzip %define __copydir cp -a -Name: %{srcname} -Version: 1.4.3 +Name: python%{python3_pkgversion}-%{srcname} +Version: 1.4.4 Release: %{release}%{?dist} Summary: %{summary} +Obsoletes: drspine <= 1.4.3 Group: Development/Libraries License: MIT URL: https://code.ornl.gov/zp1/drspine/ -Source0: %{name}-%{version}.tar.gz +Source0: %{srcname}-%{version}.tar.gz Source1: appendix.zip Source2: cprotect.zip Source3: draftwatermark.zip @@ -29,7 +30,7 @@ Requires: libgfortran%{?_isa}, compat-libgfortran-48%{?_isa}, python%{pyth %{summary} %prep -%setup -q +%setup -q -n %{srcname}-%{version} -n %{srcname}-%{version} %{__unzip} -q %{SOURCE1} %{__unzip} -q %{SOURCE2} %{__unzip} -q %{SOURCE3} @@ -44,24 +45,24 @@ Requires: libgfortran%{?_isa}, compat-libgfortran-48%{?_isa}, python%{pyth 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 + %{__install} -m 644 appendix.sty %{_builddir}/%{srcname}-%{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 + %{__install} -m 644 draftwatermark.sty %{_builddir}/%{srcname}-%{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 + %{__install} -m 644 relsize.sty %{_builddir}/%{srcname}-%{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 + %{__install} -m 644 cprotect.sty %{_builddir}/%{srcname}-%{version}/doc popd %{__make} INSTRUMENT=1 GRDIR=%{_usr}/gr all @@ -70,13 +71,17 @@ popd #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} +%make_install DESTDIR=%{buildroot}%{_prefix} PYTHONDESTDIR=%{buildroot} # put icons in the right place %{__mkdir} -p %{buildroot}/%{_datadir}/pixmaps/ %{__install} -m 644 desktop/drspine.png %{buildroot}/%{_datadir}/pixmaps/ # put desktop files in the right place %{__mkdir} -p %{buildroot}%{_datadir}/applications/ %{__install} -m 644 desktop/drspine.desktop %{buildroot}%{_datadir}/applications/ +# rename and put drspine_exec_wrapper files in the right place +mv sources/drspine %{buildroot}%{_bindir}/drspine.bin +mv drspine_wrapper %{buildroot}%{_bindir}/drspine + %check #test after install step @@ -89,15 +94,15 @@ mktexlsr %{_datadir}/texmf > /dev/null || : %doc README.md %license LICENSE.drspine LICENSE.linenoise # the files are in /bin, /lib, /share -# the default macros point to /usr/bin, /usr/lib, etc and cannot be used %{_bindir}/drspine +%{_bindir}/drspine.bin %{_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 +%{python3_sitelib}/drspine/* +%{python3_sitelib}/drspine-*.egg-info %{_libdir}/libdrspine.a %{_datadir}/applications/drspine.desktop %{_datadir}/drspine/* diff --git a/drspine_wrapper b/drspine_wrapper new file mode 100755 index 0000000000000000000000000000000000000000..251de4775e016d23b7985ec88ec313dc7c6d9662 --- /dev/null +++ b/drspine_wrapper @@ -0,0 +1,8 @@ +#!/bin/bash +profile_home=`ipython profile locate drspine 2> /dev/null` +profile_exists=$? +if [ $profile_exists -eq 1 ]; then + echo "drspine ipython profile not found: ${profile_home} ${profile_exists}" + drspine_create_env.sh -rv +fi +drspine.bin $* \ No newline at end of file diff --git a/python/Makefile b/python/Makefile index 98a089500730b33dbd20af807369fc72d07fae5d..4c161fa7db4ef97d47eb9e9e28aee7bce6e922bc 100644 --- a/python/Makefile +++ b/python/Makefile @@ -25,6 +25,11 @@ ifeq "$(findstring s, $(MAKEFLAGS))" "s" SETUP_FLAG=-q endif +#installation process +INSTALLATION_PARAMS=--home $(DESTDIR) +ifneq "$(PYTHONDESTDIR)" "" +INSTALLATION_PARAMS=--root "${PYTHONDESTDIR}" +endif all: build @@ -35,8 +40,8 @@ build: @$(PYTHON) setup.py $(SETUP_FLAG) build install: - @$(PYTHON) setup.py install --home $(DESTDIR) - + @$(PYTHON) setup.py install $(INSTALLATION_PARAMS) + echo "---------------- ------------------- INSTALLATION_PARAMS $(INSTALLATION_PARAMS) ---------------------" clean: @-$(PYTHON) setup.py -q clean @find . -name '*~' | xargs rm -f