| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
# Uncomment this to turn on verbose mode. |
| 4 |
#export DH_VERBOSE=1 |
| 5 |
|
| 6 |
# Make sure build is always done in a reproducible and working |
| 7 |
# language environment |
| 8 |
LC_ALL = C |
| 9 |
export LC_ALL |
| 10 |
|
| 11 |
# Useful only to build aspell official dir |
| 12 |
ASPELL6BASENAME = aspell6-es |
| 13 |
ASPELL6DIR = $(CURDIR)/debian/$(ASPELL6BASENAME) |
| 14 |
ASPELLPROC = /usr/share/aspell-lang/proc # Location of proc script |
| 15 |
|
| 16 |
TMP_BUILD = tmp-build |
| 17 |
|
| 18 |
LANGUAGE = espa~nol |
| 19 |
ISOLANG = es |
| 20 |
AFFIXES = ./$(LANGUAGE).aff |
| 21 |
OTHERDICTS = debian/debian.words |
| 22 |
|
| 23 |
%: |
| 24 |
dh $@ |
| 25 |
|
| 26 |
|
| 27 |
override_dh_auto_build: |
| 28 |
mkdir -p $(TMP_BUILD) |
| 29 |
|
| 30 |
# Create a latin1 version of affix file |
| 31 |
sh -e < debian/aff2latin1 > $(TMP_BUILD)/$(AFFIXES) |
| 32 |
# Munch extra debian words |
| 33 |
munchlist -v -l $(AFFIXES) $(OTHERDICTS) \ |
| 34 |
> $(TMP_BUILD)/$(LANGUAGE).otherwords+ |
| 35 |
# Merge munched debian words with upstream munched wordlist |
| 36 |
( cat $(LANGUAGE).words+ $(TMP_BUILD)/$(LANGUAGE).otherwords+ && \ |
| 37 |
grep -h -e ^.$$ -e ^./ $(LANGUAGE).words ) | \ |
| 38 |
sort | \ |
| 39 |
icombine $(AFFIXES) | \ |
| 40 |
sed -f debian/orig2latin1.sed \ |
| 41 |
> $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 |
| 42 |
|
| 43 |
gzip -9n -c $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 \ |
| 44 |
> $(TMP_BUILD)/$(LANGUAGE).mwl.gz |
| 45 |
|
| 46 |
# Create myspell dict |
| 47 |
( echo `cat $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 | wc -l`; \ |
| 48 |
cat $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 ) \ |
| 49 |
> $(TMP_BUILD)/es.dic |
| 50 |
ispellaff2myspell --charset=latin1 \ |
| 51 |
--replacements=debian/es_ES.replaces \ |
| 52 |
--myheader=debian/es_ES.myheader \ |
| 53 |
$(TMP_BUILD)/$(LANGUAGE).aff \ |
| 54 |
> $(TMP_BUILD)/es.aff |
| 55 |
|
| 56 |
# Create aspell compressed cwl file and affix file |
| 57 |
cat $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 \ |
| 58 |
| prezip -s -c | gzip -9n -c \ |
| 59 |
> $(TMP_BUILD)/$(ISOLANG).cwl.gz |
| 60 |
cp $(TMP_BUILD)/es.aff $(TMP_BUILD)/es_affix.dat |
| 61 |
echo "add es.rws" > $(TMP_BUILD)/es.multi |
| 62 |
echo "add es.multi" > $(TMP_BUILD)/spanish.alias |
| 63 |
|
| 64 |
override_dh_auto_clean: |
| 65 |
rm -rf $(TMP_BUILD) |
| 66 |
rm -f core *.hash *.stat *.cnt *.latin1 *.otherwords+ *~ |
| 67 |
if [ -d $(ASPELL6DIR) ]; then \ |
| 68 |
rm $(ASPELL6DIR)/* && rmdir $(ASPELL6DIR); fi |
| 69 |
|
| 70 |
dh_auto_clean |
| 71 |
|
| 72 |
override_dh_auto_install: |
| 73 |
installdeb-ispell -pispanish |
| 74 |
installdeb-aspell -paspell-es |
| 75 |
installdeb-hunspell -pmyspell-es |
| 76 |
installdeb-myspell -pmyspell-es --bdic --srcdir=$(TMP_BUILD) |
| 77 |
dh_installdocs --all README LEAME |
| 78 |
|
| 79 |
# Useful only to build aspell official dir |
| 80 |
aspelltgz: clean build |
| 81 |
mkdir -p $(ASPELL6DIR) |
| 82 |
install -m 644 debian/aspell/Copyright $(ASPELL6DIR) |
| 83 |
install -m 644 debian/aspell/info $(ASPELL6DIR) |
| 84 |
install -m 644 /usr/share/common-licenses/GPL $(ASPELL6DIR)/COPYING |
| 85 |
install -m 644 debian/aspell/es.dat $(ASPELL6DIR) |
| 86 |
install -m 644 $(TMP_BUILD)/es_affix.dat $(ASPELL6DIR) |
| 87 |
cat $(TMP_BUILD)/es.dic | sed 1d | LANG=C sort -u > $(ASPELL6DIR)/es.wl |
| 88 |
( cd $(ASPELL6DIR) && \ |
| 89 |
ln -sf $(ASPELLPROC) && \ |
| 90 |
perl proc && \ |
| 91 |
./configure && \ |
| 92 |
make dist ) |
| 93 |
mv $(ASPELL6DIR)/$(ASPELL6BASENAME)*.tar.bz2 .. |