| 1 | %define double_profiling_build 0
|
|---|
| 2 |
|
|---|
| 3 | Name: hunspell
|
|---|
| 4 | Summary: A spell checker and morphological analyzer library
|
|---|
| 5 | Version: 1.6.2
|
|---|
| 6 | Release: 1%{?dist}
|
|---|
| 7 | URL: https://github.com/hunspell/hunspell
|
|---|
| 8 | Group: System Environment/Libraries
|
|---|
| 9 | License: LGPLv2+ or GPLv2+ or MPLv1.1
|
|---|
| 10 |
|
|---|
| 11 | Vendor: bww bitwise works GmbH
|
|---|
| 12 | %scm_source github https://github.com/bitwiseworks/hunspell-os2 %{version}-os2
|
|---|
| 13 |
|
|---|
| 14 | BuildRequires: ncurses-devel, gettext
|
|---|
| 15 | BuildRequires: perl-generators
|
|---|
| 16 | %ifarch %{ix86} x86_64
|
|---|
| 17 | #BuildRequires: valgrind
|
|---|
| 18 | %endif
|
|---|
| 19 | %if %{double_profiling_build}
|
|---|
| 20 | BuildRequires: words
|
|---|
| 21 | %endif
|
|---|
| 22 | Requires: hunspell-en-US
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | %description
|
|---|
| 26 | Hunspell is a spell checker and morphological analyzer library and program
|
|---|
| 27 | designed for languages with rich morphology and complex word compounding or
|
|---|
| 28 | character encoding. Hunspell interfaces: Ispell-like terminal interface using
|
|---|
| 29 | Curses library, Ispell pipe interface, OpenOffice.org UNO module.
|
|---|
| 30 |
|
|---|
| 31 | %package devel
|
|---|
| 32 | Requires: hunspell = %{version}-%{release}, pkgconfig
|
|---|
| 33 | Summary: Files for developing with hunspell
|
|---|
| 34 | Group: Development/Libraries
|
|---|
| 35 |
|
|---|
| 36 | %description devel
|
|---|
| 37 | Includes and definitions for developing with hunspell
|
|---|
| 38 |
|
|---|
| 39 | %prep
|
|---|
| 40 | %scm_setup
|
|---|
| 41 | autoreconf -fvi
|
|---|
| 42 |
|
|---|
| 43 | %build
|
|---|
| 44 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 45 | export LIBS="-lcx -ltinfo"
|
|---|
| 46 | export VENDOR="%{vendor}"
|
|---|
| 47 |
|
|---|
| 48 | configureflags="--disable-static --enable-shared --with-ui --with-readline"
|
|---|
| 49 |
|
|---|
| 50 | %define profilegenerate \
|
|---|
| 51 | CFLAGS="${RPM_OPT_FLAGS} -fprofile-generate"\
|
|---|
| 52 | CXXFLAGS="${RPM_OPT_FLAGS} -fprofile-generate"
|
|---|
| 53 | %define profileuse \
|
|---|
| 54 | CFLAGS="${RPM_OPT_FLAGS} -fprofile-use"\
|
|---|
| 55 | CXXFLAGS="${RPM_OPT_FLAGS} -fprofile-use"
|
|---|
| 56 |
|
|---|
| 57 | %if !%{double_profiling_build}
|
|---|
| 58 | %configure $configureflags
|
|---|
| 59 | make %{?_smp_mflags}
|
|---|
| 60 | %else
|
|---|
| 61 | #Generate a word list to use for profiling, take half of it to ensure
|
|---|
| 62 | #that the original word list is then considered to contain correctly
|
|---|
| 63 | #and incorrectly spelled words
|
|---|
| 64 | head -n $((`cat /usr/share/dict/words | wc -l`/2)) /usr/share/dict/words |\
|
|---|
| 65 | sed '/\//d'> words
|
|---|
| 66 |
|
|---|
| 67 | #generate profiling
|
|---|
| 68 | %{profilegenerate} %configure $configureflags
|
|---|
| 69 | make %{?_smp_mflags}
|
|---|
| 70 | ./src/tools/affixcompress words > /dev/null 2>&1
|
|---|
| 71 | ./src/tools/hunspell -d words -l /usr/share/dict/words > /dev/null
|
|---|
| 72 | make check
|
|---|
| 73 | make distclean
|
|---|
| 74 |
|
|---|
| 75 | #use profiling
|
|---|
| 76 | %{profileuse} %configure $configureflags
|
|---|
| 77 | make %{?_smp_mflags}
|
|---|
| 78 | %endif
|
|---|
| 79 | cd po && make %{?_smp_mflags} update-gmo && cd ..
|
|---|
| 80 |
|
|---|
| 81 | %check
|
|---|
| 82 | %ifarch %{ix86} x86_64
|
|---|
| 83 | #VALGRIND=memcheck make check
|
|---|
| 84 | #make check
|
|---|
| 85 | %endif
|
|---|
| 86 |
|
|---|
| 87 | %install
|
|---|
| 88 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 89 | make DESTDIR=$RPM_BUILD_ROOT install
|
|---|
| 90 | rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
|
|---|
| 91 | mkdir $RPM_BUILD_ROOT/%{_datadir}/myspell
|
|---|
| 92 | %find_lang %{name}
|
|---|
| 93 |
|
|---|
| 94 | %clean
|
|---|
| 95 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 96 |
|
|---|
| 97 | #post -p /sbin/ldconfig
|
|---|
| 98 |
|
|---|
| 99 | #postun -p /sbin/ldconfig
|
|---|
| 100 |
|
|---|
| 101 | %files -f %{name}.lang
|
|---|
| 102 | %defattr(-,root,root,-)
|
|---|
| 103 | %doc README README.myspell COPYING COPYING.LESSER COPYING.MPL AUTHORS AUTHORS.myspell license.hunspell license.myspell THANKS
|
|---|
| 104 | %{_libdir}/*.dll
|
|---|
| 105 | %{_datadir}/myspell
|
|---|
| 106 | %{_bindir}/hunspell.exe
|
|---|
| 107 | %{_mandir}/man1/hunspell.1.gz
|
|---|
| 108 | %lang(hu) %{_mandir}/hu/man1/hunspell.1.gz
|
|---|
| 109 |
|
|---|
| 110 | %files devel
|
|---|
| 111 | %defattr(-,root,root,-)
|
|---|
| 112 | %{_includedir}/%{name}
|
|---|
| 113 | %{_libdir}/*_dll.a
|
|---|
| 114 | %{_bindir}/affixcompress
|
|---|
| 115 | %{_bindir}/makealias
|
|---|
| 116 | %{_bindir}/munch.exe
|
|---|
| 117 | %{_bindir}/unmunch.exe
|
|---|
| 118 | %{_bindir}/analyze.exe
|
|---|
| 119 | %{_bindir}/chmorph.exe
|
|---|
| 120 | %{_bindir}/hzip.exe
|
|---|
| 121 | %{_bindir}/hunzip.exe
|
|---|
| 122 | %{_bindir}/ispellaff2myspell
|
|---|
| 123 | %{_bindir}/wordlist2hunspell
|
|---|
| 124 | %{_bindir}/wordforms
|
|---|
| 125 | %{_libdir}/pkgconfig/hunspell.pc
|
|---|
| 126 | %{_mandir}/man1/hunzip.1.gz
|
|---|
| 127 | %{_mandir}/man1/hzip.1.gz
|
|---|
| 128 | %{_mandir}/man3/hunspell.3.gz
|
|---|
| 129 | %{_mandir}/man5/hunspell.5.gz
|
|---|
| 130 |
|
|---|
| 131 | %changelog
|
|---|
| 132 | * Tue Sep 26 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> - 1.6.2-1
|
|---|
| 133 | - update to upstream version 1.6.2
|
|---|
| 134 | - fix hunspell.exe to find dictionaries in the path
|
|---|
| 135 |
|
|---|
| 136 | * Mon Apr 10 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> - 1.6.1-2
|
|---|
| 137 | - remove wrong ldconfig in post and postun
|
|---|
| 138 |
|
|---|
| 139 | * Fri Apr 07 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> - 1.6.1-1
|
|---|
| 140 | - initial port
|
|---|