diff --git a/Artworks/Documentation/Corporate/corporate.asciidoc b/Artworks/Documentation/Corporate/corporate.asciidoc index 4009928..a9d5fab 100644 --- a/Artworks/Documentation/Corporate/corporate.asciidoc +++ b/Artworks/Documentation/Corporate/corporate.asciidoc @@ -19,7 +19,9 @@ recognizability, reputation, structure and identification to The CentOS Project organization by means of Corporate Design, Corporate Communication, and Corporate Behaviour. -image:corporate.png[alt="The CentOS Project Corporate Identity"] +[[corporate_identity]] +.The CentOS Project Corporate Identity +image::../corporate.png[alt="The CentOS Project Corporate Identity"] Corporate Mission ----------------- diff --git a/Artworks/Documentation/Corporate/render.conf b/Artworks/Documentation/Corporate/render.conf index 087e9c7..42b8ca7 100644 --- a/Artworks/Documentation/Corporate/render.conf +++ b/Artworks/Documentation/Corporate/render.conf @@ -1,13 +1,26 @@ -# -# This file contains configuration values used by the render module. -# -[corporate.docbook] -render-from = "corporate.asciidoc" -formats = "xhtml pdf" -comment = "The CentOS project corporate visual identity manual." - [corporate.png] -render-type = "svg" -render-flow = "base" -render-from = "corporate.svgz" -command = "/usr/bin/convert -colors 32" +render-type = "svg" +render-flow = "base" +render-from = "corporate.svgz" +locale-from = "${TCAR_SCRIPT_LANG_LC}/messages.po" +command = "/usr/bin/convert -colors 32" + +[corporate.xhtml] +render-type = "asciidoc" +render-flow = "article" +render-from = "corporate.asciidoc" +locale-from = "${TCAR_SCRIPT_LANG_LC}/messages.po" +images-from = "${TCAR_BASEDIR}/Artworks/Icons/Webenv" +styles-from = "${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css" +formats = "xhtml" +render-page = "single" + +[corporate-chunks] +render-type = "asciidoc" +render-flow = "article" +render-from = "corporate.asciidoc" +locale-from = "${TCAR_SCRIPT_LANG_LC}/messages.po" +images-from = "${TCAR_BASEDIR}/Artworks/Icons/Webenv" +styles-from = "${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css" +formats = "xhtml" +render-page = "chunks" diff --git a/Artworks/Documentation/Repository/DirStructure/dirStructure.svgz b/Artworks/Documentation/Repository/DirStructure/dirStructure.svgz index e42e554..7653a2e 100644 Binary files a/Artworks/Documentation/Repository/DirStructure/dirStructure.svgz and b/Artworks/Documentation/Repository/DirStructure/dirStructure.svgz differ diff --git a/Artworks/Icons/Webenv/render.conf b/Artworks/Icons/Webenv/render.conf new file mode 100644 index 0000000..9934966 --- /dev/null +++ b/Artworks/Icons/Webenv/render.conf @@ -0,0 +1,135 @@ +[a-attach.png] +render-type = "svg" +render-from = "a-attach.svgz" + +[ads-sample-468x60.png] +render-type = "svg" +render-from = "ads-sample-468x60.svgz" + +[ads-sample-728x90.png] +render-type = "svg" +render-from = "ads-sample-728x90.svgz" + +[a-mail.png] +render-type = "svg" +render-from = "a-mail.svgz" + +[arrow.png] +render-type = "svg" +render-from = "arrow.svgz" + +[a-www.png] +render-type = "svg" +render-from = "a-www.svgz" + +[caution.png] +render-type = "svg" +render-from = "caution.svgz" + +[convention.png] +render-type = "svg" +render-from = "convention.svgz" + +[error.png] +render-type = "svg" +render-from = "error.svgz" + +[h1-bg.png] +render-type = "svg" +render-from = "h1-bg.svgz" + +[h2-bg.png] +render-type = "svg" +render-from = "h2-bg.svgz" + +[html-bg.png] +render-type = "svg" +render-from = "html-bg.svgz" + +[important.png] +render-type = "svg" +render-from = "important.svgz" + +[msg-bg-blue.png] +render-type = "svg" +render-from = "msg-bg-blue.svgz" + +[msg-bg-gray.png] +render-type = "svg" +render-from = "msg-bg-gray.svgz" + +[msg-bg-green.png] +render-type = "svg" +render-from = "msg-bg-green.svgz" + +[msg-bg-orange.png] +render-type = "svg" +render-from = "msg-bg-orange.svgz" + +[msg-bg-red.png] +render-type = "svg" +render-from = "msg-bg-red.svgz" + +[msg-bg-violet.png] +render-type = "svg" +render-from = "msg-bg-violet.svgz" + +[note.png] +render-type = "svg" +render-from = "note.svgz" + +[pagination-bg-1.png] +render-type = "svg" +render-from = "pagination-bg-1.svgz" + +[pagination-bg-2.png] +render-type = "svg" +render-from = "pagination-bg-2.svgz" + +[powered_by_centos.png] +render-type = "svg" +render-from = "powered_by_centos.svgz" + +[redirect.png] +render-type = "svg" +render-from = "redirect.svgz" + +[success.png] +render-type = "svg" +render-from = "success.svgz" + +[tabs-bg-1.png] +render-type = "svg" +render-from = "tabs-bg-1.svgz" + +[tabs-bg-2.png] +render-type = "svg" +render-from = "tabs-bg-2.svgz" + +[tabs-bg-3.png] +render-type = "svg" +render-from = "tabs-bg-3.svgz" + +[tabs-bg-4.png] +render-type = "svg" +render-from = "tabs-bg-4.svgz" + +[tip.png] +render-type = "svg" +render-from = "tip.svgz" + +[toc-bg.png] +render-type = "svg" +render-from = "toc-bg.svgz" + +[top.png] +render-type = "svg" +render-from = "top.svgz" + +[ul.png] +render-type = "svg" +render-from = "ul.svgz" + +[warning.png] +render-type = "svg" +render-from = "warning.svgz" diff --git a/Artworks/Themes/Models/Distro/5/Gdm/render.conf.tpl b/Artworks/Themes/Models/Distro/5/Gdm/render.conf.tpl index 29ea2e0..7a50271 100644 --- a/Artworks/Themes/Models/Distro/5/Gdm/render.conf.tpl +++ b/Artworks/Themes/Models/Distro/5/Gdm/render.conf.tpl @@ -5,8 +5,8 @@ render-flow = "base" brand = "${TCAR_BASEDIR}/Artworks/Brands/Symbols/Default/Images/ffffff/ffffff-0/16/centos.png:x16+5+5" [800x600.tar.gz] -render-type = "dm" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/800x600-final.png" +render-type = "archive" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/800x600-final.png:background.png" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.desktop" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.xml" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-language.png" @@ -14,10 +14,11 @@ render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-rebo render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-session.png" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-shutdown.png" render-from = "screenshot.png" +command = "/bin/tar -czf" [1360x768.tar.gz] -render-type = "dm" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/1360x768-final.png" +render-type = "archive" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/1360x768-final.png:background.png" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.desktop" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.xml" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-language.png" @@ -25,3 +26,4 @@ render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-rebo render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-session.png" render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-shutdown.png" render-from = "screenshot.png" +command = "/bin/tar --remove-files -czf" diff --git a/Artworks/Themes/Models/Distro/5/Grub/brands.conf b/Artworks/Themes/Models/Distro/5/Grub/brands.conf deleted file mode 100644 index ce92ea6..0000000 --- a/Artworks/Themes/Models/Distro/5/Grub/brands.conf +++ /dev/null @@ -1,7 +0,0 @@ -# branding.conf -- This file controls the position of The CentOS -# Project branding information, when images are produced through the -# `render' functionality of the `centos-art.sh' script, and the -# `--with-brands' option is provided. -# ----------------------------------------------------------------------- -# $Id$ -# ----------------------------------------------------------------------- diff --git a/Artworks/Themes/Models/Distro/5/Grub/images.conf b/Artworks/Themes/Models/Distro/5/Grub/images.conf deleted file mode 100644 index e69de29..0000000 --- a/Artworks/Themes/Models/Distro/5/Grub/images.conf +++ /dev/null diff --git a/Artworks/Themes/Models/Distro/5/Grub/render.conf.tpl b/Artworks/Themes/Models/Distro/5/Grub/render.conf.tpl new file mode 100644 index 0000000..9787f0d --- /dev/null +++ b/Artworks/Themes/Models/Distro/5/Grub/render.conf.tpl @@ -0,0 +1,14 @@ +[splash.png] +render-type = "svg" +render-flow = "base" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Grub/splash.svgz" + +[splash.xpm] +render-from = "splash.png" +render-type = "palette" +palette-gpl = "colors.gpl" + +[splash.xpm.gz] +render-from = "splash.xpm" +render-type = "compress" +command = "/bin/gzip" diff --git a/Artworks/Themes/Models/Distro/5/Grub/splash.svgz b/Artworks/Themes/Models/Distro/5/Grub/splash.svgz index abf1d5e..44941ca 100644 Binary files a/Artworks/Themes/Models/Distro/5/Grub/splash.svgz and b/Artworks/Themes/Models/Distro/5/Grub/splash.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Gsplash/brands.conf b/Artworks/Themes/Models/Distro/5/Gsplash/brands.conf deleted file mode 100644 index 3acada7..0000000 --- a/Artworks/Themes/Models/Distro/5/Gsplash/brands.conf +++ /dev/null @@ -1,16 +0,0 @@ -# branding.conf -- This file controls the position of The CentOS -# Project branding information, when images are produced through the -# `render' functionality of the `centos-art.sh' script, and the -# `--with-brands' option is provided. -# ----------------------------------------------------------------------- -# $Id$ -# ----------------------------------------------------------------------- - -[types] - -gnome-splash.svgz = "Types/Default/ffffff/ffffff-0/24/centos.png:x24+10+190" -gnome-splash.svgz = "Types/Numbers/ffffff/ffffff-0/48/5.png:x48+150+166" - -[symbols] - -gnome-splash.svgz = "Symbols/Default/ffffff/ffffff-0/48/centos.png:x48+10+10" diff --git a/Artworks/Themes/Models/Distro/5/Gsplash/gnome-splash.svgz b/Artworks/Themes/Models/Distro/5/Gsplash/gnome-splash.svgz index 9b99b30..ad3f208 100644 Binary files a/Artworks/Themes/Models/Distro/5/Gsplash/gnome-splash.svgz and b/Artworks/Themes/Models/Distro/5/Gsplash/gnome-splash.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Gsplash/images.conf b/Artworks/Themes/Models/Distro/5/Gsplash/images.conf deleted file mode 100644 index e69de29..0000000 --- a/Artworks/Themes/Models/Distro/5/Gsplash/images.conf +++ /dev/null diff --git a/Artworks/Themes/Models/Distro/5/Gsplash/render.conf.tpl b/Artworks/Themes/Models/Distro/5/Gsplash/render.conf.tpl new file mode 100644 index 0000000..bea8c76 --- /dev/null +++ b/Artworks/Themes/Models/Distro/5/Gsplash/render.conf.tpl @@ -0,0 +1,5 @@ +[gnome-splash.png] +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gsplash/gnome-splash.svgz" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Default/Images/ffffff/ffffff-0/24/centos.png:x24+10+190" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Numbers/Images/ffffff/ffffff-0/48/5.png:x48+150+166" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Symbols/Default/Images/ffffff/ffffff-0/48/centos.png:x48+10+10" diff --git a/Artworks/Themes/Models/Distro/5/Kdm/render.conf.tpl b/Artworks/Themes/Models/Distro/5/Kdm/render.conf.tpl index 5e28a0f..a37f686 100644 --- a/Artworks/Themes/Models/Distro/5/Kdm/render.conf.tpl +++ b/Artworks/Themes/Models/Distro/5/Kdm/render.conf.tpl @@ -5,15 +5,17 @@ render-flow = "base" brand = "${TCAR_BASEDIR}/Artworks/Brands/Symbols/Default/Images/ffffff/ffffff-0/16/centos.png:x16+5+5" [800x600.tar.gz] -render-type = "dm" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/800x600-final.png" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/KdmGreeterTheme.desktop" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/KdmGreeterTheme.xml" +render-type = "archive" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/800x600-final.png:background.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/GdmGreeterTheme.desktop" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/GdmGreeterTheme.xml" render-from = "screenshot.png" +command = "/bin/tar --remove-files -czf" [1360x768.tar.gz] -render-type = "dm" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/1360x768-final.png" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/KdmGreeterTheme.desktop" -render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/KdmGreeterTheme.xml" +render-type = "archive" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/1360x768-final.png:background.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/GdmGreeterTheme.desktop" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Kdm/GdmGreeterTheme.xml" render-from = "screenshot.png" +command = "/bin/tar --remove-files -czf" diff --git a/Artworks/Themes/Models/Distro/5/Ksplash/render.conf.sh b/Artworks/Themes/Models/Distro/5/Ksplash/render.conf.sh new file mode 100644 index 0000000..652fb0a --- /dev/null +++ b/Artworks/Themes/Models/Distro/5/Ksplash/render.conf.sh @@ -0,0 +1,37 @@ +[splash_active_bar.png] +render-type = "svg" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Ksplash/splash_active_bar.svgz" +render-flow = "base" + +[splash_bottom.png] +render-type = "svg" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Ksplash/splash_bottom.svgz" +render-flow = "base" + +[splash_inactive_bar.png] +render-type = "svg" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Ksplash/splash_inactive_bar.svgz" +render-flow = "base" + +[splash_top.png] +render-type = "svg" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Ksplash/splash_top.svgz" +render-flow = "base" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Default/Images/ffffff/ffffff-0/24/centos.png:x24+10+189" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Numbers/Images/ffffff/ffffff-0/48/5.png:x48+150+165" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Symbols/Default/Images/ffffff/ffffff-0/48/centos.png:x48+10+10" + +[Preview.png] +render-type = "direct" +render-from = "splash_top.png" +render-from = "splash_active_bar.png" +render-from = "splash_bottom.png" +command = "/usr/bin/convert -append" + +[ksplash.tar.gz] +render-type = "archive" +render-from = "splash_top.png" +render-from = "splash_active_bar.png" +render-from = "splash_bottom.png" +render-from = "Preview.png +command = "/bin/tar -czf" diff --git a/Artworks/Themes/Models/Distro/5/Ksplash/splash_active_bar.svgz b/Artworks/Themes/Models/Distro/5/Ksplash/splash_active_bar.svgz index 9ab5bb8..8d9dc8c 100644 Binary files a/Artworks/Themes/Models/Distro/5/Ksplash/splash_active_bar.svgz and b/Artworks/Themes/Models/Distro/5/Ksplash/splash_active_bar.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Ksplash/splash_bottom.svgz b/Artworks/Themes/Models/Distro/5/Ksplash/splash_bottom.svgz index 09dda34..47c17f6 100644 Binary files a/Artworks/Themes/Models/Distro/5/Ksplash/splash_bottom.svgz and b/Artworks/Themes/Models/Distro/5/Ksplash/splash_bottom.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Ksplash/splash_inactive_bar.svgz b/Artworks/Themes/Models/Distro/5/Ksplash/splash_inactive_bar.svgz index 3c5598e..d00a4c7 100644 Binary files a/Artworks/Themes/Models/Distro/5/Ksplash/splash_inactive_bar.svgz and b/Artworks/Themes/Models/Distro/5/Ksplash/splash_inactive_bar.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Ksplash/splash_top.svgz b/Artworks/Themes/Models/Distro/5/Ksplash/splash_top.svgz index 71ea855..3dff3ba 100644 Binary files a/Artworks/Themes/Models/Distro/5/Ksplash/splash_top.svgz and b/Artworks/Themes/Models/Distro/5/Ksplash/splash_top.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Rhgb/large-computer.svgz b/Artworks/Themes/Models/Distro/5/Rhgb/large-computer.svgz index 365a593..a3a7505 100644 Binary files a/Artworks/Themes/Models/Distro/5/Rhgb/large-computer.svgz and b/Artworks/Themes/Models/Distro/5/Rhgb/large-computer.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Rhgb/main-logo.svgz b/Artworks/Themes/Models/Distro/5/Rhgb/main-logo.svgz index 584c5f1..441a955 100644 Binary files a/Artworks/Themes/Models/Distro/5/Rhgb/main-logo.svgz and b/Artworks/Themes/Models/Distro/5/Rhgb/main-logo.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Rhgb/render.conf.tpl b/Artworks/Themes/Models/Distro/5/Rhgb/render.conf.tpl new file mode 100644 index 0000000..a5f5ada --- /dev/null +++ b/Artworks/Themes/Models/Distro/5/Rhgb/render.conf.tpl @@ -0,0 +1,12 @@ +[large-computer.png] +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Rhgb/large-computer.svgz" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Symbols/Default/Images/ffffff/ffffff-0/48/centos.png:x48+30+30" + +[main-logo.png] +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Rhgb/main-logo.svgz" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Symbols/Default/Images/ffffff/ffffff-0/124/centos.png:x124+186.5+21" + +[system-logo.png] +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Rhgb/system-logo.svgz" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Default/Images/ffffff/ffffff-0/24/centos.png:x24+5+24" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Numbers/Images/ffffff/ffffff-0/48/5.png:x48+143+0" diff --git a/Artworks/Themes/Models/Distro/5/Rhgb/system-logo.svgz b/Artworks/Themes/Models/Distro/5/Rhgb/system-logo.svgz index 69eaf12..3259f2f 100644 Binary files a/Artworks/Themes/Models/Distro/5/Rhgb/system-logo.svgz and b/Artworks/Themes/Models/Distro/5/Rhgb/system-logo.svgz differ diff --git a/Artworks/Themes/Models/Distro/5/Syslinux/brands.conf b/Artworks/Themes/Models/Distro/5/Syslinux/brands.conf deleted file mode 100644 index 96a25c2..0000000 --- a/Artworks/Themes/Models/Distro/5/Syslinux/brands.conf +++ /dev/null @@ -1,12 +0,0 @@ -# branding.conf -- This file controls the position of The CentOS -# Project branding information, when images are produced through the -# `render' functionality of the `centos-art.sh' script, and the -# `--with-brands' option is provided. -# ----------------------------------------------------------------------- -# $Id$ -# ----------------------------------------------------------------------- - -[types] - -syslinux-splash.svgz = "Types/Default/ffffff/ffffff-0/48/centos.png:x48+20+232" -syslinux-splash.svgz = "Types/Numbers/ffffff/ffffff-0/96/5.png:x96+300+184" diff --git a/Artworks/Themes/Models/Distro/5/Syslinux/images.conf b/Artworks/Themes/Models/Distro/5/Syslinux/images.conf deleted file mode 100644 index e69de29..0000000 --- a/Artworks/Themes/Models/Distro/5/Syslinux/images.conf +++ /dev/null diff --git a/Artworks/Themes/Models/Distro/5/Syslinux/render.conf.tpl b/Artworks/Themes/Models/Distro/5/Syslinux/render.conf.tpl new file mode 100644 index 0000000..677750d --- /dev/null +++ b/Artworks/Themes/Models/Distro/5/Syslinux/render.conf.tpl @@ -0,0 +1,9 @@ +[syslinux-splash.png] +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Syslinux/syslinux-splash.svgz" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Default/Images/ffffff/ffffff-0/48/centos.png:x48+20+232" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Numbers/Images/ffffff/ffffff-0/96/5.png:x96+300+184" + +[syslinux-splash.lss] +render-from = "syslinux-splash.png" +render-type = "palette" +palette-gpl = "colors.gpl" diff --git a/Artworks/Themes/Models/Distro/5/Syslinux/syslinux-splash.svgz b/Artworks/Themes/Models/Distro/5/Syslinux/syslinux-splash.svgz index 21a76c8..f756bcd 100644 Binary files a/Artworks/Themes/Models/Distro/5/Syslinux/syslinux-splash.svgz and b/Artworks/Themes/Models/Distro/5/Syslinux/syslinux-splash.svgz differ diff --git a/Artworks/Themes/Models/Palettes/syslinux.gpl b/Artworks/Themes/Models/Palettes/syslinux.gpl index a980bcb..3371330 100644 --- a/Artworks/Themes/Models/Palettes/syslinux.gpl +++ b/Artworks/Themes/Models/Palettes/syslinux.gpl @@ -2,19 +2,19 @@ GIMP Palette Name: CentOS-=THEMENAME=-=THEMERELEASE=-Syslinux Columns: 16 # - 32 76 141 204c8d - 37 82 146 255292 - 52 94 153 345e99 - 73 110 162 496ea2 - 91 124 172 5b7cac -108 136 180 6c88b4 -120 146 186 7892ba -131 158 193 839ec1 -255 255 255 ffffff -146 170 200 92aac8 -162 182 209 a2b6d1 -183 199 219 b7c7db -204 216 230 ccd8e6 -221 229 238 dde5ee -235 241 245 ebf1f5 -246 251 254 f6fbfe + 32 76 141 204c8d + 37 82 146 255292 + 52 94 153 345e99 + 73 110 162 496ea2 + 91 124 172 5b7cac +108 136 180 6c88b4 +120 146 186 7892ba +131 158 193 839ec1 +255 255 255 ffffff +146 170 200 92aac8 +162 182 209 a2b6d1 +183 199 219 b7c7db +204 216 230 ccd8e6 +221 229 238 dde5ee +235 241 245 ebf1f5 +246 251 254 f6fbfe diff --git a/Artworks/Themes/Motifs/Flame/1/Distro/5/Grub/colors.gpl b/Artworks/Themes/Motifs/Flame/1/Distro/5/Grub/colors.gpl new file mode 100644 index 0000000..4aa6028 --- /dev/null +++ b/Artworks/Themes/Motifs/Flame/1/Distro/5/Grub/colors.gpl @@ -0,0 +1,18 @@ +GIMP Palette +Name: CentOS-Flame-1-Grub +Columns: 14 +# + 17 5 13 11050d + 18 11 22 120b16 + 22 16 26 16101a + 30 20 30 1e141e + 35 25 35 231923 + 41 34 43 29222b + 53 48 57 353039 + 69 63 73 453f49 + 92 86 96 5c5660 +117 111 121 756f79 +139 133 143 8b858f +161 158 162 a19ea2 +183 181 185 b7b5b9 +246 247 245 f6f7f5 diff --git a/Artworks/Themes/Motifs/Flame/1/Distro/5/Syslinux/colors.gpl b/Artworks/Themes/Motifs/Flame/1/Distro/5/Syslinux/colors.gpl new file mode 100644 index 0000000..79fcbfc --- /dev/null +++ b/Artworks/Themes/Motifs/Flame/1/Distro/5/Syslinux/colors.gpl @@ -0,0 +1,20 @@ +GIMP Palette +Name: CentOS-Flame-1-Syslinux +Columns: 16 +# + 16 11 29 100b1d + 23 18 36 171224 + 30 25 43 1e192b + 37 31 50 251f32 + 46 41 60 2e293c + 59 54 74 3b364a + 75 69 88 4b4558 +255 255 255 ffffff + 91 84 101 5b5465 +106 99 116 6a6374 +120 114 131 787283 +135 131 148 878394 +150 147 164 9693a4 +164 161 177 a4a1b1 +177 174 191 b1aebf +192 189 206 c0bdce diff --git a/Artworks/Themes/Motifs/Flame/1/Palettes/grub.gpl b/Artworks/Themes/Motifs/Flame/1/Palettes/grub.gpl deleted file mode 100644 index 4aa6028..0000000 --- a/Artworks/Themes/Motifs/Flame/1/Palettes/grub.gpl +++ /dev/null @@ -1,18 +0,0 @@ -GIMP Palette -Name: CentOS-Flame-1-Grub -Columns: 14 -# - 17 5 13 11050d - 18 11 22 120b16 - 22 16 26 16101a - 30 20 30 1e141e - 35 25 35 231923 - 41 34 43 29222b - 53 48 57 353039 - 69 63 73 453f49 - 92 86 96 5c5660 -117 111 121 756f79 -139 133 143 8b858f -161 158 162 a19ea2 -183 181 185 b7b5b9 -246 247 245 f6f7f5 diff --git a/Artworks/Themes/Motifs/Flame/1/Palettes/syslinux.gpl b/Artworks/Themes/Motifs/Flame/1/Palettes/syslinux.gpl deleted file mode 100644 index 79fcbfc..0000000 --- a/Artworks/Themes/Motifs/Flame/1/Palettes/syslinux.gpl +++ /dev/null @@ -1,20 +0,0 @@ -GIMP Palette -Name: CentOS-Flame-1-Syslinux -Columns: 16 -# - 16 11 29 100b1d - 23 18 36 171224 - 30 25 43 1e192b - 37 31 50 251f32 - 46 41 60 2e293c - 59 54 74 3b364a - 75 69 88 4b4558 -255 255 255 ffffff - 91 84 101 5b5465 -106 99 116 6a6374 -120 114 131 787283 -135 131 148 878394 -150 147 164 9693a4 -164 161 177 a4a1b1 -177 174 191 b1aebf -192 189 206 c0bdce diff --git a/Artworks/Themes/Motifs/Modern/2/Distro/5/Grub/colors.gpl b/Artworks/Themes/Motifs/Modern/2/Distro/5/Grub/colors.gpl new file mode 100644 index 0000000..3cdcbce --- /dev/null +++ b/Artworks/Themes/Motifs/Modern/2/Distro/5/Grub/colors.gpl @@ -0,0 +1,18 @@ +GIMP Palette +Name: Modern-2-Grub +Columns: 14 +# + 2 11 77 020b4d + 0 16 86 001056 + 2 21 93 02155d + 0 26 95 001a5f + 4 32 103 042067 + 6 40 110 06286e + 10 47 119 0a2f77 + 12 56 128 0c3880 + 20 68 140 14448c + 31 81 152 1f5198 + 38 90 159 265a9f + 51 101 168 3365a8 + 70 118 179 4676b3 + 89 132 188 5984bc diff --git a/Artworks/Themes/Motifs/Modern/2/Palettes/grub.gpl b/Artworks/Themes/Motifs/Modern/2/Palettes/grub.gpl deleted file mode 100644 index 3cdcbce..0000000 --- a/Artworks/Themes/Motifs/Modern/2/Palettes/grub.gpl +++ /dev/null @@ -1,18 +0,0 @@ -GIMP Palette -Name: Modern-2-Grub -Columns: 14 -# - 2 11 77 020b4d - 0 16 86 001056 - 2 21 93 02155d - 0 26 95 001a5f - 4 32 103 042067 - 6 40 110 06286e - 10 47 119 0a2f77 - 12 56 128 0c3880 - 20 68 140 14448c - 31 81 152 1f5198 - 38 90 159 265a9f - 51 101 168 3365a8 - 70 118 179 4676b3 - 89 132 188 5984bc diff --git a/Artworks/Webenv/Docbook/1.69.1/Css/base.css b/Artworks/Webenv/Docbook/1.69.1/Css/base.css index 0e43cd5..750af7b 100755 --- a/Artworks/Webenv/Docbook/1.69.1/Css/base.css +++ b/Artworks/Webenv/Docbook/1.69.1/Css/base.css @@ -40,6 +40,10 @@ div.example pre { margin: 0; } +pre { + border-radius: 5px; + } + div.titlepage h3.title { font-size: 1.4em; } diff --git a/Artworks/Webenv/Docbook/1.69.1/Css/headings.css b/Artworks/Webenv/Docbook/1.69.1/Css/headings.css index 2a3c298..869150d 100755 --- a/Artworks/Webenv/Docbook/1.69.1/Css/headings.css +++ b/Artworks/Webenv/Docbook/1.69.1/Css/headings.css @@ -83,12 +83,19 @@ div.section > div.titlepage h4.title { font-size: 1.2em; } +div.refnamediv { + padding-top: 1.5em; + +} + div.refentry div.refnamediv h2 span { font-family: "DejaVuLG Mono", monospace } div.refentry div.refsynopsisdiv h2, -div.refentry div.refsection h2 { +div.refnamediv h2, +div.refentry div.refsection h2, +div.refsect1 h2 { border-bottom: 1px solid #DADADA; } diff --git a/Artworks/Webenv/Docbook/1.69.1/Css/lists.css b/Artworks/Webenv/Docbook/1.69.1/Css/lists.css index 15a6ff0..0bf4d2c 100755 --- a/Artworks/Webenv/Docbook/1.69.1/Css/lists.css +++ b/Artworks/Webenv/Docbook/1.69.1/Css/lists.css @@ -23,9 +23,7 @@ */ ul { - /* - list-style: url("/home/centos/Projects/artwork/trunk/Identity/Images/Webenv/ul.png") disc; - */ + list-style: url("../Images/ul.png") disc; } span.term { @@ -59,6 +57,10 @@ span.term { margin: 0.3em 0 0.3em 0; } +.toc dl dd { + margin-bottom: 0; + } + .toc p, .list-of-figures p, .list-of-examples p, diff --git a/Artworks/Webenv/Docbook/1.69.1/Css/paragraphs.css b/Artworks/Webenv/Docbook/1.69.1/Css/paragraphs.css index 024d0f3..151cf9e 100755 --- a/Artworks/Webenv/Docbook/1.69.1/Css/paragraphs.css +++ b/Artworks/Webenv/Docbook/1.69.1/Css/paragraphs.css @@ -26,6 +26,8 @@ p { text-align:justify; } +.author p { margin: 0.3em 0 0.3em 0; } + .footnote:hover { background-color: #EEE; cursor: help; diff --git a/Artworks/Webenv/Docbook/1.69.1/Css/reset.css b/Artworks/Webenv/Docbook/1.69.1/Css/reset.css new file mode 100755 index 0000000..56752d7 --- /dev/null +++ b/Artworks/Webenv/Docbook/1.69.1/Css/reset.css @@ -0,0 +1,353 @@ +/* + * default.css -- This file resets the browser's default visual style + * and sets The CentOS Web Environment visual style as default visual + * style. This file sets default values to tags like `html', `body', + * as well as those controlling links, tables, paragrphs, headings, + * lists, forms and quotation. + * + * The CentOS Web Environment (Webenv) is specially conceived to + * achieve one unique visual style and easy navegation through all + * different web applications The CentOS Project uses to show its + * existence in the World Wide Web medium. + * + * Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG + * + * This CSS 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 CSS 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. + * + * ------------------------------------------------------------------- + * $Id$ + * ------------------------------------------------------------------- + */ + + +/* Reset browsers default margins and paddings +-----------------------------------------------*/ + +* { + margin: 0; + padding: 0; + } + +/* Define html +-----------------------------------------------*/ + +html { + background-color: #FFF; + background-image: url("../Images/html-bg.png"); + } + +/* Define body +-----------------------------------------------*/ + +body { + font-family: "DejaVu Sans", "Liberation Sans", sans-serif; + font-size: 0.85em; + /* margin: 0; /* <- full screen */ + /* margin: 0 1% 0 1%; /* <- with 1% of left and right margin */ + /* margin: 0 2% 0 2%; /* <- with 2% of left and right margin */ + margin: 0 30px 0 30px; /* <- with 30px of left and right margin */ + /* margin: 0 10% 0 10%; /* <- with 10% of left and right margin */ + color: #000; + } + +/* Links +-----------------------------------------------*/ + +a:link { text-decoration: none; color: #0044B3; } +a:hover { text-decoration: underline; color: green; } +a:active { text-decoration: underline; color: green; } +a:visited { text-decoration: none; color: #0044B3; } +a:visited:hover { text-decoration: underline; color: green; } + +.title, +.title a:link, +.title a:active, +.title a:hover, +.title a:visited, +.title a:visited:hover { + /* color: #072B61; */ + color: #000000; + } + +/* Headings +-----------------------------------------------*/ + +h1 { + font-size: 2em; + line-height: 1.5em; + } + +h2 { + font-size: 1.5em; + line-height: 1.5em; + margin-top: 1.5em; + } + +h3 { + font-size: 1.2em; + line-height: 1.2em; + margin-top: 1.2em; + } + +h4 { + font-size: 1.2em; + line-height: 1.2em; + margin-top: 1.2em; + } + +h5 { + font-size: 1.1em; + line-height: 1.1em; + margin-top: 1.1em; + } + +h6 { + font-size: 1em; + line-height: 1em; + margin-top: 1em; + } + +/* Paragraphs +-----------------------------------------------*/ + +p { + margin: 1em 0 1.5em 0; + line-height: 1.5em; + } + +/* Images +-----------------------------------------------*/ + +img { + border: none; + } + +/* Quotations +-----------------------------------------------*/ + +blockquote { + background: #fafafa; + border-color: #eeeeee; + border-width: 1px; + border-style: solid; + border-left-width: 4px; + margin-left: 1.5em; + padding: 0.5em; + margin-top: 1em; + margin-bottom: 1.3em; + } + +q:before { + content: " “"; + } + +q:after { + content: "” "; + } + +q q:before { + content: " ‘"; + } + +q q:after { + content: "’ "; + } + +address { + margin-left: 1.5em; + } + +/* Preformatted Texts +-----------------------------------------------*/ + +pre { + font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; + padding: 0.7em 1em; + margin: 1em 0 1.5em 0; + white-space: pre; + border-width: 1px; + border-style: solid; + border-color: #E5E5E5; + border-left-width: 5px; + background: #FFFAE9; + overflow: auto; + } + +/* Phrase Elements +-----------------------------------------------*/ + +tt, +samp, +kbd, +code { + font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; + white-space: nowrap; + } + +/* Page Lines +-----------------------------------------------*/ + +hr { + clear: both; + height: 1px ! important; + border: none; + background-color: #DADADA; + } + +/* Lists +-----------------------------------------------*/ + +ul, +ol, +dl { + margin: 1.5em 0 1.5em 2.5em; + text-align:justify; + } + +ul { + list-style: disc; + } + +ol { + list-style-image: none !important; + } + +ul li, +ol li { + line-height: 1.5em; + padding-bottom: 1em; + } + +ul ul, +ul ol, +ol ul, +ol ol { + margin-top: 0.3em; + margin-bottom: 0.3em; + } + +ul li p, +ol li p { + margin-bottom: 0.3em; + } + +dl dd { + line-height: 1.5em; + margin-left: 2.5em; + margin-bottom: 1.5em; + } + +dl ol, +dl ul { + margin-left: 3.5em; + } + +/* Tables +-----------------------------------------------*/ + +table { + border-collapse: collapse; + } + +table caption { + font-style: italic; + text-align: center; + } + +table tr th { + font-weight: bold; + } + +table tr td, +table tr th { + border: 1pt; + border-style: solid; + border-color: #CCC; + padding: 0.5em; + vertical-align: top; + } + +table tr td p, +table tr td pre { + margin: 0; + padding: 0; + } + +/* Forms +-----------------------------------------------*/ + +form { + display: inline; + } + +input[type="submit"], +input[type="button"] { + padding: 1px; + display: inline; + text-decoration: none; + } + +input[type="text"], +input[type="password"], +textarea { + display: inline; + padding: 2px; + } + +select { + display: inline; + padding: 1px; + } + +form p { + display: inline; + margin-left: 5px; + margin-right: 5px; + } + +/* Select +---------------------------------------- */ + +select option { + padding-left: 3px; + padding-right: 3px; + } + +select optgroup { + font-style: normal; + font-weight: bold; + padding-left: 3px; + } + +select optgroup option { + margin-left: 1em; + } + +input[type="radio"], +input[type="checkbox"] { + vertical-align: middle; + } + +fieldset { + margin: 1em 0 1em 0; + padding: 1em; + padding-bottom: 5px; + border: 1px solid #AAA; + } + +fieldset legend { + font-weight: bold; + color: #AAA; + } diff --git a/Artworks/Webenv/Docbook/1.69.1/Css/tables.css b/Artworks/Webenv/Docbook/1.69.1/Css/tables.css index 5d2f8ac..b296219 100755 --- a/Artworks/Webenv/Docbook/1.69.1/Css/tables.css +++ b/Artworks/Webenv/Docbook/1.69.1/Css/tables.css @@ -25,6 +25,10 @@ /* Revision History -----------------------------------------------*/ +div.revhistory { + margin-top: 1em; + } + div.revhistory table th, div.revhistory table td { font-size: x-small; diff --git a/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2manpage.xsl b/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2manpage.xsl new file mode 100755 index 0000000..2e4aafb --- /dev/null +++ b/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2manpage.xsl @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-chunks.xsl b/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-chunks.xsl index 20f1cac..818a9c8 100755 --- a/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-chunks.xsl +++ b/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-chunks.xsl @@ -1,6 +1,3 @@ - @@ -11,7 +8,13 @@ $Id$ at: /usr/share/doc/docbook-style-xsl-1.69.1/doc/html/index.html --> - + Css/stylesheet.css + + + + + + Images/ - - - diff --git a/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-common.xsl b/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-common.xsl deleted file mode 100755 index 810ef4e..0000000 --- a/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-common.xsl +++ /dev/null @@ -1,19 +0,0 @@ - - - - Css/stylesheet.css - - - - - - - Images/ - - diff --git a/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-single.xsl b/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-single.xsl index 463b771..c0415b6 100755 --- a/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-single.xsl +++ b/Artworks/Webenv/Docbook/1.69.1/Xsl/docbook2xhtml-single.xsl @@ -1,6 +1,3 @@ - @@ -11,6 +8,10 @@ $Id$ at: /usr/share/doc/docbook-style-xsl-1.69.1/doc/html/index.html --> - + Css/stylesheet.css + + + + Images/ diff --git a/Automation/Manuals/centos-art.sh-locale.asciidoc b/Automation/Manuals/centos-art.sh-locale.asciidoc new file mode 100644 index 0000000..0850f63 --- /dev/null +++ b/Automation/Manuals/centos-art.sh-locale.asciidoc @@ -0,0 +1,41 @@ +centos-art.sh-locale(1) +======================= + +Name +---- +centos-art.sh-locale - hello + +Synopsis +-------- +centos-art.sh locale DIRECTORY [OPTIONS] + +Description +----------- + +hi + +Author +------ + +Written by Alain Reguera Delgado + +Copyright +--------- + +Copyright (C) 2009-2013 The CentOS Project + +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. + +// vim: set syntax=asciidoc: diff --git a/Automation/Manuals/centos-art.sh-prepare.asciidoc b/Automation/Manuals/centos-art.sh-prepare.asciidoc new file mode 100644 index 0000000..ded126c --- /dev/null +++ b/Automation/Manuals/centos-art.sh-prepare.asciidoc @@ -0,0 +1,76 @@ +centos-art.sh-prepare.(1) +========================= + +Name +---- + +centos-art.sh-prepare - Standardize configuration tasks. + +Synopsis +-------- + +centos-art.sh prepare [OPTIONS] + +Description +----------- + +The *prepare* module of *centos-art.sh* script helps you to prepare +the workstation for using the working copy of CentOS artwork +repository. It assumes you've already installed the CentOS +distribution in your workstation and downloaded a working copy of +CentOS artwork repository into it. + +Options +------- +The *prepare* module has the following options: + +*--help*:: + This option shows the module's documentation (this page). +*--version*:: + This option shows the module's name and version. +*--yes*:: + This option assumes yes to all questions. +*--quiet*:: + This option suppresses all outputs except script's errors. +*--packages*:: + This option verifies whether or not required packages are + installed in the workstation. When required packages are not + installed in the workstation, the *prepare* module executes the + *yum install* command through *sudo* to install the required + packages. +*--repository*:: + This option calls the *render* module of *centos-art.sh* script + and produces content for all configuration (+render.conf+) files + found inside the repository. This option produces images, + documentation and internal links inside the repository and outside + it (e.g., to link GIMP's components produced in the repository + from GIMP's search path). + +Reporting Bugs +-------------- +Report bugs on the *automation* category of *centos-artwork* project +at the https://centos.org.cu/bugs/[The CentOS Bugs] website. + +Author +------ +Written by mailto:al@centos.org.cu[Alain Reguera Delgado] + +Copyright +--------- +Copyright (C) 2013 The CentOS Project + +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. + +// vim: set syntax=asciidoc: diff --git a/Automation/Manuals/centos-art.sh-render.asciidoc b/Automation/Manuals/centos-art.sh-render.asciidoc new file mode 100644 index 0000000..bf3924c --- /dev/null +++ b/Automation/Manuals/centos-art.sh-render.asciidoc @@ -0,0 +1,687 @@ +centos-art.sh-render(1) +======================= + +Name +---- + +centos-art.sh-render - Standardize production tasks based on +configuration files. + +Synopsis +-------- + ++centos-art.sh render [OPTIONS] [DIRECTORY ...]+ + +Description +----------- + +When you execute the *render* module, it looks for configuration files +inside the +DIRECTORY+ specified in the command-line and processes +them in the order they were found. When no +DIRECTORY+ is specified to +*centos-art.sh* script, the *render* module looks for configuration +files inside the current directory it was executed from. If no +configuration file is found, the *render* module will end its +execution with an error message. + +Options +------- + +The *render* module accepts the following options: + +*--help*:: + This option shows the *render* module's documentation (this page). +*--version*:: + This option shows the *render* module's name and version. +*--filter="REGEX"*:: + This option reduces the number of section blocks inside + configuration files the *render* module will take for processing. + +REGEX+ is a regular expression pattern matching one or more + section names inside the configuration files found under + +DIRECTORY+. + +Configuration Files +------------------- + +The configuration files are regular files with the +.conf+ extension. +The name of configuration files is frequently chosen for helping you +to remember what the configuration files are for and, in some cases, +for producing section blocks in specific order. + +The format used in configuration files use section blocks in the form ++[section-name]+. Each section block ends when the next section block +begins or at the end of the file. Section blocks contain one or more +variable definitions in the form +option = "value"+. In the specific +case of *render* module, the +section-name+ is an alphanumeric value +and points to the final file or directory you want to save the +processing results in. The configuration variables describe how to +produce the file or directory specified as +section-name+. Name +values in the +section-name+ don't accept variables or any kind of +expansion in it, but configuration values do. Commentaries are +introduced by using the +#+ character at the beginning of lines. +Commentaries defined this way are excluded from processing so you can +use them freely. + +The configuration files are processed from top to bottom. This is very +important aspect to consider in situations where you need to grantee +an specific content production priority inside a configuration file +(e.g., you have several files in a configuration file and need to +produce some of them before others). So, section blocks set first in +the configuration file are processed first and section blocks set +later are processed later. + +The configuration files can be divided in separated configuration +files to produce section blocks with an specific priority. For +example, if you have the file +render.conf+, you can divide its +content in +render-1.conf+, +render-2.conf+ to produce section blocks +inside +render-1.conf+ first and +render-2.conf+ later. This sort of +division is very useful when the configuration file begins to grow, or +you want to control the order in which specific groups of files are +produced inside +DIRECTORY+. + +To describe final files production, the *render* module's accepts the +following configuration variables inside configuration files: + +*render-type*:: + Optional. This variable specifies the sort of content rendition + the *render* module will perform. This variable can take one of + the following values: +archive+, +asciidoc+, +compress+, +direct+, + +palette+, and +svg+. When this variable is not present in the + configuration file or has not a value set, the *render* module + tries to determine the sort of rendition to perform based on the + first file path passed through *render-from* variable. +*render-from*:: + Required. This variable specifies the file name of the source file + (design model) used to produce the final file specified in the + section line. This option can receive absolute paths and relative + paths. Absolute paths begin with a slash (+/+) character while + relative paths begin with the dot slash (+./+) characters or no + character at all. +*locale-from*:: + Optional. This variable specifies the absolute path to the + +messages.po+ file used as reference to produce localized versions + of the final files. ++ +When this variable is provided, the files you specified in the +*render-from* variable must be XML-based files (e.g., SVG, DocBook). +The localization of source files will take place when the current +locale information of your terminal session is different to English +(e.g., +LANG=es_ES.UTF-8+). ++ +Localized versions of the final file will be stored in a +locale-specific directory placed at the same level of the related +configuration file. ++ +This variable accepts more than one value. If you pass more than one +translation file through *locale-from* variable, the first file in the +list will always contain the source file translatable strings and the +rest will be considered as shared translations files. Example of +shared translation files include files containing licenses +translations. Shared translation files won't be initiated or updated +by *render* module. ++ +To initiate new +messages.po+ files or update existent ones, you need +to use the *locale* module of *centos-art.sh* script. + +[[using-paths]] +Using Paths +~~~~~~~~~~~ + +When you provide absolute paths inside configuration files, there +isn't confusion about the location where the file is or should be. +However, it introduces rigidity to directory structures inside the +working copy when it is necessary to move directories from one place +to another inside the working copy. To eliminate this mobility +restrictions, relative paths can be used to create modular directory +structures. + +When you use relative paths inside configuration files, paths are +relative to the location where the configuration file is stored in. +This way it is possible to move whole directory structures without +touching the configuration file and still have a render-able +structures inside the working copy. However, relative paths get +limited in situations where the production process needs files outside +the directory where the configuration file is stored in. In such +cases, a combination of relative and absolute paths is the solution to +apply. + +When we need to use absolute paths to several files in the same +directory (e.g., we are combining them all to produce a new image) but +outside the current directory the configuration file is stored in, it +is possible to use a list of absolute paths one beside another +separated by space or we can use path expansion which is shorter and +easier to read. Path expansion is interpreted when you enclose a list +of file names in curly brackets using comma as separator without +spaces (e.g., +/some/dir/{file1,file2,file3}+). In order for path +expansion to work correctly, all the file names you put inside the +curly brackets' list must exist in the location specified first. + +[[using-environment-variables]] +Using Environment Variables +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The configuration files let you to use environment variables inside +them. This might be very useful in situation where you need to provide +absolute paths based on specific information (e.g., the current locale +information). Some of the most important environment variables used +by *centos-art.sh* script -and its configuration files- are described +below: + ++TCAR_BASEDIR+:: + This variable contains the absolute path to your repository's + working copy. The value of this variable is defined as read-only + inside *centos-art.sh* script and cannot be modified later. As a + matter of convenience, users make use of their +~/.bash_profile+ + file to define this variable there and, this way, skip the + sometimes annoyance absolute path questioning the *centos-art.sh* + script does in order to know the absolute path of the working copy + it is going to work with. ++ +Whenever you set absolute paths inside configuration files to refer +locations inside your working copy, it is necessary that you use the ++TCAR_BASEDIR+ environment variable in front of each path definition +you set. + ++LANG+:: + This variable contains the environment's current locale + information. + ++TCAR_SCRIPT_LANG_LL+:: + This variable contains the language part of the current locale + information. For instance, if the current locale is + ``en_US.UTF-8'', the value of this variable would be ``en''. + ++TCAR_SCRIPT_LANG_CC+:: + This variable contains the country part of the current locale + information. For instance, if the current locale is + ``en_US.UTF-8'', the value of this variable would be ``US''. + ++TCAR_SCRIPT_LANG_LC+:: + This variable contains the current locale information in ll_CC + format (e.g., es_ES). + ++HOME+:: + This variable contains the absolute path to current user's home + directory. The value of this variable is set by the operating + system when the user opens a terminal session. ++ +Whenever you need to set user-specific absolute paths inside +configuration files, use this variable. + +[[rendering-files-directly]] +Rendering Image Files From Other Image Files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To render image files from other image files, the *render-type* +variable must be set to ``images'' and one or more image files must be +provided in the *render-from* variable. When the *render* module finds +a section block with this characteristics, it applies the value of +*command* variable to all files found in *render-from* variable to +produce the final file specified in the section name. + +When the *command* variable is not specified, the ``/usr/bin/convert +-append'' command is used as default. This command takes all the +images passed through *render-from* and appends them from top to +bottom and saves the result in the file you specified in the section +name. When you render files this way, the order in which you define +source files through *render-from* may affect the final result based +in the *command* you provided. + +The ``images'' rendition type provides an interface for external image +manipulation programs, like ImageMagick and NetPbm. You can use these +programs to manipulate images in great detail through the +command-line. + +[[rendering-archives]] +Rendering Archives +~~~~~~~~~~~~~~~~~~ + +When the *render-type* variable is set to +archive+, the *render* +module takes the list of files set through *render-from* variable and +applies the value of *command* to them all in order to produce the +final file specified in the section line. When the command variable is +not specified, the +/bin/tar --remove-files -czf+ command is used as +default. + +[[rendering-image-files]] +Rendering Image Files +~~~~~~~~~~~~~~~~~~~~~ + +When the *render-type* variable is set to +svg+, the section block is +interpreted for rendering image files. When rendering image files, the +*render-from* variable must point to a SVG files (either compressed or +uncompressed). The following following complementary variables are +also accepted: + +*render-flow*:: + Optional. This variable specifies the rendition flow to follow + when transforming SVG files into PNG images. This variable can + take either +base+ or +extended+ as value. The +base+ rendition + flow takes one SVG file and produces just one PNG image for it. + The +extended+ value applies the +base+ rendition flow and then + transform the final PNG image to different heights, formats, + foreground colors and background colors. By default, when this + variable is not set, the +base+ rendition flow is used. +*export-id*:: + Optional. This variable specifies the export id you want to use as + reference to produce PNG images from SVG files. The export-id is + an attribute you specified as unique value to an objects inside + the SVG file in order to export that object only but not the rest + in the SVG file. If this variable is not provided or it is empty, + the drawing area of the SVG file is used as reference to produce + the final PNG image. +*heights*:: + Optional. This variable is available only for +extended+ rendition + flow and specifies the different image heights you want to create + copies of the final PNG image. The values specified in this + variable are separated by white space and should be understandable + by ImageMagick tool set. When this variable is not provided, the + *render* module will create copies of final PNG image for several + standard heights. +*formats*:: + Optional. This variable is available only for +extended+ rendition + flow and specifies the different image formats you want to create + copies of the final PNG image. The values specified in this + variable are separated by white space and should be supported by + ImageMagick tool set. When this variable is not provided or set + in the configuration file, the *render* module will create copies + of final PNG image for several standard formats. ++ +[TIP] +To see the list of possible image formats supported by ImageMagick +tool set, run the following command: *+identify -list format+*. + +*fgcolors*:: + Optional. This variable is available only for +extended+ rendition + flow and specifies the different foreground colors you want to + create copies of the final PNG image. To do this, the image you + want to copy should be rendered with black color (000000) so the + color replacement can be performed. The values specified in this + variable are separated by white space and should be understandable + by ImageMagick tool set. When this variable is not provided the + black foreground (+000000+) is used. +*bgcolors*:: + Optional. This variable is available only for +extended+ rendition + flow and specifies the different background colors you want to + create copies of the final PNG image. This variable uses + Inkscape's _--export-background_ and _--export-background-opacity_ + options to control the background information of final PNG images. + Possible values to this variable take the form +XXXXXX-X+, where + the first six +X+ represent a color in hexadecimal format and the + final +X+ might be 1 or 0. 1 for full opacity and 0 for full + transparency. Intermediate values between 0 and 1 (e.g., 0.55) + can be given to control the background opacity. When this variable + is not provided, white background full transparency (+ffffff-0+) + is used as default value. +*command*:: + Optional. This variable specifies the command used to modify the + production of final images. During the rendition process, images + are produced inside a temporal directory, and later moved to its + final location using the command specified as value in this + variable. When this variable is not specified, it can take one of + two values based on the amount of files passed through + *render-from* variable. When just one file is passed through the + *render-from* variable, the default value for this variable is + +/bin/cp+, but when there are reference to more than one file, the + value of this option is +/usr/bin/convert +append+ which combines + all images into the final images. +*comment*:: + Optional. This variable contains a sentence describing the image + you are creating. This information is written in the +comment+ + field of PNG images. When this variable is empty, no comment + information will be written to the final PNG image files. +*brand*:: + Optional. This variable describes the branding information applied + to final images. The value of this variable has the form + +FILENAME:GEOMETRY+, where +FILENAME+ is the absolute path to the + PNG image you want to apply as brand and, +GEOMETRY+ takes the + form +xHEIGHT+X+Y+. In order to apply brand information to final + images correctly, the brand images files you want to apply must be + available. In case they don't exist the *render* module ends its + execution with an error message. + +[[rendering-images-with-reduced-number-of-colros]] +Rendering Images With Reduced Number Of Colors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When the *render-type* variable is set to +palette+, the section block +where this variable was defined is interpreted for producing images +with a reduced number of colors. In these cases, the *render-from* +variable must point to an image file. The following complementary +variables are also accepted: + +*palette-gpl*:: + Required. This variable addresses the palette of colors that will + be use for reducing colors. Generally, the palette of color file + ends with the +.gpl+ extension and is stored in the same directory + of the configuration file. This file can be produced by GIMP and + provides an optimized set of colors for the specific image you + provided in the *render-from* variable. ++ +To find the optimized set of colors, you need to open the image +specified in *render-from* in GIMP, reduce its colors to the desired +number using GIMP's Indexed feature and, then, create a new palette by +importing it from the indexed image file. Once you have the palette +this way, you need to edit it using the Palettes dialog to add the +hexadecimal value of each color in the palette to the comment field, +so you have a palette file similar to the following: ++ +---------------------------------------------------------------------- +GIMP Palette +Name: Syslinux-Default +Columns: 16 +# + 32 76 141 204c8d + 37 82 146 255292 + 52 94 153 345e99 + 73 110 162 496ea2 + 91 124 172 5b7cac +108 136 180 6c88b4 +120 146 186 7892ba +131 158 193 839ec1 +255 255 255 ffffff +146 170 200 92aac8 +162 182 209 a2b6d1 +183 199 219 b7c7db +204 216 230 ccd8e6 +221 229 238 dde5ee +235 241 245 ebf1f5 +246 251 254 f6fbfe +---------------------------------------------------------------------- ++ +{asciidoc-br} ++ +Now that the palette has been created, you can set a path to +*palette-gpl* variable. Even you can set path of *palette-gpl* from +GIMP's palettes directory (+~/.gimp-x.x/palettes/+), it is much more +preferable that you copy the palette file from that location to the +configuration file's DIRECTORY inside the repository and put it under +version control, so others can take benefit of it. The palette file +is an integral part of color specific image reduction so it must be +near the configuration file you use for such actions. + +Rendering Documentation Files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To render documentation files, the *render-type* variable must be set +to ``asciidoc'' and the *render-from* variable must point to an +Asciidoc file. When the *render* module finds this information in a +section block, it takes the asciidoc file as source and transforms it +into a docbook file using the *asciidoc* program. The docbook file is +created temporarily for further format transformations and removed +later, once the final format has been rendered. + +When the *render* module creates the intermediate docbook file, it +considers the current locale information of your environment (e.g., by +reading the LANG environment variable). In case the current locale +information is different to English (e.g., the value of LANG +environment variable doesn't begin with the ``en'' characters), the +docbook file will be localized based on the translation file specified +in the *locale-from* variable, before applying further format +transformations to it. This way, further format transformations from +the temporarily docbook file will end up being localized as well. If +the *locale-from* variable is not present in the section block, the +intermediate docbook file won't be localized which make the final +result to be not localized either. + +When you set the *render-type* variable to ``asciidoc'', the section +blocks need to have the *render-flow* variable set to ``article'', +``book'' or ``manpage''. This information defines the way the +intermediate docbook file is produced from the asciidoc file and, by +extension, the possible final results, too. + +When *render-flow* variable is set to ``article'' or ``book'', it is +possible to produce final files in ``xhtml'' format but not in +``manpage'' format. This is because man pages require a specific +document structure that both articles and books don't need to have. +When producing articles and books in XHTML format, you can use the +*render-page* variable to control whether to produce the entire book +or article in just one file (``single'') or in separate files linked +one another (``chunks''). + +When *render-flow* variable is set to ``manpage'' it is possible to +set the *formats* variable to either ``manpage'' or ``xhtml'' in order +to render the docbook file as man page or XHTML format, respectively. +The final files produced this way are stored in the +man${MANSECT}/+ +or +htmlman${MANSECT}+ directories based on the format you choose. If +you are producing man pages to a language different to English, these +directories would be +${LANG}/man${MANSECT}/+ and ++${LANG}/htmlman${MANSECT}+, instead. The structure of these paths is +required in order for *man* command to find the man pages in different +locales. The value of the man's volume section can be set using the +*mansect* variable. If this variable is not set, the value of man's +volume section will be 1. + +When *render-flow* variable is not set, the ``article'' value is used +as default value. + +When the *formats* variable has the ``xhtml'' value, you need to set +the *images-from* and *styles-from* variables inside the related +section block, no matter what the value of *render-flow* would be. The +value of *images-from* and *styles-from* variables must point to a +directory, inside the working copy, containing the share images and +CSS files used by XHTML documents, respectively. If none of these two +variables are set the directories ++${TCAR_BASEDIR}/Artworks/Icons/Webenv+ and ++${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css+ will be used for +them. + +When the *formats* variable is not set, the ``xhtml'' value is used as +default value. + +Localization Files +------------------ + +When the current locale code you are using in your terminal's session +is not English, the *render* module uses localization files specified +by *locale-from* variable to produce final versions of source files +for your current locale information. Localization files are created +and edited through *locale* module. Thus, in order for you to produce +localized content you need to create the localization files through +*locale* module first and then run the *render* module. + +To know more about localization files, see *locale* module's +documentation. + +Examples +-------- + +Here are some practical configuration examples you can use as +reference to create your own configuration files. + +---------------------------------------------------------------------- +[Xhtml-single] +render-type = "asciidoc" +render-flow = "article" +render-from = "corporate.asciidoc" +locale-from = "${TCAR_SCRIPT_LANG_LC}/messages.po" +images-from = "${TCAR_BASEDIR}/Artworks/Icons/Webenv" +styles-from = "${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css" +formats = "xhtml" +render-page = "single" +---------------------------------------------------------------------- + +{asciidoc-br} + +When the *render* module reads this configuration file, it initiates +the +asscidoc+ module which in turn initiates the +xhtml+ module for +transforming the +corporate.asciidoc+ file into +corporate.docbook+ file +using +article+ as document type and ++${TCAR_SCRIPT_LANG_LC}/messages.po+ as source for localization. As +result, the *render* module produces the ++${TCAR_SCRIPTS_LANG_LC}/Xhtml-single/index.html+ file, using the same +directory of the configuration file as base directory. + +---------------------------------------------------------------------- +[centos-artwork.png] +render-from = "${TCAR_BASEDIR}/Artworks/Brands/Types/Webenv/centos.org/{centos,artwork}.svgz" +formats = "xpm pdf jpg tif" +heights = "16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" +fgcolors = "000000 ffffff" +bgcolors = "ffffff-0" +command = "/usr/bin/convert +append" +---------------------------------------------------------------------- + +{asciidoc-br} + +When the *render* module reads this configuration file, it takes the ++centos.svgz+ and +artwork.svgz+ files as source to produce the ++centos.png+ and +artwork.png+ files considering the first value in +the list of heights, background, foreground colors specified in the +configuration file. Then, it combines the results horizontally to +create the +centos-artwork.png+ file. Later, the +centos-artwork.png+ +file is converted to produce one image file for each image format +specified in the configuration file. At this point, all the process +repeats again but for the next height and color values in the list. + +{asciidoc-br} + +---------------------------------------------------------------------- +[syslinux-splash.png] +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Syslinux/syslinux-splash.svgz" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Default/Images/ffffff/ffffff-0/48/centos.png:x48+20+232" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Types/Numbers/Images/ffffff/ffffff-0/96/5.png:x96+300+184" + +[syslinux-splash.lss] +render-from = "syslinux-splash.png" +render-type = "palette" +palette-gpl = "colors.gpl" +---------------------------------------------------------------------- + +{asciidoc-br} + +When the *render* module reads this configuration file, + +---------------------------------------------------------------------- +[screenshot.png] +render-type = "svg" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/screenshot.svgz" +render-flow = "base" +brand = "${TCAR_BASEDIR}/Artworks/Brands/Symbols/Default/Images/ffffff/ffffff-0/16/centos.png:x16+5+5" + +[800x600.tar.gz] +render-type = "archive" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/800x600-final.png:background.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.desktop" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.xml" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-language.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-reboot.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-session.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-shutdown.png" +render-from = "screenshot.png" +command = "/bin/tar -czf" + +[1360x768.tar.gz] +render-type = "archive" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Motifs/${MOTIF}/Backgrounds/Images/1360x768-final.png:background.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.desktop" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/GdmGreeterTheme.xml" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-language.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-reboot.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-session.png" +render-from = "${TCAR_BASEDIR}/Artworks/Themes/Models/Distro/5/Gdm/icon-shutdown.png" +render-from = "screenshot.png" +command = "/bin/tar --remove-files -czf" +---------------------------------------------------------------------- + +{asciidoc-br} + +When the *render* module reads this configuration file, + +Bugs +---- + +The *render* module has some issues I would like you to be aware of. +Mainly, to see if you could help me find better solutions for them ;) + +Rendering Images With Reduced Number Of Colors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The process implemented to reduce image colors through GIMP's palettes +involves too much user intervention compared with ImageMagick's +--colors option that reduces image colors instantly without user +intervention. Nevertheless, the procedure of reducing color through +GIMP's palettes provides more quality to final images than +ImageMagic's --colors option does. Also, using GIMP's palettes let us +create LSS images from PNG images using the same exact information we +used to reduce colors on PNG images. This is very important in order +to have the same result in both image types. Because of these reasons +I prefer GIMP's palettes procedure against others methods like it is +the case of ImageMagick's for producing images with reduced number of +colors. + +Rendering PDF Files From Localized Docbook Files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Even it is possible to produce PDF files from Docbook files using +current applications inside CentOS-5, there are some production issues +when we use localized docbook files as source to produce localized PDF +files that made me not to implement them as part of *centos-art.sh* +script by now. + +- When using the XML(DocBook)->XML(FO)->PDF transformation chain, the + result produced by _docbook-style-xsl-1.69.1-5.1_ and + _passivetex-1.25-5.1.1_ doesn't render heading boxes very well on + page's top and page's bottom. The text put inside these boxes seem + to have not enough space in their respective areas. An image showing + this issue is available in the +Manuals/bug-1.png+ directory of + *pdf* module's directory structure. + +- Tried using _dblatex-0.2.8-2.el5_ but didn't work for localized docbook files + (i.e., those who has the +lang="lang"+ string in their root + element). If you just remove the language specification string it + just work. We need the language specification in order for internal + document strings like +Abstract+ and +Table of contents+ to be + automatically translated. When the language specific attribute is + present in the root element, dblatex outputs the following: ++ +---------------------------------------------------------------------- +Build the listings... +XSLT stylesheets DocBook - LaTeX 2e (0.2.8) +=================================================== +Processing Revision History +Build 2912-corporate.docbook.pdf +This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) +entering extended mode +pdflatex failed +/usr/share/texmf/tex/latex/dblatex/docbook.sty:160: No counter 'chapter' defined. +/usr/share/texmf/tex/latex/dblatex/docbook.sty:160: leading text: \newfloat{example}{htb}{loe}[chapter] +/usr/share/texmf/tex/latex/dblatex/docbook.sty:164: No counter 'chapter' defined. +/usr/share/texmf/tex/latex/dblatex/docbook.sty:164: leading text: \newfloat{dbequation}{htb}{loe}[chapter] +2912-corporate.docbook_tmp.tex:62: Illegal parameter number in definition of \@the@H@page. +2912-corporate.docbook_tmp.tex:62: leading text: \maketitle +2912-corporate.docbook_tmp.tex:62: Illegal parameter number in definition of \@the@H@page. +2912-corporate.docbook_tmp.tex:62: leading text: \maketitle +2912-corporate.docbook_tmp.tex:62: Illegal parameter number in definition of \@the@H@page. +2912-corporate.docbook_tmp.tex:62: leading text: \maketitle +Error: pdflatex compilation failed +---------------------------------------------------------------------- + +Reporting Bugs +-------------- +Report bugs on the *automation* category of *centos-artwork* project +at the https://centos.org.cu/bugs/[The CentOS Bugs] website. + +Author +------ +Written by mailto:al@centos.org.cu[Alain Reguera Delgado], 2009-2013 + +Copyright +--------- + +Copyright (C) 2009-2013 The CentOS Project + +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. + +// vim: set syntax=asciidoc: diff --git a/Automation/Manuals/centos-art.sh.asciidoc b/Automation/Manuals/centos-art.sh.asciidoc new file mode 100644 index 0000000..24d1afb --- /dev/null +++ b/Automation/Manuals/centos-art.sh.asciidoc @@ -0,0 +1,270 @@ +centos-art.sh(1) +================ + +Name +---- + +centos-art.sh - The CentOS artwork repository automation tool + +Synopsis +-------- + +*centos-art.sh* [*--help*|*--version*]:: + This command provides information about the script itself. + +*centos-art.sh* *MODULE* [*--help|--version*]:: + This command provides information about the specified module. See + the <> section below to see which modules are + available. + +*centos-art.sh* *MODULE* [*OPTIONS*]:: + This command executes the specified module. Options here are + module-specific. See the <> section below to see which + modules are available. + +Description +----------- + +*centos-art.sh* exists to standardize frequent tasks inside the CentOS +repository. + +When you execute the *centos-art.sh* script in a terminal, it will +request the absolute path where you stored your working copy of CentOS +artwork repository. To avoid the absolute path request every time you +execute the script, you can edit the +~/.bash_profile+ file and +declare the absolute path to your working copy there, as value to +TCAR_BASEDIR variable. + +Once *centos-art.sh* script knows what the absolute path to your +working copy is, it executes the file *centos-art.conf* to load +default values to configuration variables into its execution +environment. After configuration variables have been loaded in the +execution environment, the script looks for supported options in the +first argument. If the options passed are recognized the script +process them. If the options aren't recognized or no option is passed +at all, the *centos-art.sh* script exports common functions and +executes the module specified as first argument, assuming the first +argument is a valid module name of course. Finally, the +*centos-art.sh* script waits for the module environment to conclude +their job and exits, as described in the <> section. + + +[[exit]] +Exit Status +----------- + * 0 -- Exit successfully without errors. + * 1 -- Exit with errors. + +[[modules]] +Modules +------- +From version 0.5, the *centos-art.sh* script was redesigned to +introduce the idea of modules to its base design. Modules are +individual execution environments that may nest themselves one inside +another efficiently to achieve high levels maintainability and +extensibility. This make possible for modules to divide big tasks +into smaller tasks that can be easier to debug, maintain and share +with other modules efficiently (e.g., instead of loading modules all +at once, they are only loaded at demand and unset once they conclude +their execution). + +The following modules are available from the *centos-art.sh* script +command-line: + +*prepare*:: + This module standardizes configuration tasks needed by your + working copy (e.g., verify whether required packages are installed + or not in your workstation, calls render module to produce images + and manuals in the correct order). This is the first task you + should run in your workstation, just after downloading a fresh + working copy of CentOS artwork repository. + +*render*:: + This module standardizes the way content is produced inside the + repository. This function relies on configuration files to do its + work. Whenever you need to produce images, documentation or + localized content this is the module you'll need to use. + +*locale*:: + This module standardizes the way translatable strings are + retrieved from source files and put into portable objects for you + to edit. Portable objects produced by this module are used by + *render* module to produce localized content. Whenever you need + to produce the intermediate files holding the translatable strings + required to produce localized content, use this module. + +*help*:: + This module standardizes they way module's documentation is + retrieved from their respective locations inside the repository. + Use this module whenever you need help about the *centos-art.sh* + script and its modules. + +*tuneup*:: + This module standardizes maintenance tasks frequently run inside + the repository. + +*pack*:: + *Not implemented, yet.* This module standardizes the way RPM + packages are produced from content available in the repository. + When ever you need to produce RPM packages with information + available in the repository, use this module. + +Directory Structure +~~~~~~~~~~~~~~~~~~~ +Inside the repository, modules related to *centos-art.sh* script are +stored in the directory +Automation/Modules/${MODULE_NAME}/+. + +*Modules/*:: + This directory contains module's modules. +*Manuals/*:: + This directory contains module's documentation produced by *help* + module. The structure of this directory looks as follow: ++ +---------------------------------------------------------------------- +Manuals/ +|-- ${LANG}/ +| |-- man${SECTION_NUMBER} +| `-- ${MODULE_NAME}.${SECTION_NUMBER} +`-- man${SECTION_NUMBER} + `-- ${MODULE_NAME}.${SECTION_NUMBER} +---------------------------------------------------------------------- + +*Locales/*:: + This directory contains module's translations produced by *locale* + module. The structure of this directory looks as follow: ++ +---------------------------------------------------------------------- +Locales/ +`-- ${LANG}/ + |-- LC_MESSAGES + | |-- ${MODULE_NAME}.sh.mo + | `-- ${MODULE_NAME}.docbook.mo + |-- ${MODULE_NAME}.sh.po + |-- ${MODULE_NAME}.sh.pot + |-- ${MODULE_NAME}.docbook.po + `-- ${MODULE_NAME}.docbook.pot +---------------------------------------------------------------------- + +*Scripts/*:: + This directory contains function scripts written by module's + writers. Here is where all the tasks the module is useful for are + written and stored in. As convention the following structure is + used: ++ +---------------------------------------------------------------------- +Scripts/ +`-- ${MODULE_NAME}_${FUNCTION_NAME}.sh +---------------------------------------------------------------------- ++ +{asccidoc-br} ++ +Inside each function script, there is a top comment where you should +put the name of the function script, a brief description about what it +does, as well as author and copying information. After the top comment +and separated by one white line, you should define the function +sentence using the long format. ++ +---------------------------------------------------------------------- +#!/bin/bash +###################################################################### +# +# ${MODULE_NAME}_${FUNCTION_NAME}.sh -- ${FUNCTION_DESCRIPTION} +# +# Written by: +# * ${AUTHOR_NAME} <${AUTHOR_EMAIL}>, ${YEARS} +# +# Copyright (C) ${YEAR} The CentOS Project +# +# 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 ${MODULE_NAME}_${FUNCTION_NAME} { + ... +} +---------------------------------------------------------------------- ++ +[NOTE] +If your are planning to contribute a new module to *centos-art.sh* +script, please, consider using the layout described above for all your +function scripts, consistently. + +*$\{MODULE_NAME}.asciidoc*:: + This file contains the module's documentation source. From this + file it is possible to produce the same documentation in other + formats including manpage, html and pdf. Whenever you need to + improve the module's documentation, edit this file. +*$\{MODULE_NAME}.conf*:: + This file contains the module's configuration variables. These + variables are exported to the environment and remain there as long + as the script execution environment is alive. Some variables are + read-only others not. ++ +The configuration file provides explanation about each environment +variable it exports. If you want to know more about what these +variables are, open this file and read the comments near each +variable. + +*$\{MODULE_NAME}.sh*:: + This is the module's initialization script. The first file + executed when the module called from the command-line. This file + provides access to argument parsing and controls how + module-specific function scripts are called. This is the starting + point for writing modules. You can write a complete module using + this file only but, frequently, it is convenient as the module + complexity grows to divide it in smaller pieces (function scripts) + to improve maintainability and error findings. + +Options +------- + +*--help*:: + Display program's help (this page). + +*--version*:: + Display program's name and version. + +Bugs +---- +The module *pack* isn't implemented yet. + +Reporting Bugs +-------------- +Report bugs inside the *automation* category of *centos-artwork* +project, at the https://centos.org.cu/bugs/[The CentOS Bugs] website. + +Author +------ +Written by mailto:al@centos.org.cu[Alain Reguera Delgado] + +Copyright +--------- +Copyright (C) 2013 The CentOS Project + +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. + +// vim: set syntax=asciidoc: diff --git a/Automation/Manuals/render.conf b/Automation/Manuals/render.conf new file mode 100644 index 0000000..e262a7c --- /dev/null +++ b/Automation/Manuals/render.conf @@ -0,0 +1,7 @@ +[centos-art.sh-render] +render-type = "asciidoc" +render-flow = "manpage" +render-from = "centos-art.sh-render.asciidoc" +locale-from = "${TCAR_SCRIPT_LANG_LC}/$(basename ${TARGET}).po" +formats = "xhtml manpage" +mansect = "1" diff --git a/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXml.sh b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXml.sh new file mode 100755 index 0000000..cf7bfde --- /dev/null +++ b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXml.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# locale_updateMessageXml.sh -- This function parses XML-based files +# (e.g., Scalable Vector Graphics and Docbook files), retrieves +# translatable strings and creates/update gettext portable objects. +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXml { + + # Define what kind of XML file we are generating translation + # messages for. This is relevant because scalable vector graphics + # (SVG) files are not using entity expansion while DocBook files + # do. + if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Docbook/[[:alnum:]-]+$" ]];then + + locale_updateMessageXmlDocbook + + # Combine template messages and licenses messages so when + # template be merged into the final portable object the + # translations be there. If we cannot treat licenses as + # independent documents (e.g., through XInclude), then lets + # keep translation messages as synchronized as possible. + + elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Models/.+$" ]] \ + || [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Svg/.+$" ]];then + + locale_updateMessageXmlSvg + + else + + cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line + + fi + +} diff --git a/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbook.sh b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbook.sh new file mode 100755 index 0000000..04448e2 --- /dev/null +++ b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbook.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# locale_updateMessageXmlDocbook.sh -- This function retrieves +# translation messages from Docbook files and creates related portable +# object template for them. +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlDocbook { + + # Define location where translation files will be stored in. + local L10N_WORKDIR=$(cli_getLocalizationDir ${ACTIONVAL}) + + # Define regular expression to match extensions of shell scripts + # we use inside the repository. + local EXTENSION='docbook' + + # Define absolute paths to Docbook main file. + local TEMPLATE=$(cli_getFilesList ${ACTIONVAL} \ + --maxdepth=1 --mindepth=1 --type='f' \ + --pattern=".+/$(cli_getRepoName ${ACTIONVAL} -f)\.${EXTENSION}$") + + # Process Docbook template files based on whether it is empty or + # not. When it is empty, it is because there is not a Docbook main + # file in the location provided to centos-art.sh script + # command-line. In this case, we try to create one POT file to all + # docbook files inside the location provided but without expanding + # entities. When Docbook template file is not empty, expand + # entities and create the POT file from a Docbook main file + # instance, with all entities expanded. + if [[ -z ${TEMPLATE} ]];then + locale_updateMessageXmlDocbookNoEntities + else + locale_updateMessageXmlDocbookWithEntities + fi + +} diff --git a/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbookNoEntities.sh b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbookNoEntities.sh new file mode 100755 index 0000000..67d6f75 --- /dev/null +++ b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbookNoEntities.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# locale_updateMessageXmlDocbookNoEntities.sh -- This function creates +# an instance of one or more Docbook files without expanding entities +# inside it, retrieves all translatable strings from main file +# instance, and creates the related portable object template POT for +# them. This is useful to localize Docbook files that aren't direct +# part of a documentation manual but included at rendition time (e.g., +# Docbook files holding license information). +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlDocbookNoEntities { + + # In case no path to Docbook main file is not found, go deeper + # into the documentation models directory structure looking for + # files that do match the name of the directory who hold it, and + # use that file as template to initiate localization process. The + # way to reach these files have to be through --filter options + # because we want to respect the restrictions imposed by + # locale_isLocalizable function inside the repository. + # CAUTION: entity expansion the files found this way will be # ignored. + local TEMPLATES=$(cli_getFilesList ${ACTIONVAL} --type='f' \ + --pattern=".+/${FLAG_FILTER}.+\.${EXTENSION}$") + + # Verify number of template files found and define what kind of + # processing they are going to have. In case more than one + # template file be found and because entity expansion will be + # ignored in such case, the whole process of creating the PO file + # for all these templates is also different (simpler) from that we + # use with entity expansion. + + for TEMPLATE in ${TEMPLATES};do + + # Redefine path related to localization work directory. + local L10N_WORKDIR=$(cli_getLocalizationDir "$TEMPLATE") + + # Define location of the file used to create both portable + # object templates (.pot) and portable objects (.po) files. + local MESSAGES="${L10N_WORKDIR}/messages" + + # Print action message. + cli_printMessage "${MESSAGES}.pot" --as-updating-line + + # Extract translatable strings from docbook files and merge + # them down into related messages file. + xml2po -a -l ${CLI_LANG_LL} -o ${MESSAGES}.pot ${TEMPLATE} + + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + + done + +} diff --git a/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbookWithEntities.sh b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbookWithEntities.sh new file mode 100755 index 0000000..352e5b9 --- /dev/null +++ b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlDocbookWithEntities.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# +# locale_updateMessageXmlDocbookWithEntities.sh -- This function +# creates an instance of Docbook main file, expands entities inside +# it, retrieves all translatable strings from main file instance, and +# creates the related portable object template POT for them. +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlDocbookWithEntities { + + # Define location of the file used to create both portable object + # templates (.pot) and portable objects (.po) files. + local MESSAGES="${L10N_WORKDIR}/messages" + + # Print action message. + cli_printMessage "${MESSAGES}.pot" --as-updating-line + + # Define file name used as template instance. Here is where we + # expand translation markers and entities before retrieving + # translation messages. + local INSTANCE=$(cli_getTemporalFile "$(basename ${TEMPLATE})") + + # Create the non-translated instance of design model. + cp ${TEMPLATE} ${INSTANCE} + + # Expand common contents inside instance. + cli_exportFunctions "Render/Docbook/docbook_setExpansionLicenses" + docbook_setExpansionLicenses ${INSTANCE} + + # When translated instances are rendered, system entities (e.g., + # `%entity-name;') don't appear in the translated instance (it + # seems that xml2po removes them) and this provokes DocBook + # validation to fail. So in order to pass the validation + # successfully and automate the whole creation of system entities, + # don't let this duty ion users'. Instead, make centos-art.sh + # script responsible of it. + cli_exportFunctions "Render/Docbook/docbook_setExpansionSystemEntities" + docbook_setExpansionSystemEntities ${INSTANCE} + + # Create portable object template from instance. Validate + # translated instance before processing it. This step is very + # important in order to detect document's malformations and warn + # you about it, so you can correct them. + xmllint --valid --noent ${INSTANCE} | xml2po -a -l ${CLI_LANG_LC} - \ + | msgcat --output=${MESSAGES}.pot \ + --width=70 --no-location - + + # Expand translation markers inside file. + cli_expandTMarkers ${INSTANCE} + + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + +} diff --git a/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlSvg.sh b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlSvg.sh new file mode 100755 index 0000000..d41bec1 --- /dev/null +++ b/Automation/Modules/Locale/Modules/Xml/xml_updateMessageXmlSvg.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# locale_updateMessageXmlSvg.sh -- This function parses XML-based +# files (e.g., scalable vector graphics), retrieves translatable +# strings and creates/update gettext portable objects. +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlSvg { + + # Inside `Identity/Models' and Documentation/Models/Svg/, design + # models can be compressed or uncompressed. Because of this we + # cannot process all the design models in one unique way. Instead, + # we need to treat them individually based on their file type. + + local DIR='' + local DIRS='' + + # Define regular expression to match extensions of shell scripts + # we use inside the repository. + local EXTENSION='(svgz|svg)' + + # Build list of directories in which we want to look files for. + local DIRS=$(cli_getFilesList ${ACTIONVAL} \ + --pattern="${ACTIONVAL}/${FLAG_FILTER}") + + # Process list of directories, one by one. + for DIR in $DIRS;do + + # Reset information related to temporal files. + local TEMPFILE='' + local TEMPFILES='' + + # Redefine localization working directory using the current + # directory. The localization working directory is the place + # where POT and PO files are stored inside the working copy. + local L10N_WORKDIR=$(cli_getLocalizationDir "${DIR}") + + # Prepare working directory to receive translation files. + locale_prepareWorkingDirectory ${L10N_WORKDIR} + + # Redefine final location of messages.po file, based on + # current directory. + MESSAGES=${L10N_WORKDIR}/messages + + # Build list of files we want to work with. + FILES=$(cli_getFilesList ${DIR} --pattern="${DIR}/.+\.${EXTENSION}") + + for FILE in $FILES;do + + # Redefine temporal file based on file been processed. + TEMPFILE=$(cli_getTemporalFile $(basename ${FILE})) + + # Update the command used to read content of XML files. + if [[ $(file -b -i $FILE) =~ '^application/x-gzip$' ]];then + + # Create uncompressed copy of file. + /bin/zcat $FILE > $TEMPFILE + + else + + # Create uncompressed copy of file. + /bin/cat $FILE > $TEMPFILE + + fi + + # Concatenate temporal files into a list so we can process + # them later through xml2po, all at once. + TEMPFILES="${TEMPFILE} ${TEMPFILES}" + + done + + # Create the portable object template. + cat $TEMPFILES | xml2po -a -l ${CLI_LANG_LC} - \ + | msgcat --output=${MESSAGES}.pot --width=70 --no-location - + + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + + done + +} diff --git a/Automation/Modules/Locale/locale.conf.sh b/Automation/Modules/Locale/locale.conf.sh new file mode 100644 index 0000000..bd6d681 --- /dev/null +++ b/Automation/Modules/Locale/locale.conf.sh @@ -0,0 +1,2 @@ +#!/bin/bash +declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Locale/locale_updateMessageXml.sh b/Automation/Modules/Locale/locale_updateMessageXml.sh deleted file mode 100755 index cf7bfde..0000000 --- a/Automation/Modules/Locale/locale_updateMessageXml.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXml.sh -- This function parses XML-based files -# (e.g., Scalable Vector Graphics and Docbook files), retrieves -# translatable strings and creates/update gettext portable objects. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXml { - - # Define what kind of XML file we are generating translation - # messages for. This is relevant because scalable vector graphics - # (SVG) files are not using entity expansion while DocBook files - # do. - if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Docbook/[[:alnum:]-]+$" ]];then - - locale_updateMessageXmlDocbook - - # Combine template messages and licenses messages so when - # template be merged into the final portable object the - # translations be there. If we cannot treat licenses as - # independent documents (e.g., through XInclude), then lets - # keep translation messages as synchronized as possible. - - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Models/.+$" ]] \ - || [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Svg/.+$" ]];then - - locale_updateMessageXmlSvg - - else - - cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line - - fi - -} diff --git a/Automation/Modules/Locale/locale_updateMessageXmlDocbook.sh b/Automation/Modules/Locale/locale_updateMessageXmlDocbook.sh deleted file mode 100755 index 04448e2..0000000 --- a/Automation/Modules/Locale/locale_updateMessageXmlDocbook.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbook.sh -- This function retrieves -# translation messages from Docbook files and creates related portable -# object template for them. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbook { - - # Define location where translation files will be stored in. - local L10N_WORKDIR=$(cli_getLocalizationDir ${ACTIONVAL}) - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='docbook' - - # Define absolute paths to Docbook main file. - local TEMPLATE=$(cli_getFilesList ${ACTIONVAL} \ - --maxdepth=1 --mindepth=1 --type='f' \ - --pattern=".+/$(cli_getRepoName ${ACTIONVAL} -f)\.${EXTENSION}$") - - # Process Docbook template files based on whether it is empty or - # not. When it is empty, it is because there is not a Docbook main - # file in the location provided to centos-art.sh script - # command-line. In this case, we try to create one POT file to all - # docbook files inside the location provided but without expanding - # entities. When Docbook template file is not empty, expand - # entities and create the POT file from a Docbook main file - # instance, with all entities expanded. - if [[ -z ${TEMPLATE} ]];then - locale_updateMessageXmlDocbookNoEntities - else - locale_updateMessageXmlDocbookWithEntities - fi - -} diff --git a/Automation/Modules/Locale/locale_updateMessageXmlDocbookNoEntities.sh b/Automation/Modules/Locale/locale_updateMessageXmlDocbookNoEntities.sh deleted file mode 100755 index 67d6f75..0000000 --- a/Automation/Modules/Locale/locale_updateMessageXmlDocbookNoEntities.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbookNoEntities.sh -- This function creates -# an instance of one or more Docbook files without expanding entities -# inside it, retrieves all translatable strings from main file -# instance, and creates the related portable object template POT for -# them. This is useful to localize Docbook files that aren't direct -# part of a documentation manual but included at rendition time (e.g., -# Docbook files holding license information). -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbookNoEntities { - - # In case no path to Docbook main file is not found, go deeper - # into the documentation models directory structure looking for - # files that do match the name of the directory who hold it, and - # use that file as template to initiate localization process. The - # way to reach these files have to be through --filter options - # because we want to respect the restrictions imposed by - # locale_isLocalizable function inside the repository. - # CAUTION: entity expansion the files found this way will be # ignored. - local TEMPLATES=$(cli_getFilesList ${ACTIONVAL} --type='f' \ - --pattern=".+/${FLAG_FILTER}.+\.${EXTENSION}$") - - # Verify number of template files found and define what kind of - # processing they are going to have. In case more than one - # template file be found and because entity expansion will be - # ignored in such case, the whole process of creating the PO file - # for all these templates is also different (simpler) from that we - # use with entity expansion. - - for TEMPLATE in ${TEMPLATES};do - - # Redefine path related to localization work directory. - local L10N_WORKDIR=$(cli_getLocalizationDir "$TEMPLATE") - - # Define location of the file used to create both portable - # object templates (.pot) and portable objects (.po) files. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Extract translatable strings from docbook files and merge - # them down into related messages file. - xml2po -a -l ${CLI_LANG_LL} -o ${MESSAGES}.pot ${TEMPLATE} - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - - done - -} diff --git a/Automation/Modules/Locale/locale_updateMessageXmlDocbookWithEntities.sh b/Automation/Modules/Locale/locale_updateMessageXmlDocbookWithEntities.sh deleted file mode 100755 index 352e5b9..0000000 --- a/Automation/Modules/Locale/locale_updateMessageXmlDocbookWithEntities.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbookWithEntities.sh -- This function -# creates an instance of Docbook main file, expands entities inside -# it, retrieves all translatable strings from main file instance, and -# creates the related portable object template POT for them. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbookWithEntities { - - # Define location of the file used to create both portable object - # templates (.pot) and portable objects (.po) files. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Define file name used as template instance. Here is where we - # expand translation markers and entities before retrieving - # translation messages. - local INSTANCE=$(cli_getTemporalFile "$(basename ${TEMPLATE})") - - # Create the non-translated instance of design model. - cp ${TEMPLATE} ${INSTANCE} - - # Expand common contents inside instance. - cli_exportFunctions "Render/Docbook/docbook_setExpansionLicenses" - docbook_setExpansionLicenses ${INSTANCE} - - # When translated instances are rendered, system entities (e.g., - # `%entity-name;') don't appear in the translated instance (it - # seems that xml2po removes them) and this provokes DocBook - # validation to fail. So in order to pass the validation - # successfully and automate the whole creation of system entities, - # don't let this duty ion users'. Instead, make centos-art.sh - # script responsible of it. - cli_exportFunctions "Render/Docbook/docbook_setExpansionSystemEntities" - docbook_setExpansionSystemEntities ${INSTANCE} - - # Create portable object template from instance. Validate - # translated instance before processing it. This step is very - # important in order to detect document's malformations and warn - # you about it, so you can correct them. - xmllint --valid --noent ${INSTANCE} | xml2po -a -l ${CLI_LANG_LC} - \ - | msgcat --output=${MESSAGES}.pot \ - --width=70 --no-location - - - # Expand translation markers inside file. - cli_expandTMarkers ${INSTANCE} - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - -} diff --git a/Automation/Modules/Locale/locale_updateMessageXmlSvg.sh b/Automation/Modules/Locale/locale_updateMessageXmlSvg.sh deleted file mode 100755 index d41bec1..0000000 --- a/Automation/Modules/Locale/locale_updateMessageXmlSvg.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlSvg.sh -- This function parses XML-based -# files (e.g., scalable vector graphics), retrieves translatable -# strings and creates/update gettext portable objects. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlSvg { - - # Inside `Identity/Models' and Documentation/Models/Svg/, design - # models can be compressed or uncompressed. Because of this we - # cannot process all the design models in one unique way. Instead, - # we need to treat them individually based on their file type. - - local DIR='' - local DIRS='' - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='(svgz|svg)' - - # Build list of directories in which we want to look files for. - local DIRS=$(cli_getFilesList ${ACTIONVAL} \ - --pattern="${ACTIONVAL}/${FLAG_FILTER}") - - # Process list of directories, one by one. - for DIR in $DIRS;do - - # Reset information related to temporal files. - local TEMPFILE='' - local TEMPFILES='' - - # Redefine localization working directory using the current - # directory. The localization working directory is the place - # where POT and PO files are stored inside the working copy. - local L10N_WORKDIR=$(cli_getLocalizationDir "${DIR}") - - # Prepare working directory to receive translation files. - locale_prepareWorkingDirectory ${L10N_WORKDIR} - - # Redefine final location of messages.po file, based on - # current directory. - MESSAGES=${L10N_WORKDIR}/messages - - # Build list of files we want to work with. - FILES=$(cli_getFilesList ${DIR} --pattern="${DIR}/.+\.${EXTENSION}") - - for FILE in $FILES;do - - # Redefine temporal file based on file been processed. - TEMPFILE=$(cli_getTemporalFile $(basename ${FILE})) - - # Update the command used to read content of XML files. - if [[ $(file -b -i $FILE) =~ '^application/x-gzip$' ]];then - - # Create uncompressed copy of file. - /bin/zcat $FILE > $TEMPFILE - - else - - # Create uncompressed copy of file. - /bin/cat $FILE > $TEMPFILE - - fi - - # Concatenate temporal files into a list so we can process - # them later through xml2po, all at once. - TEMPFILES="${TEMPFILE} ${TEMPFILES}" - - done - - # Create the portable object template. - cat $TEMPFILES | xml2po -a -l ${CLI_LANG_LC} - \ - | msgcat --output=${MESSAGES}.pot --width=70 --no-location - - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - - done - -} diff --git a/Automation/Modules/Prepare/Scripts/prepare_getOptions.sh b/Automation/Modules/Prepare/Scripts/prepare_getOptions.sh deleted file mode 100755 index a2b185d..0000000 --- a/Automation/Modules/Prepare/Scripts/prepare_getOptions.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_getOptions.sh -- This function parses options passed to -# `centos-art.sh' script command-line, when the first argument is -# the `prepare' word. To parse options, this function makes use of -# getopt program. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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 prepare_getOptions { - - # Define short options we want to support. - local ARGSS="h,v,q,y" - - # Define long options we want to support. - local ARGSL="help,version,quiet,yes,packages,repository" - - # Define module arguments local to this function. This is very - # important in order to provide option parsing for different - # function environment levels. - local TCAR_ARGUMENTS='' - - # Redefine arguments using getopt(1) command parser. - tcar_setArguments "${@}" - - # Reset positional parameters on this function, using output - # produced from (getopt) arguments parser. - eval set -- "${TCAR_ARGUMENTS}" - - # Look for options passed through command-line. - while true; do - case "$1" in - - -h | --help ) - tcar_printHelp - ;; - - -v | --version ) - tcar_printVersion - ;; - - -q | --quiet ) - TCAR_FLAG_QUIET="true" - shift 1 - ;; - - -y | --yes ) - TCAR_FLAG_YES="true" - shift 1 - ;; - - --packages ) - MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setPackages" - shift 1 - ;; - - --repository ) - MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setRepository" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - - esac - done - -} diff --git a/Automation/Modules/Prepare/Scripts/prepare_setPackages.sh b/Automation/Modules/Prepare/Scripts/prepare_setPackages.sh deleted file mode 100755 index ef82342..0000000 --- a/Automation/Modules/Prepare/Scripts/prepare_setPackages.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setPackages.sh -- This function verifies packages -# required by centos-art.sh script and prints a list of installed -# and missing packages based on it. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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 prepare_setPackages { - - local PACKAGES_REQUIRED="inkscape ImageMagick netpbm - netpbm-progs syslinux gimp coreutils texinfo texinfo-tex info - tetex-latex tetex-fonts tetex-xdvi tetex-dvips gettext texi2html - 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 asciidoc - dblatex" - - local -x PACKAGES_THIRDPARTY='(inkscape|asciidoc|dblatex)' - - for PACKAGE in ${PACKAGES_REQUIRED};do - rpm -q ${PACKAGE} --quiet - if [[ $? -ne 0 ]];then - PACKAGES_UNINSTALLED="${PACKAGES_UNINSTALLED} ${PACKAGE}" - fi - done - - local YUM_OPTIONS='' - if [[ ${TCAR_FLAG_YES} == 'true' ]];then - YUM_OPTIONS='-y' - fi - if [[ ${TCAR_FLAG_QUIET} == 'true' ]];then - YUM_OPTIONS="${YUM_OPTIONS} --quiet" - fi - - if [[ ! -z ${PACKAGES_UNINSTALLED} ]];then - tcar_printMessage "`gettext "The following packages need to be installed:"`" --as-banner-line - for PACKAGE in ${PACKAGES_UNINSTALLED};do - if [[ ${PACKAGE} =~ ${PACKAGES_THIRDPARTY} ]];then - tcar_printMessage "${PACKAGE} (`gettext "from third party repository"`)" --as-response-line - else - tcar_printMessage "${PACKAGE}" --as-response-line - fi - done - tcar_printMessage '-' --as-separator-line - tcar_printMessage "`gettext "Do you want to continue"`" --as-yesornorequest-line - sudo yum install ${YUM_OPTIONS} ${PACKAGES_UNINSTALLED} - else - tcar_printMessage "`gettext "All required packages are already installed."`" --as-banner-line - fi - -} diff --git a/Automation/Modules/Prepare/Scripts/prepare_setRepository.sh b/Automation/Modules/Prepare/Scripts/prepare_setRepository.sh deleted file mode 100755 index a453eac..0000000 --- a/Automation/Modules/Prepare/Scripts/prepare_setRepository.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setRepository.sh -- This function builds a list of all -# configuration files inside the repository and calls the render -# module for processing it. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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 prepare_setRepository { - - # Build list of configuration files to be produced. - local CONFIGURATION_FILES=$(tcar_getFilesList \ - ${TCAR_BASEDIR} --type="f" --pattern=".+/${FILENAME}\.conf") - - # Verify list of configuration files. - if [[ -z ${CONFIGURATION_FILES} ]];then - return - fi - - # CAUTION: The order in which configuration files are processed is - # relevant to final production result. For example, in order for - # theme images to hold the 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 themselves, but - # combined with theme images using the ImageMagick tool suite once - # they both have been rendered as PNG files. - - # Rebuild the list of configuration files to grant brand correct - # production order when they are included in the list of files to - # produce. - echo "${CONFIGURATION_FILES}" | grep "${TCAR_BASEDIR}/Artworks/Brands" > /dev/null - if [[ $? -eq 0 ]];then - CONFIGURATION_FILES="${TCAR_BASEDIR}/Artworks/Brands - $(echo "${CONFIGURATION_FILES}" | grep -v "${TCAR_BASEDIR}/Artworks/Brands")" - fi - - # Process configuration files using render module. - tcar_setFnEnvironment render ${CONFIGURATION_FILES} - -} diff --git a/Automation/Modules/Prepare/prepare.asciidoc b/Automation/Modules/Prepare/prepare.asciidoc deleted file mode 100644 index 57307d0..0000000 --- a/Automation/Modules/Prepare/prepare.asciidoc +++ /dev/null @@ -1,73 +0,0 @@ -prepare(1) -========== - -Name ----- -prepare - Standardize configuration tasks. - -Synopsis --------- -centos-art.sh prepare [OPTIONS] - -Description ------------ -The *prepare* module of *centos-art.sh* script helps you to prepare -the workstation for using the working copy of CentOS artwork -repository. It assumes you've already installed the CentOS -distribution in your workstation and downloaded a working copy of -CentOS artwork repository into it. - -Options -------- -The *prepare* module has the following options: - -*--help*:: - This option shows the module's documentation (this page). -*--version*:: - This option shows the module's name and version. -*--yes*:: - This option assumes yes to all questions. -*--quiet*:: - This option suppresses all outputs except script's errors. -*--packages*:: - This option verifies whether or not required packages are - installed in the workstation. When required packages are not - installed in the workstation, the *prepare* module executes the - *yum install* command through *sudo* to install the required - packages. -*--repository*:: - This option calls the *render* module of *centos-art.sh* script - and produces content for all configuration (+render.conf+) files - found inside the repository. This option produces images, - documentation and internal links inside the repository and outside - it (e.g., to link GIMP's components produced in the repository - from GIMP's search path). - -Reporting Bugs --------------- -Report bugs on the *automation* category of *centos-artwork* project -at the https://centos.org.cu/bugs/[The CentOS Bugs] website. - -Author ------- -Written by mailto:al@centos.org.cu[Alain Reguera Delgado] - -Copyright ---------- -Copyright (C) 2013 The CentOS Project - -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. - -// vim: set syntax=asciidoc: diff --git a/Automation/Modules/Prepare/prepare_getOptions.sh b/Automation/Modules/Prepare/prepare_getOptions.sh new file mode 100755 index 0000000..a2b185d --- /dev/null +++ b/Automation/Modules/Prepare/prepare_getOptions.sh @@ -0,0 +1,100 @@ +#!/bin/bash +###################################################################### +# +# prepare_getOptions.sh -- This function parses options passed to +# `centos-art.sh' script command-line, when the first argument is +# the `prepare' word. To parse options, this function makes use of +# getopt program. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 prepare_getOptions { + + # Define short options we want to support. + local ARGSS="h,v,q,y" + + # Define long options we want to support. + local ARGSL="help,version,quiet,yes,packages,repository" + + # Define module arguments local to this function. This is very + # important in order to provide option parsing for different + # function environment levels. + local TCAR_ARGUMENTS='' + + # Redefine arguments using getopt(1) command parser. + tcar_setArguments "${@}" + + # Reset positional parameters on this function, using output + # produced from (getopt) arguments parser. + eval set -- "${TCAR_ARGUMENTS}" + + # Look for options passed through command-line. + while true; do + case "$1" in + + -h | --help ) + tcar_printHelp + ;; + + -v | --version ) + tcar_printVersion + ;; + + -q | --quiet ) + TCAR_FLAG_QUIET="true" + shift 1 + ;; + + -y | --yes ) + TCAR_FLAG_YES="true" + shift 1 + ;; + + --packages ) + MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setPackages" + shift 1 + ;; + + --repository ) + MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setRepository" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + + esac + done + +} diff --git a/Automation/Modules/Prepare/prepare_setPackages.sh b/Automation/Modules/Prepare/prepare_setPackages.sh new file mode 100755 index 0000000..ef82342 --- /dev/null +++ b/Automation/Modules/Prepare/prepare_setPackages.sh @@ -0,0 +1,73 @@ +#!/bin/bash +###################################################################### +# +# prepare_setPackages.sh -- This function verifies packages +# required by centos-art.sh script and prints a list of installed +# and missing packages based on it. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 prepare_setPackages { + + local PACKAGES_REQUIRED="inkscape ImageMagick netpbm + netpbm-progs syslinux gimp coreutils texinfo texinfo-tex info + tetex-latex tetex-fonts tetex-xdvi tetex-dvips gettext texi2html + 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 asciidoc + dblatex" + + local -x PACKAGES_THIRDPARTY='(inkscape|asciidoc|dblatex)' + + for PACKAGE in ${PACKAGES_REQUIRED};do + rpm -q ${PACKAGE} --quiet + if [[ $? -ne 0 ]];then + PACKAGES_UNINSTALLED="${PACKAGES_UNINSTALLED} ${PACKAGE}" + fi + done + + local YUM_OPTIONS='' + if [[ ${TCAR_FLAG_YES} == 'true' ]];then + YUM_OPTIONS='-y' + fi + if [[ ${TCAR_FLAG_QUIET} == 'true' ]];then + YUM_OPTIONS="${YUM_OPTIONS} --quiet" + fi + + if [[ ! -z ${PACKAGES_UNINSTALLED} ]];then + tcar_printMessage "`gettext "The following packages need to be installed:"`" --as-banner-line + for PACKAGE in ${PACKAGES_UNINSTALLED};do + if [[ ${PACKAGE} =~ ${PACKAGES_THIRDPARTY} ]];then + tcar_printMessage "${PACKAGE} (`gettext "from third party repository"`)" --as-response-line + else + tcar_printMessage "${PACKAGE}" --as-response-line + fi + done + tcar_printMessage '-' --as-separator-line + tcar_printMessage "`gettext "Do you want to continue"`" --as-yesornorequest-line + sudo yum install ${YUM_OPTIONS} ${PACKAGES_UNINSTALLED} + else + tcar_printMessage "`gettext "All required packages are already installed."`" --as-banner-line + fi + +} diff --git a/Automation/Modules/Prepare/prepare_setRepository.sh b/Automation/Modules/Prepare/prepare_setRepository.sh new file mode 100755 index 0000000..a453eac --- /dev/null +++ b/Automation/Modules/Prepare/prepare_setRepository.sh @@ -0,0 +1,62 @@ +#!/bin/bash +###################################################################### +# +# prepare_setRepository.sh -- This function builds a list of all +# configuration files inside the repository and calls the render +# module for processing it. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 prepare_setRepository { + + # Build list of configuration files to be produced. + local CONFIGURATION_FILES=$(tcar_getFilesList \ + ${TCAR_BASEDIR} --type="f" --pattern=".+/${FILENAME}\.conf") + + # Verify list of configuration files. + if [[ -z ${CONFIGURATION_FILES} ]];then + return + fi + + # CAUTION: The order in which configuration files are processed is + # relevant to final production result. For example, in order for + # theme images to hold the 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 themselves, but + # combined with theme images using the ImageMagick tool suite once + # they both have been rendered as PNG files. + + # Rebuild the list of configuration files to grant brand correct + # production order when they are included in the list of files to + # produce. + echo "${CONFIGURATION_FILES}" | grep "${TCAR_BASEDIR}/Artworks/Brands" > /dev/null + if [[ $? -eq 0 ]];then + CONFIGURATION_FILES="${TCAR_BASEDIR}/Artworks/Brands + $(echo "${CONFIGURATION_FILES}" | grep -v "${TCAR_BASEDIR}/Artworks/Brands")" + fi + + # Process configuration files using render module. + tcar_setFnEnvironment render ${CONFIGURATION_FILES} + +} diff --git a/Automation/Modules/Render/Modules/Archive/archive.sh b/Automation/Modules/Render/Modules/Archive/archive.sh new file mode 100755 index 0000000..8b70141 --- /dev/null +++ b/Automation/Modules/Render/Modules/Archive/archive.sh @@ -0,0 +1,51 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Archive/archive.sh -- This file +# standardizes file archiving inside the centos-art.sh script. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 archive { + + tcar_printMessage "${TARGET}" --as-creating-line + + COMMAND=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "command") + if [[ -z ${COMMAND} ]];then + COMMAND="/bin/tar --remove-files -czf" + fi + + # Let file names to be changed before compressing them. + for SOURCE in ${SOURCES[*]};do + FILE_LH=$(echo ${SOURCE} | gawk -F: '{ print $1}') + tcar_checkFiles ${FILE_LH} -f + FILE_RH=$(echo ${SOURCE} | gawk -F: '{ print $2}') + cp ${FILE_LH} ${TCAR_SCRIPT_TEMPDIR}/${FILE_RH} + done + + pushd ${TCAR_SCRIPT_TEMPDIR} > /dev/null + + ${COMMAND} ${TARGET} * + + popd > /dev/null + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/Modules/Article/article.sh b/Automation/Modules/Render/Modules/Asciidoc/Modules/Article/article.sh new file mode 100755 index 0000000..310b9ab --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/Modules/Article/article.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +function article { + + asciidoc_setFormatsRendition + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/Modules/Book/book.sh b/Automation/Modules/Render/Modules/Asciidoc/Modules/Book/book.sh new file mode 100755 index 0000000..1c55acf --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/Modules/Book/book.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +function book { + + asciidoc_setFormatsRendition + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/Modules/Manpage/manpage.sh b/Automation/Modules/Render/Modules/Asciidoc/Modules/Manpage/manpage.sh new file mode 100755 index 0000000..e5e7ae7 --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/Modules/Manpage/manpage.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +function manpage { + + local MANSECT=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "mansect") + + tcar_checkFiles ${MANSECT} --match='[1-9]' + + for FORMAT in ${FORMATS};do + + tcar_checkFiles ${FORMAT} --match='(xhtml|manpage)' + + case ${FORMAT} in + + 'xhtml' ) + local HTML_TARGET="$(dirname ${TARGET})/htmlman${MANSECT}/$(basename ${TARGET}).${MANSECT}.html" + asciidoc_setXhtmlRendition "${HTML_TARGET}" + ;; + + 'manpage' ) + local MAN_TARGET="$(dirname ${TARGET})/man${MANSECT}/$(basename ${TARGET}).${MANSECT}" + if [[ ! -d $(dirname ${MAN_TARGET}) ]];then + mkdir -p $(dirname ${MAN_TARGET}) + fi + tcar_printMessage "${MAN_TARGET}" --as-creating-line + /usr/bin/xsltproc -o ${MAN_TARGET} --nonet \ + ${DOCBOOK_XSL}/docbook2manpage.xsl ${DOCBOOK_FILE} + ;; + esac + + done + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/asciidoc.conf.sh b/Automation/Modules/Render/Modules/Asciidoc/asciidoc.conf.sh new file mode 100755 index 0000000..784ca7b --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/asciidoc.conf.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +declare -x DOCBOOK_VER="1.69.1" +declare -x DOCBOOK_XSL="${TCAR_BASEDIR}/Artworks/Webenv/Docbook/${DOCBOOK_VER}/Xsl" +declare -x DOCBOOK_CSS="${TCAR_BASEDIR}/Artworks/Webenv/Docbook/${DOCBOOK_VER}/Css" + +declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Render/Modules/Asciidoc/asciidoc.sh b/Automation/Modules/Render/Modules/Asciidoc/asciidoc.sh new file mode 100755 index 0000000..89cfef4 --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/asciidoc.sh @@ -0,0 +1,50 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Asciidoc/asciidoc.sh -- This function +# standardizes rendition of asciidoc files inside the centos-art.sh +# script. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 asciidoc { + + RENDER_FLOW=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" 'render-flow') + if [[ -z ${RENDER_FLOW} ]];then + RENDER_FLOW="article" + fi + tcar_checkFiles "${RENDER_FLOW}" --match='^(article|book|manpage)$' + + FORMATS=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" 'formats') + if [[ -z ${FORMATS} ]];then + FORMATS='xhtml' + fi + + local -a SOURCE_INSTANCES + local -a TARGET_INSTANCES + + asciidoc_setBaseRendition + + unset SOURCE_INSTANCES + unset TARGET_INSTANCES + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setBaseRendition.sh b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setBaseRendition.sh new file mode 100755 index 0000000..d08a659 --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setBaseRendition.sh @@ -0,0 +1,75 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Asciidoc/Scripts/asciidoc_setBaseRendition.sh +# -- This function standardizes transformation of asciidoc files +# into docbook files. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 asciidoc_setBaseRendition { + + local COUNTER=0 + + while [[ ${COUNTER} -lt ${#SOURCES[*]} ]];do + + tcar_checkFiles "${SOURCES[${COUNTER}]}" -f --match='\.asciidoc$' + + # Define file name for design model instances. We need to use + # a random string in from of it to prevent duplication. + # Remember that different files can have the same name in + # different locations. Use the correct file information. + SOURCE_INSTANCES[${COUNTER}]=$(tcar_getTemporalFile "${RANDOM}-$(basename ${SOURCES[${COUNTER}]})") + + # Define file name for image instances. We need to use a + # random string in from of it to prevent duplication. + # Remember that different files can have the same name in + # different locations. Use the correct file information. + TARGET_INSTANCES[${COUNTER}]=$(tcar_getTemporalFile "${RANDOM}-$(basename ${SOURCES[${COUNTER}]} \ + | sed -r 's/\.asciidoc$/.docbook/')") + + /usr/bin/asciidoc --backend="docbook" --doctype="${RENDER_FLOW}" \ + --out-file="${SOURCE_INSTANCES[${COUNTER}]}" ${SOURCES[${COUNTER}]} + + # Create source instance considering whether or not it has + # translation files related.Apply translation files to source + # instance, if any. + render_setLocalizedXml "${SOURCE_INSTANCES[${COUNTER}]}" "${TARGET_INSTANCES[${COUNTER}]}" + + # Make your best to be sure the source instance you are + # processing is a valid DocBook file. + tcar_checkFiles ${TARGET_INSTANCES[${COUNTER}]} --mime='^text/xml$' + + # Expand any translation file that might exist. + tcar_setTranslationMarkers ${TARGET_INSTANCES[${COUNTER}]} + + COUNTER=$(( ${COUNTER} + 1 )) + + done + + # Initiate format-specific transformations for current render + # flow. + for DOCBOOK_FILE in ${TARGET_INSTANCES[*]};do + tcar_setModuleEnvironment "${RENDER_FLOW}" "${@}" + done + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setBaseRenditionCommand.sh b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setBaseRenditionCommand.sh new file mode 100755 index 0000000..27656b7 --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setBaseRenditionCommand.sh @@ -0,0 +1,35 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/asciidoc_setBaseRenditionCommand.sh +# -- This function standardizes the way Asciidoc files are rendered +# inside the centos-art.sh script. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 asciidoc_setBaseRenditionCommand { + + tcar_checkFiles ${RENDER_TYPE} --match="^(article|book|manpage)$" + + asciidoc --backend docbook --doctype ${RENDER_TYPE} -o ${TARGET} + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setFormatsRendition.sh b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setFormatsRendition.sh new file mode 100755 index 0000000..240dfc1 --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setFormatsRendition.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +function asciidoc_setFormatsRendition { + + for FORMAT in ${FORMATS};do + + case ${FORMAT} in + 'xhtml' ) + asciidoc_setXhtmlRendition "${TARGET}" + ;; + esac + + done + +} diff --git a/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setXhtmlRendition.sh b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setXhtmlRendition.sh new file mode 100755 index 0000000..855664c --- /dev/null +++ b/Automation/Modules/Render/Modules/Asciidoc/asciidoc_setXhtmlRendition.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +function asciidoc_setXhtmlRendition { + + local TARGET="${1}" + + RENDER_PAGE=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-page") + if [[ -z ${RENDER_PAGE} ]];then + RENDER_PAGE='single' + fi + tcar_checkFiles ${RENDER_PAGE} --match='^(single|chunks)$' + + IMAGES_FROM=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "images-from") + if [[ -z ${IMAGES_FROM} ]];then + IMAGES_FROM="${TCAR_BASEDIR}/Artworks/Icons/Webenv" + fi + + STYLES_FROM=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "styles-from") + if [[ -z ${STYLES_FROM} ]];then + STYLES_FROM="${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css" + fi + + if [[ ${RENDER_PAGE} == 'chunks' ]];then + TARGET="${TARGET}/" + if [[ ! -d ${TARGET} ]];then + mkdir -p ${TARGET} + fi + ln -sfn ${IMAGES_FROM} ${TARGET}/Images + ln -sfn ${STYLES_FROM} ${TARGET}/Css + else + if [[ ! -d $(dirname ${TARGET}) ]];then + mkdir -p $(dirname ${TARGET}) + fi + ln -sfn ${IMAGES_FROM} $(dirname ${TARGET})/Images + ln -sfn ${STYLES_FROM} $(dirname ${TARGET})/Css + fi + + tcar_printMessage "${TARGET}" --as-creating-line + + /usr/bin/xsltproc -o ${TARGET} --nonet \ + ${DOCBOOK_XSL}/docbook2xhtml-${RENDER_PAGE}.xsl ${DOCBOOK_FILE} + +} diff --git a/Automation/Modules/Render/Modules/Compress/compress.sh b/Automation/Modules/Render/Modules/Compress/compress.sh new file mode 100755 index 0000000..7f2439e --- /dev/null +++ b/Automation/Modules/Render/Modules/Compress/compress.sh @@ -0,0 +1,41 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Compress/compress.sh -- This file +# standardize file compression inside the centos-art.sh script. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 compress { + + tcar_printMessage "${TARGET}" --as-creating-line + + COMMAND=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "command") + if [[ -z ${COMMAND} ]];then + COMMAND="/bin/gzip" + fi + + tcar_checkFiles ${SOURCES[*]} -f + + ${COMMAND} ${SOURCES[*]} + +} diff --git a/Automation/Modules/Render/Modules/Conf/Scripts/conf_setBaseRendition.sh b/Automation/Modules/Render/Modules/Conf/Scripts/conf_setBaseRendition.sh deleted file mode 100755 index 4962373..0000000 --- a/Automation/Modules/Render/Modules/Conf/Scripts/conf_setBaseRendition.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# -# conf_setBaseRendition.sh -- This function standardizes base actions -# related to image production through configuration files. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function conf_setBaseRendition { - - local COUNTER=0 - local EXPORTID="CENTOSARTWORK" - local -a MODEL_INSTANCES - local -a IMAGE_INSTANCES - local -a IMAGE_COMMANDS - - # Define absolute path to output location. This is the location - # inside the working copy all images will be stored in. - local OUTPUT=${OUTPUT}/${FGCOLOR}/${BGCOLOR}/${HEIGHT}/${FILENAME} - - # Define which command will be used to output the template - # content. This is required because template files might be found - # as compressed files inside the repository. - local VIEWER="/bin/cat" - - while [[ $COUNTER -lt ${#MODELS[*]} ]];do - - # Verify existence and extension of design models. - cli_checkFiles ${MODELS[$COUNTER]} -f --match='\.(svgz|svg)$' - - # Define file name for design model instances. We need to use - # a random string in from of it to prevent duplication. - # Remember that different files can have the same name in - # different locations. Use the correct file information. - MODEL_INSTANCES[$COUNTER]=${TMPDIR}/${RANDOM}-$(basename ${MODELS[$COUNTER]}) - - # Define file name for image instances. We need to use a - # random string in from of it to prevent duplication. - # Remember that different files can have the same name in - # different locations. Use the correct file information. - IMAGE_INSTANCES[$COUNTER]=${TMPDIR}/${RANDOM}-$(basename ${MODELS[$COUNTER]} \ - | sed -r 's/\.(svgz|svg)$/.png/') - - # Redefine command used to read design models. - if [[ $(file -b -i ${MODELS[$COUNTER]}) =~ '^application/x-gzip$' ]];then - VIEWER="/bin/zcat" - fi - - # Create uncompressed design model instances in order to make - # color replacements without affecting original design models. - $VIEWER ${MODELS[$COUNTER]} > ${MODEL_INSTANCES[$COUNTER]} - - # Make your best to be sure the design model instance you are - # processing is a valid scalable vector graphic. - cli_checkFiles ${MODEL_INSTANCES[$COUNTER]} --mime="text/xml" - - # Make color replacements to each design model instance before - # render them using Inkscape. - if [[ ${FGCOLOR} != '000000' ]];then - sed -i -r "s/((fill|stroke):#)000000/\1${FGCOLOR}/g" ${MODEL_INSTANCES[$COUNTER]} - fi - - # Create list of Inkscape commands based for each design model - # set in the configuration file. - IMAGE_COMMANDS[${COUNTER}]="${MODEL_INSTANCES[$COUNTER]} \ - --export-id=${EXPORTID} \ - --export-png=${IMAGE_INSTANCES[$COUNTER]} \ - --export-background=$(echo ${BGCOLOR} | cut -d'-' -f1) \ - --export-background-opacity=$(echo ${BGCOLOR} | cut -d'-' -f2) \ - --export-height=${HEIGHT}" - - # Create PNG image based on design models. - inkscape ${IMAGE_COMMANDS[$COUNTER]} > /dev/null - - COUNTER=$(( $COUNTER + 1 )) - - done - - cli_printMessage "${OUTPUT}" --as-creating-line - - # Verify existence of output directory. - if [[ ! -d $(dirname ${OUTPUT}) ]];then - mkdir -p $(dirname ${OUTPUT}) - fi - - # Apply command to PNG images produced from design models to - # construct the final PNG image. - ${COMMAND} ${IMAGE_INSTANCES[*]} ${OUTPUT} - - # Remove instances to save disk space. There is no need to have - # unused files inside the temporal directory. They would be - # consuming space unnecessarily. Moreover, there is a remote - # chance of name collapsing (because the huge number of files that - # would be in place and the week random string we are putting in - # front of files) which may produce unexpected results. - rm ${IMAGE_INSTANCES[*]} ${MODEL_INSTANCES[*]} - - # Create path for different image formats creation using PNG image - # extension as reference. - local TARGET=$(echo ${OUTPUT} | sed -r "s/\.png$//") - - # Convert images from PNG to those formats specified in the - # configuration file. - for FORMAT in ${FORMATS};do - cli_printMessage "${TARGET}.${FORMAT}" --as-creating-line - convert ${OUTPUT} ${TARGET}.${FORMAT} - done - -} diff --git a/Automation/Modules/Render/Modules/Conf/conf.sh b/Automation/Modules/Render/Modules/Conf/conf.sh deleted file mode 100755 index 269e016..0000000 --- a/Automation/Modules/Render/Modules/Conf/conf.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash -# -# conf.sh -- This function standardizes the way images are produced -# from configuration files. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function conf { - - # Initialize local variables. - local MODEL='' - local -a MODELS - local FORMAT='' - local HEIGHT='' - local FGCOLOR='' - local BGCOLOR='' - - # Define list with all section names. These are the final file - # names we want to produce images for. - local FILENAME='' - local FILENAMES=$(cli_getConfigSectionNames $TEMPLATE) - - for FILENAME in $FILENAMES;do - - # Retrieve models you want to produce the image from. Notice - # that relative path passed in this option must point to one - # existent file inside the working copy. - for MODEL in $(cli_getConfigValue "$TEMPLATE" "$FILENAME" "models");do - MODELS[((++${#MODELS[*]}))]=${TCAR_WORKDIR}/${MODEL} - done - - # Retrieve formats you want to produce the image for. This - # variable contains one or more image format supported by - # ImageMagick. For example, `xpm', `jpg', 'tiff', etc. - local FORMATS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "formats") - if [[ -z ${FORMATS} ]];then - FORMATS="xpm pdf jpg tif" - fi - - # Retrieve heights you want to produce the image for. This - # variable contains one or more numerical values. For example, - # `16', `24', `32', etc. - local HEIGHTS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "heights") - if [[ -z ${HEIGHTS} ]];then - HEIGHTS="16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" - fi - - # Retrieve foreground colors you want to produce the image - # for. This variable contains one or more color number in - # hexadecimal format. For example, `000000', `ffffff', etc. - local FGCOLORS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "fgcolors") - if [[ -z ${FGCOLORS} ]];then - FGCOLORS="000000" - fi - - # Retrieve background colors you want to produce the image - # for. This variable contains one or more color number in - # hexadecimal format with opacity information included. - # Opacity is specified between 0.0 and 1.0 where 0.0 is full - # transparency and 1.0 full opacity. For example, the - # following values are accepted: `000000-0', `ffffff-1', etc. - local BGCOLORS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "bgcolors") - if [[ -z ${BGCOLORS} ]];then - BGCOLORS="000000-0" - fi - - # Retrieve command-line you want execute to produce the image. - # For example, `/usr/bin/convert +append' - local COMMAND=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "command") - if [[ -z ${COMMAND} ]];then - COMMAND=/bin/cp - fi - - for FGCOLOR in $FGCOLORS;do - - # Verify value passed as foreground color. - cli_checkFiles ${FGCOLOR} --match="^[a-fA-F0-9]{3,6}$" - - for BGCOLOR in $BGCOLORS;do - - # Verify value passed as background color. - cli_checkFiles ${BGCOLOR} --match="^[a-fA-F0-9]{6}-(0|1)$" - - for HEIGHT in $HEIGHTS;do - - # Verify value passed as height. - cli_checkFiles ${HEIGHT} --match="^[[:digit:]]+$" - - # Do base rendition actions. - conf_setBaseRendition - - done - done - done - - # Reset models list to prevent it from growing for each file - # name (configuration section) iteration and create this way - # unexpected images as final result. - unset MODELS - - done - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionText.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionText.sh deleted file mode 100755 index 7c4673c..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionText.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# svg_convertToText.sh -- This function takes the XHTML file produced -# by docbook_setConversionXhtml and produces one plain-text file (i.e., -# without markup inside). -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionText { - - # Verify existence of HTML file. If `.xhtml' file doesn't exist - # don't create text file. The `.xhtml' file is required in order - # to create the `.txt' file. - if [[ ! -f ${FILE}.xhtml ]];then - return - fi - - local COMMAND='' - local OPTIONS='' - - # Define the command path to text-based web browser and options - # used to produce plain-text files. Most of these programs have a - # dump option that print formatted plain-text versions of given - # HTML file to stdout. - if [[ -x '/usr/bin/lynx' ]];then - COMMAND='/usr/bin/lynx' - OPTIONS='-force_html -nolist -width 70 -dump' - elif [[ -x '/usr/bin/elinks' ]];then - COMMAND='/usr/bin/elinks' - OPTIONS='-force_html -no-numbering -no-references -width 70 -dump' - elif [[ -x '/usr/bin/w3m' ]];then - COMMAND='/usr/bin/w3m' - OPTIONS='-dump' - fi - - if [[ $COMMAND != '' ]];then - - # Print action message. - if [[ -f ${FILE}.txt ]];then - cli_printMessage "${FILE}.txt" --as-updating-line - else - cli_printMessage "${FILE}.txt" --as-creating-line - fi - - # Convert from HTML to plain-text without markup. - ${COMMAND} ${OPTIONS} ${FILE}.xhtml > ${FILE}.txt - - else - cli_printMessage "`gettext "No way to convert from XHTML to plain-text found."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXhtml.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXhtml.sh deleted file mode 100755 index 1c9f0a6..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXhtml.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# docbook_setConversionXhtml.sh -- This function uses DocBook XML as input -# and applies XSL stylesheets to produce a big XHTML files as output. -# The procedure was taken from the documentation of -# `docbook-style-xsl-1.69.1-5.1' package, which says: ---To publish -# HTML from your XML documents, you just need an XSL engine.---. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionXhtml { - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SOURCE_FILE=${1} - - # Define absolute path to xhtml target file. This is the final - # location the xhtml file produced as result of DocBook to xhtml - # transformation will be stored in. - local TARGET_FILE=${FILE}-xhtml/$(basename ${FILE}).xhtml - - # Define absolute path to xhtml target file directory. This is the - # location the xhtml target file will be sotred in. - local TARGET_FILE_DIR=$(dirname ${TARGET_FILE}) - - # Print action message. - if [[ -f ${FILE}.xhtml ]];then - cli_printMessage "${TARGET_FILE}" --as-updating-line - else - cli_printMessage "${TARGET_FILE}" --as-creating-line - fi - - # Prepare XSL final instances used in transformations. - docbook_setStyles $(cli_getFilesList \ - ${DOCBOOK_XSL} --pattern='^.*/docbook2xhtml-(single|common)\.xsl$') - - # Clean up output directory. This is required in order to prevent - # old files from remaining therein when they are no longer needed. - if [[ -d ${TARGET_FILE_DIR} ]];then - rm -r "${TARGET_FILE_DIR}" - fi - mkdir ${TARGET_FILE_DIR} - - # Transform DocBook XML to XHTML suppressing all stderr output. - xsltproc --output ${TARGET_FILE} ${STYLE_INSTANCE_FINAL} ${SOURCE_FILE} &> /dev/null - - # Create `css' and `images' directories. In order to save disk - # space, these directories are linked (symbolically) to their - # respective locations inside the working copy. - ln -fs ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css ${TARGET_FILE_DIR}/Css - ln -fs ${TCAR_WORKDIR}/Identity/Images/Webenv ${TARGET_FILE_DIR}/Images - - # Remove XSL instance files. - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXhtmlChunks.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXhtmlChunks.sh deleted file mode 100755 index 4caf61f..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXhtmlChunks.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# docbook_setConversionXhtmlChunks.sh -- This function uses DocBook XML as -# input and applies XSL stylesheets to produce a directory with many -# XHTML files as output. The procedure was taken from the -# documentation of `docbook-style-xsl-1.69.1-5.1' package, which says: -# ---To publish HTML from your XML documents, you just need an XSLT -# engine.---. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionXhtmlChunks { - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SOURCE_FILE=${1} - - # Define absolute path to XHTML target file. This is the final - # location the XHTML file produced as result of DocBook to PDF - # transformation will be stored in. - local TARGET_FILE="${FILE}-xhtml-chunks/" - - # Clean up output directory. This is required in order to prevent - # old files from remaining therein when they are no longer needed. - if [[ -d ${TARGET_FILE} ]];then - rm -r "${TARGET_FILE}" - fi - mkdir ${TARGET_FILE} - - # Print action message. - cli_printMessage "${TARGET_FILE}" --as-creating-line - - # Prepare XSL final instances used in transformations. - docbook_setStyles $(cli_getFilesList \ - ${DOCBOOK_XSL} --pattern='^.*/docbook2xhtml-(chunks|common)\.xsl$') - - # Transform DocBook XML to XHTML suppressing all stderr output. - xsltproc --output ${TARGET_FILE} ${STYLE_INSTANCE_FINAL} ${SOURCE_FILE} &> /dev/null - - # Create `css' and `images' directories. In order to save disk - # space, these directories are linked (symbolically) to their - # respective locations inside the working copy. Be sure to remove - # previous links first to prevent a recursive creation of links. - ln -sf ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css ${TARGET_FILE}/Css - ln -sf ${TCAR_WORKDIR}/Identity/Images/Webenv ${TARGET_FILE}/Images - - # Remove XSL instance files. - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXml2Pdf.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXml2Pdf.sh deleted file mode 100755 index f639e93..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setConversionXml2Pdf.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# docbook_setConversionXml2Pdf.sh -- This function transforms DocBook -# files which have set the XML DTD in them. To produce PDF from -# DocBook XML DTD, we need an XSLT engine (e.g., through `xsltproc' -# command) to produce formatting objects (FO), which then must be -# processed with an FO engine (e.g., through `pdfxmltex' command, -# which uses PassiveTex) to produce the PDF output. -# -# In this configuration and using default configuration settings, I've -# presented the following problems: -# -# 1. Something is wrong with headings. They are not expanded along the -# whole page-body. They seem to be rendered in a reduced width (1 inch -# approximately). This provokes the heading to be broken in a -# two-to-five letters column and sometimes it overlaps the sectioning -# titles (e.g., chapter, section). I tried to customize the value of -# `header.column.widths' and `page.margin.top' but it seems to be not -# there where I need to touch. -# -# 2. TOC's indentation is not rendered. Even the `toc.indent.width' -# property is set to 24 by default. -# -# 3. Inside lists, when items are more than one line, the indentation -# seems to work for the first line only. All other lines in the same -# item are not indented and begin completely unaligned. -# -# 4. Long file paths near the end of page-body aren't hyphenated. -# Even the `hyphenate' property is set to `true' by default. -# -# In this configuration and using default configuration settings, I've -# presented the following advantages: -# -# 1. It is possible to produce localized PDF outputs through -# `xml2po', the default way of producing localized content inside -# the `centos-art.sh' script. -# -# To make the whole process transparent, a temporal directory is -# created for intermediate works and final files are moved then to -# their final location. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionXml2Pdf { - - # Print action message. - cli_printMessage "${FILE}.pdf" --as-creating-line - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SRC=${INSTANCE} - - # Define absolute path to PDF target file. This is the final - # location the PDF file produced as result of DocBook to PDF - # transformation will be stored in. - local DST="${FILE}.pdf" - - # Define file name of formatting object (.fo) file. This file is - # an intermediate file needed to produced the PDF. - local FO=$(echo ${INSTANCE} | sed -r 's/docbook$/fo/g') - - # Define file name of PDF file. This is the file we were looking - # for and the one moved, once produced. - local PDF=$(echo ${INSTANCE} | sed -r 's/docbook$/pdf/g') - - # Prepare XSL final instances used in transformations. - docbook_setStyles "${DOCBOOK_XSL}/docbook2fo.xsl" - - # Create link to `Images' directory. This is the directory where - # images used by documentation are stored in. Be sure to remove - # previous links first to prevent a recursive creation of links. - ln -sf ${TCAR_WORKDIR}/Identity/Images/Webenv $(dirname ${INSTANCE})/Images - - # Create formatting object suppressing output from stderr. - xsltproc --output ${FO} ${STYLE_INSTANCE_FINAL} ${SRC} 2> /dev/null - - # Create PDF format from formatting object. Because we are using - # relative path to access `Images', it is necessary to move the - # directory stack into the temporal directory where instance files - # are created. Otherwise, the location used to load images will - # fail. - if [[ $? -eq 0 ]];then - pushd $(dirname ${INSTANCE}) > /dev/null - xmlto -o $(dirname ${FILE}) pdf ${FO} - popd > /dev/null - else - cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setExpansionLicenses.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setExpansionLicenses.sh deleted file mode 100755 index cb3a032..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setExpansionLicenses.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# docbook_setExpansionLicenses.sh -- This function modifies the final -# DocBook instance to add license information. We are doing this way -# because using XInclude doesn't work and we want to reuse license -# information in all documents. So, if we cannot link the files, we -# modify the final instance and append the license information to it. -# Later, to reuse translation messages, the locale functionality takes -# care of merging po files related to licenses into documentation po -# file so changes made to licenses translations will also be available -# to documentation manuals in different languages. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setExpansionLicenses { - - local INSTANCE=$1 - - # Define absolute path to DocBook models. - local DOCBOOK_MODELS="${TCAR_WORKDIR}/Documentation/Models/Docbook" - - # Define list of files holding licenses you want to include. Note - # even this files are not inside the documentation structure - # itself, they are connected with it. The files holding license - # information does contain id information used inside the - # documentation structure at cross references. - local LICENSES="${DOCBOOK_MODELS}/Default/Licenses/Gpl/gpl.docbook \ - ${DOCBOOK_MODELS}/Default/Licenses/Gfdl/gfdl.docbook" - - # Define top level structure in the instance. This is the tag - # defined in the second field of DOCTYPE definition. - local DOCTYPE=$(egrep '^\n" - BLOCK="${BLOCK}\n\n" - BLOCK="${BLOCK}\n`gettext "Licenses"`\n" - BLOCK="${BLOCK}\n$(cat ${LICENSES} | sed -r '/<\?xml/,/]>/d')\n" - BLOCK="${BLOCK}\n\n" - BLOCK="${BLOCK}\n\n" - - # Expand the licenses section. Remove everything in-between - # Licenses and Back matter comment. Recreate the comments to - # support further actualizations and concatenate license - # information without their document type definitions preamble. - # This is required in order to prevent validation errors and reuse - # (through locale functionality) the translation messages already - # available for these license files. Finally, close any open tag. - sed -r -i -e "//,//c$(echo ${BLOCK})" $INSTANCE - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setExpansionSystemEntities.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setExpansionSystemEntities.sh deleted file mode 100755 index 090e09c..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setExpansionSystemEntities.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -# docbook_setExpansionSystemEntities.sh -- This function expands system -# entities required by DocBook projects stored under -# `Documentation/Manuals' directory. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setExpansionSystemEntities { - - # Define absolute path to instance where all operations will take - # place in. - local INSTANCE=$1 - - # Define absolute path to both common and specific system - # entities. - local ENTITIES_PATHS="$(cli_getFilesList ${TCAR_WORKDIR}/Documentation/Models/Docbook/Default/Book $(dirname ${TEMPLATE}) \ - --pattern='^.*/[[:alpha:]-]+\.ent$' --maxdepth=1 --mindepth=1 --type='f')" - - # Build definition of both common and specific system entities. - local ENTITIES="$(\ - for ENTITY_PATH in $ENTITIES_PATHS;do - local ENTITY_NAME=$(basename ${ENTITY_PATH}) - echo '\n\t\n' - echo '\t%'${ENTITY_NAME}';' - done)" - - # Define both xml and docbook public definition. - local PREAMBLE="" - PREAMBLE="${PREAMBLE}\n" - - # Remove both xml and docbook preamble from instance and insert - # it again with definitions of required common and specific system - # entities. - sed -r -i "1,2c$(echo $PREAMBLE)" ${INSTANCE} - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setLastRendition.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setLastRendition.sh deleted file mode 100755 index 7205cd8..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setLastRendition.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# docbook_setLastRendition.sh -- This function performs last-rendition -# actions for DocBook files. These are the actions that take -# base-rendition and post-rendition output as input to produce output -# from it. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setLastRendition { - - # Presently, there is no last-rendition action for DocBook base - # rendition but the function should exist for consistency with - # other formats. - return - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setPostRendition.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setPostRendition.sh deleted file mode 100755 index 30afef9..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setPostRendition.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# docbook_setPostRendition.sh -- This function performs post-rendition -# actions for DocBook files. These are the actions that take -# base-rendition output as input to producing output from it. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setPostRendition { - - # Presently, there is no post-rendition action for DocBook base - # rendition but the function should exist for consistency with - # other formats. - return - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setStyles.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setStyles.sh deleted file mode 100755 index 8700f0f..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setStyles.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# -# docbook_setStyles.sh -- This function prepares styles' final -# instances, used in transformations and based on XSL or DSL -# templates. There might be translation markers inside the XSL and -# DSL templates that need to be expanded before they can be used for -# transformations. This function creates temporal instances of XSL -# and DSL templates with translation markers expanded inside so as for -# transformation commands (e.g., `xmltproc' or `openjade' through -# `docbook2pdf') to use as style definition. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setStyles { - - local STYLE_TEMPLATE_FILE='' - local STYLE_TEMPLATE_FILES=$@ - local STYLE_INSTANCE_COMMON='' - local COUNT=0 - - for STYLE_TEMPLATE_FILE in $STYLE_TEMPLATE_FILES;do - - STYLE_TEMPLATE[((++${#STYLE_TEMPLATE[*]}))]="${STYLE_TEMPLATE_FILE}" - STYLE_INSTANCE[((++${#STYLE_INSTANCE[*]}))]="$(cli_getTemporalFile ${STYLE_TEMPLATE_FILE})" - - # Keep track of array's real index value. Remember, it starts - # at zero but counting starts at 1 instead. So, subtracting 1 - # from counting we have the real index value we need to work - # with the information stored in the array. - COUNT=$(( ${#STYLE_INSTANCE[*]} - 1 )) - - # Create style instance from style template. - cp ${STYLE_TEMPLATE[$COUNT]} ${STYLE_INSTANCE[$COUNT]} - - # Define both final an common style instances based on style - # templates. - if [[ $STYLE_TEMPLATE_FILE =~ 'docbook2fo\.xsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[$COUNT]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2pdf\.dsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-(chunks|single)\.xsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-common\.xsl$' ]];then - STYLE_INSTANCE_COMMON=${STYLE_INSTANCE[${COUNT}]} - fi - - done - - # Verify style final instance. This is the file used by - # transformation command (`xsltproc' or `openjade') to produce the - # specified output. We cannot continue without it. - cli_checkFiles -e $STYLE_INSTANCE_FINAL - - # Expand common translation markers in the common style instance, - # if it exists. - if [[ -f $STYLE_INSTANCE_COMMON ]];then - cli_expandTMarkers $STYLE_INSTANCE_COMMON - fi - - # Expand specific translation markers in final style instance. - sed -r -i "s!=STYLE_XHTML_COMMON=!${STYLE_INSTANCE_COMMON}!" ${STYLE_INSTANCE_FINAL} - -} diff --git a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setTranslation.sh b/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setTranslation.sh deleted file mode 100755 index 1d6bad7..0000000 --- a/Automation/Modules/Render/Modules/Docbook/Scripts/docbook_setTranslation.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# -# docbook_setTranslation.sh -- This function standardizes the way -# translation files are applied to DocBook design models in order to -# produce the translated instance that is used to expand translation -# markers and produce different output formats. -# -# Assuming no translation file exists, an untranslated instance is -# taken from the design model and created (i.e., just a copy) from it. -# Using a design model instance (translated or not) is required in -# order to expand translation markers safely. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setTranslation { - - # Print final location of translation file. - cli_printMessage "${TRANSLATION}" --as-translation-line - - # Create translation instance to combine both template translation - # and licenses translations. - local TRANSLATION_INSTANCE=${TMPDIR}/messages.po - - # Define path to DocBook locales using models as reference. - local DOCBOOK_LOCALES=$(cli_getLocalizationDir "$DOCBOOK_MODELS") - - # Define list of all locale files you want to combine. This - # include the localization files related to all different kind of - # licenses you want to use in the main documentation file and the - # localization file of the main documentation file, as well. - local DOCBOOK_PO_FILES="${TCAR_WORKDIR}/Locales/Documentation/Models/Docbook/Default/Licenses/Gfdl/${CLI_LANG_LC}/messages.po \ - ${TCAR_WORKDIR}/Locales/Documentation/Models/Docbook/Default/Licenses/Gpl/${CLI_LANG_LC}/messages.po \ - ${TRANSLATION}" - - # Be sure the files we want to combine do exist. - cli_checkFiles -e ${DOCBOOK_PO_FILES} - - # Combine license translations with template translation in order - # to reuse licenses translations in template files without - # including them in template portable objects. In the case of - # DocBook templates, translations related to licenses are required - # because license content is expanded at execution time inside the - # DocBook instance used by XSL processor during transformation. - msgcat --output=${TRANSLATION_INSTANCE} \ - --width=70 --no-location --use-first ${DOCBOOK_PO_FILES} - - # At this point the translation instance with both licenses and - # manual translations have been saved. Now it is required to - # expand entities so it could be possible to create a translated - # instance with all the content inside. - - # Print action message. - cli_printMessage "${INSTANCE}" --as-translating-line - - # Create the translated instance of design model instance with all - # entities and translation markers expanded. - xml2po -a -l ${CLI_LANG_LL} \ - -p ${TRANSLATION_INSTANCE} \ - -o ${INSTANCE}-${CLI_LANG_LL}.tmp ${INSTANCE} - - # Rename final instance so it can be treated as just instance. - mv ${INSTANCE}-${CLI_LANG_LL}.tmp ${INSTANCE} - - # Remove .xml2po.mo temporal file. - if [[ -f ${PWD}/.xml2po.mo ]];then - rm ${PWD}/.xml2po.mo - fi - - # Verify instance existence. - cli_checkFiles -e $INSTANCE - -} diff --git a/Automation/Modules/Render/Modules/Docbook/docbook.sh b/Automation/Modules/Render/Modules/Docbook/docbook.sh deleted file mode 100755 index 0cb4d7f..0000000 --- a/Automation/Modules/Render/Modules/Docbook/docbook.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash -# -# docbook.sh -- This function performs base-rendition actions for -# DocBook files. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook { - - # Define absolute path to XSL files used for transforming DocBook - # into other formats. - local DOCBOOK_XSL="${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Xsl" - - # Define absolute path to DocBook models. This path must take - # until the directory which holds the main documentation docbook - # file. - local DOCBOOK_MODELS="$(dirname ${TEMPLATE})" - - # Verify absolute path to DocBook models. - cli_checkFiles ${DOCBOOK_MODELS} -d - - # Create the non-translated instance of design model. - cp ${TEMPLATE} ${INSTANCE} - - # Expand common contents inside instance. - docbook_setExpansionLicenses ${INSTANCE} - - # When translated instances are rendered, system entities (e.g., - # `%entity-name;') don't appear in the translated instance (it - # seems that xml2po removes them) and this provokes DocBook - # validation to fail. So in order to pass the validation - # successfully and automate the whole creation of system entities, - # don't let this duty ion users'. Instead, make centos-art.sh - # script responsible of it. - docbook_setExpansionSystemEntities ${INSTANCE} - - # Print validating action. - cli_printMessage "${INSTANCE}" --as-validating-line - - # Validate translated instance before processing it. This step is - # very important in order to detect document's malformations and - # warn you about it, so you can correct them. It is also necessary - # to save them in a new file in order to make translation markers - # expansion possible before transforming the DocBook instance into - # other formats. - xmllint --valid --noent ${INSTANCE} > ${INSTANCE}.tmp - if [[ $? -ne 0 ]];then - cli_printMessage "`gettext "Validation failed."`" --as-error-line - fi - - # Update instance to add translation markers expansion. - mv ${INSTANCE}.tmp ${INSTANCE} - - # Expand translation markers on the temporal instance with - # entities already expanded. - cli_expandTMarkers ${INSTANCE} - - # Verify translation file existence apply translation to docbook - # design model instance in order to produce the translated design - # model instance. - if [[ -f ${TRANSLATION} ]];then - docbook_setTranslation ${INSTANCE} - fi - - # Convert DocBook source files to other formats. - docbook_setConversionXhtmlChunks ${INSTANCE} - docbook_setConversionXhtml ${INSTANCE} - docbook_setConversionText - - # NOTE: The current transformation from DocBook to PDF fails when - # we started to use DocBook tags inside DocBook files. - # Probably we need to test what happen when a newer release of XSL - # is used. Thus, comment production of PDF files until it can be - # produced correctly. - #docbook_setConversionXml2Pdf - - # NOTE: From version 5.0 on, DocBook specification is no longer a - # SGML specification but an XML specification only. Thus, - # transformations related to DocBook SGML specification won't be - # supported in `centos-art.sh' script. - - # Perform format post-rendition. - docbook_setPostRendition - - # Perform format last-rendition. - docbook_setLastRendition - -} diff --git a/Automation/Modules/Render/Modules/Images/images.sh b/Automation/Modules/Render/Modules/Images/images.sh new file mode 100755 index 0000000..61d7a70 --- /dev/null +++ b/Automation/Modules/Render/Modules/Images/images.sh @@ -0,0 +1,49 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Direct/images.sh -- This module +# standardizes production of image files from other image files. +# There is no intermediate process here. The image or images +# provided as value to render-from variable are used to create the +# image specified in the section line using the command specified in +# the command variable, without any intermediate process. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 { + + tcar_checkFiles ${SOURCE[*]} --mime="^image" + + COMMAND=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "command") + if [[ -z ${COMMAND} ]];then + COMMAND="/usr/bin/images -append" + fi + + if [[ ! -d $(dirname ${TARGET}) ]];then + mkdir -p $(dirname ${TARGET}) + fi + + tcar_printMessage "${TARGET}" --as-creating-line + + eval ${COMMAND} ${SOURCES[*]} ${TARGET} + +} diff --git a/Automation/Modules/Render/Modules/Palette/palette.conf.sh b/Automation/Modules/Render/Modules/Palette/palette.conf.sh new file mode 100755 index 0000000..6fb4bc3 --- /dev/null +++ b/Automation/Modules/Render/Modules/Palette/palette.conf.sh @@ -0,0 +1,28 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Alter/alter.conf.sh -- This file provides +# configuration values to alter module. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +###################################################################### + +declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Render/Modules/Palette/palette.sh b/Automation/Modules/Render/Modules/Palette/palette.sh new file mode 100755 index 0000000..c857c8f --- /dev/null +++ b/Automation/Modules/Render/Modules/Palette/palette.sh @@ -0,0 +1,103 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Palette/palette.sh -- This function +# standardizes the way palette of colors are applied to image files +# in order to produce images with specific number of colors. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 palette { + + local FILENAME=$(tcar_getTemporalFile "$(echo ${SOURCES[0]} \ + | sed -r 's/\.[[:alpha:]]+$//')") + + local LOGS=${TARGET}.log + + # Define absolute path to GPL palette. This file is the reference + # taken to set the max number of colors the final image will be + # produced for. + local PALETTE_GPL=$(dirname ${CONFIGURATION})/$(tcar_getConfigValue ${CONFIGURATION} ${SECTION} 'palette-gpl') + + local PALETTE_GPL_COLORS=$(palette_getColors "${PALETTE_GPL}") + + # Define absolute path to PPM palette. The PPM palette is built + # from source palette (PALETTE_GPL) and provides the color + # information understood by `ppmremap', the program used to + # produce images in a specific amount of colors. + local PALETTE_PPM=$(tcar_getTemporalFile 'palette.ppm') + + # Verify format of colors returned in the list. + palette_checkColorFormats "${PALETTE_GPL_COLORS}" + + # Create image in Netpbm superformat (PNM). The PNM image file is + # created from the PNG image rendered previously as centos-art + # base-rendition output. The PNM image is an intermediate format + # used to manipulate images through Netpbm tools. + pngtopnm -verbose \ + < ${SOURCE[0]} 2>${LOGS} > ${FILENAME}.pnm + + # Create PPM palette using GPL palette. + palette_convertGplToPpm + + # Reduce colors as specified in PPM palette. Here we use the PPM + # palette to enforce the color position in the image index and the + # Floyd-Steinberg dithering in order to improve color reduction. + pnmremap -verbose -mapfile=${PALETTE_PPM} -floyd \ + < ${FILENAME}.pnm 2>>${LOGS} > ${FILENAME}.ppm + + # Print action message. + tcar_printMessage "${TARGET}" --as-creating-line + + if [[ ${TARGET} =~ '\.lss$' ]];then + + # Define the HEX palette. The HEX palette is built from source + # palette (PALETTE_GPL) and provides the color information in + # the format understood by `ppmtolss16', the program used to + # produce images in LSS16 format. The HEX palette stores just + # one line with the color information as described in isolinux + # documentation (i.e #RRGGBB=0 #RRGGBB=1 ... [all values in + # the same line]) + local PALETTE_HEX=$(tcar_getTemporalFile "palette.hex") + + # Create HEX palette using GPL palette. + palette_convertGplToHex + + # Create LSS16 image. + ppmtolss16 $(cat ${PALETTE_HEX}) \ + < ${FILENAME}.ppm 2>>${LOGS} > ${TARGET} + + # Create PPM image indexed to 16 colors. Also the colormap + # used in the LSS16 image is saved on ${FILE}.log; this is + # useful to verify the correct order of colors in the image + # index. + lss16toppm -map \ + < ${TARGET} 2>>${LOGS} > ${TARGET}.ppm + + else + + # Create final file. + /usr/bin/convert ${FILENAME}.ppm ${TARGET} + + fi + +} diff --git a/Automation/Modules/Render/Modules/Palette/palette_checkColorFormat.sh b/Automation/Modules/Render/Modules/Palette/palette_checkColorFormat.sh new file mode 100755 index 0000000..d4a6c7f --- /dev/null +++ b/Automation/Modules/Render/Modules/Palette/palette_checkColorFormat.sh @@ -0,0 +1,40 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Alter/Modules/Color/Scripts/palette_checkColorFormats.sh +# -- This function verifies formats of colors (i.e., the way color +# information is specified). +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 palette_checkColorFormats { + + local COLOR='' + local PALETTE_COLORS=${1} + + # Loop through colors and perform format verification as specified + # by pattern. + for COLOR in ${PALETTE_COLORS};do + tcar_checkFiles ${COLOR} --match='#[0-9a-f]{6}$' + done + +} diff --git a/Automation/Modules/Render/Modules/Palette/palette_convertGplToHex.sh b/Automation/Modules/Render/Modules/Palette/palette_convertGplToHex.sh new file mode 100755 index 0000000..5ab4942 --- /dev/null +++ b/Automation/Modules/Render/Modules/Palette/palette_convertGplToHex.sh @@ -0,0 +1,37 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Alter/Modules/Color/Scripts/palette_convertGplToHex.sh +# -- This function takes one palette produced by GIMP (e.g., +# syslinux.gpl) as input and outputs the list of hexadecimal colors +# and their respective index position the `pnmtolss16' program needs +# (e.g., #RRGGBB=0 #RRGGBB=1 ... [all values in the same line]). +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 palette_convertGplToHex { + + # Create list of colors to be processed by `pnmtolss16'. + echo "${PALETTE_GPL_COLORS}" | nl | gawk '{ printf "%s=%d ", $2, $1 - 1 }' \ + > ${PALETTE_HEX} + +} diff --git a/Automation/Modules/Render/Modules/Palette/palette_convertGplToPpm.sh b/Automation/Modules/Render/Modules/Palette/palette_convertGplToPpm.sh new file mode 100755 index 0000000..7e4e832 --- /dev/null +++ b/Automation/Modules/Render/Modules/Palette/palette_convertGplToPpm.sh @@ -0,0 +1,53 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Alter/Modules/Color/Scripts/palette_convertGplToPpm.sh +# -- This function takes one palette produced by Gimp (e.g., +# syslinux.gpl) as input and outputs one PPM file based on it (e.g., +# syslinux.ppm). +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 palette_convertGplToPpm { + + local -a FILES + local COUNT=0 + + # Create temporal images (of 1x1 pixel each) to store each color + # retrieved from Gimp's palette. + for COLOR in ${PALETTE_GPL_COLORS};do + FILES[${COUNT}]=$(tcar_getTemporalFile ${COUNT}.ppm) + ppmmake ${COLOR} 1 1 > ${FILES[${COUNT}]} + COUNT=$((${COUNT} + 1)) + done + + # Concatenate each temporal image from left to right to create the + # PPM file. + pnmcat -lr ${FILES[*]} > ${PALETTE_PPM} + + # Remove temporal images used to build the PPM palette file. + rm ${FILES[*]} + + # Verify PPM palette existence. + tcar_checkFiles -e "${PALETTE_PPM}" + +} diff --git a/Automation/Modules/Render/Modules/Palette/palette_getColors.sh b/Automation/Modules/Render/Modules/Palette/palette_getColors.sh new file mode 100755 index 0000000..346c8fc --- /dev/null +++ b/Automation/Modules/Render/Modules/Palette/palette_getColors.sh @@ -0,0 +1,64 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Alter/Modules/Color/Scripts/palette_getColors.sh +# -- This function takes one palette produced by Gimp (e.g., +# syslinux.gpl) as input and outputs a list of colors in #rrggbb +# format set in the fourth column of it. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 palette_getColors { + + local COLOR='' + local PALETTE_COLORS='' + local PALETTE=${1} + + if [[ -f ${PALETTE} ]];then + + # Retrieve the fourth column from GPL palette. The fourth + # column of a GPL palette contains the palette commentary + # field. The palette commentary field can be anything, but for + # the sake of our own convenience we use it to store the color + # value in hexadecimal format (e.g., rrggbb). Notice that you + # can put your comments from the fifth column on, using an + # space as field separator. + PALETTE_COLORS=$(sed -r '1,/^#/d' ${PALETTE} \ + | gawk '{ printf "%s\n", $4 }') + + else + + # Redefine default background color using The CentOS Project + # default color then. + PALETTE_COLORS='#204c8d' + + fi + + # Be sure all color information be output in the #rrggbb format. + for COLOR in ${PALETTE_COLORS};do + if [[ ! ${COLOR} =~ '^#' ]];then + COLOR="#${COLOR}" + fi + echo "${COLOR}" + done + +} diff --git a/Automation/Modules/Render/Modules/Svg/Modules/Base/base.sh b/Automation/Modules/Render/Modules/Svg/Modules/Base/base.sh new file mode 100755 index 0000000..3c778ec --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/Modules/Base/base.sh @@ -0,0 +1,33 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Modules/Simple/base.sh -- This function +# standardizes base rendition of PNG files. Base rendition consists +# on producing one PNG image for each SVG file provided as source. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 base { + + svg_setBaseRendition + +} diff --git a/Automation/Modules/Render/Modules/Svg/Modules/Extended/extended.sh b/Automation/Modules/Render/Modules/Svg/Modules/Extended/extended.sh new file mode 100755 index 0000000..d740c6c --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/Modules/Extended/extended.sh @@ -0,0 +1,91 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Modules/Extended/extended.sh -- This +# function standardize extended production of PNG files from SVG +# files. The extended production consists on producing PNG images in +# in different formats, heights, foreground colors and background +# colors. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 extended { + + # Retrieve formats you want to produce the image for. This + # variable contains one or more image format supported by + # ImageMagick. For example, `xpm', `jpg', 'tiff', etc. + local FORMATS=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "formats") + if [[ -z ${FORMATS} ]];then + FORMATS="png" + fi + + # Retrieve heights you want to produce the image for. This + # variable contains one or more numerical values. For example, + # `16', `24', `32', etc. + local HEIGHTS=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "heights") + if [[ -z ${HEIGHTS} ]];then + HEIGHTS="16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" + fi + + # Retrieve foreground colors you want to produce the image for. + # This variable contains one or more color number in hexadecimal + # format. For example, `000000', `ffffff', etc. + local FGCOLORS=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "fgcolors") + if [[ -z ${FGCOLORS} ]];then + FGCOLORS="000000" + fi + + # Retrieve background colors you want to produce the image for. + # This variable contains one or more color number in hexadecimal + # format with opacity information included. Opacity is specified + # between 0.0 and 1.0 where 0.0 is full transparency and 1.0 full + # opacity. For example, the following values are accepted: + # `000000-0', `ffffff-1', etc. + local BGCOLORS=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "bgcolors") + if [[ -z ${BGCOLORS} ]];then + BGCOLORS="ffffff-0 ffffff-1" + fi + + for FGCOLOR in ${FGCOLORS};do + + # Verify value passed as foreground color. + tcar_checkFiles ${FGCOLOR} --match="^[a-fA-F0-9]{3,6}$" + + for BGCOLOR in ${BGCOLORS};do + + # Verify value passed as background color. + tcar_checkFiles ${BGCOLOR} --match="^[a-fA-F0-9]{6}-(0|1)$" + + for HEIGHT in ${HEIGHTS};do + + # Verify value passed as height. + tcar_checkFiles ${HEIGHT} --match="^[[:digit:]]+$" + + # Do base rendition actions. + extended_setBaseRendition + + done + done + done + + +} diff --git a/Automation/Modules/Render/Modules/Svg/Modules/Extended/extended_setBaseRendition.sh b/Automation/Modules/Render/Modules/Svg/Modules/Extended/extended_setBaseRendition.sh new file mode 100755 index 0000000..bad1dd6 --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/Modules/Extended/extended_setBaseRendition.sh @@ -0,0 +1,53 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Modules/Extended/Scripts/extended_setBaseRendition.sh +# -- This function standardize base rendition tasks needed to +# perform the extended production of PNG files from SVG files. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 extended_setBaseRendition { + + # Redefine absolute path to final file. + local TARGET=$(dirname ${CONFIGURATION})/Images/${FGCOLOR}/${BGCOLOR}/${HEIGHT}/${SECTION} + if [[ ! ${TCAR_SCRIPT_LANG_LL} =~ '^en$' ]];then + TARGET=$(dirname ${CONFIGURATION})/${TCAR_SCRIPTS_LANG_LC}/Images/${FGCOLOR}/${BGCOLOR}/${HEIGHT}/${SECTION} + fi + + svg_setBaseRendition + + # Create path for different image formats creation using PNG image + # extension as reference. + local TARGET=$(echo ${TARGET} | sed -r "s/\.png$//") + + # Convert images from PNG to those formats specified in the + # configuration file. + for FORMAT in ${FORMATS};do + if [[ ${FORMAT} =~ 'png' ]];then + continue + fi + tcar_printMessage "${TARGET}.${FORMAT}" --as-creating-line + convert ${TARGET}.png ${TARGET}.${FORMAT} + done + +} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkColorAmount.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkColorAmount.sh deleted file mode 100755 index 8d25900..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkColorAmount.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# svg_checkColorAmount.sh -- This function verifies whether the list -# of colors provided in the first argument matches the amount of -# colors specified by the second argument. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkColorAmount { - - # Define list of colors. - local COLORS=$1 - - # Define the amount of colors the list provided must have, in - # order to be considered as valid. - local NUMBER=$2 - - # Verify amount of colors provided in the list. - if [[ $(echo "$COLORS" | wc -l) -ne $NUMBER ]];then - cli_printMessage "`gettext "The palette does not have the correct number of colors."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkColorFormats.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkColorFormats.sh deleted file mode 100755 index 19ddd9d..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkColorFormats.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# -# svg_checkColorFormats.sh -- This function verifies formats of colors -# (i.e., the way color information is specified). -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkColorFormats { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='format:' - - # Initialize pattern used for color sanitation. - local PATTERN='^#[0-9a-f]{6}$' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS variable for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --format ) - - case "$2" in - - rrggbb|*) - PATTERN='^#[0-9a-f]{6}$' - ;; - - esac - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # Define the location we want to apply verifications to. - local COLOR='' - local COLORS="$@" - - # Loop through colors and perform format verification as specified - # by pattern. - for COLOR in $COLORS;do - - if [[ ! $COLOR =~ $PATTERN ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$COLOR\\\" string is not a valid color code."`" --as-error-line - fi - - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkModelAbsref.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkModelAbsref.sh deleted file mode 100755 index 4775e26..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkModelAbsref.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash -# -# svg_checkModelAbsref.sh -- This function retrives absolute files and -# checks their existence. In order for design templates to point -# different artistic motifs, design templates make use of external -# files which point to specific artistic motif background images. If -# such external files don't exist, try to create the background image -# required by cropping a higher background image (e.g., -# 2048x1536-final.png). If this isn't possible neither, then create -# the background image using a plain color and crop from it then. We -# can't go on without the required background information. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkModelAbsref { - - local FILE='' - local BG_DST_FILES='' - local BG_DST_FILE='' - local BG_DST_FILE_WIDTH='' - local BG_DST_FILE_HEIGHT='' - local BG_SRC_FILE='' - local BG_SRC_FILE_COLOR='' - local BG_SRC_FILE_WIDTH='' - local BG_SRC_FILE_HEIGHT='' - - # Define absolute path to the translated instance of design model. - FILE="$1" - - # Verify existence of file we need to retrive absolute paths from. - cli_checkFiles -e "$FILE" - - # Retrive absolute paths from file. - BG_DST_FILES=$(egrep "(sodipodi:absref|xlink:href)=\"${HOME}.+" $FILE \ - | sed -r "s,.+=\"(${HOME}.+\.png)\".*,\1," | sort | uniq) - - # Verify absolute paths retrived from file. - for BG_DST_FILE in $BG_DST_FILES;do - - # Print action message. - cli_printMessage "$BG_DST_FILE" --as-checking-line - - # Verify parent directory of absolute files retrived from - # file. This is required to prevent the construction of paths - # to locations that don't exist. For example, when including - # background images in SVG files, it is possible that the path - # information inside SVG files get outdated temporarly. If in - # that exact moment, you try to render the SVG file it won't - # be possible to create the image used for cropping because - # the path build from the location inside SVG file doesn't - # exist. In this case, centos-art.sh script will end up with - # `file ... doesn't exist' errors. - cli_checkFiles -d "$(dirname ${BG_DST_FILE})" - - if [[ ! -a $BG_DST_FILE ]];then - - # Define the source background file, the image file will - # crop when no specific background informatio be available - # for using. Generally, this is the most reusable - # background file inside the artistic motifs (e.g,. the - # `2048x1536-final.png' file). We can use this image file - # to create almost all artworks inside The CentOS - # Distribution visual manifestation when - # resolution-specific backgrounds don't exist. - BG_SRC_FILE=$(echo $BG_DST_FILE \ - | sed -r "s!(.+)/[[:digit:]]+x[[:digit:]]+(-final\.png)!\1/2048x1536\2!") - - # Verify existence of source background file. If the file - # doesn't exist create it using The CentOS Project default - # background color information, as specified in its - # corporate identity manual. - if [[ ! -f $BG_SRC_FILE ]];then - - # Define plain color that will be used as background. - BG_SRC_FILE_COLOR=$(svg_getColors) - - # Verify format of color value. - svg_checkColorFormats $BG_SRC_FILE_COLOR --format='rrggbb' - - # Define width for the source background file the - # required background information is cropped from. - BG_SRC_FILE_WIDTH=$(echo $BG_SRC_FILE \ - | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') - - # Define height for the source background file the - # required background information is cropped from. - BG_SRC_FILE_HEIGHT=$(echo $BG_SRC_FILE \ - | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') - - # Print action message. - cli_printMessage "${BG_SRC_FILE} ($BG_SRC_FILE_COLOR)" --as-creating-line - - # Create the source background file. - ppmmake -quiet ${BG_SRC_FILE_COLOR} \ - ${BG_SRC_FILE_WIDTH} ${BG_SRC_FILE_HEIGHT} \ - | pnmtopng > ${BG_SRC_FILE} - - fi - - # Print action message. - cli_printMessage "$BG_SRC_FILE" --as-cropping-line - - # Define the width of the required background information. - BG_DST_FILE_WIDTH=$(echo $BG_DST_FILE \ - | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') - - # Define the height of the required background information. - BG_DST_FILE_HEIGHT=$(echo $BG_DST_FILE \ - | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') - - # Create required backgrounnd information. - convert -quiet \ - -crop ${BG_DST_FILE_WIDTH}x${BG_DST_FILE_HEIGHT}+0+0 \ - ${BG_SRC_FILE} ${BG_DST_FILE} - - # Verify required background information. - cli_checkFiles -e $BG_DST_FILE - - fi - - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkModelExportId.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkModelExportId.sh deleted file mode 100755 index 2944195..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_checkModelExportId.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# svg_checkModelExportId.sh -- This function standardizes the export -# id used inside svg files and the way of verify them. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkModelExportId { - - local INSTANCE="$1" - local EXPORTID="$2" - - # Verify instance. - cli_checkFiles -e $INSTANCE - - # Verify export id. - if [[ $EXPORTID == '' ]];then - cli_printMessage "`gettext "The export id value cannot be empty."`" --as-error-line - fi - - # Check export id inside design templates. - grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null - if [[ $? -gt 0 ]];then - cli_printMessage "`eval_gettext "There is not export id (\\\$EXPORTID) inside \\\"\\\$TEMPLATE\\\"."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertGplToHex.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertGplToHex.sh deleted file mode 100755 index 51efe26..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertGplToHex.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# svg_convertGplToHex.sh -- This function takes one palette produced -# by Gimp (e.g., syslinux.gpl) as input and outputs the list of -# hexadecimal colors and their respective index position the -# `pnmtolss16' program needs (e.g., #RRGGBB=0 #RRGGBB=1 ... [all -# values in the same line]). -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertGplToHex { - - # Define path to GPL palette. This is the .gpl file we use to - # retrive color information from. - local PALETTE_GPL="$1" - - # Define path to HEX palette. This is the palette used to stored - # the color information the `ppmtolss16' program needs. - local PALETTE_HEX="$2" - - # Define the number of colors this function should return. - local NUMBER="$3" - - # Define list of colors from GPL palette. - local COLORS=$(svg_getColors $PALETTE_GPL --head=$NUMBER --tail=$NUMBER) - - # Verify number of colors returned in the list. They must match - # exactly the amount specified, no more no less. Sometimes, the - # list of colors may have less colors than it should have, so we - # need to prevent such palettes from being used. - svg_checkColorAmount "$COLORS" "$NUMBER" - - # Verify format of colors. - svg_checkColorFormats "$COLORS" --format='rrggbb' - - # Create list of colors to be processed by `pnmtolss16'. - echo "$COLORS" | nl | gawk '{ printf "%s=%d ", $2, $1 - 1 }' \ - > $PALETTE_HEX - - # Verify HEX palette existence. - cli_checkFiles -e $PALETTE_HEX - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertGplToPpm.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertGplToPpm.sh deleted file mode 100755 index 559127b..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertGplToPpm.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# svg_convertGplToPpm.sh -- This function takes one palette produced -# by Gimp (e.g., syslinux.gpl) as input and outputs one PPM file based -# on it (e.g., syslinux.ppm). -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertGplToPpm { - - local -a FILES - local COUNT=0 - - # Define path to GPL palette. This is the .gpl file we use to - # retrive color information from. - local PALETTE_GPL="$1" - - # Define path to PPM palette. This is the .ppm file we'll save - # color information to. - local PALETTE_PPM="$2" - - # Define the number of colors this function should return. - local NUMBER="$3" - - # Define list of colors from GPL palette. - local COLOR='' - local COLORS=$(svg_getColors "$PALETTE_GPL" --head=$NUMBER --tail=$NUMBER --format='rrrggbb') - - # Verify amount of colors in the list of colors. - svg_checkColorAmount "$COLORS" "$NUMBER" - - # Verify format of colors. - svg_checkColorFormats $COLORS --format='rrggbb' - - # Create temporal images (of 1x1 pixel each) to store each color - # retrived from Gimp's palette. - for COLOR in $COLORS;do - FILES[$COUNT]=$(cli_getTemporalFile ${COUNT}.ppm) - ppmmake $COLOR 1 1 > ${FILES[$COUNT]} - COUNT=$(($COUNT + 1)) - done - - # Concatenate each temporal image from left to right to create the - # PPM file. - pnmcat -lr ${FILES[*]} > $PALETTE_PPM - - # Remove temporal images used to build the PPM palette file. - rm ${FILES[*]} - - # Verify PPM palette existence. - cli_checkFiles -e "$PALETTE_PPM" - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngTo.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngTo.sh deleted file mode 100755 index 9fad7ba..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngTo.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# svg_convertPngTo.sh -- This function provides post-rendition actions -# to use the `convert' command of ImageMagick tool set. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngTo { - - # Initialize image formats. - local FORMAT='' - local FORMATS=$(render_getConfigOption "$ACTION" '2') - - # Convert from PNG to specified formats. - for FORMAT in $FORMATS;do - cli_printMessage "${FILE}.${FORMAT}" --as-savedas-line - convert -quality 85 ${FILE}.png ${FILE}.${FORMAT} - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToBranded.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToBranded.sh deleted file mode 100755 index 8ffba47..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToBranded.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToBranded.sh -- This function standardizes image -# branding. Once the base PNG image is rendered and the -# `--with-brands' option is provided, this function composites a new -# branded image using the preferences set in the related -# `branding.conf' file. The `branding.conf' file must be stored -# inside the related design model component used as reference to -# produce the base PNG image. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToBranded { - - # Verify whether the option `--with-brands' was provided or not to - # `centos-art.sh' script command-line. - if [[ $FLAG_WITH_BRANDS == 'false' ]];then - return - fi - - local BRANDING_CONF_FILE='' - local BRANDING_CONF_SECTION='' - local BRANDING_CONF_VALUES='' - local BRANDING_CONF_VALUE='' - local BRANDFILE='' - local POSITION='' - local POSITIONS='' - - # Define absolute path to branding configuration file. - BRANDING_CONF_FILE="$(dirname ${TEMPLATE})/branding.conf" - - # Verify absolute path to branding configuration file. This is - # required in order to avoid trying to render branded content - # which doesn't have an associated `branding.conf' file. If there - # is no associated `branding.conf' file don't stop the script - # execution. Instead, continue with the next action in the list. - # This is required in order to perform massive rendition inside - # structures like themes where components might or might not have - # `branding.conf' files associated. For example, the `Concept' - # component doesn't have branding information associated but most - # elements inside `Distro' component do. - if [[ ! -f "$BRANDING_CONF_FILE" ]];then - continue - fi - - # Define regular expression matching the variable name (i.e., the - # left column), inside the configuration line, you want to match - # on. - BRANDING_CONF_VARNAME=$(basename ${TEMPLATE}) - - # Define list of configuration lines related to current design - # model. This are the lines that tell us how and where to apply - # branding information on base PNG image. Be sure that only - # configuration lines from supported section names (e.g., - # `symbol', `type', `logo') be read, no need to waste resources - # with others. - BRANDING_CONF_VALUES=$(\ - for BRANDING_CONF_SECTION in $(echo "types symbols logos");do - cli_getConfigValue "${BRANDING_CONF_FILE}" "${BRANDING_CONF_SECTION}" "${BRANDING_CONF_VARNAME}" - done) - - for BRANDING_CONF_VALUE in $BRANDING_CONF_VALUES;do - - # Define absolute path to image file used as brand. This is - # the image put over the PNG image produced as result of - # design models base rendition. - BRANDFILE=${TCAR_WORKDIR}/Identity/Images/Brands/$(echo $BRANDING_CONF_VALUE \ - | gawk 'BEGIN{ FS=":" } { print $1 }' ) - - # Verify absolute path to image file used as brand. Assuming - # no brand image file is found, continue with the next - # configuration line. - if [[ ! -f $BRANDFILE ]];then - continue - fi - - # Define list of positions using the format of ImageMagick - # `-geometry' option argument. - POSITIONS=$(echo "$BRANDING_CONF_VALUE" | cut -d: -f2- | tr ':' ' ') - - # Loop through list of brand image positions and use the - # composite command from ImageMagick, to overlap the unbranded - # image just rendered with the branded version of itself. - for POSITION in $POSITIONS;do - composite -geometry ${POSITION} ${BRANDFILE} ${FILE}.png ${FILE}.png - done - - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToDm.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToDm.sh deleted file mode 100755 index 4ba8b10..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToDm.sh +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToDm.sh -- This function standardize production of -# display managers (e.g., Gdm and Kdm). This function copies all files -# needed into a temporal directory, realize expansion of translation -# markers and packs all the files into a tar.gz package that is used -# for installation. This function must be used as last-rendition -# action for Gdm and Kdm directory specific base-rendition actions. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToDm { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Initialize source and destination local variables. - local SRC='' - local DST='' - - # Initialize display manager type. - local DM=$(render_getConfigOption "${ACTION}" '2') - - # Initialize screen resolutions used by display manager theme. - # These are the different screen resolutions a display manager - # theme is built for. The amount of screen resolution a display - # manager theme can be built for is limited to the amount of - # background files provided by the artistic motif used to build - # the display manager theme. - local RESOLUTION='' - local RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3') - - # Verify screen resolutions. We cannot produce display manager - # theme if no screen resolution has been specified. - if [[ "$RESOLUTIONS" == '' ]];then - cli_printMessage "`gettext "There is no resolution information to process."`" --as-error-line - fi - - # Initialize theme information we are going to build the display - # manager theme for. - local THEME=$(cli_getPathComponent $ACTIONVAL --motif) - local THEME_NAME=$(cli_getPathComponent $ACTIONVAL --motif-name) - - # Initialize temporal directory where we collect all files needed - # in order to create the tar.gz file. This intermediate step is - # also needed in order to expand translation markers from XML and - # Desktop definitions. - local TMPDIR=$(cli_getTemporalFile 'dm') - - # Initialize source location for brands. This is the place where - # brand information, needed to build the display manager theme, is - # retrieved from. - local BRAND_BASEDIR=${TCAR_WORKDIR}/Identity/Images/Brands - - # Initialize source location for artistic motif's backgrounds. - # This is the place where background information needed to ubild - # the display manager theme is retrieved from. - local BGS=${TCAR_WORKDIR}/Identity/Images/Themes/${THEME}/Backgrounds/Img/Png - - # Initialize file variables. File variables are used build and - # process the file relation between source and target locations. - local FILE='' - local FILES='' - - # Define major release from template. - local MAJOR_RELEASE=$(cli_getPathComponent "$TEMPLATE" "--release-major") - - # Define file relation between source and target locations, based - # on whether we are producing GDM or KDM. Use the colon character - # (`:') as separator; on the left side we put the file's source - # location and in the right side the file's target location. - # Presently, both GDM and KDM are very similar on files with the - # exception that GDM does use icons near actions buttons (e.g., - # shutdown, reboot, session, language) and KDM doesn't. - case ${DM} in - - Gdm ) - FILES="\ - ${BRAND_BASEDIR}/Symbols/48/${TCAR_BRAND}.png:${TCAR_BRAND}-symbol.png - ${OUTPUT}/screenshot.png:screenshot.png - $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml - $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop - $(dirname $TEMPLATE)/icon-language.png:icon-language.png - $(dirname $TEMPLATE)/icon-reboot.png:icon-reboot.png - $(dirname $TEMPLATE)/icon-session.png:icon-session.png - $(dirname $TEMPLATE)/icon-shutdown.png:icon-shutdown.png - " - ;; - - Kdm ) - FILES="\ - ${BRAND_BASEDIR}/Symbols/48/${TCAR_BRAND}.png:${TCAR_BRAND}-symbol.png - ${OUTPUT}/screenshot.png:screenshot.png - $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml - $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop - " - ;; - - * ) - cli_printMessage "`eval_gettext "The \\\"\\\$DM\\\" display manager is not supported yet."`" --as-error-line - ;; - esac - - for FILE in $FILES;do - - # Define source location. - SRC=$(echo $FILE | cut -d: -f1) - - # Define target location. - DST=${TMPDIR}/${THEME_NAME}/$(echo $FILE | cut -d: -f2) - - # Verify source files. - cli_checkFiles -e $SRC - - # Verify parent directory for target file. - if [[ ! -d $(dirname $DST) ]];then - mkdir -p $(dirname $DST) - fi - - # Copy files from source to target location. - cp ${SRC} ${DST} - - # Expand translation markers. - if [[ ${DST} =~ "\.(xml|desktop)$" ]];then - cli_expandTMarkers "${DST}" - fi - - done - - # Move into temporal directory. - pushd $TMPDIR > /dev/null - - for RESOLUTION in $RESOLUTIONS;do - - # Verify background information. If it doesn't exist go on - # with the next one in the list. - if [[ ! -f $BGS/${RESOLUTION}-final.png ]];then - continue - fi - - # Print action message. - if [[ -f ${RESOLUTION}.tar.gz ]];then - cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-updating-line - else - cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-creating-line - fi - - # Copy background information. - cp $BGS/${RESOLUTION}-final.png ${THEME_NAME}/background.png - - # Create tar.gz file. - tar -czf ${RESOLUTION}.tar.gz ${THEME_NAME} - - # Move from temporal directory to its final location. - mv ${RESOLUTION}.tar.gz ${OUTPUT} - - done - - # Return to where we were initially. - popd > /dev/null - - # Remove temporal directory. - rm -r ${TMPDIR} - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToGrub.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToGrub.sh deleted file mode 100755 index 00da4d6..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToGrub.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToGrub.sh -- This function provides post-rendition -# action used to produce GRUB images. -# -# Initially, the color information is defined with GIMP (The GNU Image -# Manipulation Program) as a `.gpl' palette of color. This palette of -# colors contains 14 colors only and is saved in a file named -# `grub.gpl. The `grub.gpl' file is used to build the `grub.ppm' file -# which provide the color information needed to reduce the full color -# PNG image, produced as result of SVG base-rendition, to the amount -# of colors specified (i.e., 14 colors). Later, with the 14 color PNG -# image already created, the `grub.ppm' file is used to build the -# `splash.xpm.gz' file. -# -# In order for this function to work, the `grub.gpl' file should have -# a format similar to the following: -# -# GIMP Palette -# Name: CentOS-TreeFlower-4-Syslinux -# Columns: 14 -# # -# 32 76 141 204c8d -# 36 82 146 245292 -# 52 93 152 345d98 -# 72 108 162 486ca2 -# 102 131 176 6683b0 -# 126 153 190 7e99be -# 146 170 200 92aac8 -# 161 182 209 a1b6d1 -# 182 199 219 b6c7db -# 202 214 228 cad6e4 -# 221 230 238 dde6ee -# 235 241 245 ebf1f5 -# 246 251 254 f6fbfe -# 254 255 252 fefffc -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToGrub { - - # Define number of colors the images will be produced on. - local COLORS='14' - - # Define options using those passed to actions from pre-rendition - # configuration script. These options are applied to pnmremap when - # doing color reduction, so any option available for pnmremap - # command can be passed to renderSyslinux functionality. - local OPTIONS=$(render_getConfigOption "$ACTION" '2-') - - # Check options passed to action. This is required in order to - # aviod using options used already in this script. For example - # -verbose and -mapfile options. - for OPTION in $OPTIONS;do - # Remove anything after equal sign inside option. - OPTION=$(echo -n $OPTION | cut -d'=' -f1) - if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line - fi - done - - # Define file name prefix. - local PREFIX="-${COLORS}c" - - # Redefine file name prefix using options as reference. This is - # useful to differenciate final files produced using - # Floyd-Steinberg dithering and files which are not. - if [[ "$OPTIONS" =~ '-floyd' ]];then - PREFIX="${PREFIX}-floyd" - fi - - # Define logs' file. Log files are stored in the same place of - # images and are used to store output information produced by - # programs when the image files are built up. - local LOGS=${FILE}${PREFIX}.log - - # Define absolute path to GPL palette. This palettes should have - # 14 colors only. For more information on this see the GRUB's - # documentation. - local PALETTE_GPL=${MOTIF_DIR}/Palettes/grub.gpl - - # Verify GPL palette existence. If it doesn't exist copy the one - # provided by the design model through subversion (to keep track - # of the change) and expand translation markers in the copied - # instance. - if [[ ! -f $PALETTE_GPL ]];then - cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} - cli_expandTMarkers ${PALETTE_GPL} - fi - - # Define absolute path to PPM palette. The PPM palette is built - # from source palette (PALETTE_GPL) and provides the color - # information understood by `ppmremap', the program used to - # produce images in a specific amount of colors. - local PALETTE_PPM=$(cli_getTemporalFile "grub.ppm") - - # Create image in Netpbm superformat (PNM). The PNM image file is - # created from the PNG image rendered previously as centos-art - # base-rendition output. The PNM image is an intermediate format - # used to manipulate images through Netpbm tools. - cli_printMessage "${FILE}.pnm" --as-savedas-line - pngtopnm -verbose \ - < ${FILE}.png 2>${LOGS} > ${FILE}.pnm - - # Print the path to GPL palette. - cli_printMessage "$PALETTE_GPL" --as-palette-line - - # Create PPM palette using GPL palette. - svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" - - # Reduce colors as specified in PPM palette. Here we use the PPM - # palette to enforce the color position in the image index and the - # Floyd-Steinberg dithering in order to improve color reduction. - cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line - pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ - < ${FILE}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.ppm - - # Remove PPM palette. It is no longer needed. - if [[ -f ${PALETTE_PPM} ]];then - rm $PALETTE_PPM - fi - - # Create the 14 colors xpm.gz file. - cli_printMessage "${FILE}${PREFIX}.xpm.gz" --as-savedas-line - ppmtoxpm \ - < ${FILE}${PREFIX}.ppm 2>>${LOGS} > ${FILE}.xpm \ - && gzip --force ${FILE}.xpm \ - && mv ${FILE}.xpm.gz ${FILE}${PREFIX}.xpm.gz - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToIcons.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToIcons.sh deleted file mode 100755 index 1c4a1af..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToIcons.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToIcons.sh -- This function provides post-rendition -# actions to produce icon images in different sizes and formats from -# the same SVG design model. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToIcons { - - # Define height dimensions you want to produce brands for. - local SIZE="" - local SIZES="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200 512" - - # Define image formats you want to produce brands for. - local FORMAT="" - local FORMATS="" - - for SIZE in ${SIZES};do - - # Redefine absolute path to file location where size-specific - # images will be stored in. - local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) - - # Prepare directory where size-specific images will be stored - # in. If it doesn't exist create it. - if [[ ! -d $(dirname $FINALFILE) ]];then - mkdir -p $(dirname $FINALFILE) - fi - - # Print action message. - cli_printMessage "${FINALFILE}.png" --as-creating-line - - # Create size-specific PNG image ommiting all output. - inkscape $INSTANCE --export-id=$EXPORTID \ - --export-png=${FINALFILE}.png --export-height=${SIZE} \ - &> /dev/null - - #for FORMAT in ${FORMATS};do - # - # # Print action message. - # cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line - # - # # Convert size-specific PNG image into different formats. - # convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} - # - #done - - # Create copy of size-specific image in 2 colors. - #cli_printMessage "${FINALFILE}.xbm" --as-creating-line - #convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm - - # Create copy of size-specific image with emboss effect. - #cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line - #convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png - - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToKsplash.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToKsplash.sh deleted file mode 100755 index 091245d..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToKsplash.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToKsplash.sh -- This function collects KDE splash -# (KSplash) required files and creates a tar.gz package that groups -# them all together. Use this function as last-rendition action for -# KSplash base-rendition action. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToKsplash { - - local -a SRC - local -a DST - local FONT='' - local COUNT=0 - - # Define font used to print bottom splash message. - FONT=$(svg_getTTFont "DejaVuLGCSans-Bold") - - # Check existence of font file. - cli_checkFiles -e "$FONT" - - # Define absolute source location of files. - SRC[0]="${OUTPUT}/splash_top.png" - SRC[1]="${OUTPUT}/splash_active_bar.png" - SRC[2]="${OUTPUT}/splash_inactive_bar.png" - SRC[3]="${OUTPUT}/splash_bottom.png" - SRC[4]="$(dirname $TEMPLATE)/Theme.rc" - - # Check absolute source location of files. - cli_checkFiles -e "${SRC[@]}" - - # Define relative target location of files. - DST[0]="${OUTPUT}/splash_top.png" - DST[1]="${OUTPUT}/splash_active_bar.png" - DST[2]="${OUTPUT}/splash_inactive_bar.png" - DST[3]="${OUTPUT}/splash_bottom.png" - DST[4]="${OUTPUT}/Theme.rc" - - # Print action message. - cli_printMessage "${OUTPUT}/Preview.png" --as-creating-line - - # Create `Preview.png' image. - convert -append ${SRC[0]} ${SRC[1]} ${SRC[3]} ${OUTPUT}/Preview.png - - # Add bottom text to Preview.png image. The text position was set - # inside an image of 400x300 pixels. If you change the final - # preview image dimension, you probably need to change the text - # position too. - mogrify -draw 'text 6,295 "KDE is up and running."' \ - -fill \#ffffff \ - -font $FONT \ - ${OUTPUT}/Preview.png - - # Copy `Theme.rc' file. - cp ${SRC[4]} ${DST[4]} - - # Apply common translation markers to Theme.rc file. - cli_expandTMarkers "${DST[4]}" - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToSyslinux.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToSyslinux.sh deleted file mode 100755 index d04b0a0..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToSyslinux.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToSyslinux.sh -- This function provides post-rendition -# action used to produce LSS16 images, the images used by isolinux. -# -# Initially, the color information is defined with GIMP (The GNU Image -# Manipulation Program) as a `.gpl' palette of color. This palette of -# colors contains 16 colors only and is saved in a file named -# `syslinux.gpl. The `syslinux.gpl' file is used to build two other -# files: the `syslinux.ppm' file and the `syslinux.hex' file. The -# `syslinux.ppm' provides the color information needed to reduce the -# full color PNG image, produced as result of SVG base-rendition, to -# the amount of colors specified (i.e., 16 colors). Later, with the 16 -# color PNG image already created, the `syslinux.hex' file is used to -# build the LSS16 image. -# -# In order to produce images in LSS16 format correctly, it is required -# that both the `syslinux.ppm' and `syslinux.hex' files do contain the -# same color information. This is, both `syslinux.ppm' and -# `syslinux.hex' must represent the same color values and in the same -# color index. -# -# In order for this function to work, the `syslinux.gpl' file should -# have a format similar to the following: -# -# GIMP Palette -# Name: CentOS-TreeFlower-4-Syslinux -# Columns: 16 -# # -# 32 76 141 204c8d -# 37 82 146 255292 -# 52 94 153 345e99 -# 73 110 162 496ea2 -# 91 124 172 5b7cac -# 108 136 180 6c88b4 -# 120 146 186 7892ba -# 131 158 193 839ec1 -# 255 255 255 ffffff -# 146 170 200 92aac8 -# 162 182 209 a2b6d1 -# 183 199 219 b7c7db -# 204 216 230 ccd8e6 -# 221 229 238 dde5ee -# 235 241 245 ebf1f5 -# 246 251 254 f6fbfe -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToSyslinux { - - # Define number of colors the images will be produced on. - local COLORS='16' - - # Define options using those passed to actions from pre-rendition - # configuration script. These options are applied to pnmremap when - # doing color reduction, so any option available for pnmremap - # command can be passed to renderSyslinux functionality. - local OPTIONS=$(render_getConfigOption "$ACTION" '2-') - - # Check options passed to action. This is required in order to - # aviod using options already used in this script. For example - # -verbose and -mapfile options. - for OPTION in $OPTIONS;do - # Remove anything after equal sign inside option. - OPTION=$(echo $OPTION | cut -d'=' -f1) - if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line - fi - done - - # Define default file name prefix for 16 colors images. - local PREFIX="-${COLORS}c" - - # Re-define 16 colors images default file name prefix using - # options as reference. This is useful to differenciate final - # files produced using Floyd-Steinberg dithering and final files - # which are not. - if [[ "$OPTIONS" =~ '-floyd' ]];then - PREFIX="${PREFIX}-floyd" - fi - - # Define logs' file. Log files are stored in the same place of - # images and are used to store output information produced by - # programs when the image files are built up. - local LOGS=${FILE}${PREFIX}.log - - # Define absolute path to GPL palette. The GPL palette defines the - # color information used to build syslinux images. This palette - # should be set to 16 colors and, as specified in isolinux - # documentation, the background color should be indexed on - # position 0 and the forground in position 7 (see - # /usr/share/doc/syslinux-X.XX/isolinux.doc, for more - # information.) - local PALETTE_GPL=${MOTIF_DIR}/Palettes/syslinux.gpl - - # Verify GPL palette existence. If it doesn't exist copy the one - # provided by the design model through subversion (to keep track - # of the change) and expand translation markers in the copied - # instance. - if [[ ! -f $PALETTE_GPL ]];then - cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL} - cli_expandTMarkers ${PALETTE_GPL} - fi - - # Define absolute path to PPM palette. The PPM palette is built - # from source palette (PALETTE_GPL) and provides the color - # information understood by `ppmremap', the program used to - # produce images in a specific amount of colors. - local PALETTE_PPM=$(cli_getTemporalFile "syslinux.ppm") - - # Define the HEX palette. The HEX palette is built from source - # palette (PALETTE_GPL) and provides the color information in the - # format understood by `ppmtolss16', the program used to produce - # images in LSS16 format. The HEX palette stores just one line - # with the color information as described in isolinux - # documentation (i.e #RRGGBB=0 #RRGGBB=1 ... [all values in the - # same line]) - local PALETTE_HEX=$(cli_getTemporalFile "syslinux.hex") - - # Create image in Netpbm superformat (PNM). The PNM image file is - # created from the PNG image rendered previously as centos-art - # base-rendition output. The PNM image is an intermediate format - # used to manipulate images through Netpbm tools. - cli_printMessage "${FILE}.pnm" --as-savedas-line - pngtopnm -verbose \ - < ${FILE}.png 2>${LOGS} > ${FILE}.pnm - - # Print the path to GPL palette. - cli_printMessage "$PALETTE_GPL" --as-palette-line - - # Create PPM palette using GPL palette. - svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" - - # Create HEX palette using GPL palette. - svg_convertGplToHex "$PALETTE_GPL" "$PALETTE_HEX" "$COLORS" - - # Reduce colors as specified in PPM palette. Here we use the PPM - # palette to enforce the color position in the image index and the - # Floyd-Steinberg dithering in order to improve color reduction. - cli_printMessage "${FILE}${PREFIX}.pnm" --as-savedas-line - pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ - < ${FILE}.pnm 2>> ${LOGS} > ${FILE}${PREFIX}.pnm - - # Create LSS16 image. - cli_printMessage "${FILE}${PREFIX}.lss" --as-savedas-line - ppmtolss16 $(cat $PALETTE_HEX) \ - < ${FILE}${PREFIX}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.lss - - # Remove HEX palette. It is no longer needed. - if [[ -f ${PALETTE_HEX} ]];then - rm $PALETTE_HEX - fi - - # Create PPM image indexed to 16 colors. Also the colormap used in - # the LSS16 image is saved on ${FILE}.log; this is useful to - # verify the correct order of colors in the image index. - cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line - lss16toppm -map \ - < ${FILE}${PREFIX}.lss 2>>${LOGS} > ${FILE}${PREFIX}.ppm - - # Create PNG image indexed to 16 colors. - cli_printMessage "${FILE}${PREFIX}.png" --as-savedas-line - pnmtopng -verbose \ - < ${FILE}${PREFIX}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.png - - # Remove PPM palette. It is no longer needed. - if [[ -f ${PALETTE_PPM} ]];then - rm $PALETTE_PPM - fi - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToThumbnail.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToThumbnail.sh deleted file mode 100755 index 52dcf3b..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_convertPngToThumbnail.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToThumbnail.sh -- This function provides -# post-rendition to create thumbnails from images produced by -# centos-art base-rendition. Thumbnails are created in PNG and JPG -# format for you to decide which is the more appropriate one. When no -# size is specified, thumbnails are created at 250 pixels width and -# height is automatically calculated to match the image ratio. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToThumbnail { - - # Get image size. - local SIZE='' - local SIZES=$(render_getConfigOption "$ACTION" '2-') - - # Check image sizes and do convertion. - if [[ "$SIZES" == "" ]];then - SIZES='250' - fi - - # Check base file existence. - cli_checkFiles -e "${FILE}.png" - - # Create thumbnails. - for SIZE in $SIZES;do - cli_printMessage "${FILE}-thumb-${SIZE}.png" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}.png ${FILE}-thumb-${SIZE}.png - cli_printMessage "${FILE}-thumb-${SIZE}.jpg" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.jpg - cli_printMessage "${FILE}-thumb-${SIZE}.pdf" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.pdf - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doLastActions.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_doLastActions.sh deleted file mode 100755 index 5562eeb..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doLastActions.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# svg_doLastActions.sh -- This function performs last-rendition -# actions for SVG files. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doLastActions { - - # Verify position of file being produced in the list of files been - # currently processed. - if [[ $THIS_FILE_DIR == $NEXT_FILE_DIR ]];then - return - fi - - local ACTION='' - - # Redefine SVG last-rendition actions as local to avoid undesired - # concatenation when massive rendition is performed. - local -a LASTACTIONS - - # Define SVG directory-specific actions. This is required in order - # to provide a predictable way of producing content inside the - # repository and save you the time of writing long several - # commands each time you need to produce images inside the - # repository. - if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then - if [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Gdm/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Gdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Kdm/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Kdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Ksplash/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToKsplash:' - fi - fi - - # Define SVG last-rendition actions. Since last-rendition makes - # use of all files in the output directory structure and - # directory-specific rendition modifies all the files in the - # output directory structure as well, these actions must be - # defined after the directory-specific definition. Otherwise, - # modifications impossed by these actions may interfier the whole - # purpose of having a directory-specific rendition. - [[ $FLAG_LASTRENDITION != '' ]] && LASTACTIONS[((++${#LASTACTIONS[*]}))]="doLastActions:(png|jpg):${FLAG_LASTRENDITION}" - - # At this point centos-art.sh should be producing the last file - # from the same unique directory structure, so, before producing - # images for the next directory structure lets execute the list of - # last-rendition actions for the current directory structure. - for ACTION in "${LASTACTIONS[@]}"; do - svg_$(echo "$ACTION" | cut -d: -f1) - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doLastCommand.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_doLastCommand.sh deleted file mode 100755 index 458ec6b..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doLastCommand.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# svg_doLastCommand.sh -- This function standardizes the way -# last-rendition commands are applied to base-rendition and -# post-rendition outputs. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doLastCommand { - - # Define the file extensions. This value is a regular expression - # pattern which must match the file extensions that last-rendition - # actions will be applied to. - local EXTENSION=$(render_getConfigOption "$ACTION" '2') - - # Define the command string that will be evaluated as - # last-rendition action. Only commands that perform in-place - # modifications can be passed here. - local COMMAND=$(render_getConfigOption "$ACTION" '3-') - - # Define the list of files to process. This value contain all the - # files in the output directory which extension match the - # extension pattern previously defined. - local FILE='' - local FILES=$(cli_getFilesList $OUTPUT --pattern="^.+\.${EXTENSION}$") - - for FILE in $FILES;do - - # Identify file before processing it. Only formats recognized - # by ImageMagick are supported. In case the file isn't - # supported by ImageMagick, continue with the next file in the - # list. - identify -quiet ${FILE} > /dev/null - if [[ $? -ne 0 ]];then - continue - fi - - # Print action message. - cli_printMessage "${FILE}" --as-updating-line - - # Execute mogrify action on all files inside the same - # directory structure. - eval ${COMMAND} ${FILE} - - # Be sure the command was executed correctly. Otherwise stop - # script execution. - if [[ $? -ne 0 ]];then - exit - fi - - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doPostActions.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_doPostActions.sh deleted file mode 100755 index 86b998e..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doPostActions.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# -# svg_doPostActions.sh -- This function performs post-rendition -# actions for SVG files. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doPostActions { - - local ACTION='' - - # Redefine SVG post-rendition actions as local to avoid undesired - # concatenation when massive rendition is performed. - local -a POSTACTIONS - - # Define default comment written to base-rendition output. - local COMMENT="`gettext "Created in CentOS Artwork Repository"` ($(cli_printUrl '--svn')artwork/)" - - # Define SVG post-rendition actions. Since these actions are - # applied to base-rendition output and base-rendition output is - # used as reference to perform directory-specific rendition, these - # action must be defined before directory-specific rendition. - # Otherwise it wouldn't be possible to propagate changes imposed - # by these actions to new files produced as result of - # directory-specific rendition. - POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:mogrify -comment '$COMMENT'" - [[ $FLAG_POSTRENDITION != '' ]] && POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:${FLAG_POSTRENDITION}" - - # Define SVG directory-specific rendition. Directory-specfic - # rendition provides a predictable way of producing content inside - # the repository. - if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then - - if [[ $TEMPLATE =~ "Identity/(Models|Images)/Themes/.+\.${RENDER_EXTENSION}$" ]];then - - POSTACTIONS[((++${#POSTACTIONS[*]}))]="convertPngToBranded" - - if [[ $TEMPLATE =~ "Backgrounds/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='groupBy:png jpg' - - elif [[ $TEMPLATE =~ "Concept/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToThumbnail:250' - - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Syslinux/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:-floyd' - - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Grub/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:-floyd' - - elif [[ $TEMPLATE =~ "Posters/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - fi - - elif [[ $TEMPLATE =~ "Identity/Models/Icons/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToIcons' - - elif [[ $TEMPLATE =~ "Identity/Models/Manuals.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - - fi - - fi - - # Execute SVG post-rendition actions. - for ACTION in "${POSTACTIONS[@]}"; do - svg_$(echo "$ACTION" | cut -d: -f1) - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doPostCommand.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_doPostCommand.sh deleted file mode 100755 index 42c7738..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doPostCommand.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# svg_doPostCommand.sh -- This function standardizes the way -# post-rendition commands are applied to base-rendition output. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doPostCommand { - - # Define the file extension of base-rendition output. - local EXTENSION=$(render_getConfigOption "$ACTION" '2') - - # Define the command string. - local COMMAND=$(render_getConfigOption "$ACTION" '3-') - - # Verify the absolute path of base-rendition output. - cli_checkFiles -e ${FILE}.${EXTENSION} - - # Execute the command string on base-rendition output. - eval $COMMAND ${FILE}.${EXTENSION} - - # Be sure the command string was executed correctly. Otherwise - # stop the script execution. - if [[ $? -ne 0 ]];then - exit - fi - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doTranslation.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_doTranslation.sh deleted file mode 100755 index 2dc359e..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_doTranslation.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# svg_doTranslation.sh -- This function standardizes the way -# translation files are applied to SVG design models in order to -# produce the translated instance that is used to expand translation -# markers and produce PNG output in different languages. -# -# Assuming no translation file exists, an untranslated instace is -# taken from the design model and created (i.e., just a copy) from it. -# Using a design model instance (translated or not) is required in -# order to expand translation markers safetly. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doTranslation { - - # Define which command will be used to output the template - # content. This is required because template files might be found - # as compressed files inside the repository. - local COMMAND="/bin/cat" - if [[ $(file -b -i $TEMPLATE) =~ '^application/x-gzip$' ]];then - COMMAND="/bin/zcat" - fi - - # Move into template's directory in order to satisfy relative - # entities. Take care that some XML documents (e.g., DocBook - # documents) can use entities relatively from their base - # locations. In order to process such documents, it is necessary - # to put the template directory up in the directory stack and - # create the instance from there. Thus, it is possible to expand - # relative entities correctly when validating the document. - pushd $(dirname $TEMPLATE) > /dev/null - - # Verify translation file existence and create template - # instance accordingly. - if [[ -f ${TRANSLATION} ]];then - - # Print final location of translation file. - cli_printMessage "${TRANSLATION}" --as-translation-line - - # Create translation instance to combine both template - # translation and licenses translations. - local TRANSLATION_INSTANCE=${TMPDIR}/message.po - - # In the case of SVG and other files, license translations is - # not required so we don't combine it into the template - # translation. - cp ${TRANSLATION} ${TRANSLATION_INSTANCE} - - # Create the translated instance of design model. - ${COMMAND} ${TEMPLATE} | xml2po -a -l ${CLI_LANG_LL} \ - -p ${TRANSLATION_INSTANCE} -o ${INSTANCE} - - - # Remove .xml2po.mo temporal file. - if [[ -f ${PWD}/.xml2po.mo ]];then - rm ${PWD}/.xml2po.mo - fi - - # Remove instance created to store both licenses and template - # translations. - if [[ -f ${TRANSLATION_INSTANCE} ]];then - rm ${TRANSLATION_INSTANCE} - fi - - else - - # Create the non-translated instance of design model. - ${COMMAND} ${TEMPLATE} > ${INSTANCE} - - fi - - # Return to where we were. - popd > /dev/null - - # Verify instance existence. - cli_checkFiles -e $INSTANCE - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_getColors.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_getColors.sh deleted file mode 100755 index 2b4ccd9..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_getColors.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/bash -# -# svg_getColors.sh -- This function takes one palette produced by Gimp -# (e.g., syslinux.gpl) as input and outputs a list of colors in the -# specified format. In order for this function to output the color in -# the format specified, it is needed that the fourth column in the gpl -# palette be set in the `rrggbb' format and the appropriate conversion -# be implemented here. -# -# Notice that using both the `--head' and `--tail' options it is -# possible to control how many consecutive items does the list of -# colors is going to have. It is possible to output all colors in the -# list, or a consecutive range of them. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_getColors { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='head:,tail:,format:' - - # Initialize both head and tail values to return the first line of - # color information from the palette. - local HEAD=1 - local TAIL=1 - - # Initialize format value used as default when no format option be - # provided. - local FORMAT='rrggbb' - - # Initialize list of colors. - local COLORS='' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS variable for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --head ) - HEAD=$2 - shift 2 - ;; - - --tail ) - TAIL=$2 - shift 2 - ;; - - --format ) - FORMAT=$2 - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # Define path to gpl palette. This is the first file we use to - # retrieve color information from. Only the first file provided - # will be used. - local PALETTE=$(echo $@ | cut -d' ' -f1) - - if [[ ! -f $PALETTE ]];then - - # Define palette path inside the theme's artistic motif. - local MOTIF_PALETTE=${TCAR_WORKDIR}/Identity/Images/Themes/$(cli_getPathComponent $ACTIONVAL --motif)/Palettes/grub.gpl - - # Define palette path inside the theme's design model. - local MODEL_PALETTE=${TCAR_WORKDIR}/Identity/Models/Themes/${THEME_MODEL_NAME}/Palettes/grub.gpl - - # Redefine default background color using palettes provided by - # artistic motif first, and design model later. Assuming none - # of them is present, use The CentOS Project default color - # then. - if [[ -f $MOTIF_PALETTE ]];then - COLORS=$(svg_getColors $MOTIF_PALETTE --head=1 --tail=1) - elif [[ -f $MODEL_PALETTE ]];then - COLORS=$(svg_getColors $MODEL_PALETTE --head=1 --tail=1) - else - COLORS='#204c8d' - fi - - else - - # Retrieve the fourth column from GPL palette. The fourth - # column of a GPL palette contains the palette commentary - # field. The palette commentary field can be anything, but for - # the sake of our own convenience we use it to store the color - # value in hexadecimal format (e.g., rrggbb). Notice that you - # can put your comments from the fifth column on using an - # space as field separator. - COLORS=$(sed -r '1,/^#/d' $PALETTE \ - | awk '{ printf "%s\n", $4 }' | head -n $HEAD | tail -n $TAIL) - - fi - - # Implement color formats conversions from rrggbb to other formats - # that you might need to use. - for COLOR in $COLORS;do - - case $FORMAT in - - rrggbb|* ) - if [[ ! $COLOR =~ '^#' ]];then - COLOR="#${COLOR}" - fi - ;; - - esac - - # Output color value. - echo "$COLOR" - - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_getTTFont.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_getTTFont.sh deleted file mode 100755 index 78b6050..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_getTTFont.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# cli_getFont.sh -- This function creates a list of all True Type -# Fonts (TTF) installed in your workstation and returns the absolute -# path of the file matching the pattern passed as first argument. -# Assuming more than one value matches, the first one in the list is -# used. In case no match is found, the function verifies if there is -# any file in the list that can be used (giving preference to sans -# files). If no file is found at this point, an error will be printed -# out. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_getTTFont { - - local -a FONT_PATTERNS - local FONT_PATTERN='' - local FONT_FILE='' - - # Define list of patterns used to build the list of TTF files. - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="/${1}\.ttf$" - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="sans\.ttf$" - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="\.ttf$" - - # Define directory location where fonts are installed in your - # workstation. - local FONT_DIR='/usr/share/fonts' - - # Define list of all TTF files installed in your workstation. - local FONT_FILES=$(cli_getFilesList ${FONT_DIR} --pattern="^.+\.ttf$") - - # Define TTF absolute path based on pattern. Notice that if the - # pattern matches more than one value, only the first one of a - # sorted list will be used. - for FONT_PATTERN in ${FONT_PATTERNS[@]};do - - FONT_FILE=$(echo "$FONT_FILES" | egrep ${FONT_PATTERN} \ - | head -n 1) - - if [[ -f $FONT_FILE ]];then - break - fi - - done - - # Output TTF absolute path. - if [[ -f $FONT_FILE ]];then - echo $FONT_FILE - else - cli_printMessage "`gettext "The font provided doesn't exist."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Render/Modules/Svg/Scripts/svg_groupBy.sh b/Automation/Modules/Render/Modules/Svg/Scripts/svg_groupBy.sh deleted file mode 100755 index 25d334c..0000000 --- a/Automation/Modules/Render/Modules/Svg/Scripts/svg_groupBy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# svg_groupBy.sh -- This function provides post-rendition action to -# group files inside directories named as their file extensions. For -# example: if the current file is a .png file, it is moved inside a -# Png/ directory; if the current file is a .jpg file, it is stored -# inside a Jpg/ directory, and so on. -# -# For this function to work correctly, you need to specify which file -# type you want to group. This is done in the post-rendition ACTIONS -# array inside the appropriate `render.conf.sh' pre-configuration -# script. This function cannot be used as last-rendition action. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_groupBy { - - local SOURCE='' - local TARGET='' - - # Sanitate file types passed from render.conf.sh pre-rendition - # configuration script. - local FORMAT='' - local FORMATS=$(render_getConfigOption "$ACTION" '2-') - - for FORMAT in $FORMATS;do - - # Redifine source file we want to move. - SOURCE=${FILE}.${FORMAT} - - # Define target directory where source file will be moved - # into. - TARGET=$(dirname "$FILE")/$(cli_getRepoName $FORMAT -d) - - # Check existence of source file. - cli_checkFiles -e $SOURCE - - # Check existence of target directory. - if [[ ! -d $TARGET ]];then - mkdir -p $TARGET - fi - - # Redifine file path to add file and its type. - TARGET=${TARGET}/$(cli_getRepoName $FILE -f).${FORMAT} - - # Move file into its final location. - cli_printMessage "$TARGET" --as-movedto-line - mv ${SOURCE} ${TARGET} - - done - -} diff --git a/Automation/Modules/Render/Modules/Svg/svg.conf.sh b/Automation/Modules/Render/Modules/Svg/svg.conf.sh new file mode 100755 index 0000000..9dfee52 --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/svg.conf.sh @@ -0,0 +1,28 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/svg.conf.sh -- This file provides the +# configuration values used by svg module. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +###################################################################### + +declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Render/Modules/Svg/svg.sh b/Automation/Modules/Render/Modules/Svg/svg.sh index df419c6..caede3c 100755 --- a/Automation/Modules/Render/Modules/Svg/svg.sh +++ b/Automation/Modules/Render/Modules/Svg/svg.sh @@ -1,14 +1,20 @@ #!/bin/bash +###################################################################### # -# svg.sh -- This function performs base-rendition action for SVG -# files. +# Modules/Render/Modules/Svg/svg.sh -- This file initializes the svg +# module. The svg module takes SVG fies as input and produces +# different kind of images based on either simple or advanced +# rendition flow. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 # # Copyright (C) 2009-2013 The CentOS Project # # 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. +# 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 @@ -19,51 +25,34 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- +###################################################################### function svg { - # Apply translation to design model in order to produce the - # translated design model instance. - svg_doTranslation - - # Expand translation markers inside design model instance. - cli_expandTMarkers ${INSTANCE} - - # Initialize the export id used inside design templates. This - # value defines the design area we want to export. - local EXPORTID='CENTOSARTWORK' - - # Verify the export id. - svg_checkModelExportId "$INSTANCE" "$EXPORTID" - - # Check existence of external files. Inside design templates and - # their instances, external files are used to refer the background - # information required by the design template. If such background - # information is not available the image is produced without - # background information. This is something that need to be - # avoided. - svg_checkModelAbsref "$INSTANCE" - - # Render template instance using inkscape and save the output. - local INKSCAPE_OUTPUT="$(\ - inkscape $INSTANCE --export-id=$EXPORTID --export-png=${FILE}.png)" - - # Modify output from inkscape to fit the centos-art.sh script - # output visual style. - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Area' \ - | sed -r "s!^Area!`gettext "Area"`:!")" --as-inkscape-line - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Background' \ - | sed -r "s!^Background (RRGGBBAA):(.*)!`gettext "Background"`: \1 \2!")" --as-inkscape-line - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Bitmap saved as' \ - | sed -r "s!^Bitmap saved as:!`gettext "Saved as"`:!")" --as-inkscape-line - - # Perform format post-rendition. - svg_doPostActions - - # Perform format last-rendition. - svg_doLastActions + COMMAND=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "command") + if [[ -z ${COMMAND} ]];then + if [[ ${#SOURCES[*]} -gt 1 ]];then + COMMAND="/usr/bin/convert +append" + else + COMMAND="/bin/cp" + fi + fi + + RENDER_FLOWS=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-flow") + if [[ -z ${RENDER_FLOWS} ]];then + RENDER_FLOWS='base' + fi + + BRANDS=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "brand") + COMMENT=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "comment") + + local EXPORTID=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "export-id") + if [[ -z ${EXPORTID} ]];then + EXPORTID="CENTOSARTWORK" + fi + + for RENDER_FLOW in ${RENDER_FLOWS} ;do + tcar_setModuleEnvironment "${RENDER_FLOW}" "${@}" + done } diff --git a/Automation/Modules/Render/Modules/Svg/svg_checkModelAbsref.sh b/Automation/Modules/Render/Modules/Svg/svg_checkModelAbsref.sh new file mode 100755 index 0000000..3e98a6d --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/svg_checkModelAbsref.sh @@ -0,0 +1,143 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/svg_checkModelAbsref.sh -- This +# function retrieves absolute pahts from source files and checks +# their existence. +# +# In order for design templates to point different artistic motifs, +# design templates make use of external files which point to +# specific artistic motif background images. If such external files +# don't exist, try to create the background image required by +# cropping a higher background image (e.g., 2048x1536-final.png). +# If this isn't possible either, then create the background image +# using a plain color and crop from it then. We can't go on without +# the required background information. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 svg_checkModelAbsref { + + local FILE='' + local BG_DST_FILES='' + local BG_DST_FILE='' + local BG_DST_FILE_WIDTH='' + local BG_DST_FILE_HEIGHT='' + local BG_SRC_FILE='' + local BG_SRC_FILE_COLOR='' + local BG_SRC_FILE_WIDTH='' + local BG_SRC_FILE_HEIGHT='' + + # Define absolute path to the translated instance of design model. + FILE="${1}" + + # Verify existence of file we need to retrieve absolute paths from. + tcar_checkFiles -e "${FILE}" + + # Retrieve absolute paths from file. + BG_DST_FILES=$(egrep "(sodipodi:absref|xlink:href)=\"${HOME}.+" ${FILE} \ + | sed -r "s,.+=\"(${HOME}.+\.png)\".*,\1," | sort | uniq) + + # Verify absolute paths retrieved from file. + for BG_DST_FILE in ${BG_DST_FILES};do + + # Verify parent directory of absolute files retrieved from + # file. This is required to prevent the construction of paths + # to locations that don't exist. For example, when including + # background images in SVG files, it is possible that the path + # information inside SVG files get outdated temporally. If in + # that exact moment, you try to render the SVG file it won't + # be possible to create the image used for cropping because + # the path build from the location inside SVG file doesn't + # exist. In this case, centos-art.sh script will end up with + # `file ... doesn't exist' errors. + tcar_checkFiles -d "$(dirname ${BG_DST_FILE})" + + if [[ ! -a ${BG_DST_FILE} ]];then + + # Define the source background file, the image file will + # crop when no specific background information be + # available for using. Generally, this is the most + # reusable background file inside the artistic motifs + # (e.g,. the `2048x1536-final.png' file). We can use + # this image file to create almost all artworks inside The + # CentOS Distribution visual manifestation when + # resolution-specific backgrounds don't exist. + BG_SRC_FILE=$(echo ${BG_DST_FILE} \ + | sed -r "s!(.+)/[[:digit:]]+x[[:digit:]]+(-final\.png)!\1/2048x1536\2!") + + # Verify existence of source background file. If the file + # doesn't exist create it using The CentOS Project default + # background color information, as specified in its + # corporate identity manual. + if [[ ! -f ${BG_SRC_FILE} ]];then + + # Define plain color that will be used as background. + BG_SRC_FILE_COLOR=$(svg_getColors) + + # Verify format of color value. + svg_checkColorFormats ${BG_SRC_FILE_COLOR} --format='rrggbb' + + # Define width for the source background file the + # required background information is cropped from. + BG_SRC_FILE_WIDTH=$(echo ${BG_SRC_FILE} \ + | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') + + # Define height for the source background file the + # required background information is cropped from. + BG_SRC_FILE_HEIGHT=$(echo ${BG_SRC_FILE} \ + | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') + + # Print action message. + tcar_printMessage "${BG_SRC_FILE} (${BG_SRC_FILE_COLOR})" --as-creating-line + + # Create the source background file. + ppmmake -quiet ${BG_SRC_FILE_COLOR} \ + ${BG_SRC_FILE_WIDTH} ${BG_SRC_FILE_HEIGHT} \ + | pnmtopng > ${BG_SRC_FILE} + + fi + + # Print action message. + tcar_printMessage "${BG_SRC_FILE}" --as-cropping-line + + # Define the width of the required background information. + BG_DST_FILE_WIDTH=$(echo ${BG_DST_FILE} \ + | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') + + # Define the height of the required background information. + BG_DST_FILE_HEIGHT=$(echo ${BG_DST_FILE} \ + | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') + + # Create required backgrounnd information. + convert -quiet \ + -crop ${BG_DST_FILE_WIDTH}x${BG_DST_FILE_HEIGHT}+0+0 \ + ${BG_SRC_FILE} ${BG_DST_FILE} + + # Verify required background information. + tcar_checkFiles -e ${BG_DST_FILE} + + fi + + done + +} diff --git a/Automation/Modules/Render/Modules/Svg/svg_checkModelExportId.sh b/Automation/Modules/Render/Modules/Svg/svg_checkModelExportId.sh new file mode 100755 index 0000000..42ba0f3 --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/svg_checkModelExportId.sh @@ -0,0 +1,46 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/svg_checkModelExportId.sh -- +# This function standardizes the export id used inside svg files and +# the way of verify them. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 svg_checkModelExportId { + + local INSTANCE="$1" + local EXPORTID="$2" + + # Verify instance. + tcar_checkFiles -e ${INSTANCE} + + # Verify export id. + tcar_checkFiles ${EXPORTID} --match="[[:alnum:]]+" + + # Check export id inside design templates. + grep "id=\"${EXPORTID}\"" ${INSTANCE} > /dev/null + if [[ $? -gt 0 ]];then + tcar_printMessage "`eval_gettext "There is not export id (\\\${EXPORTID}) inside \\\"\\\${TEMPLATE}\\\"."`" --as-error-line + fi + +} diff --git a/Automation/Modules/Render/Modules/Svg/svg_setBaseRendition.sh b/Automation/Modules/Render/Modules/Svg/svg_setBaseRendition.sh new file mode 100755 index 0000000..47d980c --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/svg_setBaseRendition.sh @@ -0,0 +1,114 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/svg_setBaseRendition.sh -- This +# function standardizes the base rendition tasks needed to produce +# PNG files from SVG files. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 svg_setBaseRendition { + + local COUNTER=0 + + local -a SOURCE_INSTANCES + local -a TARGET_INSTANCES + local -a TARGET_COMMANDS + local -a INKSCAPE_OPTIONS + + while [[ ${COUNTER} -lt ${#SOURCES[*]} ]];do + + # Verify existence and extension of design models. + tcar_checkFiles ${SOURCES[${COUNTER}]} -f --match='\.(svgz|svg)$' + + # Define file name for design model instances. We need to use + # a random string in from of it to prevent duplication. + # Remember that different files can have the same name in + # different locations. Use the correct file information. + SOURCE_INSTANCES[${COUNTER}]=${TCAR_SCRIPT_TEMPDIR}/${RANDOM}-$(basename ${SOURCES[${COUNTER}]}) + + # Define file name for image instances. We need to use a + # random string in from of it to prevent duplication. + # Remember that different files can have the same name in + # different locations. Use the correct file information. + TARGET_INSTANCES[${COUNTER}]=${TCAR_SCRIPT_TEMPDIR}/${RANDOM}-$(basename ${SOURCES[${COUNTER}]} \ + | sed -r 's/\.(svgz|svg)$/.png/') + + # Create source instance considering whether or not it has + # translation files related.Apply translation files to source instance, if any. + render_setLocalizedXml "${SOURCES[${COUNTER}]}" "${SOURCE_INSTANCES[${COUNTER}]}" + + # Make your best to be sure the source instance you are + # processing is a valid Scalable Vector Graphic (SVG) file. + tcar_checkFiles ${SOURCE_INSTANCES[${COUNTER}]} --mime='^text/xml$' + + # Expand any translation file that might exist. + tcar_setTranslationMarkers ${SOURCE_INSTANCES[${COUNTER}]} + + svg_checkModelAbsref "${SOURCE_INSTANCES[${COUNTER}]}" + + svg_setBaseRenditionOptions + + svg_setBaseRenditionCommand + + COUNTER=$(( ${COUNTER} + 1 )) + + done + + # Verify existence of output directory. + if [[ ! -d $(dirname ${TARGET}) ]];then + mkdir -p $(dirname ${TARGET}) + fi + + tcar_printMessage "${TARGET}" --as-creating-line + + # Apply command to PNG images produced from design models to + # construct the final PNG image. + ${COMMAND} ${TARGET_INSTANCES[*]} ${TARGET} + + # Apply branding images to final PNG image. + if [[ ! -z ${BRANDS} ]];then + svg_setBrandInformation + fi + + # Apply comment to final PNG image. + if [[ ! -z ${COMMENT} ]];then + /usr/bin/mogrify -comment "${COMMENT}" ${TARGET} + fi + + # Remove instances to save disk space. There is no need to have + # unused files inside the temporal directory. They would be + # consuming space unnecessarily. Moreover, there is a remote + # chance of name collapsing (because the huge number of files that + # would be in place and the week random string we are putting in + # front of files) which may produce unexpected results. + rm ${TARGET_INSTANCES[*]} ${SOURCE_INSTANCES[*]} + + # Unset array variables and their counter to prevent undesired + # concatenations. + unset SOURCE_INSTANCES + unset TARGET_INSTANCES + unset TARGET_COMMANDS + unset INKSCAPE_OPTIONS + unset COUNTER + +} diff --git a/Automation/Modules/Render/Modules/Svg/svg_setBaseRenditionCommand.sh b/Automation/Modules/Render/Modules/Svg/svg_setBaseRenditionCommand.sh new file mode 100755 index 0000000..13c481c --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/svg_setBaseRenditionCommand.sh @@ -0,0 +1,33 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/svg_setBaseRenditionCommand.sh +# -- This function standardizes the way SVG files are produced +# inside the centos-art.sh script. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 svg_setBaseRenditionCommand { + + inkscape ${SOURCE_INSTANCES[${COUNTER}]} ${INKSCAPE_OPTIONS[${COUNTER}]} > /dev/null + +} diff --git a/Automation/Modules/Render/Modules/Svg/svg_setBaseRenditionOptions.sh b/Automation/Modules/Render/Modules/Svg/svg_setBaseRenditionOptions.sh new file mode 100755 index 0000000..7222430 --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/svg_setBaseRenditionOptions.sh @@ -0,0 +1,53 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/svg_setBaseRenditionOptions.sh +# -- This function standardizes the way base rendition options are +# set. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 svg_setBaseRenditionOptions { + + if [[ ! -z ${FGCOLOR} ]] && [[ ${FGCOLOR} != '000000' ]];then + sed -i -r "s/((fill|stroke):#)000000/\1${FGCOLOR}/g" ${SOURCE_INSTANCES[${COUNTER}]} + fi + + INKSCAPE_OPTIONS[${COUNTER}]="--export-png=${TARGET_INSTANCES[${COUNTER}]}" + + if [[ -z ${EXPORTID} ]];then + INKSCAPE_OPTIONS[${COUNTER}]="${INKSCAPE_OPTIONS[${COUNTER}]} --export-area-drawing " + else + svg_checkModelExportId "${SOURCE_INSTANCES[${COUNTER}]}" "${EXPORTID}" + INKSCAPE_OPTIONS[${COUNTER}]="${INKSCAPE_OPTIONS[${COUNTER}]} --export-id=${EXPORTID} " + fi + + if [[ ! -z ${BGCOLOR} ]];then + INKSCAPE_OPTIONS[${COUNTER}]="${INKSCAPE_OPTIONS[${COUNTER}]} --export-background=$(echo ${BGCOLOR} | cut -d'-' -f1) " + INKSCAPE_OPTIONS[${COUNTER}]="${INKSCAPE_OPTIONS[${COUNTER}]} --export-background-opacity=$(echo ${BGCOLOR} | cut -d'-' -f2) " + fi + + if [[ ! -z ${HEIGHT} ]];then + INKSCAPE_OPTIONS[${COUNTER}]="${INKSCAPE_OPTIONS[${COUNTER}]} --export-height=${HEIGHT} " + fi + +} diff --git a/Automation/Modules/Render/Modules/Svg/svg_setBrandInformation.sh b/Automation/Modules/Render/Modules/Svg/svg_setBrandInformation.sh new file mode 100755 index 0000000..68f5c39 --- /dev/null +++ b/Automation/Modules/Render/Modules/Svg/svg_setBrandInformation.sh @@ -0,0 +1,42 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/svg_setBrandInformation.sh -- +# This function takes brand information from configuration files, +# processes it, and apply it on final PNG image file. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 svg_setBrandInformation { + + for BRAND in ${BRANDS};do + + local FILENAME=$(echo ${BRAND} | cut -d: -f1) + local GEOMETRY=$(echo ${BRAND} | cut -d: -f2) + + tcar_checkFiles ${FILENAME} -f + + /usr/bin/composite -geometry ${GEOMETRY} ${FILENAME} ${TARGET} ${TARGET} + + done + +} diff --git a/Automation/Modules/Render/Scripts/render_getConfigOption.sh b/Automation/Modules/Render/Scripts/render_getConfigOption.sh deleted file mode 100755 index dbf1937..0000000 --- a/Automation/Modules/Render/Scripts/render_getConfigOption.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# render_getConfigOption.sh -- This function standardizes the -# configuration fields are retrived from some action-specific -# definitions. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getConfigOption { - - # Initialize action string. - local ACTION="$1" - - # Initialize field definition. - local FIELD="$2" - - # Initialize configuration options. - local OPTION='' - - # Check action string. The action string must be present in order - # for this function to work. It provides the information needed to - # retrive configurantion options from. - if [[ "$ACTION" == '' ]];then - cli_printMessage "`gettext "There is no action string to work with."`" --as-error-line - fi - - # Check field definition. The field definition must match any of - # the formats specified by the `-f' option of `cut' command. - if [[ ! "$FIELD" =~ '^([0-9]+|[0-9]+-|-[0-9]+|[0-9]+-[0-9]+)$' ]];then - cli_printMessage "`gettext "The field definition is not valid."`" --as-error-line - fi - - # Get configuration option from action string. - OPTION=$(echo -n "$ACTION" | cut -d: -f${FIELD}) - - # Sanitate configuration option retrived from action string. - OPTION=$(echo -n "${OPTION}" \ - | sed -r 's!^ *!!g' \ - | sed -r 's!( |,|;) *! !g' \ - | sed -r 's! *$!!g') - - # Print out the configuration option retrived from action string, - # only if it is not an empty value. Do not use `echo' or `printf' - # built-in commands here. Use the `cli_printMessage' functionality - # instead. This is required in order to reverse the apostrophe - # codification accomplished when options were retrived from - # command-line (cli_parseArgumentsReDef) in the argument of - # options like `--post-rendition' and `--last-rendition'. - if [[ $OPTION != '' ]];then - cli_printMessage "$OPTION" --as-stdout-line - fi - -} diff --git a/Automation/Modules/Render/Scripts/render_getDirOutput.sh b/Automation/Modules/Render/Scripts/render_getDirOutput.sh deleted file mode 100755 index ffc475e..0000000 --- a/Automation/Modules/Render/Scripts/render_getDirOutput.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# render_getDirOutput.sh -- This function defines the final -# absolute path the centos-art.sh script uses to store identity -# contents produced at rendition time. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getDirOutput { - - # Define base output directory using design model path as - # reference. - OUTPUT=$(dirname $FILE | sed -r \ - -e "s!Identity/Models!Identity/Images!" \ - -e "s!Themes/${FLAG_THEME_MODEL}!Themes/$(cli_getPathComponent $ACTIONVAL --motif)!" \ - -e "s!Documentation/Models!Documentation/Manuals!" \ - -e "s!/Models!!") - - # By default, images rendered are stored under Identity/Images - # directory structure. But if an `Images/' directory exists in the - # current location use it instead. - if [[ -d "${OUTPUT}/Images" ]];then - OUTPUT=${OUTPUT}/Images - fi - - # Redefine base output directory to introduce specific information - # like release number and architecture. This information is - # require by directories (e.g., the `Media' directory inside - # themes and the `Documentation/Manuals/Docbook/Distro' directory - # ) whose need this information to be passed explicitly at the - # command-line through the `--releasever' and `--basearch' - # options. Other directories take such information from the path - # they are stored in (e.g., the `Distro/5/Anaconda' directory - # inside themes.). So, we need to differentiate the way - # information like release numbers and architectures are retrieved - # in order to build the output path correctly at rendition time. - if [[ $OUTPUT =~ "^${MOTIF_DIR}/Media$" ]];then - OUTPUT=${OUTPUT}/${FLAG_RELEASEVER}/${FLAG_BASEARCH} - elif [[ $OUTPUT =~ 'Documentation/Manuals/Docbook/Distro$' ]];then - OUTPUT=${OUTPUT}/${FLAG_RELEASEVER} - else - OUTPUT=${OUTPUT} - fi - - # Define whether to use or not locale-specific directory to store - # content, using current locale information as reference. As - # convection, when we produce content, only specific locations - # use locale-specific directories to organize language-specific - # content (e.g., Manuals, Anaconda, Installation media, etc.). All - # other locations do not use locale-specific directories to - # organize content. This convection is important in order for - # the `prepare' functionality of centos-art.sh script to produce - # content in the correct location. Otherwise, we might end up - # duplicating content (e.g., icons, brands, etc.) which doesn't - # have any translation, nor any need to be translated. - if [[ ! ${CLI_LANG_LC} =~ '^en' ]];then - OUTPUT=${OUTPUT}/${CLI_LANG_LC} - fi - - # Create final output directory, if it doesn't exist yet. - if [[ ! -d ${OUTPUT} ]];then - mkdir -p ${OUTPUT} - fi - -} diff --git a/Automation/Modules/Render/Scripts/render_getDirTemplate.sh b/Automation/Modules/Render/Scripts/render_getDirTemplate.sh deleted file mode 100755 index 9c6058a..0000000 --- a/Automation/Modules/Render/Scripts/render_getDirTemplate.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# render_getDirTemplate.sh -- This function defines the way renderable -# directories are processed inside the repository. Inside the -# repository, renderable directories are processed either through -# direct or theme-specific rendition. -# -# Direct rendition takes one XML file from design model -# (`Identity/Models') directory structure and produces one file -# in `Identity/Images' directory strucutre. In this -# configuration, the organization used to stored the design model is -# taken as reference to build the path required to store the image -# related to it under `Identity/Images' directory structure. -# -# Theme-specific rendition takes one design model from -# `Identity/Models/Themes' directory structure to produce one or -# more images in `Identity/Images/Themes/$THEME/$VERSION/$MODEL' -# directory structure. In this configuration we have many different -# artistic motifs that use one unique design model directory structure -# as reference to produce images. -# -# Since theme design models are unified to be reused by more -# than one artistic motif, it is not possible to render artistic -# motifs in a lineal manner (i.e., as we do with direct rendition) -# because we need to establish the relation between the artistic motif -# renderable directory structure and the design model first and that -# relation happens when renderable directory structures inside -# artistic motifs are processed individually. -# -# In the first rendition category, we use a design model directory -# structure as reference to produce images one by one. In the second -# rendition category, we can't use the same procedure because one -# design model directory structure is used to produce several -# renderable directory structures, not just one. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getDirTemplate { - - # Initialize design models location used as reference to process - # renderable directory structures. - TEMPLATE=$ACTIONVAL - - # Define absolute path to input files using absolute path from - # output files. - if [[ -d ${TEMPLATE}/Models ]];then - TEMPLATE=${TEMPLATE}/Models - else - TEMPLATE=$(echo "$TEMPLATE" | sed -r \ - -e "s!/Themes/$(cli_getPathComponent $ACTIONVAL --motif)!/Themes/${FLAG_THEME_MODEL}!" \ - -e "s!/(Manuals|Images)!/Models!") - fi - - # Verify absolute path to input file. This verification is - # specially needed in those situations when the artistic motif - # directory structure has an organization different to that in - # design models directory structure. Since the path to design - # models is built from artistic motif directory structure, if - # artistic motifs directory structure is different from design - # model directory structure, as result we'll have a path to a - # design model that may not exist and that would make - # centos-art.sh script to fail. So, verify the absolute path to - # the input file and stop script execution if it doesn't exist. - cli_checkFiles -e $TEMPLATE - -} diff --git a/Automation/Modules/Render/Scripts/render_getOptions.sh b/Automation/Modules/Render/Scripts/render_getOptions.sh deleted file mode 100755 index 6598f99..0000000 --- a/Automation/Modules/Render/Scripts/render_getOptions.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# -# render_getOptions.sh -- This function interprets option parameters -# passed to `render' functionality and calls actions accordingly. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,filter:,answer-yes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands,synchronize" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-render" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --filter ) - FLAG_FILTER="$2" - shift 2 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --dont-dirspecific ) - FLAG_DONT_DIRSPECIFIC="true" - shift 1 - ;; - - --post-rendition ) - FLAG_POSTRENDITION="$2" - shift 2 - ;; - - --last-rendition ) - FLAG_LASTRENDITION="$2" - shift 2 - ;; - - --basearch ) - FLAG_BASEARCH="$2" - if [[ ! $FLAG_BASEARCH =~ $(cli_getPathComponent --architecture-pattern) ]];then - cli_printMessage "`gettext "The architecture provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --releasever ) - FLAG_RELEASEVER="$2" - if [[ ! $FLAG_RELEASEVER =~ $(cli_getPathComponent --release-pattern) ]];then - cli_printMessage "`gettext "The release version provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --theme-model ) - FLAG_THEME_MODEL=$(cli_getRepoName $2 -d) - shift 2 - ;; - - --with-brands ) - FLAG_WITH_BRANDS='true' - shift 1 - ;; - - --synchronize ) - FLAG_SYNCHRONIZE='true' - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Automation/Modules/Render/Scripts/render_setBaseRendition.sh b/Automation/Modules/Render/Scripts/render_setBaseRendition.sh deleted file mode 100755 index 8591dec..0000000 --- a/Automation/Modules/Render/Scripts/render_setBaseRendition.sh +++ /dev/null @@ -1,276 +0,0 @@ -#!/bin/bash -# -# render_setBaseRendition.sh -- This function performs base-rendition -# action for all files. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setBaseRendition { - - local -a FILES - local FILE='' - local OUTPUT='' - local TEMPLATE='' - local TEMPLATES='' - local PARENTDIR='' - local TRANSLATION='' - local EXTERNALFILE='' - local EXTERNALFILES='' - local THIS_FILE_DIR='' - local NEXT_FILE_DIR='' - local RENDER_EXTENSION='' - local EXPORTID='' - local COUNT=0 - - # Verify default directory where design models are stored in. - cli_checkFiles -e "${TCAR_WORKDIR}/Identity/Models/Themes/${FLAG_THEME_MODEL}" - - # Redefine parent directory for current workplace. - PARENTDIR=$(basename "${ACTIONVAL}") - - # Loop through list of supported file extensions. - for RENDER_EXTENSION in ${RENDER_EXTENSIONS};do - - # Redefine rendition format name based on supported file - # extension. - if [[ $RENDER_EXTENSION =~ '^(svgz|svg)$' ]];then - RENDER_FORMAT='svg' - elif [[ $RENDER_EXTENSION =~ '^(docbook)$' ]];then - RENDER_FORMAT='docbook' - elif [[ $RENDER_EXTENSION =~ '^(conf)$' ]];then - RENDER_FORMAT='conf' - else - cli_printMessage "`eval_gettext "The \\\"\\\$RENDER_EXTENSION\\\" file extension is not supported yet."`" --as-error-line - fi - - # Redefine specific function export id. - EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${RENDER_FORMAT} -d)/$(cli_getRepoName ${RENDER_FORMAT} -f)" - - # Define base location of template files using paths passed to - # centos-art.sh script as argument to. - render_getDirTemplate - - # Verify whether or not the source location of the path - # provided as argument to centos-art.sh script accepts or not - # localization messages. Don't produce localized content for - # repository components that don't accept it. - if [[ ! ${CLI_LANG_LC} =~ '^en' ]];then - cli_runFnEnvironment locale --is-localizable ${TEMPLATE} - fi - - # Define the list of files to process. Use an array variable - # to store the list of files to process. This make possible to - # realize verifications like: is the current base directory - # equal to the next one in the list of files to process? - # Questions like this let us to know when centos-art.sh is - # leaving a directory structure and entering another. This - # information is required in order for centos-art.sh to know - # when to apply last-rendition actions. - # - # Another issue is that some directories might be named as if - # they were files (e.g., using a render able extension like - # .docbook). In these situations we need to avoid such - # directories from being interpreted as a render able file. - # For this, pass the `--type="f"' option when building the - # list of files to process in order to retrieve regular files - # only. - # - # Another issue to consider here is that, in some cases, both - # templates and outputs might be in the same location. In - # these cases localized content are stored in the same - # location where template files are retrieved from and we need - # to avoid using localized content from being interpreted as - # design models. In that sake, build the list of files to - # process using the files directly stored in the directory - # passed as argument to centos-art.sh command-line. Don't go - # recursively here. - # - # Another issue to consider here, is the way of restricting - # the list of files to process. We cannot expand the pattern - # specified by FLAG_FILTER with a `.*' here (e.g., - # "${FLAG_FILTER}.*\.${RENDER_EXTENSION}") because that would - # suppress any possibility from the user to specify just one - # file name in locations where more than one file with the - # same name as prefix exists (e.g., `repository.docbook', - # `repository-preamble.docbook' and - # `repository-parts.docbook'). Instead, pass filtering - # control to the user whom can use regular expression markup - # in the `--filter' option to decide whether to match - # `repository.docbook' only (e.g., through - # `--filter="repository"') or `repository-preamble.docbook' - # and `repository-parts.docbook' but not `repository.docbook' - # (e.g., through `--filter="repository-.*"'). - if [[ ${RENDER_FORMAT} =~ "^docbook$" ]];then - - # When the render format is docbook, don't build a list of - # files to process. Instead, build the absolute path of - # the main file used to render docbook from models to - # final output manuals. This file must be stored directly - # inside the main manual's directory and named as it but - # with all letters in lowercase. - for FILE in $(cli_getFilesList ${TEMPLATE} \ - --maxdepth="1" --mindepth="1" \ - --pattern="^.*$(cli_getRepoName ${TEMPLATE} -f)\.${RENDER_EXTENSION}$" \ - --type="f");do - FILES[((++${#FILES[*]}))]=$FILE - done - - elif [[ ${RENDER_FORMAT} =~ "^conf$" ]];then - - # When the render format is conf, be sure it refers to - # image.conf files only. Other configuration files (e.g., - # branding.conf) cannot be processed this way because - # their configuration options and values haven't any - # meaning in this context. - for FILE in $(cli_getFilesList ${TEMPLATE} \ - --pattern="^.+/images\.${RENDER_EXTENSION}$" \ - --type="f");do - FILES[((++${#FILES[*]}))]=$FILE - done - - else - - # For all other cases, build a list of files to process - # using the path value pass as argument. - for FILE in $(cli_getFilesList ${TEMPLATE} \ - --pattern="^.+/${FLAG_FILTER}.*\.${RENDER_EXTENSION}$" \ - --type="f");do - FILES[((++${#FILES[*]}))]=$FILE - done - - fi - - # Verify list of files to process. Assuming no file was found, - # evaluate the next supported file extension. - if [[ ${#FILES[*]} -eq 0 ]];then - continue - fi - - # Initialize format-specific functionalities. - cli_exportFunctions "${EXPORTID}" - - # Start processing the base rendition list of FILES. Fun part - # approaching :-). - while [[ $COUNT -lt ${#FILES[*]} ]];do - - # Define base file. - FILE=${FILES[$COUNT]} - - # Define the base directory path for the current file being - # process. - THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) - - # Define the base directory path for the next file that will - # be process. - if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then - NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) - else - NEXT_FILE_DIR='' - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message based on file extension. - if [[ ${FILE} =~ 'images\.conf$' ]] && [[ $FLAG_WITH_BRANDS == 'true' ]];then - cli_printMessage "${FILE}" --as-processing-line - elif [[ ${FILE} =~ 'brands\.conf$' ]];then - continue - else - cli_printMessage "${FILE}" --as-template-line - fi - - # Verify design models file existence. We cannot continue - # with out it. - cli_checkFiles ${FILE} -f - - # Define final location of translation file. - TRANSLATION=$(dirname ${FILE} \ - | sed -r 's!(Documentation|Identity)!Locales/\1!')/${CLI_LANG_LC}/messages.po - - # Define final location of template file. - TEMPLATE=${FILE} - - # Define final location of output directory. - render_getDirOutput - - # Get relative path to file. The path string (stored in - # FILE) has two parts: 1. the variable path and 2. the - # common path. The variable path is before the common - # point in the path string. The common path is after the - # common point in the path string. The common point is the - # name of the parent directory (stored in PARENTDIR). - # - # Identity/Models/Themes/.../Firstboot/3/splash-small.svg - # -------------------------^| the |^------------^ - # variable path | common | common path - # -------------------------v| point | v------------v - # Identity/Images/Themes/.../Firstboot/Img/3/splash-small.png - # - # What we do here is remove the variable path, the common - # point, and the file extension parts in the string - # holding the path retrieved from design models directory - # structure. Then we use the common path as relative path - # to store the final image file. - # - # The file extension is removed from the common path - # because it is set when we create the final image file. - # This configuration let us use different extensions for - # the same file name. - # - # When we render using base-rendition action, the - # structure of files under the output directory will be - # the same used after the common point in the related - # design model directory structure. - FILE=$(echo ${FILE} \ - | sed -r "s!.*${PARENTDIR}/!!" \ - | sed -r "s/\.${RENDER_EXTENSION}$//") - - # Define absolute path to final file (without extension). - FILE=${OUTPUT}/$(basename "${FILE}") - - # Define instance name from design model. - INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) - - # Perform format base-rendition. - ${RENDER_FORMAT} - - # Remove template instance. - if [[ -f $INSTANCE ]];then - rm $INSTANCE - fi - - # Increment file counter. - COUNT=$(($COUNT + 1)) - - done - - # Reset counter to prevent accumulation of values. - COUNT=0 - - # Unset format-specific functionalities. - cli_unsetFunctions "${EXPORTID}" - - # Unset files list to prevent accumulation of values. - unset FILES - - done -} diff --git a/Automation/Modules/Render/Scripts/render_setBrands.sh b/Automation/Modules/Render/Scripts/render_setBrands.sh deleted file mode 100755 index 187c4df..0000000 --- a/Automation/Modules/Render/Scripts/render_setBrands.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# render_setBrands.sh -- This function performs brand-specific -# rendition. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setBrands { - - local BRANDS_MODELS_DIR=${TCAR_WORKDIR}/Identity/Models/Brands - local BRANDS_IMAGES_DIR=${TCAR_WORKDIR}/Identity/Images/Brands - - render_setBrandsDirValidates ${BRANDS_IMAGES_DIR} ${ACTIONVAL} - render_setBrandsDirStructure ${BRANDS_MODELS_DIR} ${BRANDS_IMAGES_DIR} - - render_setBaseRendition - -} diff --git a/Automation/Modules/Render/Scripts/render_setBrandsDirStructure.sh b/Automation/Modules/Render/Scripts/render_setBrandsDirStructure.sh deleted file mode 100755 index 453e90c..0000000 --- a/Automation/Modules/Render/Scripts/render_setBrandsDirStructure.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# render_setBrandsDirectoryStructure.sh -- This function verifies the -# directory structure of brands images using the directory structure -# of brands models as reference. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setBrandsDirStructure { - - local BRANDS_SOURCE_DIR=$(cli_checkRepoDirSource ${1}) - local BRANDS_TARGET_DIR=$(cli_checkRepoDirSource ${2}) - - cli_printMessage "${BRANDS_TARGET_DIR} `gettext "directory structures..."`" --as-checking-line - - cli_runFnEnvironment prepare ${BRANDS_SOURCE_DIR} ${BRANDS_TARGET_DIR} --directories - -} diff --git a/Automation/Modules/Render/Scripts/render_setBrandsDirValidates.sh b/Automation/Modules/Render/Scripts/render_setBrandsDirValidates.sh deleted file mode 100755 index 8622474..0000000 --- a/Automation/Modules/Render/Scripts/render_setBrandsDirValidates.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# render_setBrandsDirVerification.sh -- This function standardize path -# verification between path provided in the command line and -# repository directory structure. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - - -function render_setBrandsDirValidates { - - local BRANDS_PATH_OK=$(cli_checkRepoDirSource ${1}) - local BRANDS_PATH_UNKNOWN=$(cli_checkRepoDirSource ${2}) - - cli_checkFiles ${BRANDS_PATH_UNKNOWN} --match="^${BRANDS_PATH_OK}" - - local BRANDS_PATH_UNKNOWN_MODEL=$(echo ${BRANDS_PATH_UNKNOWN} \ - | sed -r "s,/Images/,/Models/,") - - cli_checkFiles ${BRANDS_PATH_UNKNOWN_MODEL} -d - -} diff --git a/Automation/Modules/Render/Scripts/render_setDirStructure.sh b/Automation/Modules/Render/Scripts/render_setDirStructure.sh deleted file mode 100755 index 8064b59..0000000 --- a/Automation/Modules/Render/Scripts/render_setDirStructure.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -###################################################################### -# -# render_setDirStructure.sh -- This function standardizes the -# relation between source and target directory structures inside the -# repository. -# -# This function takes two arguments. The first is the source -# directory and the second is the target directory where you wan to -# reproduce the source directory structure. In order for this to -# work, all source directory structures provided to this function -# must have one level of directories more than its related target -# directory. The purpose of this level is content categorization. -# For example, consider the following path: -# -# ----------++++++++++++++++++++++++ -# ${SOURCE}/${CATEGORY}/${COMPONENT} -# ----------++++++++++++++++++++++++ -# +++++++++++++++++++++++++++++------------ -# ${TARGET}/${NAME}/${VERSION}/${COMPONENT} -# +++++++++++++++++++++++++++++------------ -# -# So we end with the following path: -# -# ${TARGET}/${CATEGORY}/${COMPONENT} -# -# In this path, ${CATEGORY} makes reference to a categorization -# directory used to describe source components related to target -# components. However, in the target side, such ${CATEGORY} -# directory is not needed and should be removed from it in order to -# get the final target path, which is: -# -# ${TARGET}/${COMPONENT} -# -# ${CATEGORY} is always a one-level directory, but ${COMPONENT} -# might have several levels deep inside. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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 render_setDirStructure { - - # Define absolute path to design models' directory structure. This - # directory contains the directory structure you want to verify - # inside target path. - local SOURCE_DIRECTORY=$(tcar_checkRepoDirSource "${1}") - - # Verify existence source path, just to be sure it was passed and - # it is a valid directory. - tcar_checkFiles ${SOURCE_DIR} -d - - # Define absolute path to directory inside the repository where - # you want to replicate the source path directory structure. - local TARGET_DIRECTORY=$(tcar_checkRepoDirSource "${2}") - - # NOTE: It is possible that target path doesn't exist. So verify - # the relation between target and source path. If there is a - # source path for the target, create an empty directory as target, - # using the related source directory as reference. - - # Define list of directories inside source path. - local DIRECTORIES=$(tcar_getFilesList ${SOURCE_DIRECTORY} \ - --pattern='.+/[[:alpha:]]+$' --type='d') - - # Iterate through directories inside source path and verify - # whether or not they exist in the target path. If they don't - # exist create them. - for DIRECTORY in ${DIRECTORIES};do - - local DIRECTORY_BASENAME=$(echo ${DIRECTORY} \ - | sed -r "s,${SOURCE_DIRECTORY}/,,") - - if [[ ${DIRECTORY} == ${DIRECTORY_BASENAME} ]];then - continue - fi - - local DIRECTORY_TARGET=${TARGET_DIRECTORY}/${DIRECTORY_BASENAME} - - if [[ ! -d ${DIRECTORY_TARGET} ]];then - mkdir -p ${DIRECTORY_TARGET} - fi - - done - -} diff --git a/Automation/Modules/Render/Scripts/render_setThemes.sh b/Automation/Modules/Render/Scripts/render_setThemes.sh deleted file mode 100755 index 134d6aa..0000000 --- a/Automation/Modules/Render/Scripts/render_setThemes.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/bash -# -# render_setThemes.sh -- This function performs theme-specific -# rendition. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setThemes { - - local -a DIRS - local COUNT=0 - local NEXTDIR='' - local MOTIF_NAME='' - local MOTIF_DIR='' - - # Define base directory of artistic motifs. This is the location - # where all artistic motifs are stored in. - local MOTIF_BASEDIR="${TCAR_WORKDIR}/Identity/Images/Themes" - - # Define base directory of design models. This is the location - # where all design models are stored in. - local MODEL_BASEDIR="${TCAR_WORKDIR}/Identity/Models/Themes" - - # Verify directory structure for all theme-specific directories. - render_setThemesDirStructure "${MODEL_BASEDIR}/${FLAG_THEME_MODEL}" "${MOTIF_BASEDIR}" - - # Define directory structure of design models. Design models - # directory structures are used as reference to create artistic - # motifs directory structure. Use the `--pattern' option to be - # sure any modification to FLAG_FILTER won't affect the output - # result. We need to make matching everything here, no matter what - # the FLAG_FILTER value be. - local MODEL_DIR='' - local MODEL_DIRS="$(cli_getFilesList ${MODEL_BASEDIR}/${FLAG_THEME_MODEL} \ - --pattern='^.+/[^.svn][[:alnum:]_/-]+$' --type="d" \ - | sed -e "s!^.*/${FLAG_THEME_MODEL}!!" \ - -e '/^[[:space:]]*$/d' \ - -e 's!^/!!')" - - # Define design model regular expression patterns from design - # models directory structure. - local MODEL_PATTERN=$(echo "$MODEL_DIRS" | tr "\n" '|' \ - | sed -e 's!^|!!' -e 's!|$!!') - - # Define regular expression pattern that match the theme artistic - # motif component inside the path strings. - local MOTIF_PATTERN=$(cli_getPathComponent --motif-pattern) - - # Define list of render-able directory structures inside the - # artistic motif. As reference, to build this list, use design - # model directory structure. The more specific you be in the path - # specification the more specific theme rendition will be. Thus, - # we use the path provided as argument and the --filter option as - # reference to control the amount of directories considered - # render-able directory. - local MOTIF_RENDERABLE_DIR='' - local MOTIF_RENDERABLE_DIRS=$(cli_getFilesList ${MOTIF_BASEDIR} \ - --pattern="^${TCAR_WORKDIR}/${MOTIF_PATTERN}/($MODEL_PATTERN)$" --type="d" \ - | grep "$(echo ${ACTIONVAL} | sed -r 's,/$,,')") - - # When no render-able directories are found, finish the script - # execution with an error message. There is an obvious typo in the - # path provided. - if [[ -z ${MOTIF_RENDERABLE_DIRS} ]];then - cli_printMessage "`gettext "No related model was found for the path provided."`" --as-error-line - fi - - # Rebuild list of render-able directory structures using an array - # variable. This let us to predict what directory is one step - # forward or backward from the current directory structure. - for MOTIF_RENDERABLE_DIR in $MOTIF_RENDERABLE_DIRS;do - DIRS[((++${#DIRS[*]}))]=${MOTIF_RENDERABLE_DIR} - done - - # Define total number of directories to process. This is required - # in order to correct the counting value and so, make it to match - # the zero based nature of bash array variables. - local DIRS_TOTAL=$((${#DIRS[*]} - 1)) - - while [[ $COUNT -le ${DIRS_TOTAL} ]];do - - # Redefine action value to refer the theme-specific render-able - # directory. - ACTIONVAL=${DIRS[$COUNT]} - - # Refine artistic motif name using the current action value. - MOTIF_NAME=$(cli_getPathComponent $ACTIONVAL --motif) - - # Verify artistic motif name. The name of the artistic motif - # must be present in order for theme rendition to happen. - # Theme rendition takes place inside artistic motifs and the - # artistic motif name is an indispensable part of it. Take - # care of not using design models directory structure as name - # for artistic motifs. They, sometimes, match the pattern used - # to verify artistic motifs names but must not be confused. - if [[ $MOTIF_NAME == '' ]] || [[ $MOTIF_NAME =~ "^($MODEL_PATTERN)" ]];then - COUNT=$(($COUNT + 1)) - continue - fi - - # Refine artistic motif directory. This is the top directory - # where all visual manifestations of an artistic motif are - # stored in (e.g., Backgrounds, Brushes, Concept, Distro, - # etc.). - MOTIF_DIR="${MOTIF_BASEDIR}/${MOTIF_NAME}" - - # Define what is the next directory in the list, so we could - # verify whether to render or not the current theme-specific - # render-able directory. - if [[ $COUNT -lt ${DIRS_TOTAL} ]];then - NEXTDIR=$(dirname ${DIRS[(($COUNT + 1))]}) - else - NEXTDIR='' - fi - - # Verify whether to render or not the current theme's - # render-able directory. This verification is needed in order - # to avoid unnecessary rendition loops. For example, don't - # render `path/to/dir/A' when `path/to/dir/A/B' does exist, - # that configuration would produce `/path/to/dir/A/B twice. - if [[ $ACTIONVAL =~ '[[:digit:]]$' ]] || [[ $ACTIONVAL == $NEXTDIR ]];then - COUNT=$(($COUNT + 1)) - continue - fi - - # Execute direct rendition on theme specific render-able - # directory as specified by action value. - render_setBaseRendition - - # Increment counter to match the correct count value. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Automation/Modules/Render/Scripts/render_setThemesDirStructure.sh b/Automation/Modules/Render/Scripts/render_setThemesDirStructure.sh deleted file mode 100755 index ed98d3d..0000000 --- a/Automation/Modules/Render/Scripts/render_setThemesDirStructure.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# render_setThemeDirectoryStructre.sh -- This function verifies -# theme-specific directory structures using common theme models -# directory structure as pattern. If there are missing directories inside -# theme-specific directories, this function will create it. This is a -# requisite of rendition process, so be sure to call this function -# before building the list of render-able theme directories. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - - -function render_setThemesDirStructure { - - local THEMES_SOURCE_DIR=$(cli_checkRepoDirSource "${1}") - local THEMES_TARGET_DIR=$(cli_checkRepoDirSource "${2}") - - local THEMES_FILTER=${THEMES_TARGET_DIR}/$(cli_getPathComponent --motif ${ACTIONVAL}) - - THEMES_TARGET_DIRS=$(cli_getFilesList ${THEMES_TARGET_DIR} \ - --pattern=".+/[[:digit:]]+$" --maxdepth=2 --mindepth=2 \ - | grep "${THEMES_FILTER}") - - for THEMES_TARGET_DIR in $THEMES_TARGET_DIRS;do - cli_printMessage "$THEMES_TARGET_DIR `gettext "directory structure..."`" --as-checking-line - cli_runFnEnvironment prepare ${THEMES_SOURCE_DIR} ${THEMES_TARGET_DIR} --directories - done - -} diff --git a/Automation/Modules/Render/render.asciidoc b/Automation/Modules/Render/render.asciidoc deleted file mode 100755 index 715b7b9..0000000 --- a/Automation/Modules/Render/render.asciidoc +++ /dev/null @@ -1,323 +0,0 @@ -render(1) -========= - -Name ----- -render - Standardize production tasks. - -Synopsis --------- -centos-art.sh render [OPTIONS] [DIRECTORY ...] - -Description ------------ - -The *render* module looks for configuration files inside the DIRECTORY -specified in the command-line and renders content based on -configuration files found inside it, if any. When no DIRECTORY is -specified, the *render* module looks for configuration files inside -the current directory it was executed from. If the current directory -is out of the working copy or no configuration file is found inside -the working copy DIRECTORY, the *render* module ends its execution -with an error message. - -Options -------- - -The *render* module accepts the following options: - -*--help*:: - This option shows the *render* module's documentation (this page). -*--version*:: - This option shows the *render* module's name and version. - -Configuration Files -------------------- - -The configuration files are regular files with the _.conf_ extension. -The name of configuration files is not relevant, though it might help -to remember what the configuration file is for. This way, and because -different modules can use configuration files for their own purposes, -the configuration files used by the *render* module are frequently -named as _render.conf_. - -The format used by configuration files is common to all modules inside -*centos-art.sh* script. They all use configuration sections in the -form +[section-name]+ and configuration values in the form +option = -"value"+ to describe. Based on the module being executed, the section -name and configuration values of configuration files might take -different meanings. In the specific case of *render* module, the -section name is always containing the name of the target file you want -to produce and the section-related configuration values always -describe the way you want to produce the file specified in the section -name. Commentaries are also supported using the +#+ character a the -beginning of lines. Commentaries defined this way are excluded from -processing so you can use them freely. - -The configuration files can be divided in smaller configuration files -using name conventions. For example, if you have the file -_render.conf_, you can divide its content in _render-1.conf_, -_render-2.conf_ and so on. This sort of division is very useful when -the configuration file begins to grow, or you want to control the -order in which specific groups of files are produced inside the -DIRECTORY. - -To describe the file's production, the *render* module's configuration -files accept the following configuration options: - -*render-type*:: - Optional. This variable specifies the type or rendition the - *render* module will perform. Possible values to this variable - include _svg_, _asciidoc_, _symlink_. When this value is not - specified or no value is set to it, the *render* module reads the - value of *render-from* variable and determines what kind of - rendition to perform based on the MIME information of the file - provided. -*render-from*:: - Required. This variable specifies the file name of the source file - (design model) used to produce the final file specified in the - section line. This option can receive absolute paths and relative - paths. Absolute paths begin with a slash (+/+) character while - relative paths begin with the dot slash (+./+) characters or no - character at all. -*formats*:: - Optional. This variable specifies the different formats you want - to create copies of the final file. The values specified in this - variable are separated by white space and should be consequent - with the production environment (e.g., image formats supported by - ImageMagick when +render-type = "svg"+ and documentation formats - supported by asciidoc when +render-type = "asciidoc"+). When this - variable is not provided no duplicate copies in different formats - are created, - just the base file in its format. -*comment*:: - Optional. This variable specifies a section-specific comment - describeing it. - -Using Paths -~~~~~~~~~~~ - -When you provide absolute paths inside configuration files, there -isn't confusion about the location where the file is or should be. -However, it introduces rigidity to directory structures inside the -working copy when it is necessary to move directories from one place -to another inside the working copy. To eliminate this mobility -restrictions, relative paths can be used to create modular directory -structures. - -When you use relative paths inside configuration files, paths are -relative to the location where the configuration file is stored in. -This way it is possible to move whole directory structures without -touching the configuration file and still have a render-able -structures inside the working copy. However, relative paths get -limited in situations where the production process needs files outside -the directory where the configuration file is stored in. In such -cases, a combination of relative and absolute paths is the solution to -apply. - -When we need to use absolute paths to several files in the same -directory (e.g., we are combining them all to produce a new image) but -outside the current directory the configuration file is stored in, it -is possible to use a list of absolute paths one beside another -separated by space or we can use path expansion which is shorter and -easier to read. Path expansion is interpreted when you enclose a list -of file names in curly brackets using comma as separator without -spaces (e.g., +{file1,file2,file3}+). In order for path expansion to -work correctly, all the file names you put inside the curly brackets' -list must exist in the location specified first. - -Using Environment Variables -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The configuration files let you to use environment variables inside -them. This might be very useful in situation where you need to provide -absolute paths based on specific information (e.g., your home -directory or the current locale information). To use environment -variables inside the configuration file you need to know the -environment variables used by *centos-art.sh* script and write them in -the form +${VARNAME}+, where +VARNAME+ is the name of the variable you -want to expand. Some of the most important environment variables used -by *centos-art.sh* script -and its configuration files- are described -below: - -+TCAR_BASEDIR+:: - This variable contains the absolute path to your repository's - working copy. The value of this variable is defined as read-only - inside *centos-art.sh* script and cannot be modified later. As a - matter of convenience, users make use of their +~/.bash_profile+ - file to define this variable there and, this way, skip the - sometimes annoyance absolute path questioning the *centos-art.sh* - script does in order to know the absolute path of the working copy - it is going to work with. -+ -Whenever you set absolute paths inside configuration files to refer -locations inside your working copy, it is necessary that you use the -+TCAR_BASEDIR+ environment variable in front of each path definition -you set. - -+HOME+:: - This variable contains the absolute path to current user's home - directory. The value of this variable is set by the operating - system when the user opens a terminal session. -+ -Whenever you need to set user-specific absolute paths inside -configuration files, use this variable. - -Rendering SVG Files -~~~~~~~~~~~~~~~~~~~ - -When the *render-type* variable is set to _svg_, the following -complementary variables can be used inside the configuration file: - -*heights*:: - Optional. This variable specifies the different image heights you - want to create copies of the final PNG image. The values specified - in this variable are separated by white space and should be - understandable by ImageMagick tool set. When this variable is not - provided no duplicate copies in different heights will be - produced. In this case the height information is taken from source - file and just one PNG image is produced with it. -*fgcolors*:: - Optional. This variable specifies the different forground colors - you want to create copies of the final PNG image. To do this, the - image you want to copy should be rendered with black color - (000000) so the color replacement can be performed. The values - specified in this variable are separated by white space and should - be understandable by ImageMagick tool set. When this variable is - not provided no duplicate copies in different foreground colors - are created. -*bgcolors*:: - Optional. This variable specifies the different background colors - you want to create copies of the final PNG image. This variable - plays with Inkscape's _--export-background_ and - _--export-background-opacity_ options. Possible values to this - functions take the form XXXXXX-X, where the first six X represent - a color in hexadeciamal format and the final X might be 1 or 0. 1 - for full opacity and 0 for full transparency. Intermediate values - between 0 and 1 (e.g., 0.55) can be given to control the - background opacity. When this variable is not provided no - duplicate copies in different background colors are created. -*command*:: - Optional. This variable specifies the command used to perform the - image manipulation. There are two options we've been using here - both from ImageMagick tool set. The first option is - +/usr/bin/convert+ command. This command creates copies of the - image produced which is useful to create modified copies or - combination of already existent images. The second option is - +/usr/bin/mogrify+ command. This command modifies the PNG image - inplace which might be useful when no modified duplications need - to be created but just one modified image. When this variable is - not provided +/usr/bin/convert+ is used as default. Note that you - can use this variable to pass options to image production (e.g., - to control whether images are combined horizotally or - veritcally.). - -Rendering Asciidoc Files -~~~~~~~~~~~~~~~~~~~~~~~~ - -When the *render-type* variable is set to _asciidoc_, the following -complementary variables can be used inside the configuration file: - - -Examples --------- - -Here are some practical configuration files' examples you can use as -reference to create your own configuration files. - ----------------------------------------------------------------------- -[corporate.docbook] -render-type = "asciidoc" -render-from = "corporate.asciidoc" -formats = "xhtml pdf" -comment = "The CentOS project corporate visual identity manual." ----------------------------------------------------------------------- - -{asciidoc-br} - -When the *render* module reads this configuration file, it creates the -+corporate.docbook+ file from +corporate.asciidoc+ file and later, -transforms the +corporate.docbook_ file into +corporate.html+ and -+corporate.pdf+ formats. The creation of files take place in the same -directory the configuration file was found. To control the location of -final files, you can use the section name of configuration files. - ----------------------------------------------------------------------- -[centos-artwork.png] -render-from = "${TCAR_BASEDIR}/Artworks/Brands/Types/Webenv/centos.org/{centos,artwork}.svgz" -formats = "xpm pdf jpg tif" -heights = "16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" -fgcolors = "000000 ffffff" -bgcolors = "ffffff-0" -command = "/usr/bin/convert +append" ----------------------------------------------------------------------- - -{asciidoc-br} - -When the *render* module reads this configuration file, it takes the -+centos.svgz+ and +artwork.svgz+ files as source to produce the -+centos.png+ and +artwork.png+ files considering the first value in -the list of background and foreground colors specified in the -configuration file. Then, it takes these PNG files and reduces their -sizes based on the *heights* variable and combines the results -horizontally to create the +centos-artwork.png+ file. Later, the -+centos-artwork.png+ file is converted to produce one image file for -each image format specified in the configuration file. At this point, -all the process repeats again but for the next height and color values -in the list. - -{asciidoc-br} - ----------------------------------------------------------------------- -[${HOME}/bin/centos-art] -render-type = "symbolic-link" -render-from = "centos-art.sh" -comment = "The centos-art.sh script command." ----------------------------------------------------------------------- - -When the *render* module reads this configuration file, it tries to -create the +${HOME}/bin/centos-art+ symbolic link from +centos-art.sh+ -file. In case the +${HOME}/bin+ directory doesn't exist, it will be -created to favor the symbolic link creation. The *comment* variable -here hasn't any use here (except to describe what the section is for) -and you can get rid of it, if you want to. - -Note how in this example we used an environment variable in the -section name definition. This value will be expanded before the -*render* module could process the section name definition itself. The -environment variables definitions can be used inside variable's -values, as well, but it is less common because most path references -inside configuration files are relative to the current location. - -To identify a file is relative to current location, the repository -working copy or the system it is necessary to use a convention when -writing configuration files. - -Reporting Bugs --------------- -Report bugs on the *automation* category of *centos-artwork* project -at the https://centos.org.cu/bugs/[The CentOS Bugs] website. - -Author ------- -Written by mailto:al@centos.org.cu[Alain Reguera Delgado] - -Copyright ---------- -Copyright (C) 2013 The CentOS Project - -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. - -// vim: set syntax=asciidoc: diff --git a/Automation/Modules/Render/render.conf.sh b/Automation/Modules/Render/render.conf.sh index a8933a9..fce1be1 100755 --- a/Automation/Modules/Render/render.conf.sh +++ b/Automation/Modules/Render/render.conf.sh @@ -28,3 +28,4 @@ declare -xr MODULE_VERSION='0.1' declare -x MODULE_ACTIONS='' +declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Render/render.sh b/Automation/Modules/Render/render.sh index d271baa..c2dab14 100755 --- a/Automation/Modules/Render/render.sh +++ b/Automation/Modules/Render/render.sh @@ -1,14 +1,19 @@ #!/bin/bash +###################################################################### # -# render.sh -- This function standardizes the way source files are -# rendered inside the working copy. +# render.sh -- This function standardizes the way source files are +# processed inside the working copy. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 # # Copyright (C) 2009-2013 The CentOS Project # # 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. +# 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 @@ -19,91 +24,30 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- +###################################################################### function render { - local ACTIONNAM='' - local ACTIONVAL='' - - # Initialize `--releasever' option. The release version option - # controls the release number used to produce release-specific - # content. By default, the release number of The CentOS - # Distribution you have installed in your workstation is used. - local FLAG_RELEASEVER=$(cat /etc/redhat-release \ - | gawk '{ print $3 }') - - # Initialize `--basearch' option. The base architecture option - # controls the architecture type used to produce - # architecture-specific content. By default, the hardware - # platform of your workstation is used. - local FLAG_BASEARCH=$(uname -i) - - # Initialize `--theme-model' option. The theme model option - # specifies the theme model name used to produce theme - # artistic motifs. - local FLAG_THEME_MODEL='Default' - - # Initialize `--post-rendition' option. This option defines what - # command to use as post-rendition. Post-rendition takes place - # over base-rendition output. - local FLAG_POSTRENDITION='' - - # Initialize `--last-rendition' option. This option defines what - # command to use as last-rendition. Last-rendition takes place - # once both base-rendition and post-rendition has been performed - # in the same directory structure. - local FLAG_LASTRENDITION='' - - # Initialize `--dont-dirspecific' option. This option can take two - # values only (e.g., `true' or `false') and controls whether to - # perform or not directory-specific rendition. Directory-specific - # rendition may use any of the three types of renditions (e.g., - # base-rendition, post-rendition and last-rendition) to accomplish - # specific tasks when specific directory structures are detected - # in the rendition flow. By default, the centos-art.sh script - # performs directory-specific rendition. - local FLAG_DONT_DIRSPECIFIC='false' - - # Initialize `--with-brands' option. This option controls whether - # to brand output images or not. By default output images are not - # branded. - local FLAG_WITH_BRANDS='false' - - # Initialize list of supported file extensions. These file - # extensions are used to build the list of source files we'll use - # to create images from. The order in which these extensions are - # listed here determines the order in which they are process if - # more than one is found in the same location. - local RENDER_EXTENSIONS='svgz svg docbook conf' - - # Initialize the rendition format name as an empty value. The name - # of rendition format is determined later at rendition time, based - # on template file extension. - local RENDER_FORMAT='' - - # Initialize absolute path to format's base directory, the place - # where format-specific directories are stored in. - local RENDER_FORMAT_DIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" - # Interpret arguments and options passed through command-line. - render_getOptions + render_getOptions "${@}" # Redefine positional parameters using ARGUMENTS. At this point, # option arguments have been removed from ARGUMENTS variable and # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" + eval set -- "${TCAR_ARGUMENTS}" # Define action value. We use non-option arguments to define the # action value (ACTIONVAL) variable. - for ACTIONVAL in "$@";do - + for DIRECTORY in "$@";do + # Sanitate non-option arguments to be sure they match the # directory conventions established by centos-art.sh script # against source directory locations in the working copy. - ACTIONVAL=$(cli_checkRepoDirSource ${ACTIONVAL}) + DIRECTORY=$(tcar_checkRepoDirSource ${DIRECTORY}) + + # Retrieve list of configuration files from directory. + CONFIGURATIONS=$(tcar_getFilesList ${DIRECTORY} \ + --pattern=".+/.+\.conf$" --type="f") # Verify non-option arguments passed to centos-art.sh # command-line. The path provided as argument must exist in @@ -112,39 +56,12 @@ function render { # meaning. In order to be sure all required directories are # available in the repository it is necessary use the prepare # functionality. - #cli_checkFiles ${ACTIONVAL} -d - - # Define render-able directories and the way they are - # produced. To describe the way render-able directories are - # produced, we take the action value (ACTIONVAL) as reference - # and describe the production through an action name - # (ACTIONNAM). - if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images/Themes" ]];then - ACTIONNAM="render_setThemes" - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images/Brands" ]];then - ACTIONNAM="render_setBrands" - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images" ]];then - ACTIONNAM="render_setBaseRendition" - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Manuals/(Docbook|Svg)/[[:alnum:]-]+" ]];then - ACTIONNAM="render_setBaseRendition" - else - cli_printMessage "`gettext "The path provided doesn't support rendition."`" --as-error-line - fi - - # Synchronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_synchronizeRepoChanges "${ACTIONVAL}" - - # Execute action name. - ${ACTIONNAM} + tcar_checkFiles ${CONFIGURATIONS} -f - # Synchronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_synchronizeRepoChanges "${ACTIONVAL}" + # Process each configuration file. + for CONFIGURATION in ${CONFIGURATIONS};do + render_setRenderType "${@}" + done done diff --git a/Automation/Modules/Render/render_getOptions.sh b/Automation/Modules/Render/render_getOptions.sh new file mode 100755 index 0000000..0700c3d --- /dev/null +++ b/Automation/Modules/Render/render_getOptions.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# +# render_getOptions.sh -- This function interprets option parameters +# passed to `render' functionality and calls actions accordingly. +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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. +# +# ---------------------------------------------------------------------- +# ${Id}$ +# ---------------------------------------------------------------------- + +function render_getOptions { + + # Define short options we want to support. + local ARGSS="h,v,f:" + + # Define long options we want to support. + local ARGSL="help,version,filter:" + + # Redefine arguments using getopt(1) command parser. + tcar_setArguments "${@}" + + # Reset positional parameters on this function, using output + # produced from (getopt) arguments parser. + eval set -- "${TCAR_ARGUMENTS}" + + # Look for options passed through command-line. + while true; do + case "$1" in + + -h | --help ) + tcar_printHelp + ;; + + -v | --version ) + tcar_printVersion + ;; + + -f | --filter ) + TCAR_FLAG_FILTER="$2" + shift 2 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Redefine arguments using current positional parameters. Only + # paths should remain as arguments, at this point. + TCAR_ARGUMENTS="${@}" + +} diff --git a/Automation/Modules/Render/render_setLocalizedXml.sh b/Automation/Modules/Render/render_setLocalizedXml.sh new file mode 100755 index 0000000..2347a32 --- /dev/null +++ b/Automation/Modules/Render/render_setLocalizedXml.sh @@ -0,0 +1,75 @@ +#!/bin/bash +###################################################################### +# +# Modules/Render/Modules/Svg/Scripts/render_setLocalization.sh -- +# This function standardizes the way (.po) translation files are +# applied to XML files (e.g., .docbook, .svg) in order to produce +# their related translated instances, used to expand translation +# markers and produce the final file format in different languages. +# Assuming no translation file exists, an untranslated instance is +# taken from the design model and created (i.e., just a copy) from +# it. Using a design model instance (translated or not) is required +# in order to expand translation markers safely. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# +# Copyright (C) 2009-2013 The CentOS Project +# +# 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 render_setLocalizedXml { + + local SOURCE=${1} + local TARGET=${2} + + # Define which command will be used to output the template + # content. This is required because template files might be found + # as compressed files inside the repository. + local COMMAND="/bin/cat" + if [[ $(file -b -i ${SOURCES}) =~ '^application/x-gzip$' ]];then + COMMAND="/bin/zcat" + fi + + if [[ -f ${TRANSLATIONS[0]} ]];then + + # Define name of temporal file used as translation instance. + local TRANSLATION_INSTANCE=${TCAR_SCRIPT_TEMPDIR}/messages.po + + # Combine translations into the translation instance. + msgcat -u -o ${TRANSLATION_INSTANCE} ${TRANSLATIONS[*]} + + # Create the translated instance of design model. + ${COMMAND} ${SOURCE} | xml2po -a -l ${TCAR_SCRIPT_LANG_LL} \ + -p ${TRANSLATION_INSTANCE} -o ${TARGET} - + + # Remove .xml2po.mo temporal file. + if [[ -f ./.xml2po.mo ]];then + rm ./.xml2po.mo + fi + + # Remove instance created to store both licenses and template + # translations. + if [[ -f ${TRANSLATION_INSTANCE} ]];then + rm ${TRANSLATION_INSTANCE} + fi + + else + ${COMMAND} ${SOURCE} > ${TARGET} + fi + +} diff --git a/Automation/Modules/Render/render_setRenderType.sh b/Automation/Modules/Render/render_setRenderType.sh new file mode 100755 index 0000000..9f43a31 --- /dev/null +++ b/Automation/Modules/Render/render_setRenderType.sh @@ -0,0 +1,148 @@ +#!/bin/bash +###################################################################### +# +# render_setRenderType.sh -- This file evaluates a configuration +# file and determines what kind of rendition to do. +# +# Written by: +# * Alain Reguera Delgado , 2013 +# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 +# +# Copyright (C) 2013 The CentOS Project +# +# 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 render_setRenderType { + + local -a SECTIONS + + # Define motif-specific environment variables, based on + # configuration file path. These variables might save + # configuration file writers from typing motif-specific + # information when they produce motif-specific content. These + # variables will be empty if the configuration file isn't inside + # a motif-specific directory structure. + MOTIF=$(tcar_getPathComponent ${CONFIGURATION} --motif) + MOTIF_NAME=$(tcar_getPathComponent ${CONFIGURATION} --motif-name) + MOTIF_VERSION=$(tcar_getPathComponent ${CONFIGURATION} --motif-version) + + # Use arrays to store section names. This make possible to make + # use of post-rendition and last-rendition concepts. Otherwise it + # would be difficult to predict information about sections inside + # deeper environments. + for SECTION in $(tcar_getConfigSectionNames "${CONFIGURATION}" \ + | egrep ${TCAR_FLAG_FILTER});do + SECTIONS[((++${#SECTIONS[*]}))]="${SECTION}" + done + + local COUNTER=0 + + while [[ ${COUNTER} -lt ${#SECTIONS[*]} ]];do + + # Initialize array variables locally. + local -a TRANSLATIONS + local -a SOURCES + + SECTION=${SECTIONS[${COUNTER}]} + + if [[ ${SECTION} =~ "^/" ]];then + TARGET=${SECTION} + else + if [[ ${TCAR_SCRIPT_LANG_LC} =~ '^en' ]];then + TARGET=$(dirname ${CONFIGURATION})/${SECTION} + else + TARGET=$(dirname ${CONFIGURATION})/${TCAR_SCRIPT_LANG_LC}/${SECTION} + fi + fi + + RENDER_TYPE=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-type") + + RENDER_FROM=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-from") + + for SOURCE in ${RENDER_FROM};do + if [[ ${SOURCE} =~ "^/" ]];then + SOURCES[((++${#SOURCES[*]}))]=${SOURCE} + else + SOURCES[((++${#SOURCES[*]}))]=$(dirname ${CONFIGURATION})/${SOURCE} + fi + done + + if [[ -z ${RENDER_TYPE} ]];then + RENDER_TYPE=$(echo ${SOURCES[0]} | sed -r 's/.+\.([[:alpha:]]+)$/\1/') + fi + + LOCALE_FROM=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "locale-from") + + # When the current locale information is not English, don't + # process section blocks unless they have any related + # translation file. There is no need to have untranslated + # content inside language-specific directories. + if [[ ! ${TCAR_SCRIPT_LANG_LC} =~ '^en' ]];then + + if [[ -z ${LOCALE_FROM} ]];then + + # Increment array counter. + COUNTER=$(( ${COUNTER} + 1 )) + + # Reset array variable to avoid undesired + # concatenations between sections blocks. + unset TRANSLATIONS + unset SOURCES + + # Move to next section block. + continue + + fi + + for TRANSLATION in ${LOCALE_FROM};do + if [[ ${TRANSLATION} =~ "^/" ]];then + TRANSLATIONS[((++${#TRANSLATIONS[*]}))]=${TRANSLATION} + else + TRANSLATIONS[((++${#TRANSLATIONS[*]}))]=$(dirname ${CONFIGURATION})/${TRANSLATION} + fi + done + + tcar_checkFiles "${TRANSLATIONS[*]}" -f + + fi + + # Initialize render's modules. + case ${RENDER_TYPE} in + "svgz" | "svg" ) + tcar_setModuleEnvironment "svg" "${@}" + ;; + * ) + tcar_setModuleEnvironment "${RENDER_TYPE}" "${@}" + ;; + esac + + # Increment section's counter. + COUNTER=$(( ${COUNTER} + 1 )) + + # Reset array variable to avoid undesired concatenations + # between sections blocks. + unset TRANSLATIONS + unset SOURCES + + done + + # Reset array variables and their counters to avoid undesired + # concatenations between configuration files. + unset COUNTER + unset SECTIONS + +} diff --git a/Automation/Scripts/tcar_checkFiles.sh b/Automation/Scripts/tcar_checkFiles.sh index 1b18023..6c3f019 100755 --- a/Automation/Scripts/tcar_checkFiles.sh +++ b/Automation/Scripts/tcar_checkFiles.sh @@ -162,7 +162,7 @@ function tcar_checkFiles { ;; "file" ) - if [[ ! $(${CONDITION_COMMAND[${COUNTER}]} ${CONDITION_PATTERN[${COUNTER}]} ${FILE}) == "${MIME}" ]];then + if [[ ! $(${CONDITION_COMMAND[${COUNTER}]} ${CONDITION_PATTERN[${COUNTER}]} ${FILE}) =~ "${MIME}" ]];then tcar_printMessage "${FILE} ${CONDITION_MESSAGE[${COUNTER}]}" --as-error-line fi ;; diff --git a/Automation/Scripts/tcar_checkRepoDirSource.sh b/Automation/Scripts/tcar_checkRepoDirSource.sh index 3aefbff..5ceb62c 100755 --- a/Automation/Scripts/tcar_checkRepoDirSource.sh +++ b/Automation/Scripts/tcar_checkRepoDirSource.sh @@ -56,7 +56,7 @@ function tcar_checkRepoDirSource { # Remove the working directory absolute path from location to # avoid path duplications here. - LOCATION=$(echo "${LOCATION}" | sed "s,${TCAR_USER_WRKDIR}/,,g") + LOCATION=$(echo "${LOCATION}" | sed "s,${TCAR_BASEDIR}/,,g") # When we use Git as version control system, there isn't a need of # using the `trunk', `branches', `tags' convention we were using @@ -83,7 +83,7 @@ function tcar_checkRepoDirSource { # messages when we reassign variable values using this function as # reference (e.g., in order to prevent error messages from being # stored inside variables.). - LOCATION=${TCAR_USER_WRKDIR}/${LOCATION} + LOCATION=${TCAR_BASEDIR}/${LOCATION} # Output the absolute path to location. echo "${LOCATION}" diff --git a/Automation/Scripts/tcar_getConfigLines.sh b/Automation/Scripts/tcar_getConfigLines.sh index 86a63a4..07de940 100755 --- a/Automation/Scripts/tcar_getConfigLines.sh +++ b/Automation/Scripts/tcar_getConfigLines.sh @@ -33,18 +33,10 @@ function tcar_getConfigLines { # Initialize absolute path to configuration file. local CONFIGURATION_FILE="${1}" - # Verify that configuration file does exist. - tcar_checkFiles -e ${CONFIGURATION_FILE} - # Initialize configuration section name where the variable value # we want to to retrieve is set in. local CONFIGURATION_SECTION="${2}" - # Be sure the configuration section name has the correct format. - if [[ ! ${CONFIGURATION_SECTION} =~ '^[[:alnum:]._-]+$' ]];then - tcar_printMessage "`gettext "The configuration section provided is incorrect."`" --as-error-line - fi - # Initialize variable name we want to retrieve value from. local CONFIGURATION_OPTION="${3}" @@ -56,12 +48,15 @@ function tcar_getConfigLines { CONFIGURATION_OPTION='[[:alnum:]_./-]+[[:space:]]*=' fi - # Retrieve configuration lines from configuration file. + # Retrieve configuration lines from configuration file. Don't sort + # the value of this value so as to preserve the order given in the + # configuration file. This is important because configuration + # files are being used for setting render-from priorities. local CONFIGURATION_LINES=$(cat ${CONFIGURATION_FILE} \ | egrep -v '^#' \ | egrep -v '^[[:space:]]*$' \ | sed -r -n "/^\[${CONFIGURATION_SECTION}\][[:space:]]*$/,/^\[/p" \ - | egrep -v '^\[' | sort | uniq \ + | egrep -v '^\[' \ | egrep "^${CONFIGURATION_OPTION}") # Output value related to variable name. diff --git a/Automation/Scripts/tcar_getConfigSectionNames.sh b/Automation/Scripts/tcar_getConfigSectionNames.sh index 0fd58cb..bb61d97 100755 --- a/Automation/Scripts/tcar_getConfigSectionNames.sh +++ b/Automation/Scripts/tcar_getConfigSectionNames.sh @@ -37,8 +37,16 @@ function tcar_getConfigSectionNames { # Verify existence of configuration file. tcar_checkFiles ${CONFIGURATION_FILE} -f - # Output all section names without brackets, one per line. - egrep '^\[[[:alnum:]._-]+\][[:space:]]*$' ${CONFIGURATION_FILE} \ - | sed -r 's/\[(.+)\]/\1/' + # Define regular expression pattern used to retrieve section names + # from configuration files. Don't permit any regular expression + # meta-character either. + local CONFIGURATION_SECTION_REGEX='^\[[[:alnum:]_.-]+\][[:space:]]*$' + + # Output all section names without brackets, one per line. Don't + # permit any kind of expansion here. Section names are used as + # reference to retrieve information from configuration file, + # expanding them would create different points of verifications. + egrep ${CONFIGURATION_SECTION_REGEX} ${CONFIGURATION_FILE} \ + | sed -r 's,\[(.+)\],\1,' } diff --git a/Automation/Scripts/tcar_getConfigValue.sh b/Automation/Scripts/tcar_getConfigValue.sh index ce5e538..b747df8 100755 --- a/Automation/Scripts/tcar_getConfigValue.sh +++ b/Automation/Scripts/tcar_getConfigValue.sh @@ -30,27 +30,23 @@ function tcar_getConfigValue { - # Initialize absolute path to configuration file. local CONFIGURATION_FILE="${1}" - # Initialize configuration section name where the variable value - # we want to to retrieve is set in. local CONFIGURATION_SECTION="${2}" - # Initialize variable name we want to retrieve value from. local CONFIGURATION_OPTION="${3}" - # Retrieve configuration lines from configuration file. local CONFIGURATION_LINES=$(tcar_getConfigLines \ "${CONFIGURATION_FILE}" "${CONFIGURATION_SECTION}" "${CONFIGURATION_OPTION}") - # Parse configuration lines to retrieve the values of variable - # names. - local CONFIGURATION_VALUE=$(echo ${CONFIGURATION_LINES} \ - | cut -d= -f2- \ - | sed -r -e 's/"//g' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' ) + for CONFIGURATION_LINE in "${CONFIGURATION_LINES}";do + + local CONFIGURATION_VALUE=$(echo "${CONFIGURATION_LINE}" \ + | cut -d= -f2- | sed -r -e 's/"//g' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + + eval echo ${CONFIGURATION_VALUE} + + done - # Output values related to variable name. - echo "${CONFIGURATION_VALUE}" } diff --git a/Automation/Scripts/tcar_getPathComponent.sh b/Automation/Scripts/tcar_getPathComponent.sh index e683577..bd6f282 100755 --- a/Automation/Scripts/tcar_getPathComponent.sh +++ b/Automation/Scripts/tcar_getPathComponent.sh @@ -35,10 +35,10 @@ function tcar_getPathComponent { local ARGSS='' # Define long options. - local ARGSL='release,release-major,release-minor,release-pattern,architecture,architecture-pattern,motif,motif-name,motif-release,motif-pattern,repo-dir' + local ARGSL='release,release-major,release-minor,release-pattern,architecture,architecture-pattern,motif,motif-name,motif-version,motif-pattern,repo-dir' # Define release pattern. - local RELEASE="(([[:digit:]]+)(\.([[:digit:]]+))?)" + local VERSION="(([[:digit:]]+)(\.([[:digit:]]+))?)" # Define architecture pattern. Make it match the architectures the # CentOS distribution is able to be installed on. @@ -46,7 +46,7 @@ function tcar_getPathComponent { # Define regular expression pattern that match the theme artistic # motif component inside the path strings. - local THEME_MOTIF="Identity/Images/Themes/(([[:alnum:]]+)/(${RELEASE}))" + local THEME_MOTIF="Themes/Motifs/(([[:alnum:]]+)/(${VERSION}))" # Initialize arguments with an empty value and set it as local # variable to this function scope. Doing this is very important to @@ -70,25 +70,25 @@ function tcar_getPathComponent { case "${1}" in --release ) - echo "${LOCATION}" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\1!" + echo "${LOCATION}" | egrep "${VERSION}" | sed -r "s!.*/${VERSION}/.*!\1!" shift 1 break ;; --release-major ) - echo "${LOCATION}" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\2!" + echo "${LOCATION}" | egrep "${VERSION}" | sed -r "s!.*/${VERSION}/.*!\2!" shift 1 break ;; --release-minor ) - echo "${LOCATION}" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\4!" + echo "${LOCATION}" | egrep "${VERSION}" | sed -r "s!.*/${VERSION}/.*!\4!" shift 1 break ;; --release-pattern ) - echo "${RELEASE}" + echo "${VERSION}" shift 1 break ;; @@ -117,7 +117,7 @@ function tcar_getPathComponent { break ;; - --motif-release ) + --motif-version ) echo "${LOCATION}" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\3!" shift 1 break diff --git a/Automation/Scripts/tcar_printMessage.sh b/Automation/Scripts/tcar_printMessage.sh index 2957d1f..fa7d604 100755 --- a/Automation/Scripts/tcar_printMessage.sh +++ b/Automation/Scripts/tcar_printMessage.sh @@ -71,8 +71,15 @@ function tcar_printMessage { --as-error-line ) + # Build the error trail. This is very useful for tracking + # the error down. + tcar_printMessage '-' --as-separator-line + tcar_printMessage "${FUNCNAME[*]}" --as-tree-line + # Build the error message. - tcar_printMessage "${TCAR_SCRIPT_COMMAND} ($(tcar_printCaller 1)): ${MESSAGE}" --as-stderr-line + tcar_printMessage '-' --as-separator-line + tcar_printMessage "$(tcar_printCaller 1) ${MESSAGE}" --as-stdout-line + tcar_printMessage '-' --as-separator-line tcar_printMessage "${MODULE_NAME}" --as-toknowmore-line # Finish script execution with exit status 1 (SIGHUP) to @@ -82,12 +89,34 @@ function tcar_printMessage { exit 1 ;; + --as-tree-line ) + local NAME + local -a FN + for NAME in ${MESSAGE};do + FN[++((${#FN[*]}))]=${NAME} + done + local COUNT=$(( ${#FN[*]} - 2 )) + local SEPARATOR='`--' + local SPACES=0 + echo "${TCAR_SCRIPT_BASEDIR}/${TCAR_SCRIPT_NAME}" 1>&2 + while [[ ${COUNT} -gt 0 ]];do + if [[ ${COUNT} -eq $(( ${#FN[*]} - 2 )) ]];then + echo ${SEPARATOR} ${FN[${COUNT}]} + else + echo ${FN[${COUNT}]} \ + | gawk '{ printf "%'${SPACES}'s%s %s\n", "", "'${SEPARATOR}'", $1 }' + fi + COUNT=$((${COUNT} - 1)) + SPACES=$((${SPACES} + 4)) + done + ;; + --as-suggestion-line ) # Build the error message. - tcar_printMessage "${TCAR_SCRIPT_COMMAND} ($(tcar_printCaller 1)):" --as-stderr-line - tcar_printMessage "`gettext "The path provided cannot be processed the way you entered it."`" --as-stderr-line - tcar_printMessage "`gettext "Instead, try the following equivalence:"` ${MESSAGE}" --as-stderr-line + tcar_printMessage "${TCAR_SCRIPT_COMMAND} ($(tcar_printCaller 1)):" --as-stdout-line + tcar_printMessage "`gettext "The path provided cannot be processed the way you entered it."`" --as-stdout-line + tcar_printMessage "`gettext "Instead, try the following equivalence:"` ${MESSAGE}" --as-stdout-line tcar_printMessage "${MODULE_NAME}" --as-toknowmore-line # Finish script execution with exit status 1 (SIGHUP) to @@ -98,7 +127,7 @@ function tcar_printMessage { ;; --as-toknowmore-line ) - tcar_printMessage "`gettext "To know more, run"` ${TCAR_SCRIPT_COMMAND} ${MESSAGE} --help" --as-stderr-line + tcar_printMessage "`gettext "To know more, run"` ${TCAR_SCRIPT_COMMAND} ${MESSAGE} --help" --as-stdout-line ;; --as-yesornorequest-line ) @@ -145,7 +174,7 @@ function tcar_printMessage { ;; --as-response-line ) - tcar_printMessage "--> ${MESSAGE}" --as-stderr-line + tcar_printMessage "--> ${MESSAGE}" --as-stdout-line ;; --as-request-line ) @@ -181,10 +210,10 @@ function tcar_printMessage { until [[ ${MESSAGE_WIDTH} -eq 0 ]];do echo -n "$(echo ${MESSAGE} | sed -r 's!(.).*!\1!')" MESSAGE_WIDTH=$((${MESSAGE_WIDTH} - 1)) - done) + done) # Draw the separator line. - echo "${MESSAGE}" + echo "${MESSAGE}" 1>&2 ;; --as-banner-line ) diff --git a/Automation/Scripts/tcar_setModuleEnvironment.sh b/Automation/Scripts/tcar_setModuleEnvironment.sh index 47c5837..f462677 100755 --- a/Automation/Scripts/tcar_setModuleEnvironment.sh +++ b/Automation/Scripts/tcar_setModuleEnvironment.sh @@ -46,9 +46,6 @@ function tcar_setModuleEnvironment { # Define module's related directories. local MODULE_DIR_MODULES=${MODULE_DIR}/Modules - local MODULE_DIR_MANUALS=${MODULE_DIR}/Manuals - local MODULE_DIR_SCRIPTS=${MODULE_DIR}/Scripts - local MODULE_DIR_LOCALES=${MODULE_DIR}/Locales # Define module's initialization file. local MODULE_INIT_FILE=${MODULE_DIR}/${MODULE_NAME}.sh @@ -61,21 +58,18 @@ function tcar_setModuleEnvironment { # start counting from second argument on, inclusively. shift 1 - # Verify number of arguments passed to centos-art.sh script. By - # default, to all modules, when no option is provided the version - # information is printed. - if [[ $# -lt 1 ]];then - tcar_printVersion - fi - # Redefine module-specific configuration values. if [[ -f ${MODULE_DIR}/${MODULE_NAME}.conf.sh ]];then . ${MODULE_DIR}/${MODULE_NAME}.conf.sh fi - # Redefine module-specific internationalization configuration variables. - declare -x TEXTDOMAIN=${MODULE_NAME} - declare -x TEXTDOMAINDIR=${MODULE_DIR}/Locales + # Verify the number of arguments passed to centos-art.sh script. + # By default, to all modules, when no argument is provided after + # the module name, use the current directory as default directory + # to look for configuration files. + if [[ $# -eq 0 ]];then + set -- ${PWD} + fi # Load module-specific (function) scripts into current execution # environment. Keep the tcar_setModuleEnvironmentScripts function @@ -85,4 +79,7 @@ function tcar_setModuleEnvironment { # Execute module-specific initialization script. ${MODULE_NAME} "${@}" + # Unset the module environment. + tcar_unsetModuleEnvironment "${MODULE_NAME}" + } diff --git a/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh b/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh index 03997bc..95e0d98 100755 --- a/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh +++ b/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh @@ -34,10 +34,13 @@ function tcar_setModuleEnvironmentScripts { local FUNCTION_PATTERN="^function[[:space:]]+${MODULE_NAME}(_[[:alnum:]]+)?[[:space:]]+{[[:space:]]*$" # Define the list of files. - local MODULE_SCRIPTS="${MODULE_INIT_FILE} - $(tcar_getFilesList ${MODULE_DIR_SCRIPTS} \ - --pattern="${MODULE_DIR}/.+\.sh$" --maxdepth='1' \ - --mindepth='1' --type='f')" + local MODULE_SCRIPTS="${MODULE_INIT_FILE}" + if [[ -d ${MODULE_DIR} ]];then + MODULE_SCRIPTS="${MODULE_SCRIPTS} + $(tcar_getFilesList ${MODULE_DIR} \ + --pattern="${MODULE_DIR}/${MODULE_NAME}_.+\.sh$" --maxdepth='1' \ + --mindepth='1' --type='f')" + fi # Verify the list of files. If no function file exists for the # location specified stop the script execution. Otherwise the diff --git a/Automation/Scripts/tcar_setTranslationMarkers.sh b/Automation/Scripts/tcar_setTranslationMarkers.sh index 77f826c..99499a6 100755 --- a/Automation/Scripts/tcar_setTranslationMarkers.sh +++ b/Automation/Scripts/tcar_setTranslationMarkers.sh @@ -42,7 +42,7 @@ function tcar_setTranslationMarkers { local LOCATION="${1}" # Verify that source location does exist. - tcar_checkFiles -e ${LOCATION} + tcar_checkFiles -f ${LOCATION} # Define copyright translation markers. SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(_LAST)?=' @@ -62,11 +62,11 @@ function tcar_setTranslationMarkers { # Define theme translation markers. SRC[((++${#SRC[*]}))]='=THEME=' - DST[((++${#DST[*]}))]="$(tcar_getPathComponent ${OUTPUT} --motif)" + DST[((++${#DST[*]}))]="$(tcar_getPathComponent ${TARGET} --motif)" SRC[((++${#SRC[*]}))]='=THEMENAME=' - DST[((++${#DST[*]}))]="$(tcar_getPathComponent ${OUTPUT} --motif-name)" + DST[((++${#DST[*]}))]="$(tcar_getPathComponent ${TARGET} --motif-name)" SRC[((++${#SRC[*]}))]='=THEMERELEASE=' - DST[((++${#DST[*]}))]="$(tcar_getPathComponent ${OUTPUT} --motif-release)" + DST[((++${#DST[*]}))]="$(tcar_getPathComponent ${TARGET} --motif-version)" # Define release-specific translation markers. SRC[((++${#SRC[*]}))]='=RELEASE=' @@ -125,7 +125,7 @@ function tcar_setTranslationMarkers { fi # Define repository translation markers. - SRC[((++${#SRC[*]}))]='=(REPO_TLDIR|REPO_HOME|TCAR_BASEDIR)=' + SRC[((++${#SRC[*]}))]='=(REPO_TLDIR|REPO_HOME|TCAR_BASEDIR|TCAR_WORKDIR)=' DST[((++${#DST[*]}))]="${TCAR_BASEDIR}" # Do replacement of nested translation markers. diff --git a/Automation/centos-art-command.conf b/Automation/centos-art-command.conf deleted file mode 100644 index 5b305d9..0000000 --- a/Automation/centos-art-command.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# This file contains configuration values for centos-art.sh script. -# -[centos-art.sh] -render-as = "symbolic-link" -source = "${HOME}/bin/centos-art" -comment = "Create command for centos-art.sh script." diff --git a/Automation/centos-art-mails.conf b/Automation/centos-art-mails.conf deleted file mode 100644 index c4f63d9..0000000 --- a/Automation/centos-art-mails.conf +++ /dev/null @@ -1,11 +0,0 @@ -# -# This file describes the mailing lists information used by -# centos-art.sh script. -# -[centos] -address = "centos@centos.org" -comment = "The CentOS Users mailing list." - -[centos-devel] -address = "centos-devel@centos.org" -comment = "The CentOS Developers mailing list." diff --git a/Automation/centos-art-sites.conf b/Automation/centos-art-sites.conf deleted file mode 100644 index 635aba5..0000000 --- a/Automation/centos-art-sites.conf +++ /dev/null @@ -1,18 +0,0 @@ -# -# This file contains url information used by centos-art.sh script. -# -[www] -url = "http://www.centos.org/" -comment = "The CentOS Project" - -[forums] -url = "http://forums.centos.org/" -comment = "The CentOS Forums" - -[wiki] -url = "http://wiki.centos.org/" -comment = "The CentOS Wiki" - -[bugs] -url = "http://bugs.centos.org/" -comment = "The CentOS Bugs" diff --git a/Automation/centos-art.asciidoc b/Automation/centos-art.asciidoc deleted file mode 100644 index f9b1e99..0000000 --- a/Automation/centos-art.asciidoc +++ /dev/null @@ -1,269 +0,0 @@ -centos-art.sh(1) -================ - -Name ----- -centos-art.sh - The CentOS artwork repository automation tool - -Synopsis --------- -*centos-art.sh* [*--help*|*--version*]:: - This command provides information about the script itself. - -*centos-art.sh* *MODULE* [*--help|--version*]:: - This command provides information about the specified module. See - the xref:Modules[] section below to see which modules are - available. - -*centos-art.sh* *MODULE* [*OPTIONS*]:: - This command executes the specified module. Options here are - module-specific. See the xref:Modules[] section below to see which - modules are available. - -Description ------------ -*centos-art.sh* exists to standardize frequent tasks inside the CentOS -repository. - -When you execute the *centos-art.sh* script in a terminal, it will -request the absolute path where you stored your working copy of CentOS -artwork repository. To avoid the absolute path request every time you -execute the script, you can edit the +~/.bash_profile+ file and -declare the absolute path to your working copy there, as value to -TCAR_BASEDIR variable. - -Once *centos-art.sh* script knows what the absolute path to your -working copy is, it executes the file *centos-art.conf* to load -default values to configuration variables into its execution -environment. After configuration variables have been loaded in the -execution environment, the script looks for supported options in the -first argument. If the options passed are recognized the script -process them. If the options aren't recognized or no option is passed -at all, the *centos-art.sh* script exports common functions and -executes the module specified as first argument, assuming the first -argument is a valid module name of course. Finally, the -*centos-art.sh* script waits for the module script to conclude its job -and exits the as described in the xref:exit[] section. - -anchor:exit[Exit Status] - -Exit Status ------------ - * 0 -- Exit successfully without errors. - * 1 -- Exit with errors. - -anchor:Modules[Modules] - -Modules -------- -From version 0.5 on, *centos-art.sh* script introduces the idea of -modules to its base design. Modules are individual execution -environments that may nest themselves one inside another to achieve -high levels maintainability. Modules make it possible to divide a big -task into smaller tasks that can be easier to debug, maintain and -share with other modules. - -The following modules are available for *centos-art.sh* script: - -*prepare*:: - This module standardizes configuration tasks needed by your - working copy (e.g., verify whether required packages are installed - or not in your workstation). This is the first task you should run - in your workstation, just after downloading a fresh working copy - of CentOS artwork repository. - -*render*:: - This module standardizes the way content is produced inside the - repository. This function relies on configuration files to do its - work. Whenever you need to produce images, documentation or - localized content this is the module you'll need to use. - -*locale*:: - This module standardizes the way translatable strings are - retrieved from source files and put into portable objects for you - to edit. Portable objects produced by this module are used by - *render* module to produce localized content. Whenever you need - to produce the intermediate files holding the translatable strings - required to produce localized content, use this module. - -*help*:: - This module standardizes the way documentation is produced inside - the repository. Whenever you need to manage documentation source - files inside the repository, use this module. - -*tuneup*:: - This module standardizes maintenance tasks frequently run inside - the repository. - -*vcs*:: - This module standardizes the way version control tasks are - performed inside the repository. This module is used internally - and you probably don't need to use it from the command line. This - module is the interface that let us support different version - control systems inside *centos-art.sh* script. - -*pack*:: - This module standardizes the way RPM packages are produced from - content available in the repository. When ever you need to produce - RPM packages with information available in the repository, use - this module. - -Directory Structure -~~~~~~~~~~~~~~~~~~~ -Inside the repository, modules related to *centos-art.sh* script are -stored in the directory +Automation/Modules+. - -*Modules/*:: - This directory contains module's modules. -*Manuals/*:: - This directory contains module's documentation produced by *help* - module. The structure of this directory looks as follow: -+ ----------------------------------------------------------------------- -Manuals/ -|-- ${LANG}/ -| |-- man${SECTION_NUMBER} -| `-- ${MODULE_NAME}.${SECTION_NUMBER} -`-- man${SECTION_NUMBER} - `-- ${MODULE_NAME}.${SECTION_NUMBER} ----------------------------------------------------------------------- - -*Locales/*:: - This directory contains module's translations produced by *locale* - module. The structure of this directory looks as follow: -+ ----------------------------------------------------------------------- -Locales/ -`-- ${LANG}/ - |-- LC_MESSAGES - | |-- ${MODULE_NAME}.sh.mo - | `-- ${MODULE_NAME}.docbook.mo - |-- ${MODULE_NAME}.sh.po - |-- ${MODULE_NAME}.sh.pot - |-- ${MODULE_NAME}.docbook.po - `-- ${MODULE_NAME}.docbook.pot ----------------------------------------------------------------------- - -*Scripts/*:: - This directory contains function scripts written by module's - writers. Here is where all the tasks the module is useful for are - written and stored in. As convention the following structure is - used: -+ ----------------------------------------------------------------------- -Scripts/ -`-- ${MODULE_NAME}_${FUNCTION_NAME}.sh ----------------------------------------------------------------------- -+ -{asccidoc-br} -+ -Inside each function script, there is a top comment where you should -put the name of the function script, a brief description about what it -does, as well as author and copying information. After the top comment -and separated by one white line, you should define the function -sentence using the long format. -+ ----------------------------------------------------------------------- -#!/bin/bash -###################################################################### -# -# ${MODULE_NAME}_${FUNCTION_NAME}.sh -- ${FUNCTION_DESCRIPTION} -# -# Written by: -# * ${AUTHOR_NAME} <${AUTHOR_EMAIL}>, ${YEARS} -# -# Copyright (C) ${YEAR} The CentOS Project -# -# 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 ${MODULE_NAME}_${FUNCTION_NAME} { - ... -} ----------------------------------------------------------------------- -+ -[NOTE] -If your are planning to contribute a new module to *centos-art.sh* -script, please, consider using the layout described above for all your -function scripts, consistently. - -*$\{MODULE_NAME}.asciidoc*:: - This file contains the module's documentation source. From this - file it is possible to produce the same documentation in other - formats including manpage, html and pdf. Whenever you need to - improve the module's documentation, edit this file. -*$\{MODULE_NAME}.conf*:: - This file contains the module's configuration variables. These - variables are exported to the environment and remain there as long - as the script execution environment is alive. Some variables are - read-only others not. -+ -The configuration file provides explanation about each environment -variable it exports. If you want to know more about what these -variables are, open this file and read the comments near each -variable. - -*$\{MODULE_NAME}.sh*:: - This is the module's initialization script. The first file - executed when the module called from the command-line. This file - provides access to argument parsing and controls how - module-specific function scripts are called. This is the starting - point for writing modules. You can write a complete module using - this file only but, frequently, it is convenient as the module - complexity grows to divide it in smaller pieces (function scripts) - to improve maintainability and error findings. - -Options -------- - -*--help*:: - Display program's help (this page). - -*--version*:: - Display program's name and version. - -Bugs ----- -The module *pack* isn't implemented yet. - -Reporting Bugs --------------- -Report bugs inside the *automation* category of *centos-artwork* -project, at the https://centos.org.cu/bugs/[The CentOS Bugs] website. - -Author ------- -Written by mailto:al@centos.org.cu[Alain Reguera Delgado] - -Copyright ---------- -Copyright (C) 2013 The CentOS Project - -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. - -// vim: set syntax=asciidoc: