<commit_before>#!/bin/sh

# Copyright (C) 2008 SIPez LLC. 
#
# Script for building sipxtapi doxygen documentation
#
# Based off a script from <NAME> <<EMAIL>>
# Extended and optimized for continuous-integration build systems 
# (specifically Hudson) by <NAME> <<EMAIL>>


if [ ! -e sipXportLib ] ; then 
  echo "You don't appear to be in a sipxtapi working dir."
  echo "Please change your current directory to a sipxtapi working directory"
  echo "and re-run this script."
  exit 2
fi

# Figure out where to install things to... Make a temporary directory for it.
# For docs, this shouldn't contain anything, and we'll remove it at the end.
# so no need to tell the user where it is.
INSTALLDIR=`mktemp -t -d sipxtapi_stage.XXXXXX`
exitStatus=$?
if [ $exitStatus -gt 0 ] ; then
  # Failed to create temporary directory for installing to, for some reason.
  # exit failure.
  echo "Failed to create temporary directory, for some reason ($exitStatus)" 
  exit 3
fi

# Define where we're storing the documentation zipfile artifact
DOCZIP_PATH="$PWD/sipxtapi_doc.zip"


# Apply patch to sipXmediaLib so that autoconf 2.59 will work.
(
  exitStatus=0
  cd sipXmediaLib
  ac259patchapplied=`svn stat | grep "contrib/libspeex/doc/Makefile.am" | wc -l`
  if [ $ac259patchapplied -eq 0 ] ; then 
    patch -p0 < autoconf259.patch
    if [ $? -gt 0 ] ; then
      # Exit non-zero so that automated build will detect failure properly
      exitStatus=2
    fi
  fi
  exit $exitStatus
) &&

(
  cd sipXportLib &&
  mkdir -p build &&
  autoreconf -fi &&
  cd build &&
  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} &&
  make doc
) &&

(
  cd sipXsdpLib &&
  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
  mv configure.ac.nolibreqs configure.ac &&
  mkdir -p build &&
  autoreconf -fi &&
  cd build &&
  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} &&
  make doc
) &&

(
  cd sipXtackLib &&
  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
  mv configure.ac.nolibreqs configure.ac &&
  mkdir -p build &&
  autoreconf -fi &&
  cd build &&
  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} --disable-sipviewer &&
  make doc
) &&

#(
#  cd sipXmediaLib &&
#  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
#  mv configure.ac.nolibreqs configure.ac &&
#  mkdir -p build &&
#  autoreconf -fi &&
#  cd build &&
#  ../configure --prefix=$INSTALLDIR  ${CONFIGFLAGS} &&
#  make doc 
#) &&

# making documentation in sipXmediaAdapterLib seems broken right now.
# Leave it out temporarily
#(
#  cd sipXmediaAdapterLib &&
#  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
#  mv configure.ac.nolibreqs configure.ac &&
#  mkdir -p build &&
#  autoreconf -fi &&
#  cd build &&
#  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} &&
#  make doc
#) &&

# Zip up the documentation.  We have to delve into each directory so that the
# paths encoded in the zip file are correct.
(
  pushd sipXportLib/build &&
  zip -g -r $DOCZIP_PATH doc/sipxportlib && 
  popd &&

  pushd sipXsdpLib/build &&
  zip -g -r $DOCZIP_PATH doc/sipxsdplib && 
  popd &&

  pushd sipXtackLib/build &&
  zip -g -r $DOCZIP_PATH doc/sipxtacklib && 
  popd
) &&

rm -rf $INSTALLDIR && 

echo "Successfully built sipXtapi documentation" &&
echo "$DOCZIP_PATH"<commit_msg>Install the docs to the temp install directory, and zip from that, This way, documentation project interdependencies will be generated.<commit_after>#!/bin/sh

# Copyright (C) 2008 SIPez LLC. 
#
# Script for building sipxtapi doxygen documentation
#
# Based off a script from <NAME> <<EMAIL>>
# Extended and optimized for continuous-integration build systems 
# (specifically Hudson) by <NAME> <<EMAIL>>


