Changeset 2566:9bf417837888 for build-tools
- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- Location:
- build-tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
build-tools/dh-make-dotclear
r0 r2566 6 6 private $type; 7 7 private $today; 8 8 9 9 private $id; 10 10 private $package_name; … … 13 13 private $author; 14 14 private $version; 15 15 16 16 public function __construct($module,$type) 17 17 { … … 20 20 } 21 21 $this->type = $type; 22 22 23 23 if (!$module || !is_dir($module)) { 24 24 throw new Exception(sprintf('Module %s does not exist',$module)); 25 25 } 26 26 27 27 $mod_define = $module.'/_define.php'; 28 28 29 29 if (!is_file($mod_define)) { 30 30 throw new Exception(sprintf('Module %s does not have _define.php file',$module)); 31 31 } 32 32 33 33 if (is_dir($module.'/debian')) { 34 34 throw new Exception(sprintf('Module %s already have a debian directory',$module)); 35 35 } 36 36 37 37 include $mod_define; 38 38 $this->id = strtolower(basename(realpath($module))); 39 39 $this->package_name = 'libdotclear-'.$this->type.'-'.$this->id; 40 40 41 41 # Creating debian directory 42 42 $this->deb = $module.'/debian'; 43 43 mkdir($this->deb); 44 44 45 45 $this->createFile('changelog',$this->changelogTPL()); 46 46 $this->createFile('compat',"4\n"); … … 51 51 chmod($this->deb.'/rules',0755); 52 52 } 53 53 54 54 private function registerModule($name,$desc,$author,$version) 55 55 { … … 59 59 $this->version = $version; 60 60 } 61 61 62 62 private function createFile($name,$content='') 63 63 { … … 66 66 fclose($fp); 67 67 } 68 68 69 69 private function changelogTPL() 70 70 { … … 76 76 " -- ".$this->author." <email@example.com> ".date('r')."\n\n"; 77 77 } 78 78 79 79 private function controlTPL() 80 80 { … … 96 96 "\n"; 97 97 } 98 98 99 99 private function copyrightTPL() 100 100 { … … 126 126 "\n"; 127 127 } 128 128 129 129 private function dirsTPL() 130 130 { … … 132 132 '/usr/share/dotclear/'.$this->type.'s/'.$this->id."\n"; 133 133 } 134 134 135 135 private function rulesTPL() 136 136 { -
build-tools/make-l10n.php
r1863 r2566 28 28 $dest = dirname($f).'/'.basename($f,'.po').'.lang.php'; 29 29 echo "l10n file ".$dest.": "; 30 30 31 31 if (l10n::generatePhpFileFromPo(dirname($f).'/'.basename($f,'.po'),$license_block)) { 32 32 echo 'OK'; -
build-tools/min-js.php
r1179 r2566 15 15 { 16 16 $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null; 17 17 18 18 if (!$js || !is_file($js)) { 19 19 throw new Exception(sprintf("File %s does not exist",$js)); 20 20 } 21 21 22 22 require dirname(__FILE__).'/jsmin-1.1.1.php'; 23 23 24 24 $content = file_get_contents($js); 25 25 $res = JSMin::minify($content); 26 26 27 27 if (($fp = fopen($js,'wb')) === false) { 28 28 throw new Exception(sprintf('Unable to open file %s',$js)); -
build-tools/po_update.sh
r2283 r2566 68 68 { 69 69 tee - 70 70 71 71 $XGETTEXT \ 72 72 - \ … … 84 84 po_dir=`dirname $1` 85 85 po_tmp=$po_dir/tmp.po~ 86 86 87 87 if [ ! -d $po_dir ]; then 88 88 mkdir $po_dir 89 89 fi 90 90 91 91 if [ ! -f $po_file ]; then 92 92 cp $pot_file $po_file 93 93 perl -pi -e "s|; charset=CHARSET|; charset=UTF-8|sgi;" $po_file $po_file 94 94 fi 95 95 96 96 $MSGMERGE --no-location --no-wrap -o $po_tmp $po_file $pot_file 97 97 mv $po_tmp $po_file … … 108 108 -o locales/_pot/main.pot \ 109 109 -x locales/_pot/date.pot 110 110 111 111 echo "DONE" 112 112 113 113 # plugins.pot 114 114 echo "Building plugins PO template..." … … 123 123 -x locales/_pot/date.pot \ 124 124 -x locales/_pot/main.pot 125 125 126 126 echo "DONE" 127 127 128 128 # 129 129 # Update locales/<lang> if needed … … 132 132 exit 0; 133 133 fi 134 134 135 135 # Init locale if not present 136 136 if [ ! -d locales/$PO_LANG ]; then 137 137 mkdir -p locales/$PO_LANG/help 138 138 139 139 # Base help files 140 140 for i in locales/en/help/*.html; do … … 147 147 done 148 148 fi 149 149 150 150 # update main.po 151 151 echo "Updating <$PO_LANG> po files..." … … 158 158 # Plugin language update 159 159 # 160 160 161 161 if [ ! -d $PO_MODULE ]; then 162 162 echo "Module $PO_MODULE does not exist" … … 164 164 fi 165 165 echo "Module $PO_MODULE language update" 166 167 166 167 168 168 # 169 169 # Building po template file … … 173 173 fi 174 174 echo "Building main PO template..." 175 echo '<?php' >$PO_MODULE/__html_tpl_dummy.php 175 echo '<?php' >$PO_MODULE/__html_tpl_dummy.php 176 176 find $PO_MODULE -name '*.html' -exec grep -o '{{tpl:lang [^}]*}}' {} \; | sed 's/{{tpl:lang \(.*\)}}$/__\("\1")/' | sort -u \ 177 177 >> $PO_MODULE/__html_tpl_dummy.php 178 sed -i "" 's/\$/\\\$/g' $PO_MODULE/__html_tpl_dummy.php 179 178 sed -i "" 's/\$/\\\$/g' $PO_MODULE/__html_tpl_dummy.php 179 180 180 find $PO_MODULE -name '*.php' -print | \ 181 181 extract_strings \ … … 183 183 -o $PO_MODULE/locales/_pot/main.pot \ 184 184 -x locales/_pot/date.pot -x locales/_pot/main.pot -x locales/_pot/public.pot -x locales/_pot/plugins.pot 185 185 186 186 rm -f $PO_MODULE/__html_tpl_dummy.php 187 187 188 188 echo "DONE" 189 189 190 190 # 191 191 # Update locale/<lang>
Note: See TracChangeset
for help on using the changeset viewer.