diff options
-rwxr-xr-x | PKGBUILD | 12 | ||||
-rw-r--r-- | openmc.sh | 16 | ||||
-rw-r--r-- | post.install | 7 | ||||
-rw-r--r-- | set_paths.sh | 20 |
4 files changed, 30 insertions, 25 deletions
@@ -1,13 +1,14 @@ # Maintainer: Gavin Ridley <gavin dot keith dot ridley at gmail dot com> # Maintainer: Luke Labrie-Cleary <luke dot cleary at copenhagenatomics dot com> pkgname=openmc-git -pkgver=v0.13.2.r497.g6218becb1 +pkgver=v0.13.3.r314.g7fe80e149 pkgrel=1 pkgdesc="The OpenMC project aims to provide a fully-featured Monte Carlo particle transport code based on modern methods." arch=('x86_64') url="https://github.com/openmc-dev/openmc" license=('MIT') +install="post.install" source=("${pkgname}::git+${url}.git" "set_paths.sh") pkgver() { @@ -66,13 +67,6 @@ build() { package() { cd $srcdir/${pkgname}/build make DESTDIR="$pkgdir/" install - pip install --break-system-packages ../ cp -r $srcdir/${pkgname} $pkgdir/opt/openmc cp $srcdir/set_paths.sh $pkgdir/opt/openmc - - # installed to opt, inform user how to set paths - _path_msg="$'\n'INFO: OpenMC and its dependencies were installed to the - non-standard location /opt. Run bash - ~/opt/openmc/set_paths.sh before attempting to - use openmc$'\n'" -} +}
\ No newline at end of file diff --git a/openmc.sh b/openmc.sh new file mode 100644 index 000000000000..08de28ca7409 --- /dev/null +++ b/openmc.sh @@ -0,0 +1,16 @@ +# get variables +arch=$(uname -m) +python_version=$(python -V 2>&1 | cut -d' ' -f2 | cut -d'.' -f1-2) +var=`echo /opt/nuclear-data/*hdf5 | head -n1` + +# Define the paths +export_path="export PATH=\$PATH:/opt/openmc/bin" +export_pythonpath="export PYTHONPATH=\$PYTHONPATH:/opt/MOAB/lib/python$python_version/site-packages" +export_ld_library_path="export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/MOAB/lib" +export_openmc_cross_sections="export OPENMC_CROSS_SECTIONS=$var/cross_sections.xml" + +# set non-standard paths in current session +eval $export_path +eval $export_pythonpath +eval $export_ld_library_path +eval $export_openmc_cross_sections diff --git a/post.install b/post.install new file mode 100644 index 000000000000..5f73383be311 --- /dev/null +++ b/post.install @@ -0,0 +1,7 @@ +post_install() { +# installed to opt, inform user how to set paths +_path_msg="$'\n'INFO: OpenMC and its dependencies were installed to the non-standard location /opt. Run sudo bash \ + /opt/openmc/set_paths.sh before attempting to use openmc$'\n'." + +echo -e $_path_msg +}
\ No newline at end of file diff --git a/set_paths.sh b/set_paths.sh index da0799ae29bd..3a8327895ccf 100644 --- a/set_paths.sh +++ b/set_paths.sh @@ -1,3 +1,5 @@ +# set for current session + # get variables arch=$(uname -m) python_version=$(python -V 2>&1 | cut -d' ' -f2 | cut -d'.' -f1-2) @@ -15,19 +17,5 @@ eval $export_pythonpath eval $export_ld_library_path eval $export_openmc_cross_sections -# Check and add to bashrc if not exists -if ! grep -qF "$export_path" ~/.bashrc; then - echo "$export_path" >> ~/.bashrc -fi - -if ! grep -qF "$export_pythonpath" ~/.bashrc; then - echo "$export_pythonpath" >> ~/.bashrc -fi - -if ! grep -qF "$export_ld_library_path" ~/.bashrc; then - echo "$export_ld_library_path" >> ~/.bashrc -fi - -if ! grep -qF "$export_openmc_cross_sections" ~/.bashrc; then - echo "$export_openmc_cross_sections" >> ~/.bashrc -fi
\ No newline at end of file +# set for future sessions +cp openmc.sh /etc/profile.d
\ No newline at end of file |