Commit d6020016 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - added exclusion of externals not needed in debian pack

parent 25265c07
......@@ -53,8 +53,12 @@ IF( NIFTILIB_FOUND )
INCLUDE_DIRECTORIES( ${NIFTILIB_INCLUDE_DIR} )
SET( OWExtNiftiIOName ${NIFTILIB_LIBRARY} )
ELSE()
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/nifti )
ADD_SUBDIRECTORY( ext/nifti )
IF( EXISTS ext/nifti/CMakeLists.txt )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/nifti )
ADD_SUBDIRECTORY( ext/nifti )
ELSE()
MESSAGE( FATAL_ERROR "Could not find niftilib." )
ENDIF()
ENDIF()
# -----------------------------------------------------------------------------------------------------------------------------------------------
......@@ -70,8 +74,12 @@ IF( BIOSIG_FOUND )
INCLUDE_DIRECTORIES( ${BIOSIG_INCLUDE_DIR} )
SET( OWExtBioSigName ${BIOSIG_LIBRARY} )
ELSE()
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/biosig )
ADD_SUBDIRECTORY( ext/biosig )
IF( EXISTS ext/biosig/CMakeLists.txt )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/biosig )
ADD_SUBDIRECTORY( ext/biosig )
ELSE()
MESSAGE( FATAL_ERROR "Could not find biosig." )
ENDIF()
ENDIF()
# -----------------------------------------------------------------------------------------------------------------------------------------------
......
......@@ -115,6 +115,7 @@ CreateSrcArchive()
# Param $1 the directory to create
# Param $2 the optional alternative name for the source archive. Some package mechanism need this to work
# properly
# Param $3 the exlusion list for re-packing purposes
#
# POSTCONDITION the PWD is not changed
CreateWorkingDir()
......@@ -150,8 +151,18 @@ CreateWorkingDir()
exit 1
fi
# If source re-packing is needed, param $3 should contain the exclusion list
EXCLUDE_LIST=""
if [ $# -eq 3 ]; then
# re-package with exclusion list
for ex in $3
do
EXCLUDE_LIST="$EXCLUDE_LIST --exclude=$ex"
done
fi
# Extract it
tar xzf $SRC_DIR.tar.gz
tar xzf $SRC_DIR.tar.gz $EXCLUDE_LIST
if [ $? -ne 0 ]; then
echo " * Failed to extract source archive to \"$1\"."
cd ..
......@@ -159,11 +170,16 @@ CreateWorkingDir()
fi
# did the user specify some new name for the tar?
if [ $# -eq 2 ]; then
mv $SRC_DIR.tar.gz $2
if [ $? -ne 0 ]; then
echo " * Failed to move \"$SRC_DIR.tar.gz\" to \"$2\"."
exit 1
if [ $# -ge 2 ]; then
if [ $# -eq 2 ]; then
mv $SRC_DIR.tar.gz $2
if [ $? -ne 0 ]; then
echo " * Failed to move \"$SRC_DIR.tar.gz\" to \"$2\"."
exit 1
fi
else
echo " * Repacking with exclusions."
tar czf $2 $SRC_DIR
fi
fi
......@@ -197,8 +213,8 @@ BuildDeb()
echo "* Creating all deb binary packages."
DEB_WORKDIR=${SRC_DIR}_deb
# Create a working dir
CreateWorkingDir $DEB_WORKDIR ${ARCHIVE_PREFIX}_${VERSION}.orig.tar.gz
# Create a working dir and exclude some external code
CreateWorkingDir $DEB_WORKDIR ${ARCHIVE_PREFIX}_${VERSION}.orig.tar.gz "src/modules/data/ext/nifti* src/modules/data/ext/biosig*"
if [ $? -ne 0 ]; then
echo " * Failed to creating working diretory."
exit 1
......@@ -220,7 +236,7 @@ BuildDeb()
#pdebuild --debbuildopts "-uc -us" --architecture $arch --buildresult ..
debuild -uc -us
if [ $? -ne 0 ]; then
echo " * debuild for failed. You probably missed dependencies or have errors in the package config files."
echo " * debuild failed. You probably missed dependencies or have errors in the package config files."
cd ..
exit 1
fi
......
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