summaryrefslogtreecommitdiff
path: root/wordnet.spec
blob: e456df0e981c8f5c956195878ca75befc34d8b24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Name:           wordnet
Version:        3.0
Release:        1
Summary:        A lexical database for the English language

License:        MIT and GPLv2+
URL:            http://wordnet.princeton.edu/
Source0:        http://wordnetcode.princeton.edu/%{version}/WordNet-%{version}.tar.bz2
Source1:        http://wordnetcode.princeton.edu/wn3.1.dict.tar.gz
Patch0:         wordnet-3.0-CVE-2008-2149.patch
Patch1:         wordnet-3.0-CVE-2008-3908.patch
Patch2:         wordnet-3.0-fix_man.patch
Patch3:         wordnet-3.0-fix_resourcedir_path.patch
Patch4:         wordnet-3.0-src_stubs_c.patch
Patch5:         wordnet-3.0-wishwn_manpage.patch
Patch6:         wordnet-3.0-use_system_tk_headers.patch
Patch7:         wordnet-3.0-libtool.patch
Patch8:         wordnet-3.0-error_message.patch
Patch9:         wordnet-3.0-Pass-compilation-with-Werror-format-security.patch
BuildRequires:  automake >= 1.8 coreutils gcc gzip libtool make tar tcl-devel tk-devel

%description
WordNet is a large lexical database of English, developed under the direction
of George A. Miller. Nouns, verbs, adjectives and adverbs are grouped into sets
of cognitive synonyms (synsets), each expressing a distinct concept. Synsets
are interlinked by means of conceptual-semantic and lexical relations. The
resulting network of meaningfully related words and concepts can be navigated
with the browser. WordNet is also freely and publicly available for download.
WordNet's structure makes it a useful tool for computational linguistics and
natural language processing.


%package browser
Summary:    Tk browser for WordNet
Requires:   %{name}%{?_isa} = %{version}-%{release}
Requires:   font(:lang=en)

%description browser
This package contains graphical browser for WordNet database.


%package devel
Summary:    The development libraries and header files for WordNet
Requires:   %{name} = %{version}-%{release}

%description devel
This package contains the libraries and header files required to create
applications based on WordNet.

%package_help

%prep
%setup -q -n WordNet-%{version}
%patch0 -p1 -b .cve-2008-2149
%patch1 -p1 -b .cve-2008-3908
%patch2 -p1 -b .fix_man
%patch3 -p1 -b .fix_resourcedir_path
%patch4 -p1 -b .src_stubs_c
%patch5 -p1 -b .wishwn_manpage
sed -e '/man_MANS/ s/$/ wishwn.1/' -i doc/man/Makefile.am
%patch6 -p1 -b .use_system_tk_headers
%patch7 -p1 -b .libtool
%patch8 -p1 -b .error_message
%patch9 -p1 -b .format
rm -rf include/tk
tar -xozf %{SOURCE1}
rm -rf dict/dbfiles


%build
libtoolize && aclocal
autoupdate
autoreconf -i
export CFLAGS="%{?optflags} -DUSE_INTERP_RESULT"
export CXXFLAGS="%{?optflags} -DUSE_INTERP_RESULT"
%configure --enable-static=no --prefix=%{_datadir}/wordnet-%{version}/
make %{?_smp_mflags}

%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -f  $RPM_BUILD_ROOT%{_libdir}/libWN.la
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/doc
rm -rf doc/{html,ps,pdf}/Makefile*

%ldconfig_scriptlets

%files
%doc AUTHORS COPYING ChangeLog README
%{_bindir}/wn
%{_datadir}/%{name}-%{version}/
%exclude %{_datadir}/%{name}-%{version}/lib/wnres/
%{_libdir}/libWN.so.*

%files browser
%{_bindir}/wishwn
%{_bindir}/wnb
%{_datadir}/%{name}-%{version}/lib/wnres/

%files devel
%{_includedir}/wn.h
%{_libdir}/libWN.so

%files help
%doc COPYING doc/{html,ps,pdf}
%{_mandir}/man1/wishwn.1.gz
%{_mandir}/man1/wnb.1.gz
%{_mandir}/man1/grind.1.gz
%{_mandir}/man1/wn.1.gz
%{_mandir}/man1/wnintro.1.gz
%{_mandir}/man3/*.3.gz
%{_mandir}/man5/*.5.gz
%{_mandir}/man7/*.7.gz

%changelog
* Wed Sep 06 2023 Darssin <2020303249@mail.nwpu.edu.cn> - 3.0-1
- Package init