Prepare the complete ksgmltools2 in the binary directory

instead of updating in the source.

The configuration file mechanism is used to update items in
general.entities instead of loading the file and replacing
it with regular expressions.

This relates to bug 3135.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/91/head
Slávek Banko 4 years ago
parent 98436f882d
commit a94bf7ad14
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -9,4 +9,4 @@
# #
################################################# #################################################
tde_create_handbook( SRCDIR ${CMAKE_SOURCE_DIR}/kdoctools DESTINATION tdespell ) tde_create_handbook( SRCDIR ${CMAKE_BINARY_DIR}/ksgmltools2 DESTINATION tdespell )

@ -37,19 +37,28 @@ install( PROGRAMS move_tdeio_help_cache.sh DESTINATION ${KCONF_UPDATE_INSTALL_DI
install( FILES tdeio_help.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( FILES tdeio_help.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
install( FILES help.protocol ghelp.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) install( FILES help.protocol ghelp.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
# FIXME why automake version is so complicated? file(
# install-data-local: COPY
# @(for subdir in customization docbook; do \ customization docbook
# for dir in `( cd $(srcdir)/$$subdir && find . -type d ! -name CVS | grep -v '\.svn' )`; do \ man-template.docbook template.docbook
# $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/ksgmltools2/$$subdir/$$dir ;\ DESTINATION
# for file in `(cd $(srcdir)/$$subdir && ls -1 $$dir/*)`; do \ ${CMAKE_BINARY_DIR}/ksgmltools2
# if test -f $(srcdir)/$$subdir/$$file; then \ PATTERN ".svn" EXCLUDE
# $(INSTALL_DATA) $(srcdir)/$$subdir/$$file $(DESTDIR)$(kde_datadir)/ksgmltools2/$$subdir/$$file; fi ;\ REGEX "customization/entities/general.entities$" EXCLUDE
# done ;\ )
# done ;\ configure_file(
# done ) customization/entities/general.entities
install( DIRECTORY customization docbook DESTINATION ${DATA_INSTALL_DIR}/ksgmltools2 PATTERN ".svn" EXCLUDE ) ${CMAKE_BINARY_DIR}/ksgmltools2/customization/entities/general.entities
install( FILES man-template.docbook template.docbook DESTINATION ${DATA_INSTALL_DIR}/ksgmltools2 ) @ONLY
)
install(
DIRECTORY
${CMAKE_BINARY_DIR}/ksgmltools2/
DESTINATION
${DATA_INSTALL_DIR}/ksgmltools2
)
##### kbzipfilter_dummy ############################## ##### kbzipfilter_dummy ##############################

@ -14,9 +14,11 @@ if( NOT TDE_RELEASE_ENTITIES )
set( ENTITIES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/customization/entities/general.entities" ) set( ENTITIES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/customization/entities/general.entities" )
if( NOT EXISTS ${TDEVERSION_FILE} ) if( NOT EXISTS ${TDEVERSION_FILE} )
file( RELATIVE_PATH TDEVERSION_FILE ${CMAKE_SOURCE_DIR} ${TDEVERSION_FILE} )
tde_message_fatal( "${TDEVERSION_FILE} not found! Check your sources." ) tde_message_fatal( "${TDEVERSION_FILE} not found! Check your sources." )
endif( ) endif( )
if( NOT EXISTS ${ENTITIES_FILE} ) if( NOT EXISTS ${ENTITIES_FILE} )
file( RELATIVE_PATH ENTITIES_FILE ${CMAKE_SOURCE_DIR} ${ENTITIES_FILE} )
tde_message_fatal( "${ENTITIES_FILE} not found! Check your sources." ) tde_message_fatal( "${ENTITIES_FILE} not found! Check your sources." )
endif( ) endif( )
@ -65,34 +67,12 @@ if( NOT TDE_RELEASE_ENTITIES )
TDE_RELEASE_DATE "${TDE_RELEASE_DATE}" ) TDE_RELEASE_DATE "${TDE_RELEASE_DATE}" )
# update entities # update entities
file( RELATIVE_PATH ENTITIES_FILE ${CMAKE_SOURCE_DIR} ${ENTITIES_FILE} )
message( STATUS "Updating ${ENTITIES_FILE} message( STATUS "Updating ${ENTITIES_FILE}
TDE Release Version: ${TDE_VERSION_STRING} TDE Release Version: ${TDE_VERSION_STRING}
TDE Release Date: ${TDE_RELEASE_DATE} TDE Release Date: ${TDE_RELEASE_DATE}
TDE Release Copyright: ${TDE_RELEASE_COPYRIGHT}" TDE Release Copyright: ${TDE_RELEASE_COPYRIGHT}"
) )
file( READ ${ENTITIES_FILE} ENTITIES_DATA )
if( "${ENTITIES_DATA}" MATCHES "ENTITY tde-release-version" )
string( REGEX REPLACE "(ENTITY tde-release-version) \"[^\"]*\""
"\\1 \"${TDE_VERSION_STRING}\"" ENTITIES_DATA "${ENTITIES_DATA}" )
else( )
set( ENTITIES_DATA
"${ENTITIES_DATA}<!ENTITY tde-release-version \"${TDE_VERSION_STRING}\">\n" )
endif( )
if( "${ENTITIES_DATA}" MATCHES "ENTITY tde-release-date" )
string( REGEX REPLACE "(ENTITY tde-release-date) \"[^\"]*\""
"\\1 \"${TDE_RELEASE_DATE}\"" ENTITIES_DATA "${ENTITIES_DATA}" )
else( )
set( ENTITIES_DATA
"${ENTITIES_DATA}<!ENTITY tde-release-date \"${TDE_RELEASE_DATE}\">\n" )
endif( )
if( "${ENTITIES_DATA}" MATCHES "ENTITY tde-copyright-date" )
string( REGEX REPLACE "(ENTITY tde-copyright-date) \"[^\"]*\""
"\\1 \"${TDE_RELEASE_COPYRIGHT}\"" ENTITIES_DATA "${ENTITIES_DATA}" )
else( )
set( ENTITIES_DATA
"${ENTITIES_DATA}<!ENTITY tde-copyright-date \"${TDE_RELEASE_COPYRIGHT}\">\n" )
endif( )
file( WRITE ${ENTITIES_FILE} "${ENTITIES_DATA}" )
set( TDE_RELEASE_ENTITIES 1 CACHE INTERNAL "" ) set( TDE_RELEASE_ENTITIES 1 CACHE INTERNAL "" )
endif( ) endif( )

@ -425,3 +425,6 @@
<!ENTITY tde-team "The &tde; Team"> <!ENTITY tde-team "The &tde; Team">
<!ENTITY tde-release-version "@TDE_VERSION_STRING@">
<!ENTITY tde-release-date "@TDE_RELEASE_DATE@">
<!ENTITY tde-copyright-date "@TDE_RELEASE_COPYRIGHT@">

Loading…
Cancel
Save