diff options
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules index c710ad6..ed249f6 100755 --- a/debian/rules +++ b/debian/rules @@ -87,6 +87,60 @@ execute_after_dh_install: $(call link_hyphen, uk, uk, uk_UA ) $(call link_hyphen, zu, zu, zu_ZA ) + # Build the .bdic dictionaries that don't need special treatment. + # The ones that do need special treatment will fail, but their hunspell-bdic directories will be created. + for d in `find debian/hunspell-* -name "*.dic"`; do \ + mkdir -p `echo $$d | sed -e "s/share\/hunspell.*dic/share\/hunspell-bdic/"` && \ + convert-bdic $$d `echo $$d | sed -e "s/share\/hunspell/share\/hunspell-bdic/" | sed -e "s/dic$$/bdic/"`; \ + done + + # Copy the dictionaries that need special treatment to their corresponding hunspell-bdic directories. + cp debian/hunspell-an/usr/share/hunspell/an_ES.* debian/hunspell-an/usr/share/hunspell-bdic + cp debian/hunspell-da/usr/share/hunspell/da_DK.* debian/hunspell-da/usr/share/hunspell-bdic + cp debian/hunspell-gl/usr/share/hunspell/gl_ES.* debian/hunspell-gl/usr/share/hunspell-bdic + cp debian/hunspell-gu/usr/share/hunspell/gu_IN.* debian/hunspell-gu/usr/share/hunspell-bdic + cp debian/hunspell-hu/usr/share/hunspell/hu_HU.* debian/hunspell-hu/usr/share/hunspell-bdic + cp debian/hunspell-th/usr/share/hunspell/th_TH.* debian/hunspell-th/usr/share/hunspell-bdic + cp debian/hunspell-uk/usr/share/hunspell/uk_UA.* debian/hunspell-uk/usr/share/hunspell-bdic + + # Convert all tabs in an_ES.aff into spaces before building the .bdic, which doesn't like tabs in most fields. + sed -i "s/\t/ /g" debian/hunspell-an/usr/share/hunspell-bdic/an_ES.aff + + # Remove any lines greater than or equal to 109 characters in da_DK.dic. The exact maximum line length in the .bdic binary format depends on how many UTF-16 characters there are. + sed -i "/.\{109\}/d" debian/hunspell-da/usr/share/hunspell-bdic/da_DK.dic + + # Remove any lines greater than or equal to 110 characters in gl_ES.dic. The exact maximum line length in the .bdic binary format depends on how many UTF-16 characters there are. + sed -i "/.\{110\}/d" debian/hunspell-gl/usr/share/hunspell-bdic/gl_ES.dic + + # Remove any lines greater than or equal to 21 characters in gu_IN.dic. The exact maximum line length in the .bdic binary format depends on how many UTF-16 characters there are. + sed -i "/.\{21\}/d" debian/hunspell-gu/usr/share/hunspell-bdic/gu_IN.dic + + # Remove any lines that contain the IGNORE command in hu_HU.aff, which isn't supported by .bdic. + sed -i "/IGNORE/d" debian/hunspell-hu/usr/share/hunspell-bdic/hu_HU.aff + + # Remove any lines greater than or equal to 33 characters in th_TH.dic. The exact maximum line length in the .bdic binary format depends on how many UTF-16 characters there are. + sed -i "/.\{33\}/d" debian/hunspell-th/usr/share/hunspell-bdic/th_TH.dic + + # Remove any lines that contain the IGNORE command in uk_UA.aff, which isn't supported by .bdic. + sed -i "/IGNORE/d" debian/hunspell-uk/usr/share/hunspell-bdic/uk_UA.aff + + # Build the dictionaries that need special treatment. + convert-bdic debian/hunspell-an/usr/share/hunspell-bdic/an_ES.dic debian/hunspell-an/usr/share/hunspell-bdic/an_ES.bdic + convert-bdic debian/hunspell-da/usr/share/hunspell-bdic/da_DK.dic debian/hunspell-da/usr/share/hunspell-bdic/da_DK.bdic + convert-bdic debian/hunspell-gl/usr/share/hunspell-bdic/gl_ES.dic debian/hunspell-gl/usr/share/hunspell-bdic/gl_ES.bdic + convert-bdic debian/hunspell-gu/usr/share/hunspell-bdic/gu_IN.dic debian/hunspell-gu/usr/share/hunspell-bdic/gu_IN.bdic + convert-bdic debian/hunspell-hu/usr/share/hunspell-bdic/hu_HU.dic debian/hunspell-hu/usr/share/hunspell-bdic/hu_HU.bdic + convert-bdic debian/hunspell-th/usr/share/hunspell-bdic/th_TH.dic debian/hunspell-th/usr/share/hunspell-bdic/th_TH.bdic + convert-bdic debian/hunspell-uk/usr/share/hunspell-bdic/uk_UA.dic debian/hunspell-uk/usr/share/hunspell-bdic/uk_UA.bdic + + # Remove the temporary copies of the .dic and .aff in the hunspell-bdic directory. + rm debian/hunspell-an/usr/share/hunspell-bdic/an_ES.dic debian/hunspell-an/usr/share/hunspell-bdic/an_ES.aff + rm debian/hunspell-da/usr/share/hunspell-bdic/da_DK.dic debian/hunspell-da/usr/share/hunspell-bdic/da_DK.aff + rm debian/hunspell-gl/usr/share/hunspell-bdic/gl_ES.dic debian/hunspell-gl/usr/share/hunspell-bdic/gl_ES.aff + rm debian/hunspell-gu/usr/share/hunspell-bdic/gu_IN.dic debian/hunspell-gu/usr/share/hunspell-bdic/gu_IN.aff + rm debian/hunspell-hu/usr/share/hunspell-bdic/hu_HU.dic debian/hunspell-hu/usr/share/hunspell-bdic/hu_HU.aff + rm debian/hunspell-th/usr/share/hunspell-bdic/th_TH.dic debian/hunspell-th/usr/share/hunspell-bdic/th_TH.aff + rm debian/hunspell-uk/usr/share/hunspell-bdic/uk_UA.dic debian/hunspell-uk/usr/share/hunspell-bdic/uk_UA.aff execute_before_dh_clean: find dictionaries/ -type f -name '*.idx' -delete |