Commit 8f997658 by Maarten L. Hekkelman

update configure to configure data directories

parent 50693163
......@@ -18,3 +18,4 @@ src/Config.hpp.in~
src/Config.hpp
aclocal.m4
version-info-*.txt
tools/update-dictionary-script
......@@ -47,8 +47,8 @@ pkgconfigdir = $(libdir)/pkgconfig
CCP4DIR = @CCP4@
CLIBD = $(CCP4DIR:%=%/lib/data)
CACHE_DIR = $(DESTDIR)/var/cache/libcifpp
DATA_DIR = $(datadir)/libcifpp
CACHE_DIR = $(DESTDIR)@DATA_CACHE_DIR@
DATA_DIR = @DATA_LIB_DIR@
CRON_DIR = $(DESTDIR)/etc/cron.weekly
DEFINES += CACHE_DIR='"$(CACHE_DIR)"' DATA_DIR='"$(DATA_DIR)"'
......
......@@ -635,6 +635,8 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
DATA_CACHE_DIR
DATA_LIB_DIR
BOOST_REGEX_LIB
BOOST_DATE_TIME_LIB
BOOST_IOSTREAMS_LIB
......@@ -779,7 +781,9 @@ DEBUG
CCP4
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR'
PKG_CONFIG_LIBDIR
DATA_LIB_DIR
DATA_CACHE_DIR'
# Initialize some variables set by options.
......@@ -1467,6 +1471,10 @@ Some influential environment variables:
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
DATA_LIB_DIR
The location where to store packaged dictionary files
DATA_CACHE_DIR
The location where to store cached dictionary files
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
......@@ -18364,7 +18372,15 @@ _ACEOF
fi
ac_config_files="$ac_config_files GNUmakefile libcifpp.pc"
DATA_LIB_DIR=$datadir/libcifpp
DATA_CACHE_DIR=/var/cache/libcifpp
ac_config_files="$ac_config_files GNUmakefile libcifpp.pc tools/update-dictionary-script"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
......@@ -19450,6 +19466,7 @@ do
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
"libcifpp.pc") CONFIG_FILES="$CONFIG_FILES libcifpp.pc" ;;
"tools/update-dictionary-script") CONFIG_FILES="$CONFIG_FILES tools/update-dictionary-script" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
......
......@@ -114,5 +114,15 @@ AX_BOOST_REGEX
AC_CHECK_LIB([atomic], [atomic_flag_clear])
dnl Set output variables for the various directories
AC_ARG_VAR([DATA_LIB_DIR], [The location where to store packaged dictionary files])
AC_SUBST([DATA_LIB_DIR])
DATA_LIB_DIR=$datadir/libcifpp
AC_ARG_VAR([DATA_CACHE_DIR], [The location where to store cached dictionary files])
AC_SUBST([DATA_CACHE_DIR])
DATA_CACHE_DIR=/var/cache/libcifpp
AC_OUTPUT([GNUmakefile
libcifpp.pc])
libcifpp.pc
tools/update-dictionary-script])
......@@ -2,6 +2,7 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datalibdir=@datarootdir@/libcifpp
Name: libcifpp
Description: C++ library for the manipulation of mmCIF files.
......
......@@ -5778,24 +5778,6 @@ void PDBFileParser::Parse(std::istream& is, cif::File& result)
auto& atom_site = *getCategory("atom_site");
// for (const auto& [asym1, seq1, atom1, asym2, seq2, atom2]: getCategory("struct_conn")
// ->find<std::string,std::string,std::string,std::string,std::string,std::string>(
// "pdbx_dist_value"_key == 0 or "pdbx_dist_value"_key == Null,
// { "ptnr1_label_asym_id", "ptnr1_label_seq_id", "ptnr1_label_atom_id",
// "ptnr2_label_asym_id", "ptnr2_label_seq_id", "ptnr2_label_atom_id" }))
// {
// auto a1 = atom_site.find1("label_asym_id"_key == asym1 and "label_seq_id"_key == seq1 and "label_atom_id"_key == atom1);
// auto a2 = atom_site.find1("label_asym_id"_key == asym2 and "label_seq_id"_key == seq2 and "label_atom_id"_key == atom2);
// const auto& [x1, y1, z1] = a1.get<float,float,float>({"cartn_x", "cartn_y", "cartn_z"});
// const auto& [x2, y2, z2] = a2.get<float,float,float>({"cartn_x", "cartn_y", "cartn_z"});
// float distance = mmcif::Distance(mmcif::Point{x1, y1, z1}, mmcif::Point{x2, y2, z2});
// std::cerr << "Distance for link: " << distance << std::endl;
// }
for (auto r: getCategory("struct_conn")->find("pdbx_dist_value"_key == 0 or "pdbx_dist_value"_key == Null))
{
const auto& [asym1, seq1, atom1, symm1, asym2, seq2, atom2, symm2] = r.get<std::string,std::string,std::string,std::string,std::string,std::string,std::string,std::string>(
......
......@@ -17,13 +17,13 @@ if [ "$update" != "true" ] ; then
fi
# if cache directory doesn't exist, exit.
if ! [ -d /var/cache/libcifpp ]; then
if ! [ -d @DATA_CACHE_DIR@ ]; then
exit
fi
# fetch the dictionary
dict=/var/cache/libcifpp/mmcif_pdbx_v50.dic
dict=@DATA_CACHE_DIR@/mmcif_pdbx_v50.dic
source=https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz
wget -O${dict}.gz ${source}
......
Markdown is supported
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