From ce25c0b1aff811b1ec664ba941d9ab11ee031a93 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Dec 20 2013 14:08:42 +0000 Subject: Merge branch 'tcar-scripts-prepare' into tcar --- diff --git a/tcar-scripts-prepare/Locales/es_ES/prepare.sh.po b/tcar-scripts-prepare/Locales/es_ES/prepare.sh.po deleted file mode 100644 index 0bf026e..0000000 --- a/tcar-scripts-prepare/Locales/es_ES/prepare.sh.po +++ /dev/null @@ -1,28 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: prepare.sh 0.6\n" -"Report-Msgid-Bugs-To: centos-l10n-es@centos.org.cu\n" -"POT-Creation-Date: 2013-10-28 16:31-0400\n" -"PO-Revision-Date: 2013-10-28 16:31-0400\n" -"Last-Translator: Localization SIG \n" -"Language-Team: Spanish\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: Automation/Modules/Prepare/Modules/Packages/packages.sh:54 -msgid "All required packages are installed already." -msgstr "Todos los paquetes requeridos ya est\'an instalados." - -#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:55 -msgid "The option name cannot be empty." -msgstr "El nombre de la opción no puede estar vacío." - -#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:64 -msgid "The option value cannot be empty." -msgstr "El valor de la opción no puede estar vacío." - -#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:80 -msgid "The search path cannot be empty." -msgstr "El camino de búsqueda no puede estar vacío." diff --git a/tcar-scripts-prepare/Modules/Conf/Configs/asciidoc.render.conf.tpl b/tcar-scripts-prepare/Modules/Conf/Configs/asciidoc.render.conf.tpl deleted file mode 100644 index 3883162..0000000 --- a/tcar-scripts-prepare/Modules/Conf/Configs/asciidoc.render.conf.tpl +++ /dev/null @@ -1,10 +0,0 @@ -[=SECTION=.html] -render-type = "asciidoc" -render-flow = "article" -render-from = "=SECTION=.asciidoc" -locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.asciidoc.po" -images-from = "${TCAR_BASEDIR}/Artworks/Icons/Webenv" -styles-from = "${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css" -formats = "xhtml" -render-page = "single chunks" - diff --git a/tcar-scripts-prepare/Modules/Conf/Configs/svg.render.conf.tpl b/tcar-scripts-prepare/Modules/Conf/Configs/svg.render.conf.tpl deleted file mode 100644 index 10d323d..0000000 --- a/tcar-scripts-prepare/Modules/Conf/Configs/svg.render.conf.tpl +++ /dev/null @@ -1,6 +0,0 @@ -[=SECTION=.png] -render-type = "svg" -render-flow = "base" -render-from = "=SECTION=.svg" -locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.svg.po" - diff --git a/tcar-scripts-prepare/Modules/Conf/Configs/svgz.render.conf.tpl b/tcar-scripts-prepare/Modules/Conf/Configs/svgz.render.conf.tpl deleted file mode 100644 index 6e45b4e..0000000 --- a/tcar-scripts-prepare/Modules/Conf/Configs/svgz.render.conf.tpl +++ /dev/null @@ -1,6 +0,0 @@ -[=SECTION=.png] -render-type = "svg" -render-flow = "base" -render-from = "=SECTION=.svgz" -locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.svgz.po" - diff --git a/tcar-scripts-prepare/Modules/Conf/conf.sh b/tcar-scripts-prepare/Modules/Conf/conf.sh deleted file mode 100755 index 4000d9f..0000000 --- a/tcar-scripts-prepare/Modules/Conf/conf.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -###################################################################### -# -# conf.sh -- This module prepares configuration files used by both -# render and locale modules. -# -# To build the configuration file, this module creates a list of -# files to process based on the arguments provided in the -# command-line line. With this list, then, it creates the -# configuration file using configuration templates for each file -# extension supported inside the repository. -# -# The configuration file this module creates doesn't include options -# like brand which require information about the image you are about -# to produce. The intention of this module is create the -# configuration files you need to produce content right away in the -# simplest way possible and then letting you improve it as needed. -# -# The name and location of the final configuration file is that -# passed as argument to prepare module in the command-line. -# -# Written by: -# * Alain Reguera Delgado , 2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -function conf { - - # Verify that a configuration file was provided as argument. - if [[ $# -eq 0 ]];then - tcar_printMessage "`gettext "The configuration file wasn't provided."`" --as-error-line - fi - - # Define configuration file. - local CONF_FILE=$(tcar_checkRepoDirSource "${1}") - tcar_checkFiles -m "\.conf$" ${CONF_FILE} - - # Define parent directory of configuration file. - local CONF_DIR=$(dirname ${CONF_FILE}) - tcar_checkFiles -ed "${CONF_DIR}" - - # Build the list of files to process. This is all the source files - # we want to produce th configuration file for. - local SOURCE_FILES=$(tcar_getFilesList ${CONF_DIR} \ - --mindepth=1 --maxdepth=1 --type=f \ - --pattern='.+\.(svgz|svg|asciidoc)$') - - # Verify the list of files to process. - tcar_checkFiles -ef ${SOURCE_FILES} - - # Print action message. - tcar_printMessage "${CONF_FILE}" --as-creating-line - - # Process list of files. - for SOURCE_FILE in ${SOURCE_FILES};do - - local CONF_FILE_NAME=$(tcar_getFileName "${SOURCE_FILE}") - local CONF_FILE_EXTENSION=$(tcar_getFileExtension "${SOURCE_FILE}") - local CONF_FILE_TEMPLATE=${TCAR_MODULE_DIR_CONFIGS}/${CONF_FILE_EXTENSION}.render.conf.tpl - - sed -r "s/=SECTION=/${CONF_FILE_NAME}/g" ${CONF_FILE_TEMPLATE} >> ${CONF_FILE} - - done - -} diff --git a/tcar-scripts-prepare/Modules/Documents/documents.sh b/tcar-scripts-prepare/Modules/Documents/documents.sh deleted file mode 100755 index 8f13836..0000000 --- a/tcar-scripts-prepare/Modules/Documents/documents.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -###################################################################### -# -# documents.sh -- This function renders all documentation files -# inside the repository using the render module. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -function documents { - - # Define base location where configuration files will be searched - # from. You can provide more than one location here. - local DIRS='/' - - # Define the name of the option you want to look configuration - # files for. - local NAME='render-type' - - # Define the value of the option you want to look configuration - # files for. - local VALUE='asciidoc' - - # Render configuration files that match specified options and - # values in the search directories. - prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" - -} diff --git a/tcar-scripts-prepare/Modules/Images/images.sh b/tcar-scripts-prepare/Modules/Images/images.sh deleted file mode 100755 index 5916d70..0000000 --- a/tcar-scripts-prepare/Modules/Images/images.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -###################################################################### -# -# images.sh -- This function renders all configuration images files -# inside the repository, using the render module and the correct -# production order. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -function images { - - # CAUTION: The order in which repository components are processed - # affect the final result. For instance, in order for theme images - # to hold the CentOS branding information the `Artworks/Brands' - # directory must be rendered before the `Artworks/Themes' - # directory. The reason of this is that brand images are not - # drawn inside theme design models but combined with them using - # ImageMagick, once they both have been rendered as PNG files. - - # Define base location where configuration files will be searched - # from. You can provide more than one location here. - local DIRS="\ - Artworks/Brands\ - Artworks/Documentation\ - Artworks/Themes" - - # Define the name of the option you want to look configuration - # files for. - local NAME='render-type' - - # Define the value of the option you want to look configuration - # files for. - local VALUE='svg' - - # Render configuration files that match specified options and - # values in the search directories. - prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" - -} diff --git a/tcar-scripts-prepare/Modules/Links/Configs/render.conf b/tcar-scripts-prepare/Modules/Links/Configs/render.conf deleted file mode 100755 index 6982fd7..0000000 --- a/tcar-scripts-prepare/Modules/Links/Configs/render.conf +++ /dev/null @@ -1,26 +0,0 @@ -# Install centos-art command. -[centos-art] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Automation/centos-art.sh" -link-target = "${HOME}/bin" - -# Install vim's settings used as convention to edit files inside the -# repository. In case the conventions change, and link-target is -# updated inside the repository, the new conventions will be available -# to you immediately after fetching changes from central repository. -[.vimrc] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Automation/Modules/Prepare/Modules/Links/Configs/vimrc" -link-target = "${HOME}" - -# Install corporate typography. -[denmark.ttf] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Artworks/Fonts/denmark.ttf" -link-target = "${HOME}/.fonts" - -# Install corporate palette of colors (for inkscape). -[corporate.gpl] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Artworks/Palettes/corporate.gpl" -link-target = "${HOME}/.inkscape/palettes" diff --git a/tcar-scripts-prepare/Modules/Links/Configs/vimrc b/tcar-scripts-prepare/Modules/Links/Configs/vimrc deleted file mode 100755 index 5737ebd..0000000 --- a/tcar-scripts-prepare/Modules/Links/Configs/vimrc +++ /dev/null @@ -1,8 +0,0 @@ -set nu -set textwidth=70 -set autoindent -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab -set tags=./tags,tags diff --git a/tcar-scripts-prepare/Modules/Links/links.sh b/tcar-scripts-prepare/Modules/Links/links.sh deleted file mode 100755 index d33b94a..0000000 --- a/tcar-scripts-prepare/Modules/Links/links.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -###################################################################### -# -# links.sh -- This function renders configuration files inside -# automation scripts directory structure, using the render module. -# These configuration files are mainly used to connect content -# inside the repository with applications outside the repository, -# using symbolic links. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -function links { - - # Define base location where configuration files will be searched - # from. You can provide more than one location here. - local DIRS="/" - - # Define the name of the option you want to look configuration - # files for. - local NAME='render-type' - - # Define the value of the option you want to look configuration - # files for. - local VALUE='symlink' - - # Render configuration files that match specified options and - # values in the search directories. - prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" - -} - diff --git a/tcar-scripts-prepare/Modules/Locales/locales.sh b/tcar-scripts-prepare/Modules/Locales/locales.sh deleted file mode 100755 index b733cb1..0000000 --- a/tcar-scripts-prepare/Modules/Locales/locales.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -###################################################################### -# -# locales.sh -- This module retrieves translatable strings from -# automation scripts and creates the related machine objects, so -# script messages can be rendered in different languages. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -function locales { - - tcar_setModuleEnvironment locale "Automation/centos-art.sh" --update - -} diff --git a/tcar-scripts-prepare/Modules/Packages/packages.sh b/tcar-scripts-prepare/Modules/Packages/packages.sh deleted file mode 100755 index 17c0695..0000000 --- a/tcar-scripts-prepare/Modules/Packages/packages.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -###################################################################### -# -# packages.sh -- This function defines and verifies packages -# required by centos-art.sh script. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -function packages { - - # Define required packages used by centos-art.sh script inside - # CentOS base repository. - local BASE_PACKAGES="ImageMagick netpbm netpbm-progs syslinux-perl - gimp coreutils texinfo texinfo-tex info tetex-latex - tetex-fonts tetex-xdvi tetex-dvips gettext texi2html libxml2 - gnome-doc-utils elinks docbook-style-xsl docbook-utils - docbook-dtds docbook-style-dsssl docbook-simple - docbook-utils-pdf docbook-slides firefox sudo yum rpm ctags - vim-enhanced" - - # Define required packages used by centos-art.sh script inside - # EPEL repository. Start verifying the package that contains - # repository configuration, then everything else. - local EPEL_PACKAGES="epel-release inkscape asciidoc" - - # Verify required packages. The order in which packages are - # verified my help to reduce some loops (e.g., verify packages - # containing the repository's configuration files first and - # packages from that repository later. It is rather possible that - # you won't be able to install any package from a repository you - # don't have configuration files for, in first place). - tcar_checkFiles -n ${BASE_PACKAGES} ${EPEL_PACKAGES} - - # Print a confirmation message here. - tcar_printMessage "`gettext "All required packages are installed already."`" --as-stdout-line - -} diff --git a/tcar-scripts-prepare/locales/es_ES/prepare.sh.po b/tcar-scripts-prepare/locales/es_ES/prepare.sh.po new file mode 100644 index 0000000..0bf026e --- /dev/null +++ b/tcar-scripts-prepare/locales/es_ES/prepare.sh.po @@ -0,0 +1,28 @@ +msgid "" +msgstr "" +"Project-Id-Version: prepare.sh 0.6\n" +"Report-Msgid-Bugs-To: centos-l10n-es@centos.org.cu\n" +"POT-Creation-Date: 2013-10-28 16:31-0400\n" +"PO-Revision-Date: 2013-10-28 16:31-0400\n" +"Last-Translator: Localization SIG \n" +"Language-Team: Spanish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Automation/Modules/Prepare/Modules/Packages/packages.sh:54 +msgid "All required packages are installed already." +msgstr "Todos los paquetes requeridos ya est\'an instalados." + +#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:55 +msgid "The option name cannot be empty." +msgstr "El nombre de la opción no puede estar vacío." + +#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:64 +msgid "The option value cannot be empty." +msgstr "El valor de la opción no puede estar vacío." + +#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:80 +msgid "The search path cannot be empty." +msgstr "El camino de búsqueda no puede estar vacío." diff --git a/tcar-scripts-prepare/modules/conf/conf.sh b/tcar-scripts-prepare/modules/conf/conf.sh new file mode 100755 index 0000000..4000d9f --- /dev/null +++ b/tcar-scripts-prepare/modules/conf/conf.sh @@ -0,0 +1,81 @@ +#!/bin/bash +###################################################################### +# +# conf.sh -- This module prepares configuration files used by both +# render and locale modules. +# +# To build the configuration file, this module creates a list of +# files to process based on the arguments provided in the +# command-line line. With this list, then, it creates the +# configuration file using configuration templates for each file +# extension supported inside the repository. +# +# The configuration file this module creates doesn't include options +# like brand which require information about the image you are about +# to produce. The intention of this module is create the +# configuration files you need to produce content right away in the +# simplest way possible and then letting you improve it as needed. +# +# The name and location of the final configuration file is that +# passed as argument to prepare module in the command-line. +# +# Written by: +# * Alain Reguera Delgado , 2013 +# +# Copyright (C) 2009-2013 The CentOS Artwork SIG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +###################################################################### + +function conf { + + # Verify that a configuration file was provided as argument. + if [[ $# -eq 0 ]];then + tcar_printMessage "`gettext "The configuration file wasn't provided."`" --as-error-line + fi + + # Define configuration file. + local CONF_FILE=$(tcar_checkRepoDirSource "${1}") + tcar_checkFiles -m "\.conf$" ${CONF_FILE} + + # Define parent directory of configuration file. + local CONF_DIR=$(dirname ${CONF_FILE}) + tcar_checkFiles -ed "${CONF_DIR}" + + # Build the list of files to process. This is all the source files + # we want to produce th configuration file for. + local SOURCE_FILES=$(tcar_getFilesList ${CONF_DIR} \ + --mindepth=1 --maxdepth=1 --type=f \ + --pattern='.+\.(svgz|svg|asciidoc)$') + + # Verify the list of files to process. + tcar_checkFiles -ef ${SOURCE_FILES} + + # Print action message. + tcar_printMessage "${CONF_FILE}" --as-creating-line + + # Process list of files. + for SOURCE_FILE in ${SOURCE_FILES};do + + local CONF_FILE_NAME=$(tcar_getFileName "${SOURCE_FILE}") + local CONF_FILE_EXTENSION=$(tcar_getFileExtension "${SOURCE_FILE}") + local CONF_FILE_TEMPLATE=${TCAR_MODULE_DIR_CONFIGS}/${CONF_FILE_EXTENSION}.render.conf.tpl + + sed -r "s/=SECTION=/${CONF_FILE_NAME}/g" ${CONF_FILE_TEMPLATE} >> ${CONF_FILE} + + done + +} diff --git a/tcar-scripts-prepare/modules/conf/configs/asciidoc.render.conf.tpl b/tcar-scripts-prepare/modules/conf/configs/asciidoc.render.conf.tpl new file mode 100644 index 0000000..3883162 --- /dev/null +++ b/tcar-scripts-prepare/modules/conf/configs/asciidoc.render.conf.tpl @@ -0,0 +1,10 @@ +[=SECTION=.html] +render-type = "asciidoc" +render-flow = "article" +render-from = "=SECTION=.asciidoc" +locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.asciidoc.po" +images-from = "${TCAR_BASEDIR}/Artworks/Icons/Webenv" +styles-from = "${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css" +formats = "xhtml" +render-page = "single chunks" + diff --git a/tcar-scripts-prepare/modules/conf/configs/svg.render.conf.tpl b/tcar-scripts-prepare/modules/conf/configs/svg.render.conf.tpl new file mode 100644 index 0000000..10d323d --- /dev/null +++ b/tcar-scripts-prepare/modules/conf/configs/svg.render.conf.tpl @@ -0,0 +1,6 @@ +[=SECTION=.png] +render-type = "svg" +render-flow = "base" +render-from = "=SECTION=.svg" +locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.svg.po" + diff --git a/tcar-scripts-prepare/modules/conf/configs/svgz.render.conf.tpl b/tcar-scripts-prepare/modules/conf/configs/svgz.render.conf.tpl new file mode 100644 index 0000000..6e45b4e --- /dev/null +++ b/tcar-scripts-prepare/modules/conf/configs/svgz.render.conf.tpl @@ -0,0 +1,6 @@ +[=SECTION=.png] +render-type = "svg" +render-flow = "base" +render-from = "=SECTION=.svgz" +locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.svgz.po" + diff --git a/tcar-scripts-prepare/modules/documents/documents.sh b/tcar-scripts-prepare/modules/documents/documents.sh new file mode 100755 index 0000000..8f13836 --- /dev/null +++ b/tcar-scripts-prepare/modules/documents/documents.sh @@ -0,0 +1,46 @@ +#!/bin/bash +###################################################################### +# +# documents.sh -- This function renders all documentation files +# inside the repository using the render module. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Artwork SIG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +###################################################################### + +function documents { + + # Define base location where configuration files will be searched + # from. You can provide more than one location here. + local DIRS='/' + + # Define the name of the option you want to look configuration + # files for. + local NAME='render-type' + + # Define the value of the option you want to look configuration + # files for. + local VALUE='asciidoc' + + # Render configuration files that match specified options and + # values in the search directories. + prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" + +} diff --git a/tcar-scripts-prepare/modules/images/images.sh b/tcar-scripts-prepare/modules/images/images.sh new file mode 100755 index 0000000..5916d70 --- /dev/null +++ b/tcar-scripts-prepare/modules/images/images.sh @@ -0,0 +1,58 @@ +#!/bin/bash +###################################################################### +# +# images.sh -- This function renders all configuration images files +# inside the repository, using the render module and the correct +# production order. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Artwork SIG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +###################################################################### + +function images { + + # CAUTION: The order in which repository components are processed + # affect the final result. For instance, in order for theme images + # to hold the CentOS branding information the `Artworks/Brands' + # directory must be rendered before the `Artworks/Themes' + # directory. The reason of this is that brand images are not + # drawn inside theme design models but combined with them using + # ImageMagick, once they both have been rendered as PNG files. + + # Define base location where configuration files will be searched + # from. You can provide more than one location here. + local DIRS="\ + Artworks/Brands\ + Artworks/Documentation\ + Artworks/Themes" + + # Define the name of the option you want to look configuration + # files for. + local NAME='render-type' + + # Define the value of the option you want to look configuration + # files for. + local VALUE='svg' + + # Render configuration files that match specified options and + # values in the search directories. + prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" + +} diff --git a/tcar-scripts-prepare/modules/links/configs/render.conf b/tcar-scripts-prepare/modules/links/configs/render.conf new file mode 100755 index 0000000..6982fd7 --- /dev/null +++ b/tcar-scripts-prepare/modules/links/configs/render.conf @@ -0,0 +1,26 @@ +# Install centos-art command. +[centos-art] +render-type = "symlink" +render-from = "${TCAR_BASEDIR}/Automation/centos-art.sh" +link-target = "${HOME}/bin" + +# Install vim's settings used as convention to edit files inside the +# repository. In case the conventions change, and link-target is +# updated inside the repository, the new conventions will be available +# to you immediately after fetching changes from central repository. +[.vimrc] +render-type = "symlink" +render-from = "${TCAR_BASEDIR}/Automation/Modules/Prepare/Modules/Links/Configs/vimrc" +link-target = "${HOME}" + +# Install corporate typography. +[denmark.ttf] +render-type = "symlink" +render-from = "${TCAR_BASEDIR}/Artworks/Fonts/denmark.ttf" +link-target = "${HOME}/.fonts" + +# Install corporate palette of colors (for inkscape). +[corporate.gpl] +render-type = "symlink" +render-from = "${TCAR_BASEDIR}/Artworks/Palettes/corporate.gpl" +link-target = "${HOME}/.inkscape/palettes" diff --git a/tcar-scripts-prepare/modules/links/configs/vimrc b/tcar-scripts-prepare/modules/links/configs/vimrc new file mode 100755 index 0000000..5737ebd --- /dev/null +++ b/tcar-scripts-prepare/modules/links/configs/vimrc @@ -0,0 +1,8 @@ +set nu +set textwidth=70 +set autoindent +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab +set tags=./tags,tags diff --git a/tcar-scripts-prepare/modules/links/links.sh b/tcar-scripts-prepare/modules/links/links.sh new file mode 100755 index 0000000..d33b94a --- /dev/null +++ b/tcar-scripts-prepare/modules/links/links.sh @@ -0,0 +1,50 @@ +#!/bin/bash +###################################################################### +# +# links.sh -- This function renders configuration files inside +# automation scripts directory structure, using the render module. +# These configuration files are mainly used to connect content +# inside the repository with applications outside the repository, +# using symbolic links. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Artwork SIG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +###################################################################### + +function links { + + # Define base location where configuration files will be searched + # from. You can provide more than one location here. + local DIRS="/" + + # Define the name of the option you want to look configuration + # files for. + local NAME='render-type' + + # Define the value of the option you want to look configuration + # files for. + local VALUE='symlink' + + # Render configuration files that match specified options and + # values in the search directories. + prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" + +} + diff --git a/tcar-scripts-prepare/modules/locales/locales.sh b/tcar-scripts-prepare/modules/locales/locales.sh new file mode 100755 index 0000000..b733cb1 --- /dev/null +++ b/tcar-scripts-prepare/modules/locales/locales.sh @@ -0,0 +1,33 @@ +#!/bin/bash +###################################################################### +# +# locales.sh -- This module retrieves translatable strings from +# automation scripts and creates the related machine objects, so +# script messages can be rendered in different languages. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Artwork SIG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +###################################################################### + +function locales { + + tcar_setModuleEnvironment locale "Automation/centos-art.sh" --update + +} diff --git a/tcar-scripts-prepare/modules/packages/packages.sh b/tcar-scripts-prepare/modules/packages/packages.sh new file mode 100755 index 0000000..17c0695 --- /dev/null +++ b/tcar-scripts-prepare/modules/packages/packages.sh @@ -0,0 +1,56 @@ +#!/bin/bash +###################################################################### +# +# packages.sh -- This function defines and verifies packages +# required by centos-art.sh script. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Artwork SIG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +###################################################################### + +function packages { + + # Define required packages used by centos-art.sh script inside + # CentOS base repository. + local BASE_PACKAGES="ImageMagick netpbm netpbm-progs syslinux-perl + gimp coreutils texinfo texinfo-tex info tetex-latex + tetex-fonts tetex-xdvi tetex-dvips gettext texi2html libxml2 + gnome-doc-utils elinks docbook-style-xsl docbook-utils + docbook-dtds docbook-style-dsssl docbook-simple + docbook-utils-pdf docbook-slides firefox sudo yum rpm ctags + vim-enhanced" + + # Define required packages used by centos-art.sh script inside + # EPEL repository. Start verifying the package that contains + # repository configuration, then everything else. + local EPEL_PACKAGES="epel-release inkscape asciidoc" + + # Verify required packages. The order in which packages are + # verified my help to reduce some loops (e.g., verify packages + # containing the repository's configuration files first and + # packages from that repository later. It is rather possible that + # you won't be able to install any package from a repository you + # don't have configuration files for, in first place). + tcar_checkFiles -n ${BASE_PACKAGES} ${EPEL_PACKAGES} + + # Print a confirmation message here. + tcar_printMessage "`gettext "All required packages are installed already."`" --as-stdout-line + +}