| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | # Aap recipe for Portuguese Vim spell files. | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | # See ftp://ftp.vim.org/pub/vim/runtime/spell/README.txt | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Use a freshly compiled Vim if it exists. | 
					
						
							|  |  |  | @if os.path.exists('../../../src/vim'): | 
					
						
							|  |  |  |     VIM = ../../../src/vim | 
					
						
							|  |  |  | @else: | 
					
						
							|  |  |  |     :progsearch VIM vim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SPELLDIR = .. | 
					
						
							|  |  |  | FILES    = pt_PT.aff pt_PT.dic | 
					
						
							|  |  |  | 	   pt_BR.aff pt_BR.dic | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | # | 
					
						
							|  |  |  | # Fetching the pt_PT files from the Natura project. | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2010-08-10 22:53:02 +02:00
										 |  |  | PT_FNAME = oo3x-pt-PT.oxt | 
					
						
							|  |  |  | PT_DIR = http://extensions.services.openoffice.org/e-files/1196/5/$(PT_FNAME) | 
					
						
							|  |  |  | :attr {fetch = $PT_DIR} $PT_FNAME | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  | # Fetching the pt_BR files from BrOffice.org (Brazilian OOo). | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2010-08-10 22:53:02 +02:00
										 |  |  | BR_FNAME = Vero_pt_BR_V207AOC.oxt | 
					
						
							|  |  |  | BR_DIR = http://www.broffice.org/files/$(BR_FNAME) | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | :attr {fetch = $BR_DIR} $BR_FNAME | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | all: $SPELLDIR/pt.latin1.spl $SPELLDIR/pt.utf-8.spl \ | 
					
						
							|  |  |  |         ../README_pt.txt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $SPELLDIR/pt.latin1.spl : $FILES | 
					
						
							| 
									
										
										
										
											2010-07-10 15:52:35 +02:00
										 |  |  |         :sys env LANG=pt_PT.ISO-8859-1 LC_ALL=pt_PT.ISO-8859-1 | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 		$VIM -u NONE -e -c "mkspell! $SPELLDIR/pt pt_PT pt_BR" -c q | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $SPELLDIR/pt.utf-8.spl : $FILES | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |         :sys env LANG=pt_PT.UTF-8 LC_ALL=pt_PT.UTF-8 | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 		$VIM -u NONE -e -c "mkspell! $SPELLDIR/pt pt_PT pt_BR" -c q | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ../README_pt.txt: README_pt_PT.txt README_pt_BR.txt | 
					
						
							|  |  |  |         :print pt_PT >!$target | 
					
						
							|  |  |  |         :cat README_pt_PT.txt | :eval re.sub('\r', '', stdin) >>$target | 
					
						
							|  |  |  |         :print =================================================== >>$target | 
					
						
							|  |  |  |         :print pt_BR: >>$target | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |         :cat README_pt_BR.txt | :eval re.sub('\r', '', stdin) >>$target | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # The files don't depend on the .zip file so that we can delete it. | 
					
						
							|  |  |  | # Only download the zip file if the targets don't exist. | 
					
						
							|  |  |  | pt_PT.aff pt_PT.dic: {buildcheck=} | 
					
						
							|  |  |  |         :assertpkg unzip patch | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |         :fetch $PT_FNAME | 
					
						
							|  |  |  |         :sys $UNZIP $PT_FNAME | 
					
						
							|  |  |  |         :delete $PT_FNAME | 
					
						
							| 
									
										
										
										
											2010-08-10 22:53:02 +02:00
										 |  |  |         :move dictionaries/pt_PT.dic . | 
					
						
							|  |  |  |         :move dictionaries/pt_PT.aff . | 
					
						
							|  |  |  |         :move dictionaries/README_pt_PT.txt . | 
					
						
							|  |  |  |         :move dictionaries/COPYING COPYING_pt_PT.txt | 
					
						
							|  |  |  |         :delete {r}{f} dictionaries | 
					
						
							|  |  |  |         :delete {r}{f} META-INF | 
					
						
							|  |  |  |         :delete {f} description.xml | 
					
						
							|  |  |  |         :delete {f} dictionaries.xcu | 
					
						
							|  |  |  |         :delete {f} LICENSES.txt | 
					
						
							| 
									
										
										
										
											2010-08-13 14:38:12 +02:00
										 |  |  |         # Remove grammer items and the duplicates this causes | 
					
						
							|  |  |  |         :sys $VIM pt_PT.dic -u NONE -e -c "%s/\t.*//" -c "2,$$ sort u" -c update -c q | 
					
						
							| 
									
										
										
										
											2010-08-10 22:53:02 +02:00
										 |  |  |         :sys $VIM pt_PT.aff -u NONE -e -c "%s/\S\+=\S\+$$//" -c update -c q | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |         @if not os.path.exists('pt_PT.orig.aff'): | 
					
						
							|  |  |  |             :copy pt_PT.aff pt_PT.orig.aff | 
					
						
							|  |  |  |         @if not os.path.exists('pt_PT.orig.dic'): | 
					
						
							|  |  |  |             :copy pt_PT.dic pt_PT.orig.dic | 
					
						
							|  |  |  |         @if os.path.exists('pt_PT.diff'): | 
					
						
							|  |  |  |             :sys patch <pt_PT.diff | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pt_BR.aff pt_BR.dic: {buildcheck=} | 
					
						
							|  |  |  |         :assertpkg unzip patch | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |         :fetch $BR_FNAME | 
					
						
							|  |  |  |         :sys $UNZIP $BR_FNAME | 
					
						
							|  |  |  |         :delete $BR_FNAME | 
					
						
							| 
									
										
										
										
											2010-08-11 23:11:47 +02:00
										 |  |  |         :delete {f} description.xml | 
					
						
							|  |  |  |         :delete {f} dictionaries.xcu | 
					
						
							|  |  |  |         :delete {f} hyph_pt_BR.dic | 
					
						
							|  |  |  |         :delete {r}{f} META-INF | 
					
						
							|  |  |  |         :delete {f} README_en.TXT | 
					
						
							|  |  |  |         :delete {f} README_hyph_pt_BR.TXT | 
					
						
							| 
									
										
										
										
											2010-08-10 22:53:02 +02:00
										 |  |  |         :sys $VIM README_pt_BR.TXT -u NONE -N -e -c "set ff=unix" -c update -c q | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |         :move README_pt_BR.TXT README_pt_BR.txt | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-10 22:53:02 +02:00
										 |  |  |         :sys $VIM pt_BR.dic -u NONE -N -e -c "set ff=unix" -c update -c q | 
					
						
							|  |  |  |         :sys $VIM pt_BR.aff -u NONE -N -e -c "set ff=unix" -c update -c q | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |         @if not os.path.exists('pt_BR.orig.aff'): | 
					
						
							|  |  |  |             :copy pt_BR.aff pt_BR.orig.aff | 
					
						
							|  |  |  |         @if not os.path.exists('pt_BR.orig.dic'): | 
					
						
							|  |  |  |             :copy pt_BR.dic pt_BR.orig.dic | 
					
						
							|  |  |  |         @if os.path.exists('pt_BR.diff'): | 
					
						
							|  |  |  |             :sys patch <pt_BR.diff | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Generate diff files, so that others can get the OpenOffice files and apply | 
					
						
							|  |  |  | # the diffs to get the Vim versions. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | diff: | 
					
						
							|  |  |  |         :assertpkg diff | 
					
						
							|  |  |  |         :sys {force} diff -a -C 1 pt_PT.orig.aff pt_PT.aff >pt_PT.diff | 
					
						
							|  |  |  |         :sys {force} diff -a -C 1 pt_PT.orig.dic pt_PT.dic >>pt_PT.diff | 
					
						
							|  |  |  |         :sys {force} diff -a -C 1 pt_BR.orig.aff pt_BR.aff >pt_BR.diff | 
					
						
							|  |  |  | 	:sys {force} diff -a -C 1 pt_BR.orig.dic pt_BR.dic >>pt_BR.diff | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-10 22:53:02 +02:00
										 |  |  | # Delete all downloaded and generated files. | 
					
						
							|  |  |  | clean: clean_pt_BR clean_pt_PT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | clean_pt_BR: | 
					
						
							|  |  |  |         :delete {f} pt_BR.aff | 
					
						
							|  |  |  |         :delete {f} pt_BR.dic | 
					
						
							|  |  |  |         :delete {f} pt_BR.orig.aff | 
					
						
							|  |  |  |         :delete {f} pt_BR.orig.dic | 
					
						
							|  |  |  |         :delete {f} README_pt_BR.txt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | clean_pt_PT: | 
					
						
							|  |  |  |         :delete {f} pt_PT.aff | 
					
						
							|  |  |  |         :delete {f} pt_PT.dic | 
					
						
							|  |  |  |         :delete {f} pt_PT.orig.aff | 
					
						
							|  |  |  |         :delete {f} pt_PT.orig.dic | 
					
						
							|  |  |  |         :delete {f} README_pt_PT.txt | 
					
						
							|  |  |  |         :delete {f} COPYING_pt_PT.txt | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Check for updated OpenOffice spell files.  When there are changes the | 
					
						
							|  |  |  | # ".new.aff" and ".new.dic" files are left behind for manual inspection. | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | # TO BE IMPLEMENTED | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | check: check-pt check-br | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | check-pt: | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |         :assertpkg unzip diff | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |         :fetch $PT_FNAME | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |         :mkdir tmp | 
					
						
							|  |  |  |         :cd tmp | 
					
						
							|  |  |  |         @try: | 
					
						
							|  |  |  |             @import stat | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |             :sys $UNZIP ../$PT_FNAME | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |             :sys {force} diff ../pt_PT.orig.aff pt_PT.aff >d | 
					
						
							|  |  |  |             @if os.stat('d')[stat.ST_SIZE] > 0: | 
					
						
							|  |  |  |                 :copy pt_PT.aff ../pt_PT.new.aff | 
					
						
							|  |  |  |             :sys {force} diff ../pt_PT.orig.dic pt_PT.dic >d | 
					
						
							|  |  |  |             @if os.stat('d')[stat.ST_SIZE] > 0: | 
					
						
							|  |  |  |                 :copy pt_PT.dic ../pt_PT.new.dic | 
					
						
							|  |  |  |         @finally: | 
					
						
							|  |  |  |             :cd .. | 
					
						
							|  |  |  |             :delete {r}{f}{q} tmp | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |             :delete $PT_FNAME | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | check-br: | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |         :assertpkg unzip diff | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |         :fetch $BR_FNAME | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |         :mkdir tmp | 
					
						
							|  |  |  |         :cd tmp | 
					
						
							|  |  |  |         @try: | 
					
						
							|  |  |  |             @import stat | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |             :sys $UNZIP ../$BR_FNAME | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  |             :sys {force} diff ../pt_BR.orig.aff pt_BR.aff >d | 
					
						
							|  |  |  |             @if os.stat('d')[stat.ST_SIZE] > 0: | 
					
						
							|  |  |  |                 :copy pt_BR.aff ../pt_BR.new.aff | 
					
						
							|  |  |  |             :sys {force} diff ../pt_BR.orig.dic pt_BR.dic >d | 
					
						
							|  |  |  |             @if os.stat('d')[stat.ST_SIZE] > 0: | 
					
						
							|  |  |  |                 :copy pt_BR.dic ../pt_BR.new.dic | 
					
						
							|  |  |  |         @finally: | 
					
						
							|  |  |  |             :cd .. | 
					
						
							|  |  |  |             :delete {r}{f}{q} tmp | 
					
						
							| 
									
										
										
										
											2008-06-24 22:09:24 +00:00
										 |  |  |             :delete $BR_FNAME | 
					
						
							| 
									
										
										
										
											2005-09-01 20:46:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # vim: set sts=4 sw=4 : |