[icinga-checkins] icinga.org: icinga-web/mhein/default: * Makefile changes (targets, output)

git at icinga.org git at icinga.org
Wed Apr 7 17:48:26 CEST 2010


Module: icinga-web
Branch: mhein/default
Commit: fb2a6573855beda5fb02f4a9af121b7ff12cce12
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=fb2a6573855beda5fb02f4a9af121b7ff12cce12

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Apr  7 17:48:07 2010 +0200

* Makefile changes (targets, output)
* Doc files for translation

---

 Makefile.in               |   39 +++++++++++++++++++-------------
 bin/testdeps.php          |    4 +-
 configure                 |   53 ++++++++++++++++++++++++++++++++++++++++++++-
 configure.ac              |    8 ++++++
 doc/CHANGELOG             |    3 ++
 doc/makefile-howto.txt    |   19 ++++++++-------
 doc/translation-howto.txt |   45 ++++++++++++++++++++++++++++++++++++++
 7 files changed, 143 insertions(+), 28 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index c601fce..c601e07 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -18,28 +18,35 @@ WEB_USER=@web_user@
 WEB_GROUP=@web_group@
 SED=@SED@
 PHP=@PHP@
+PRINTF=@PRINTF@
 PC=bin/phing -f etc/build.xml
 API_DIR=@icinga_api@
 INC_MAKE_FILES=./etc/make/files.mk
 
 none:
-	@echo "Please supply a command line argument (i.e. 'make install')."
-	@echo ""
-	@echo "Generic targets: install, clean"
-	@echo ""
-	@echo "Other usefull targets:"
-	@echo "\ttestdeps - test the php dependencies"
-	@echo "\tcreate-tarball - creates a tarball for packaging"
-	@echo "\tdevclean - to a sourcecode ready for ci or packaging" 
-	@echo ""
-	@echo "Experimental targets:"
-	@echo "\tmake db-initialize			- create the db"
-	@echo "\tmake db-deinitialize		- reverse the path (removes all data and drop the relations)"
-	@echo "\tmake db-upgrade			- tries to upgrade from a available db revision"
-	@echo "\tmake db-drop				- create the entire db"
-	@echo "\tmake db-purge-userprefs	- purge existing user preferences"
-	@echo ""
-
+#	@$(PRINTF) "\t%15s - %s\n" "" ""
+	@$(PRINTF) "Please supply a command line argument (i.e. 'make install').\n\n"
+	@$(PRINTF) "Generic targets: install, clean\n\n"
+	@$(PRINTF) "Other usefull targets:\n"
+	@$(PRINTF) "\t%18s - %s\n" "testdeps" "test php dependencies"
+	@$(PRINTF) "\t%18s - %s\n" "create-tarball" "creates a tarball for packaging"
+	@$(PRINTF) "\t%18s - %s\n" "devclean" "make source ready for commit or packaging"
+	@$(PRINTF) "\t%18s - %s\n" "cacheclean" "purges the agavi xml cache"
+	
+	@$(PRINTF) "\nDatabase (web) targets:\n"
+	@$(PRINTF) "\t%18s - %s\n" "db-initialize" "create the db"
+	@$(PRINTF) "\t%18s - %s\n" "db-deinitialize" "reverse the path (removes all data and drop the relations)"
+	@$(PRINTF) "\t%18s - %s\n" "db-upgrade" "tries to upgrade from a available db revision"
+	@$(PRINTF) "\t%18s - %s\n" "db-drop" "drop the entire db"
+	@$(PRINTF) "\t%18s - %s\n" "db-purge-userprefs" "purge existing user preferences"
+
+	@$(PRINTF) "\nI18n targets:\n"
+	@$(PRINTF) "\t%18s - %s\n" "loc-update-catalog" "Create a initial locale from source (default.po)"
+	@$(PRINTF) "\t%18s - %s\n" "loc-create-mo" "Compile all po files"
+	@$(PRINTF) "\t%18s - %s\n" "loc-create-json" "Create json gettext from po"
+
+	@$(PRINTF) "\n\n"
+	
 include $(INC_MAKE_FILES)
 
 install-files-list:
