gen_cmake_deploy 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. ################################################################################
  3. # Copyright (C) 2011 HPCC Systems.
  4. #
  5. # All rights reserved. This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU Affero General Public License as
  7. # published by the Free Software Foundation, either version 3 of the
  8. # License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Affero General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ################################################################################
  18. for XML in `find . -name deploy_map.xml` ; do
  19. BASE=`dirname $XML | sed -e 's/^\.\///' `
  20. echo $BASE
  21. export HPCC_MODULE=`basename "${BASE}"`
  22. echo "----------"
  23. tidy -q -w -xml -i $XML | grep '<[^/]*/>' | \
  24. grep -v "srcPath='\.\..libs'" | grep -v "srcPath='\.\..bin'" |\
  25. sed -e 's/<\(.*\)\/>/\1/' > ${BASE}.sf
  26. if [ -s ${BASE}.sf ]; then
  27. echo "# ${BASE} Supplementals" > ${BASE}.install
  28. echo "Install ( FILES \${CMAKE_CURRENT_SOURCE_DIR}/install_directory/${BASE}/${BASE}_deploy_map.xml DESTINATION \${OSSDIR}/componentfiles/$HPCC_MODULE" >>${BASE}.install
  29. echo " PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )" >>${BASE}.install
  30. cat ${BASE}.sf | sed -e 's/\\/\//g' -e 's/^/.\/emit_install /' | bash >> ${BASE}.install
  31. fi
  32. grep -E 'UnKnOwN|NoTfOuNd' ${BASE}.install
  33. #UNKNOWNS=`cat ${BASE}.install | grep -c UnKnOwN`
  34. #DUPLICATES=`cat ${BASE}.install | grep -c NoTfOuNd`
  35. #printf "Install file has %d unresolved files and %d ambiguous files\n" $NOTFOUND $UNKNOWN
  36. done