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}
%build
make MOBERG_VERSION=__MOBERG_VERSION__
make MOBERG_VERSION=%{version}
%check
make test || true
......@@ -128,7 +128,7 @@ cp adaptors/matlab/Makefile.mex ${RPM_BUILD_ROOT}/opt/matlab/src/moberg/Makefile
# Python
(
cd adaptors/python
export MOBERG_VERSION=__MOBERG_VERSION__
export MOBERG_VERSION=%{version}
%{__python2} setup.py install -O1 \
--root=$RPM_BUILD_ROOT --prefix /usr \
--record=INSTALLED_python2
......@@ -138,34 +138,37 @@ cp adaptors/matlab/Makefile.mex ${RPM_BUILD_ROOT}/opt/matlab/src/moberg/Makefile
)
# Julia
mkdir -p ${RPM_BUILD_ROOT}/opt/julia/packages/MobergIO/src
cp adaptors/julia/*.jl ${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/local/packages/MobergIO/src
cat adaptors/julia/Project.toml.template \
| 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 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.name "Mockbuild"
git commit -m 'Local version of moberg __MOBERG_VERSION__'
git tag __MOBERG_VERSION__
git commit -m 'Local version of moberg %{version}'
git tag %{version}
)
%post julia
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_DEPOT_PATH=/opt/julia:
cat<<EOF|julia
import Pkg
Pkg.add(path="/opt/julia/packages/MobergIO/")
Pkg.add(path="/opt/julia/local/packages/MobergIO/")
Pkg.precompile()
EOF
rm ${JULIA_PROJECT}/Manifest.toml
rm ${JULIA_PROJECT}/Project.toml
rmdir ${JULIA_PROJECT}
#rm ${JULIA_PROJECT}/Manifest.toml
#rm ${JULIA_PROJECT}/Project.toml
#rmdir ${JULIA_PROJECT}
%postun julia
# Cleanup of precomiled, etc needed...?
......@@ -208,4 +211,4 @@ rmdir ${JULIA_PROJECT}
%files julia
%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