Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
88b3c87b
Unverified
Commit
88b3c87b
authored
Nov 29, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for automatic update of data
parent
7fd7dfd9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
.github/workflows/cmake-multi-platform.yml
+2
-0
CMakeLists.txt
+10
-5
tools/update-libcifpp-data.in
+12
-7
No files found.
.github/workflows/cmake-multi-platform.yml
View file @
88b3c87b
...
@@ -55,3 +55,5 @@ jobs:
...
@@ -55,3 +55,5 @@ jobs:
working-directory
:
${{ steps.strings.outputs.build-output-dir }}
working-directory
:
${{ steps.strings.outputs.build-output-dir }}
run
:
ctest --build-config Release --output-on-failure
run
:
ctest --build-config Release --output-on-failure
-
name
:
Install
run
:
cmake --install ${{ steps.strings.outputs.build-output-dir }} --config Release
CMakeLists.txt
View file @
88b3c87b
...
@@ -66,12 +66,17 @@ if(NOT(BUILD_FOR_CCP4 AND WIN32))
...
@@ -66,12 +66,17 @@ if(NOT(BUILD_FOR_CCP4 AND WIN32))
option
(
BUILD_SHARED_LIBS
"Build a shared library instead of a static one"
OFF
)
option
(
BUILD_SHARED_LIBS
"Build a shared library instead of a static one"
OFF
)
endif
()
endif
()
# Lots of code depend on the availability of the components.cif file
if
(
BUILD_FOR_CCP4
)
option
(
CIFPP_DOWNLOAD_CCD
"Download the CCD file components.cif during installation"
ON
)
unset
(
CIFPP_DOWNLOAD_CCD
)
unset
(
CIFPP_INSTALL_UPDATE_SCRIPT
)
else
()
# Lots of code depend on the availability of the components.cif file
option
(
CIFPP_DOWNLOAD_CCD
"Download the CCD file components.cif during installation"
ON
)
# An optional cron script can be installed to keep the data files up-to-date
# An optional cron script can be installed to keep the data files up-to-date
if
(
"
${
CMAKE_SYSTEM_NAME
}
"
STREQUAL
"Linux"
AND NOT BUILD_FOR_CCP4
)
if
(
UNIX
)
option
(
CIFPP_INSTALL_UPDATE_SCRIPT
"Install the script to update CCD and dictionary files"
ON
)
option
(
CIFPP_INSTALL_UPDATE_SCRIPT
"Install the script to update CCD and dictionary files"
ON
)
endif
()
endif
()
endif
()
# When CCP4 is sourced in the environment, we can recreate the symmetry operations table
# When CCP4 is sourced in the environment, we can recreate the symmetry operations table
...
@@ -564,7 +569,7 @@ if(CIFPP_INSTALL_UPDATE_SCRIPT)
...
@@ -564,7 +569,7 @@ if(CIFPP_INSTALL_UPDATE_SCRIPT)
else
()
else
()
set
(
CIFPP_CRON_DIR
"
${
CIFPP_ETC_DIR
}
/cron.weekly"
CACHE PATH
"The cron directory, for the update script"
)
set
(
CIFPP_CRON_DIR
"
${
CIFPP_ETC_DIR
}
/cron.weekly"
CACHE PATH
"The cron directory, for the update script"
)
endif
()
endif
()
elseif
(
UNIX
)
# assume all others are like FreeBSD...
elseif
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"FreeBSD"
)
set
(
CIFPP_CRON_DIR
"
${
CIFPP_ETC_DIR
}
/periodic/weekly"
CACHE PATH
"The cron directory, for the update script"
)
set
(
CIFPP_CRON_DIR
"
${
CIFPP_ETC_DIR
}
/periodic/weekly"
CACHE PATH
"The cron directory, for the update script"
)
else
()
else
()
message
(
FATAL_ERROR
"Don't know where to install the update script"
)
message
(
FATAL_ERROR
"Don't know where to install the update script"
)
...
...
tools/update-libcifpp-data.in
View file @
88b3c87b
...
@@ -10,7 +10,7 @@ euid=${EUID:-$(id -u)}
...
@@ -10,7 +10,7 @@ euid=${EUID:-$(id -u)}
if
[
"
${
euid
}
"
-ne
0
]
;
then
if
[
"
${
euid
}
"
-ne
0
]
;
then
echo
"Please run as root"
echo
"Please run as root"
exit
exit
1
fi
fi
if
[
-f
"@CIFPP_ETC_DIR@/libcifpp.conf"
]
;
then
if
[
-f
"@CIFPP_ETC_DIR@/libcifpp.conf"
]
;
then
...
@@ -19,12 +19,13 @@ fi
...
@@ -19,12 +19,13 @@ fi
# check to see if we're supposed to run at all
# check to see if we're supposed to run at all
if
[
"
$update
"
!=
"true"
]
;
then
if
[
"
$update
"
!=
"true"
]
;
then
exit
exit
0
fi
fi
# if cache directory doesn't exist, exit.
# if cache directory doesn't exist, exit.
if
!
[
-d
"@CIFPP_CACHE_DIR@"
]
;
then
if
!
[
-d
"@CIFPP_CACHE_DIR@"
]
;
then
exit
echo
"Cache directory '@CIFPP_CACHE_DIR@' does not exist"
exit
1
fi
fi
# Create a temp file in the right directory and
# Create a temp file in the right directory and
...
@@ -60,12 +61,16 @@ update_dictionary() {
...
@@ -60,12 +61,16 @@ update_dictionary() {
# Update the dictionaries
# Update the dictionaries
update_dictionary
"@CIFPP_CACHE_DIR@/components.cif"
"https://f
tp
.wwpdb.org/pub/pdb/data/monomers/components.cif.gz"
update_dictionary
"@CIFPP_CACHE_DIR@/components.cif"
"https://f
iles
.wwpdb.org/pub/pdb/data/monomers/components.cif.gz"
update_dictionary
"@CIFPP_CACHE_DIR@/mmcif_pdbx.dic"
"https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz"
update_dictionary
"@CIFPP_CACHE_DIR@/mmcif_pdbx.dic"
"https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz"
update_dictionary
"@CIFPP_CACHE_DIR@/mmcif_ma.dic"
"https://github.com/ihmwg/ModelCIF/raw/master/dist/mmcif_ma.dic"
update_dictionary
"@CIFPP_CACHE_DIR@/mmcif_ma.dic"
"https://github.com/ihmwg/ModelCIF/raw/master/dist/mmcif_ma.dic"
# notify subscribers,
will fail on FreeBSD
# notify subscribers,
using find instead of run-parts to make it work on FreeBSD as well
if
[
-d
"@CIFPP_ETC_DIR@/libcifpp/cache-update.d"
]
&&
[
-x
/bin/run-parts
]
;
then
if
[
-d
"@CIFPP_ETC_DIR@/libcifpp/cache-update.d"
]
;
then
run-parts
--arg
"@CIFPP_CACHE_DIR@"
--
"@CIFPP_ETC_DIR@/libcifpp/cache-update.d"
find
"@CIFPP_ETC_DIR@/libcifpp/cache-update.d"
\
-exec
test
-x
{}
\;
-and
-not
-exec
test
-d
{}
\;
\
-exec
{}
"@CIFPP_CACHE_DIR@"
\;
fi
fi
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment