File words.spec of Package words

#
# spec file for package words
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           words
Version:        7.1
Release:        2
Summary:        An English words dictionary

License:        Public Domain, Freeware
Url:            http://wordlist.sourceforge.net/
Group:          Productivity/Office/Dictionary
Source0:        http://prdownloads.sourceforge.net/wordlist/scowl-7.1.tar.gz
Source1:        sysconfig.words
Source2:        SuSEconfig.words
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

PreReq:         %fillup_prereq
Provides:       scowl = %{version}-%{release}
BuildArch:      noarch

%description
This package contains an English words dictionary which will be installed as

/usr/share/dict/american and linked to /usr/share/dict/words

The symbolic link may be used by look(1) and ispell(1).

For a British or Canadian version of such a words dictionary you may install
words-british or words-canadian respectively.

%package -n words-british
License:        Public Domain, Freeware
Summary:        A British words dictionary
Group:          Productivity/Text/Utilities
Requires:       words

%description -n words-british
This package contains a British words dictionary which will be installed as

/usr/share/dict/british

For a description see the package words.

%package -n words-canadian
License:        Public Domain, Freeware
Summary:        A Canadian words dictionary
Group:          Productivity/Text/Utilities
Requires:       words

%description -n words-canadian
This package contains a Canadian words dictionary which will be installed as

/usr/share/dict/canadian

For a description see the package words.

%prep
%setup -q -n scowl-%{version}

%build
test -d result/ || mkdir result
./mk-list -v2 american 80 > result/american
./mk-list -v2 british 80 > result/british
./mk-list -v2 canadian 80 > result/canadian

%install
mkdir -p %{buildroot}%{_datadir}/dict
install -pm 0644 result/* %{buildroot}%{_datadir}/dict/
mkdir -p %{buildroot}%{_localstatedir}/lib/dict
ln -sf ../../..%{_datadir}/dict/american %{buildroot}%{_localstatedir}/lib/dict/words
ln -sf ../../../var/lib/dict/words %{buildroot}%{_datadir}/dict/words
mkdir -p %{buildroot}/sbin/conf.d
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
install -pm 0644 %{SOURCE1} %{buildroot}%{_localstatedir}/adm/fillup-templates/
install -pm 0755 %{SOURCE2} %{buildroot}/sbin/conf.d/

%clean
rm -rf %{buildroot}

%post
%{fillup_only}

%preun
test -L usr/share/dict/words && rm usr/share/dict/words || true

%files
%defattr(-,root,root,-)
%doc Copyright README
%attr(755,root,root) /sbin/conf.d/SuSEconfig.words
%{_datadir}/dict/american
%ghost %{_datadir}/dict/words
%{_localstatedir}/adm/fillup-templates/sysconfig.words
%dir %{_localstatedir}/lib/dict/
%verify(not link mtime) %{_localstatedir}/lib/dict/words

%files -n words-british
%defattr(-,root,root,-)
%{_datadir}/dict/british

%files -n words-canadian
%defattr(-,root,root,-)
%{_datadir}/dict/canadian

%changelog
openSUSE Build Service is sponsored by