Commit ecff89a0 authored by Patrou, Maria's avatar Patrou, Maria
Browse files

Python paths and startup script

parent ac2790cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
+18 −13
Original line number Diff line number Diff line
@@ -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 <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.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/*

drspine_wrapper

0 → 100755
+8 −0
Original line number Diff line number Diff line
#!/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
+7 −2
Original line number Diff line number Diff line
@@ -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