Commit ec9c70c2 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Move julia package to /opt/julia/local/packages in rpm

parent 33f74b61
...@@ -82,7 +82,7 @@ Julia support files for %{name} ...@@ -82,7 +82,7 @@ Julia support files for %{name}
%build %build
make MOBERG_VERSION=__MOBERG_VERSION__ make MOBERG_VERSION=%{version}
%check %check
make test || true make test || true
...@@ -128,7 +128,7 @@ cp adaptors/matlab/Makefile.mex ${RPM_BUILD_ROOT}/opt/matlab/src/moberg/Makefile ...@@ -128,7 +128,7 @@ cp adaptors/matlab/Makefile.mex ${RPM_BUILD_ROOT}/opt/matlab/src/moberg/Makefile
# Python # Python
( (
cd adaptors/python cd adaptors/python
export MOBERG_VERSION=__MOBERG_VERSION__ export MOBERG_VERSION=%{version}
%{__python2} setup.py install -O1 \ %{__python2} setup.py install -O1 \
--root=$RPM_BUILD_ROOT --prefix /usr \ --root=$RPM_BUILD_ROOT --prefix /usr \
--record=INSTALLED_python2 --record=INSTALLED_python2
...@@ -138,34 +138,37 @@ cp adaptors/matlab/Makefile.mex ${RPM_BUILD_ROOT}/opt/matlab/src/moberg/Makefile ...@@ -138,34 +138,37 @@ cp adaptors/matlab/Makefile.mex ${RPM_BUILD_ROOT}/opt/matlab/src/moberg/Makefile
) )
# Julia # Julia
mkdir -p ${RPM_BUILD_ROOT}/opt/julia/packages/MobergIO/src mkdir -p ${RPM_BUILD_ROOT}/opt/julia/local/packages/MobergIO/src
cp adaptors/julia/*.jl ${RPM_BUILD_ROOT}/opt/julia/packages/MobergIO/src cp adaptors/julia/*.jl ${RPM_BUILD_ROOT}/opt/julia/local/packages/MobergIO/src
cat adaptors/julia/Project.toml.template \ cat adaptors/julia/Project.toml.template \
| sed -e 's/<<<VERSION>>>/%{version}/' \ | sed -e 's/<<<VERSION>>>/%{version}/' \
> ${RPM_BUILD_ROOT}/opt/julia/packages/MobergIO/Project.toml > ${RPM_BUILD_ROOT}/opt/julia/local/packages/MobergIO/Project.toml
( (
cd ${RPM_BUILD_ROOT}/opt/julia/packages/MobergIO cd ${RPM_BUILD_ROOT}/opt/julia/local/packages/MobergIO
git init git init
git add Project.toml src/*.jl git add Project.toml src/*.jl
git config remote.origin.url https://gitlab.control.lth.se/anders_blomdell/moberg.git
git config user.email "mockbuild@$(hostname)" git config user.email "mockbuild@$(hostname)"
git config user.name "Mockbuild" git config user.name "Mockbuild"
git commit -m 'Local version of moberg __MOBERG_VERSION__' git commit -m 'Local version of moberg %{version}'
git tag __MOBERG_VERSION__ git tag %{version}
) )
%post julia %post julia
set -x set -x
export JULIA_PROJECT=$(mktemp -d julia.XXXXXX) exit
#export JULIA_PROJECT=$(mktemp -d julia.XXXXXX)
export JULIA_PROJECT=/opt/julia
export JULIA_LOAD_PATH=/opt/julia: export JULIA_LOAD_PATH=/opt/julia:
export JULIA_DEPOT_PATH=/opt/julia: export JULIA_DEPOT_PATH=/opt/julia:
cat<<EOF|julia cat<<EOF|julia
import Pkg import Pkg
Pkg.add(path="/opt/julia/packages/MobergIO/") Pkg.add(path="/opt/julia/local/packages/MobergIO/")
Pkg.precompile() Pkg.precompile()
EOF EOF
rm ${JULIA_PROJECT}/Manifest.toml #rm ${JULIA_PROJECT}/Manifest.toml
rm ${JULIA_PROJECT}/Project.toml #rm ${JULIA_PROJECT}/Project.toml
rmdir ${JULIA_PROJECT} #rmdir ${JULIA_PROJECT}
%postun julia %postun julia
# Cleanup of precomiled, etc needed...? # Cleanup of precomiled, etc needed...?
...@@ -208,4 +211,4 @@ rmdir ${JULIA_PROJECT} ...@@ -208,4 +211,4 @@ rmdir ${JULIA_PROJECT}
%files julia %files julia
%defattr(-,root,root,-) %defattr(-,root,root,-)
/opt/julia/packages/MobergIO /opt/julia/local/packages/MobergIO
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment