Copy translations to a new directory layout. Move documentation to a new directory layout. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>pull/1/head
@ -0,0 +1,83 @@
|
||||
############################################ |
||||
# # |
||||
# Improvements and feedbacks are welcome # |
||||
# # |
||||
# This file is released under GPL >= 3 # |
||||
# # |
||||
############################################ |
||||
|
||||
|
||||
cmake_minimum_required( VERSION 3.1 ) |
||||
|
||||
|
||||
#### general package setup |
||||
|
||||
project( kile ) |
||||
set( VERSION R14.1.0 ) |
||||
|
||||
|
||||
#### include essential cmake modules |
||||
|
||||
include( FindPerl ) |
||||
include( FindPkgConfig ) |
||||
include( CheckFunctionExists ) |
||||
include( CheckSymbolExists ) |
||||
include( CheckIncludeFile ) |
||||
include( CheckLibraryExists ) |
||||
include( CheckCSourceCompiles ) |
||||
include( CheckCXXSourceCompiles ) |
||||
|
||||
|
||||
#### include our cmake modules |
||||
|
||||
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) |
||||
include( TDEMacros ) |
||||
|
||||
|
||||
##### setup install paths |
||||
|
||||
include( TDESetupPaths ) |
||||
tde_setup_paths( ) |
||||
|
||||
|
||||
##### optional stuff |
||||
|
||||
option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) |
||||
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) |
||||
|
||||
|
||||
##### user requested modules |
||||
|
||||
option( BUILD_ALL "Build all" ON ) |
||||
option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) |
||||
option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) |
||||
|
||||
|
||||
##### configure checks |
||||
|
||||
include( ConfigureChecks.cmake ) |
||||
|
||||
|
||||
###### global compiler settings |
||||
|
||||
add_definitions( -DHAVE_CONFIG_H ) |
||||
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) |
||||
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) |
||||
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ) |
||||
|
||||
|
||||
##### directories |
||||
|
||||
add_subdirectory( src ) |
||||
|
||||
|
||||
##### other data ################################ |
||||
|
||||
tde_conditional_add_project_docs( BUILD_DOC ) |
||||
tde_conditional_add_project_translations( BUILD_TRANSLATIONS ) |
||||
|
||||
|
||||
##### write configure files |
||||
|
||||
configure_file( config.h.cmake config.h @ONLY ) |
@ -0,0 +1,27 @@
|
||||
########################################### |
||||
# # |
||||
# Improvements and feedback are welcome # |
||||
# # |
||||
# This file is released under GPL >= 3 # |
||||
# # |
||||
########################################### |
||||
|
||||
|
||||
# required stuff |
||||
|
||||
tde_setup_architecture_flags( ) |
||||
|
||||
include(TestBigEndian) |
||||
test_big_endian(WORDS_BIGENDIAN) |
||||
|
||||
tde_setup_largefiles( ) |
||||
|
||||
find_package( TQt ) |
||||
find_package( TDE ) |
||||
|
||||
|
||||
##### check for gcc visibility support ######### |
||||
|
||||
if( WITH_GCC_VISIBILITY ) |
||||
tde_setup_gcc_visibility( ) |
||||
endif( ) |
@ -0,0 +1,8 @@
|
||||
#define VERSION "@VERSION@" |
||||
|
||||
// Defined if you have fvisibility and fvisibility-inlines-hidden support. |
||||
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 |
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most |
||||
significant byte first (like Motorola and SPARC, unlike Intel). */ |
||||
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ |
@ -1,2 +1,7 @@
|
||||
# the SUBDIRS is filled automatically by am_edit. If files are
|
||||
# in this directory they are installed into the english dir
|
||||
|
||||
KDE_LANG = en
|
||||
KDE_DOCS = kile
|
||||
KDE_DOCS = AUTO
|
||||
SUBDIRS = $(AUTODIRS)
|
||||
|
||||
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@ -1,139 +1,22 @@
|
||||
PROJECT( kile ) |
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) |
||||
add_subdirectory( kile ) |
||||
|
||||
|
||||
SET( KILE_VERSION CACHE STRING "Kile's version; can be used to install special documentation files in share/doc/kile-$KILE_VERSION/" ) |
||||
##### other data |
||||
|
||||
SET( kile_PO_FILE "kile.po" ) |
||||
SET( kile_DOCBOOK "index.docbook" ) |
||||
tde_create_translated_desktop( |
||||
SOURCE x-kilepr.desktop |
||||
DESTINATION ${MIME_INSTALL_DIR}/text |
||||
) |
||||
|
||||
MACRO( KILE_ADD_DOCBOOK_DIRECTORY _sources _relative_dir _docbook _language ) |
||||
# only depend on images |
||||
FILE( GLOB_RECURSE _dependencies ${CMAKE_CURRENT_SOURCE_DIR}/${_relative_dir}/*.[pP][nN][gG] ) |
||||
FILE( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir} ) |
||||
|
||||
SET( _source_docbook ${CMAKE_CURRENT_SOURCE_DIR}/${_relative_dir}/${_docbook} ) |
||||
SET( _compiled_docbook ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir}/index.cache.bz2 ) |
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_compiled_docbook} |
||||
COMMAND ${KILE_MEINPROC} --check --cache index.cache.bz2 ${_source_docbook} |
||||
DEPENDS ${_dependencies} ${_source_docbook} |
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir} |
||||
COMMENT "Compiling ${_language} docbook in ${_relative_dir}/${_docbook}" ) |
||||
|
||||
INSTALL( FILES ${_compiled_docbook} ${_dependencies} DESTINATION share/doc/tde/HTML/${_language}) |
||||
SET( ${_sources} ${${_sources}} ${_compiled_docbook} ) |
||||
ENDMACRO( KILE_ADD_DOCBOOK_DIRECTORY _sources _docbook _language ) |
||||
|
||||
MACRO( KILE_ADD_TRANSLATION_DIRECTORY _sources _relative_dir _file _language ) |
||||
FILE( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir} ) |
||||
|
||||
GET_FILENAME_COMPONENT(_base_name ${_file} NAME_WE) |
||||
SET( _source_file ${CMAKE_CURRENT_SOURCE_DIR}/${_relative_dir}/${_file} ) |
||||
SET( _base_compiled_file ${_base_name}.mo) |
||||
SET( _compiled_file ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir}/${_base_compiled_file} ) |
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_compiled_file} |
||||
COMMAND ${KILE_MSGFMT} -o ${_compiled_file} ${_source_file} |
||||
DEPENDS ${_source_file} |
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir} |
||||
COMMENT "Compiling ${_language} translation file" ) |
||||
|
||||
INSTALL( FILES ${_compiled_file} DESTINATION share/locale/${_language}/LC_MESSAGES ) |
||||
SET( ${_sources} ${${_sources}} ${_compiled_file} ) |
||||
ENDMACRO( KILE_ADD_TRANSLATION_DIRECTORY _sources _relative_dir _file _language ) |
||||
|
||||
MACRO( KILE_ADD_TRANSLATION_DIRECTORIES _documentation_sources _translation_sources _dir ) |
||||
FILE( GLOB _subdirectories ${_dir}/* ) |
||||
|
||||
FOREACH( _entry ${_subdirectories} ) |
||||
IF( IS_DIRECTORY ${_entry} ) |
||||
GET_FILENAME_COMPONENT( _language ${_entry} NAME ) |
||||
IF( KILE_MSGFMT AND EXISTS ${_entry}/messages ) |
||||
KILE_ADD_TRANSLATION_DIRECTORY( ${_translation_sources} translations/${_language}/messages ${kile_PO_FILE} ${_language} ) |
||||
SET(_translations_built ${_translations_built} ${_language} ) |
||||
ENDIF( KILE_MSGFMT AND EXISTS ${_entry}/messages ) |
||||
IF( KILE_MEINPROC AND EXISTS ${_entry}/doc ) |
||||
KILE_ADD_DOCBOOK_DIRECTORY( ${_documentation_sources} translations/${_language}/doc ${kile_DOCBOOK} ${_language} ) |
||||
SET(_docbooks_built ${_docbooks_built} ${_language} ) |
||||
ENDIF( KILE_MEINPROC AND EXISTS ${_entry}/doc ) |
||||
ENDIF( IS_DIRECTORY ${_entry} ) |
||||
ENDFOREACH( _entry ${_subdirectories} ) |
||||
|
||||
IF( _translations_built ) |
||||
MESSAGE( STATUS "Building translations for ${_translations_built}" ) |
||||
ELSE( _translations_built ) |
||||
MESSAGE( STATUS "Not building translations" ) |
||||
ENDIF( _translations_built ) |
||||
|
||||
IF( _docbooks_built ) |
||||
MESSAGE( STATUS "Building documentation for ${_docbooks_built}" ) |
||||
ELSE( _docbooks_built ) |
||||
MESSAGE( STATUS "Not building additional documentation" ) |
||||
ENDIF( _docbooks_built ) |
||||
ENDMACRO( KILE_ADD_TRANSLATION_DIRECTORIES _documentation_sources _translation_sources _dir ) |
||||
|
||||
MACRO( KILE_FIND_DOC_TOOLS ) |
||||
FIND_PROGRAM( KILE_MEINPROC "meinproc" DOC "path of the meinproc executable") |
||||
IF( KILE_MEINPROC ) |
||||
MESSAGE( STATUS "Found meinproc executable: ${KILE_MEINPROC}" ) |
||||
ELSE( KILE_MEINPROC ) |
||||
MESSAGE( STATUS "meinproc executable not found" ) |
||||
ENDIF( KILE_MEINPROC ) |
||||
FIND_PROGRAM( KILE_MSGFMT "msgfmt" DOC "path of the msgfmt executable") |
||||
IF( KILE_MEINPROC ) |
||||
MESSAGE( STATUS "Found msgfmt executable: ${KILE_MSGFMT}" ) |
||||
ELSE( KILE_MEINPROC ) |
||||
MESSAGE( STATUS "msgfmt executable not found" ) |
||||
ENDIF( KILE_MEINPROC ) |
||||
IF( KILE_MEINPROC AND KILE_MSGFMT ) |
||||
SET( KILE_DOC_TOOLS_FOUND true ) |
||||
ENDIF( KILE_MEINPROC AND KILE_MSGFMT ) |
||||
ENDMACRO( KILE_FIND_DOC_TOOLS ) |
||||
|
||||
IF( EXISTS ${kile_SOURCE_DIR}/doc OR EXISTS ${kile_SOURCE_DIR}/translations ) |
||||
KILE_FIND_DOC_TOOLS( ) |
||||
ENDIF( EXISTS ${kile_SOURCE_DIR}/doc OR EXISTS ${kile_SOURCE_DIR}/translations ) |
||||
|
||||
IF( EXISTS ${kile_SOURCE_DIR}/doc ) |
||||
IF( KILE_MEINPROC ) |
||||
MESSAGE( STATUS "Building standard documentation") |
||||
KILE_ADD_DOCBOOK_DIRECTORY( kile_DOCUMENTATION_SOURCES doc index.docbook en ) |
||||
ENDIF( KILE_MEINPROC ) |
||||
ELSE( EXISTS ${kile_SOURCE_DIR}/doc ) |
||||
MESSAGE( STATUS "Not building standard documentation") |
||||
ENDIF( EXISTS ${kile_SOURCE_DIR}/doc ) |
||||
|
||||
IF( EXISTS ${kile_SOURCE_DIR}/translations ) |
||||
IF( KILE_MEINPROC OR KILE_MSGFMT ) |
||||
KILE_ADD_TRANSLATION_DIRECTORIES( kile_DOCUMENTATION_SOURCES kile_TRANSLATION_SOURCES ${kile_SOURCE_DIR}/translations ) |
||||
ENDIF( KILE_MEINPROC OR KILE_MSGFMT ) |
||||
ELSE( EXISTS ${kile_SOURCE_DIR}/translations ) |
||||
MESSAGE( STATUS "Not building translations") |
||||
ENDIF( EXISTS ${kile_SOURCE_DIR}/translations ) |
||||
|
||||
IF( kile_DOCUMENTATION_SOURCES ) |
||||
ADD_CUSTOM_TARGET(docbooks ALL DEPENDS ${kile_DOCUMENTATION_SOURCES}) |
||||
ENDIF( kile_DOCUMENTATION_SOURCES ) |
||||
|
||||
IF( kile_TRANSLATION_SOURCES ) |
||||
ADD_CUSTOM_TARGET(translations ALL DEPENDS ${kile_TRANSLATION_SOURCES}) |
||||
ENDIF( kile_TRANSLATION_SOURCES) |
||||
|
||||
ADD_SUBDIRECTORY( kile ) |
||||
|
||||
########### install files ############### |
||||
|
||||
INSTALL( FILES x-kilepr.desktop DESTINATION share/mimelink/text ) |
||||
|
||||
INSTALL( FILES kile.upd kile1.6_upd.pl kile1.7_upd.pl kile1.9_upd.pl kile1.9-1_upd.pl kile2.0-1_upd.pl kile2.0-2_upd.pl kile2.0-3_upd.pl kile2.0-4_upd.pl kile2.0-5_upd.pl DESTINATION share/apps/tdeconf_update ) |
||||
|
||||
IF( KILE_VERSION ) |
||||
SET(_KILE_SPECIAL_DOC_DIR "share/doc/kile-${KILE_VERSION}") |
||||
ELSE( KILE_VERSION ) |
||||
SET(_KILE_SPECIAL_DOC_DIR "share/doc/kile") |
||||
ENDIF( KILE_VERSION ) |
||||
|
||||
INSTALL( FILES AUTHORS ChangeLog README README.cwl kile-remote-control.txt README.MacOSX TODO DESTINATION ${_KILE_SPECIAL_DOC_DIR}) |
||||
install( |
||||
FILES kile.upd |
||||
DESTINATION ${KCONF_UPDATE_INSTALL_DIR} |
||||
) |
||||
|
||||
install( |
||||
PROGRAMS |
||||
kile1.6_upd.pl kile1.7_upd.pl kile1.9_upd.pl kile1.9-1_upd.pl |
||||
kile2.0-1_upd.pl kile2.0-2_upd.pl kile2.0-3_upd.pl kile2.0-4_upd.pl kile2.0-5_upd.pl |
||||
DESTINATION ${KCONF_UPDATE_INSTALL_DIR} |
||||
) |
||||
|
@ -1,2 +0,0 @@
|
||||
export UNSERMAKE=no |
||||
./createPackage.sh -ab trunk/extragear/office -a kile --i18n-sub extragear-office --admin branches/KDE/3.5/kde-common/admin -av 1.9 --package |
@ -1,874 +0,0 @@
|
||||
#!/bin/bash |
||||
# |
||||
# Extract an application from KDE svn, including documentation and translations. |
||||
# |
||||
# Authors: Michael Buesch <mbuesch@freenet.de> |
||||
# Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net> |
||||
# Sebastian Trueg |
||||
# Aurelien Gateau |
||||
# Klas Kalass |
||||
# License: GPL (http://www.gnu.org/) |
||||
# |
||||
# |
||||
# Directory lay-out of packages |
||||
# Application: |
||||
# + name-version |
||||
# + admin |
||||
# + src |
||||
# + doc |
||||
# + translations |
||||
# + nl |
||||
# + messages |
||||
# + doc |
||||
# + de (etc.) |
||||
# |
||||
# If the --notoplevel parameter is used everything under src is put into the root dir |
||||
# |
||||
# Translations: |
||||
# + nl |
||||
# + messages |
||||
# + doc |
||||
# + de (etc.) |
||||
|
||||
COPYRIGHT="2005 Michael Buesch <mbuesch@freenet.de> |
||||
2004-2005 Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net> |
||||
2003-2004 Sebastian Trueg |
||||
2002 Aurelien Gateau |
||||
2002-2004 Klas Kalass" |
||||
LICENSE="GNU General Public License v2 or later" |
||||
|
||||
SCRIPTNAME="createPackage.sh" |
||||
SCRIPTVERSION='$Revision$' |
||||
SCRIPTVERSION="`echo $SCRIPTVERSION | cut -d ' ' -f2`" |
||||
|
||||
|
||||
function showVersion |
||||
{ |
||||
echo "$SCRIPTNAME revision $SCRIPTVERSION" |
||||
} |
||||
|
||||
function showHelp |
||||
{ |
||||
showVersion |
||||
echo -e " |
||||
Extract an application from KDE svn, including documentation and translations. |
||||
|
||||
Copyright $COPYRIGHT |
||||
License: $LICENSE |
||||
|
||||
usage: |
||||
$0 -ab <PATH> -a <NAME> [OPTIONS] |
||||
|
||||
These parameters are mandatory: |
||||
|
||||
-ab|--app-base <PATH> Relative (to svnroot) path to the KDE or extragear module. |
||||
Example: |
||||
trunk/extragear/utils |
||||
If you want to checkout from a branch, you might use: |
||||
branches/foobar/1.2 |
||||
|
||||
-a|--app <NAME> Name of the application to checkout. |
||||
This is the subdir you want to checkout in --app-base. |
||||
|
||||
The following options are available: |
||||
|
||||
-d|--svnroot <URL> Base URL of the svn repository. |
||||
svn://anonsvn.kde.org/home/kde is the default. |
||||
|
||||
-ib|--i18n-base <PATH> Path to the i18n translations base. |
||||
Default: |
||||
trunk/l10n |
||||
|
||||
-is|--i18n-sub <PATH> Path to the i18n files under the |
||||
\$i18n-base/\$LANGUAGE/messages |
||||
directories. Example: |
||||
extragear-office |
||||
|
||||
-ids|--i18n-docsub <PATH> Path to the i18n docbook files under the |
||||
\$i18n-base/\$LANGUAGE/docs |
||||
directories. Example: |
||||
kdeextragear-2 |
||||
Default: |
||||
path of --i18n-sub |
||||
|
||||
--admin <PATH> Path to the /admin/ directory. |
||||
Default: |
||||
trunk/KDE/kde-common/admin |
||||
|
||||
-b|--builddir <DIRNAME> Name of the temporary working directory where |
||||
all files will be put. Default is \"./build\" |
||||
|
||||
-av|--appversion <VERSION> Version of the application (only for correct |
||||
naming of the tar archives). |
||||
|
||||
--nodoc Do not try to get any documentation. |
||||
|
||||
--noi18n Do not search for any translations. |
||||
|
||||
--split Make separate packages for the application and translations. |
||||
|
||||
--package [TYPE] Create tarballs (.tar.gz and/or .tar.bz2). |
||||
You can specify an optional package type: \"gzip\" or \"bzip2\" |
||||
If no type is given, both types will be generated. |
||||
|
||||
--packagedir <TARBALLDIR> Place a copy of the packages into TARBALLDIR. |
||||
|
||||
--postprocess <SCRIPT> Runs SCRIPT on the package, after all data is gathered, but before |
||||
the tarball is generated. This allows packagers to give the |
||||
\"final touch\" to the package. |
||||
|
||||
--pofiles <POFILES> Space seperated list of pofiles this application uses without the extension. |
||||
Defaults to the name of the application. |
||||
|
||||
-l|--languages <LANGUAGES> Space seperated list of languages to search for |
||||
translations. If no languages are specified, all |
||||
available languages will be included. |
||||
|
||||
-el|--exclude-languages <LANGUAGES> Space seperated list of languages not to include |
||||
in the package. |
||||
|
||||
--logfile <FILE> Write all logging information to FILE. |
||||
If FILE is \"no\", no logfile will be created. |
||||
|
||||
--notoplevel Do not create an additional src directory. Do not checkout the top level files. |
||||
Use configure.in.in and Makefile.am from the application's root directory. |
||||
|
||||
-v|--version Version of this script |
||||
-h|--help This Help" |
||||
} |
||||
|
||||
# |
||||
# Some simple helper functions. |
||||
# |
||||
|
||||
function printlog |
||||
{ |
||||
if [ -n "$LOGFILE" ]; then |
||||
echo -e "$SCRIPTNAME: $*" >> $LOGFILE |
||||
fi |
||||
} |
||||
|
||||
function printnlog |
||||
{ |
||||
if [ -n "$LOGFILE" ]; then |
||||
echo -n -e "$SCRIPTNAME: $*" >> $LOGFILE |
||||
fi |
||||
} |
||||
|
||||
function print |
||||
{ |
||||
echo -e "$SCRIPTNAME: $*" |
||||
printlog $* |
||||
} |
||||
|
||||
function printn |
||||
{ |
||||
echo -n -e "$SCRIPTNAME: $*" |
||||
printnlog $* |
||||
} |
||||
|
||||
function runCommand |
||||
{ |
||||
stdoutlog="$LOGFILE" |
||||
if [ -z "$stdoutlog" ]; then |
||||
stdoutlog="/dev/null" |
||||
fi |
||||
$* >> $stdoutlog 2>&1 |
||||
LASTRESULT=$? |
||||
print " [$1 returned $LASTRESULT]" |
||||
} |
||||
|
||||
function runCommandRedirect |
||||
{ |
||||
destinationfile=$1 |
||||
shift |
||||
|
||||
stdoutlog="$LOGFILE" |
||||
if [ -z "$stdoutlog" ]; then |
||||
stdoutlog="/dev/null" |
||||
fi |
||||
$* > $destinationfile 2>>$stdoutlog |
||||
LASTRESULT=$? |
||||
if [ $LASTRESULT -ne 0 ]; then |
||||
rm $destinationfile |
||||
fi |
||||
print " [$1 returned $LASTRESULT]" |
||||
} |
||||
|
||||
function testParameter |
||||
{ |
||||
if [ -z "$2" ]; then |
||||
echo "Please give a value to parameter $1" |
||||
exit 1 |
||||
fi |
||||
} |
||||
|
||||
function makeDir |
||||
{ |
||||
cd $BUILDDIR |
||||
print " Creating directory $*" |
||||
runCommand mkdir $* |
||||
} |
||||
|
||||
|
||||
# |
||||
# Removes the .svn directories |
||||
# |
||||
function removeVCDirs |
||||
{ |
||||
if ! [ -d "$BUILDDIR/$*" ]; then |
||||
return |
||||
fi |
||||
print " Removing VCDirs $*" |
||||
cd $BUILDDIR/$* |
||||
find . -type d -a -name '.svn' | xargs rm -rf |
||||
} |
||||
|
||||
# |
||||
# This is our work-horse. getResource retrieves all |
||||
# data needed to assemble a working package. |
||||
# Available resources: |
||||
# topleveldir, admindir, source, documentation, |
||||
# languagelist, guitranslation, doctranslation |
||||
# |
||||
function getResource |
||||
{ |
||||
DESTINATION=$2 |
||||
SINGLEFILEHACK="no" |
||||
case $1 in |
||||
topleveldir) |
||||
COMMAND="svn export -N $SVN_CHECKOUT_OPTIONS $SVNROOT/$APPBASE $DESTINATION" |
||||
;; |
||||
admindir) |
||||
COMMAND="svn export $SVN_CHECKOUT_OPTIONS $SVNROOT/$ADMINDIR $DESTINATION" |
||||
;; |
||||
source) |
||||
COMMAND="svn export $SVN_CHECKOUT_OPTIONS $SVNROOT/$APPBASE/$APPNAME $DESTINATION" |
||||
;; |
||||
documentation) |
||||
COMMAND="svn export $SVN_CHECKOUT_OPTIONS $SVNROOT/$APPBASE/doc/$APPNAME $DESTINATION" |
||||
;; |
||||
languagelist) |
||||
SINGLEFILEHACK="yes" |
||||
COMMAND="svn cat $SVN_CHECKOUT_OPTIONS $SVNROOT/$I18NBASE/subdirs" |
||||
;; |
||||
guitranslation) |
||||
DESTINATION=$3/$4.po |
||||
SINGLEFILEHACK="yes" |
||||
COMMAND="svn cat $SVN_CHECKOUT_OPTIONS $SVNROOT/$I18NBASE/$2/messages/$I18NSUB/$4.po" |
||||
;; |
||||
doctranslation) |
||||
DESTINATION=$3 |
||||
COMMAND="svn export $SVN_CHECKOUT_OPTIONS $SVNROOT/$I18NBASE/$2/docs/$I18NDOCSUB/$APPNAME $DESTINATION" |
||||
;; |
||||
*) |
||||
print "ERROR: Unknown resource $1" |
||||
exit 1 |
||||
;; |
||||
esac |
||||
|
||||
print " Retrieving resource: $1" |
||||
printlog " getResource $1: $COMMAND" |
||||
|
||||
cd $BUILDDIR |
||||
|
||||
if [ $SINGLEFILEHACK = "yes" ]; then |
||||
runCommandRedirect $DESTINATION $COMMAND |
||||
else |
||||
runCommand $COMMAND |
||||
fi |
||||
|
||||
if [ $LASTRESULT != "0" ]; then |
||||
print "Warning: Resource \"$1\" is not available." |
||||
fi |
||||
return $LASTRESULT |
||||
} |
||||
|
||||
# |
||||
# Creates the build dir, the dir where the packages |
||||
# are assembled. |
||||
# |
||||
function setupBuildDir |
||||
{ |
||||
print "Creating the build directory..." |
||||
print " ($BUILDDIR)" |
||||
|
||||
# clean up first |
||||
if [ -d $BUILDDIR ]; then |
||||
print " Removing the old build directory" |
||||
rm -rf $BUILDDIR |
||||
fi |
||||
|
||||
mkdir $BUILDDIR |
||||
} |
||||
|
||||
# |
||||
# Gather all data in the build dir needed to build |
||||
# the application (without translations). |
||||
# |
||||
function assembleApplicationData |
||||
{ |
||||
print "Assembling the source code..." |
||||
APPDIR=$APPNAME-$APPVERSION |
||||
print " ($APPDIR)" |
||||
|
||||
if [ $TOPLEVEL = "yes" ]; then |
||||
getResource "topleveldir" $APPDIR |
||||
fi |
||||
|
||||
getResource "admindir" $APPDIR/admin |
||||
|
||||
if [ $TOPLEVEL = "yes" ]; then |
||||
getResource "source" $APPDIR/src |
||||
else |
||||
getResource "source" $APPDIR |
||||
fi |
||||
} |
||||
|
||||
# |
||||
# Copies the GNU (README, TODO, Changelog, etc.) files. |
||||
# |
||||
function moveGNUFiles |
||||
{ |
||||
print " Moving the standard GNU files" |
||||
for file in $GNUFiles |
||||
do |
||||
if [ -f $BUILDDIR/$APPDIR/src/$file ]; then |
||||
mv $BUILDDIR/$APPDIR/src/$file $BUILDDIR/$1 |
||||
fi |
||||
done |
||||
} |
||||
|
||||
# |
||||
# Cleanup the application or i18n directory by removing |
||||
# unneccessary files and directories. |
||||
# |
||||
function cleanupDirectory |
||||
{ |
||||
dir="$1" |
||||
print "Removing unneccessary files and directories" |
||||
for file in $CLEANUPFILES |
||||
do |
||||
path="$dir/$file" |
||||
if [ -f "$path" ]; then |
||||
rm -f $path |
||||
printlog " Removed file: $path" |
||||
elif [ -d "$path" ]; then |
||||
rm -Rf $path |
||||
printlog " Removed directory: $path" |
||||
fi |
||||
done |
||||
} |
||||
|
||||
# |
||||
# After all data for the app is gathered, some files |
||||
# still need to be shuffled around. |
||||
# |
||||
function postProcessApplicationDir |
||||
{ |
||||
print "Post-processing the application directory..." |
||||
if [ $TOPLEVEL = "yes" ]; then |
||||
moveGNUFiles $APPDIR |
||||
fi |
||||
|
||||
if [ ! -z "$POSTPROCESSSCRIPT" ]; then |
||||
print "Running post-processing script..." |
||||
cd $BUILDDIR/$APPDIR |
||||
$POSTPROCESSSCRIPT |
||||
err="$?" |
||||
if [ $err -ne 0 ]; then |
||||
print "ERROR: Post-processing script failed (return status: $err)" |
||||
exit $err |
||||
fi |
||||
print "Post-processing script finished." |
||||
fi |
||||
} |
||||
|
||||
function retrieveDocumentation |
||||
{ |
||||
if [ $GETDOC = "no" ]; then |
||||
return |
||||
fi |
||||
|
||||
print "Retrieving the documentation..." |
||||
DOCDIR=$APPDIR/doc |
||||
print " ($DOCDIR)" |
||||
|
||||
getResource "documentation" $DOCDIR |
||||
} |
||||
|
||||
# |
||||
# Determines what languages need to be retrieved. |
||||
# If LANGUAGES was not set using the -l switch, |
||||
# the tde-i18n/subdirs file is used. |
||||
# |
||||
function getLanguageList |
||||
{ |
||||
print " Determining which languages to include..." |
||||
if [ -z "$LANGUAGES" ]; then |
||||
getResource "languagelist" languagelist |
||||
if [ -e $BUILDDIR/languagelist ]; then |
||||
LANGUAGES=`cat $BUILDDIR/languagelist` |
||||
rm $BUILDDIR/languagelist |
||||
else |
||||
print "ERROR:" |
||||
print "ERROR: Failed to automatically detect which languages to include." |
||||
print "ERROR:" |
||||
exit 1 |
||||
fi |
||||
fi |
||||
|
||||
# Remove the excluded languages from the list |
||||
LANGLIST="" |
||||
for language in $LANGUAGES ; do |
||||
EXCLUDE="false" |
||||
for exclang in $EXCLUDELANGUAGES ; do |
||||
if [ "$exclang" = "$language" ]; then |
||||
EXCLUDE="true" |
||||
break |
||||
fi |
||||
done |
||||
if [ $EXCLUDE = "false" ]; then |
||||
LANGLIST="$LANGLIST $language" |
||||
fi |
||||
done |
||||
LANGUAGES=$LANGLIST |
||||
print "Language list: $LANGUAGES" |
||||
} |
||||
|
||||
# |
||||
# Creates the dir that holds the translations. This is either |
||||
# a "translations" dir in the application build dir, or, if the |
||||
# --split switch is used, the root dir of a separate i18n package. |
||||
# |
||||
function setupI18NDir |
||||
{ |
||||
if [ $SPLIT = "yes" ]; then |
||||
I18NDIR="$APPNAME-i18n-$APPVERSION" |
||||
|
||||
getResource "topleveldir" $I18NDIR |
||||
getResource "admindir" $I18NDIR/admin |
||||
moveGNUFiles $I18NDIR |
||||
|
||||
TRANSDIR=$I18NDIR |
||||
else |
||||
I18NDIR=$APPDIR |
||||
TRANSDIR="$I18NDIR/translations" |
||||
makeDir $TRANSDIR |
||||
fi |
||||
} |
||||
|
||||
function createTranslationDirMakefile |
||||
{ |
||||
if [ $GETI18N = "no" ]; then |
||||
return |
||||
fi |
||||
|
||||
print " Creating Makefile.am in $1." |
||||
CONTENTS="SUBDIRS=$INCLUDED_LANGUAGES" |
||||
echo $CONTENTS > $1/Makefile.am |
||||
} |
||||
|
||||
function createTranslationMakefile |
||||
{ |
||||
print " Creating Makefile.am in $1." |
||||
CONTENTS="SUBDIRS=" |
||||
if [ -d "$1/messages" ]; then |
||||
CONTENTS="$CONTENTS messages" |
||||
fi |
||||
if [ -d "$1/doc" ]; then |
||||
CONTENTS="$CONTENTS doc"; |
||||
fi |
||||
echo $CONTENTS > $1/Makefile.am |
||||
} |
||||
|
||||
function createTranslationMakefiles |
||||
{ |
||||
if [ $GETI18N = "no" ]; then |
||||
return |
||||
fi |
||||
|
||||
for language in $INCLUDED_LANGUAGES ; do |
||||
createTranslationMakefile $BUILDDIR/$TRANSDIR/$language |
||||
done |
||||
} |
||||
|
||||
function createGUITranslationMakefile |
||||
{ |
||||
print " Creating Makefile.am in $2." |
||||
echo "KDE_LANG = $1 |
||||
SUBDIRS = \$(AUTODIRS) |
||||
POFILES = AUTO" > $2/Makefile.am |
||||
} |
||||
|
||||
function createDocTranslationMakefile |
||||
{ |
||||
print " Creating Makefile.am in $2." |
||||
echo "KDE_LANG = $1 |
||||
KDE_DOCS=$APPNAME" > $2/Makefile.am |
||||
} |
||||
|
||||
# |
||||
# Get the .po files and put them in xx/messages |
||||
# subdirectories, where xx is the language ISO code. |
||||
# |
||||
function retrieveGUITranslations |
||||
{ |
||||
if [ $GETI18N = "no" ]; then |
||||
return |
||||
fi |
||||
|
||||
print "Retrieving GUI translations..." |
||||
setupI18NDir |
||||
print " ($TRANSDIR)" |
||||
|
||||
# determine which languages to get |
||||
getLanguageList |
||||
|
||||
# then get them (its really simple actually) |
||||
INCLUDED_LANGUAGES="" |
||||
for language in $LANGUAGES |
||||
do |
||||
print " Including language $language" |
||||
makeDir $TRANSDIR/$language |
||||
makeDir $TRANSDIR/$language/messages |
||||
INCLUDE_THIS_LANG="yes" |
||||
for pofile in $APP_POFILES; do |
||||
getResource "guitranslation" $language $TRANSDIR/$language/messages $pofile |
||||
if [ ! -e $BUILDDIR/$TRANSDIR/$language/messages/$pofile.po ]; then |
||||
INCLUDE_THIS_LANG="no" |
||||
fi |
||||
done |
||||
|
||||
if [ $INCLUDE_THIS_LANG = "yes" ]; then |
||||
createGUITranslationMakefile $language $BUILDDIR/$TRANSDIR/$language/messages |
||||
INCLUDED_LANGUAGES="$INCLUDED_LANGUAGES $language" |
||||
else |
||||
rm -rf $TRANSDIR/$language |
||||
fi |
||||
done |
||||
} |
||||
|
||||
function retrieveDocTranslations |
||||
{ |
||||
if [ $GETI18N = "no" ]; then |
||||
return |
||||
fi |
||||
|
||||
print "Retrieving documentation translations..." |
||||
|
||||
for language in $INCLUDED_LANGUAGES ; do |
||||
print " Including documentation for language $language" |
||||
getResource "doctranslation" $language $TRANSDIR/$language/doc |
||||
if [ -e $BUILDDIR/$TRANSDIR/$language/doc/index.docbook ] |
||||
then |
||||
createDocTranslationMakefile $language $BUILDDIR/$TRANSDIR/$language/doc |
||||
else |
||||
print " No translations for $language docs available." |
||||
rm -rf $TRANSDIR/$language/doc |
||||
fi |
||||
done |
||||
} |
||||
|
||||
# |
||||
# Create the configure script and Makefile.in's. |
||||
# |
||||
function packageApplication |
||||
{ |
||||
cd $BUILDDIR |
||||
|
||||
print "Creating configure script and Makefile.in files" |
||||
(cd $APPDIR; runCommand make -f admin/Makefile.common cvs) |
||||
|
||||
cleanupDirectory $APPDIR |
||||
|
||||
TARNAME="$APPNAME-$APPVERSION.tar" |
||||
if [ $PACKAGE = "gzip" ] || [ $PACKAGE = "yes" ]; then |
||||
print "Packaging application ($TARNAME.gz)..." |
||||
$GZIP $TARNAME.gz $APPDIR |
||||
if [ $BUILDDIR != $TARBALLDIR ]; then |
||||
cp $TARNAME.gz $TARBALLDIR |
||||
fi |
||||
fi |
||||
if [ $PACKAGE = "bzip2" ] || [ $PACKAGE = "yes" ]; then |
||||
print "Packaging application ($TARNAME.bz2)..." |
||||
$BZIP2 $TARNAME.bz2 $APPDIR |
||||
if [ $BUILDDIR != $TARBALLDIR ]; then |
||||
cp $TARNAME.bz2 $TARBALLDIR |
||||
fi |
||||
fi |
||||
} |
||||
|
||||
# |
||||
# Create the configure script and Makefile.in's. |
||||
# |
||||
function packageTranslations |
||||
{ |
||||
if [ $SPLIT != "yes" ] || [ $GETI18N != "yes" ]; then |
||||
return |
||||
fi |
||||
|
||||
cd $BUILDDIR |
||||
|
||||
print "Creating translations configure script and Makefile.in files" |
||||
(cd $I18NDIR; runCommand make -f admin/Makefile.common cvs) |
||||
|
||||
cleanupDirectory $I18NDIR |
||||
|
||||
TARNAME="$APPNAME-i18n-$APPVERSION.tar" |
||||
if [ $PACKAGE = "gzip" ] || [ $PACKAGE = "yes" ]; then |
||||
print "Packaging translations ($TARNAME.gz)..." |
||||
$GZIP $TARNAME.gz $I18NDIR |
||||
if [ $BUILDDIR != $TARBALLDIR ]; then |
||||
cp $TARNAME.gz $TARBALLDIR |
||||
fi |
||||
fi |
||||
if [ $PACKAGE = "bzip2" ] || [ $PACKAGE = "yes" ]; then |
||||
print "Packaging translations ($TARNAME.bz2)..." |
||||
$BZIP2 $TARNAME.bz2 $I18NDIR |
||||
if [ $BUILDDIR != $TARBALLDIR ]; then |
||||
cp $TARNAME.bz2 $TARBALLDIR |
||||
fi |
||||
fi |
||||
} |
||||
|
||||
# |
||||
# Force the script to quit |
||||
# |
||||
function cancelScript |
||||
{ |
||||
errorcode="$1" |
||||
if [ -z "$errorcode" ] |
||||
then |
||||
errorcode="1" |
||||
fi |
||||
print "Script canceled ($errorcode)" |
||||
exit $errorcode |
||||
} |
||||
|
||||
# |
||||
# Do basic parameter checks, print some basic stuff |
||||
# and initialize basic things. |
||||
# |
||||
function initBasic |
||||
{ |
||||
trap "cancelScript" SIGINT SIGTERM |
||||
|
||||
if [ -n "$LOGFILE" ]; then |
||||
echo "$SCRIPTNAME revision $SCRIPTVERSION `date`" > $LOGFILE |
||||
fi |
||||
|
||||
if [ -z "$APPBASE" ]; then |
||||
print "You need to specify an application base path (--app-base). See $SCRIPTNAME --help for more info." |
||||
exit 1 |
||||
fi |
||||
if [ -t "$APPNAME" ]; then |
||||
print "You need to specify an application name (--app). See $SCRIPTNAME --help for more info." |
||||
exit 1 |
||||
fi |
||||
if [ "$GETI18N" = "yes" ] && [ -z "$I18NSUB" ]; then |
||||
print "You need to specify the i18n subdir or disable i18n checkout (--i18n-sub or --noi18n). See $SCRIPTNAME --help for more info." |
||||
exit 1 |
||||
fi |
||||
if [ -z "$I18NDOCSUB" ]; then |
||||
I18NDOCSUB="$I18NSUB" |
||||
fi |
||||
|
||||
if [ -z "$APP_POFILES" ]; then |
||||
|