if [ ! -e sipXportLib ] ; then 
  echo "You don't appear to be in a sipxtapi working dir."
  echo "Please change your current directory to a sipxtapi working directory"
  echo "and re-run this script."
  exit 2
fi

# Figure out where to install things to... Make a temporary directory for it.
# For docs, this shouldn't contain anything, and we'll remove it at the end.
# so no need to tell the user where it is.
INSTALLDIR=`mktemp -t -d sipxtapi_stage.XXXXXX`
exitStatus=$?
if [ $exitStatus -gt 0 ] ; then
  # Failed to create temporary directory for installing to, for some reason.
  # exit failure.
  echo "Failed to create temporary directory, for some reason ($exitStatus)" 
  exit 3
fi

echo "Installing to directory: $INSTALLDIR"

# Define where we're storing the documentation zipfile artifact
DOCZIP_PATH="$PWD/sipxtapi_doc.zip"


# Apply patch to sipXmediaLib so that autoconf 2.59 will work.
(
  exitStatus=0
  cd sipXmediaLib
  ac259patchapplied=`svn stat | grep "contrib/libspeex/doc/Makefile.am" | wc -l`
  if [ $ac259patchapplied -eq 0 ] ; then 
    patch -p0 < autoconf259.patch
    if [ $? -gt 0 ] ; then
      # Exit non-zero so that automated build will detect failure properly
      exitStatus=2
    fi
  fi
  exit $exitStatus
) &&

rm -rf $INSTALLDIR &&

(
  cd sipXportLib &&
  mkdir -p build &&
  autoreconf -fi &&
  cd build &&
  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} &&
  make doc &&
  make -C doc install-doc
) &&

(
  cd sipXsdpLib &&
  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
  mv configure.ac.nolibreqs configure.ac &&
  mkdir -p build &&
  autoreconf -fi &&
  cd build &&
  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} &&
  make doc &&
  make -C doc install-doc
) &&

(
  cd sipXtackLib &&
  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
  mv configure.ac.nolibreqs configure.ac &&
  mkdir -p build &&
  autoreconf -fi &&
  cd build &&
  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} --disable-sipviewer &&
  make doc &&
  make -C doc install-doc
) &&

#(
#  cd sipXmediaLib &&
#  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
#  mv configure.ac.nolibreqs configure.ac &&
#  mkdir -p build &&
#  autoreconf -fi &&
#  cd build &&
#  ../configure --prefix=$INSTALLDIR  ${CONFIGFLAGS} &&
#  make doc &&
#  make -C doc install-doc
#) &&

# making documentation in sipXmediaAdapterLib seems broken right now.
# Leave it out temporarily
#(
#  cd sipXmediaAdapterLib &&
#  sed -e '0,/SFAC_LIB_/s/SFAC_LIB_[^ ]*/SFAC_INIT_FLAGS/;/SFAC_LIB_/d' configure.ac > configure.ac.nolibreqs &&
#  mv configure.ac.nolibreqs configure.ac &&
#  mkdir -p build &&
#  autoreconf -fi &&
#  cd build &&
#  ../configure --prefix=$INSTALLDIR ${CONFIGFLAGS} &&
#  make doc &&
#  make -C doc install-doc
#) &&

# Zip up the documentation.  We have to delve into each directory so that the
# paths encoded in the zip file are correct.
(
  cd $INSTALLDIR/share &&
  zip -r $DOCZIP_PATH doc
) &&

echo "Installdir: $INSTALLDIR" && 
echo "Successfully built sipXtapi documentation" &&
echo "$DOCZIP_PATH"
{'fraction_non_alphanumeric': 0.1269729425028185, 'fraction_numerical': 0.007891770011273957, 'mean_word_length': 3.438398999374609, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2461752', 'n_tokens_mistral': 2617, 'n_tokens_neox': 2460, 'n_words': 762}