# Check if meataxe was properly installed
sage -c "import sage.libs.meataxe" || sdh_die "sage.libs.meataxe cannot be imported. To solve this, it is enough to retry installation of p_group_cohomology"

cd src

# building modular_resolution-1.1
cd csources
sdh_configure
sdh_make
# sdh_make install got broken by trac ticket #24106
$MAKE install
cd ..

# building pGroupCohomology
cd pyxsources
sdh_pip_install .

if [ "x$SAGE_SPKG_INSTALL_DOCS" = xyes ] ; then
    cd doc
    $MAKE html || sdh_die "Error building documentation"
    rm -r "$SAGE_SHARE/doc/p_group_cohomology"
    cp -r build/html "$SAGE_SHARE/doc/p_group_cohomology" || sdh_die "Error moving documentation to $SAGE_SHARE/doc/p_group_cohomology"
fi