diff --git a/bin/testdeps.php b/bin/testdeps.php
index ef6fe9d..b84938c 100755
--- a/bin/testdeps.php
+++ b/bin/testdeps.php
@@ -175,9 +175,9 @@ class IcingaWebDependencyTester {
 		
 		array (
 			'name'			=> 'ini_magic_quotes_gpc',
-			'description'	=> 'Test ini magic_quotes_gpc=off',
+			'description'	=> 'Test ini magic_quotes_gpc=on',
 			'method'		=> 'tIniSettings',
-			'args'			=> array('magic_quotes_gpc', ''),
+			'args'			=> array('magic_quotes_gpc', '1'),
 			'required'		=> true,
 		
 			'header'		=> 'PHP ini settings'
diff --git a/configure b/configure
index ad992dd..26e576f 100755
--- a/configure
+++ b/configure
@@ -570,6 +570,7 @@ bin_group
 bin_user
 web_group
 web_user
+PRINTF
 MYSQL
 PHP
 SED
@@ -634,7 +635,8 @@ with_db_pass
 host_alias
 target_alias
 PHP
-MYSQL'
+MYSQL
+PRINTF'
 
 
 # Initialize some variables set by options.
@@ -1260,6 +1262,7 @@ Optional Packages:
 Some influential environment variables:
   PHP         Perl interpreter command
   MYSQL       MySql client binary
+  PRINTF      Printf coreutil
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -2040,6 +2043,53 @@ if test "$MYSQL" = 'not found'; then
         as_fn_error "cannot use $PACKAGE_NAME without MySql client binary" "$LINENO" 5
 fi
 
+
+# Extract the first word of "printf", so it can be a program name with args.
+set dummy printf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PRINTF+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PRINTF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PRINTF="$PRINTF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PRINTF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PRINTF" && ac_cv_path_PRINTF="not found"
+  ;;
+esac
+fi
+PRINTF=$ac_cv_path_PRINTF
+if test -n "$PRINTF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRINTF" >&5
+$as_echo "$PRINTF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+if test "$PRINTF" = 'not found'; then
+        as_fn_error "cannot use $PACKAGE_NAME without printf core util" "$LINENO" 5
+fi
+
 # Custom macros
 
 # ACRT_USER_EXISTS( users, variable, default )
@@ -2223,6 +2273,7 @@ CFLAGS=""
 
 
 
+
 ac_config_files="$ac_config_files Makefile etc/build.properties app/config/databases.xml"
 
 
diff --git a/configure.ac b/configure.ac
index a9b9da2..a8aa281 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,13 @@ if test "$MYSQL" = 'not found'; then
         AC_MSG_ERROR([cannot use $PACKAGE_NAME without MySql client binary])
 fi
 
+AC_ARG_VAR([PRINTF],[Printf coreutil])
+AC_PATH_PROG([PRINTF], [printf], [not found])
+
+if test "$PRINTF" = 'not found'; then
+        AC_MSG_ERROR([cannot use $PACKAGE_NAME without printf core util])
+fi
+
 # Custom macros
 
 # ACRT_USER_EXISTS( users, variable, default )
@@ -159,6 +166,7 @@ AC_SUBST(icinga_api)
 AC_SUBST(CFLAGS)
 AC_SUBST(PHP)
 AC_SUBST(MYSQL)
+AC_SUBST(PRINTF)
 AC_SUBST(INSTALL_OPTS)
 
 AC_CONFIG_FILES([
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index de90ede..6697d48 100755
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -179,5 +179,8 @@
      * 2010-04-07
        * Finished translation template (fixes #279)
        * Added tools to handle translation (po, mo and json files)
+       * Makefile changes (targets, output)
+       * Doc files for translation
+       
        
        
\ No newline at end of file
diff --git a/doc/makefile-howto.txt b/doc/makefile-howto.txt
index 8c6d827..687a8c5 100644
--- a/doc/makefile-howto.txt
+++ b/doc/makefile-howto.txt
@@ -1,12 +1,13 @@
-1. Edit the Makefile.in and delete all lines behind "install:" target:
+1. The old behaviour is deprecated.
 
-install:
-	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/pub
-	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/pub/styles
-	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/pub/styles/extjs
-	...
-	...
+2. The file list for installation is created through a script
+   called create-makefile.sh
 
-2. Execute: ./bin/create-makefile.sh >> Makefile.in
+3. The files to install are included in Makefile.in. All changes does
+   not affect the existing Makefile.
 
-3. Test and check in changes
\ No newline at end of file
+4. The thing to refresh the list of installable made through make:
+   make install-files-list (Don't forget to call configure to create the makefile)
+
+5. To make the code ready to commit all these steps are combined within:
+   make devclean
diff --git a/doc/translation-howto.txt b/doc/translation-howto.txt
new file mode 100644
index 0000000..466d58f
--- /dev/null
+++ b/doc/translation-howto.txt
@@ -0,0 +1,45 @@
+Some abstract how icinga gettext translations works
+
+1. Architecture
+
+   Icinga's translation is made through a agavi gettext implementation which uses po and mo files. Modules can have
+   their own text domains. The default textfomain is 'default' (agavi: icinga.default).
+   
+   To keep js translation in sync we use jsgettext to provide the same way to translate things. Jsgettext uses json
+   files compiled from the orginial po files
+
+2. Build up
+
+   If you wrote some code including some new translations you have to rebuild the 'default' messages catalog:
+   
+   	make loc-update-catalog
+   
+   This command create a 'res/i18n/default.po' file, ready for translation.
+   
+3. Translate
+
+   Translate the default.po into your language or merge this with existing po files to keep translation in sync
+   
+4. Compile mo's
+
+   Gettext uses a compiled binary format of the po base files. To compile all existing files into machine readable
+   objects try: make loc-create-mo
+
+5. Compile json formats
+
+   To use javascript translation you have to compile the po's into json files. To convert all existing po's try:
+   make loc-create-json
+
+6. Change default interface behaviour
+
+   To change the default local you have to alter app/config/translation.xml.
+
+7. Layout
+
+   Default icinga translation files store in res/i18n with a two subdirs:
+   
+   po: There a the basic translation files for each language. The name is something like 'en.po' or 'en_GB.po'.
+   So you can define a country based of language based translation file
+   
+   mo: All compiled files e.g. 'en.po' or 'en.json'. Agavi uses the po files, javascript uses the json files with
+   the same country- or language-base.
\ No newline at end of file





More information about the icinga-checkins mailing list