#!/bin/csh

set  LIBDIR=`ispell -vv | grep LIBDIR | cut -d'"' -f2 | sed '/\//s/\//\\\//g'`
set    DATE=`date +"%Y.%m.%d"`
set PACKAGE=idanish-1.3.${DATE}-1

wget http://www.sslug.dk/locale/ispell/autobuild/idanish-1.3.${DATE}.tar.gz -O /usr/src/redhat/SOURCES/idanish-1.3.${DATE}.tar.gz || exit -1

sed "/LIBDIR/s/LIBDIR/${LIBDIR}/g" << FIL_SLUT | sed "/DATE/s/DATE/${DATE}/g" > ${PACKAGE}.spec
Name:        iDanish
Summary:     Dansk ordliste til stavekontrolprogrammet ispell
Summary(en): Danish word list for the spell checking program ispell
Version:     1.3.DATE
Release:     1
License:     GPL
URL:         http://www.sslug.dk/locale/ispell/idanish-1.3.shtml
Group:       Applications/Text
Source:      http://www.sslug.dk/locale/ispell/autobuild/idanish-1.3.DATE.tar.gz
Requires:    ispell >= 3.1
Packager:    Jacob Sparre Andersen <sparre@sslug.dk>
Vendor:      Skåne Sjælland Linux User Group

%description
Ispell fungerer som stavekontrol for en del Linux-programmer, og kan også
bruges alene til at tjekke tekstfiler for stavefejl. Med denne pakke er det
muligt at bruge ispell til at tjekke danske tekster for stavefejl.

%description -l en
Ispell works as spell checker for a number of Linux programs, and can also be
used alone to check text files for misspellings. With this package it is
possible to use ispell for checking Danish texts for misspellings.

%prep

%setup -n idanish-1.3.DATE
mv dansk.ufærdig.ispell dansk.ispell

%build
make all

%install
install -o root -g root -m 0644 dansk.hash LIBDIR
install -o root -g root -m 0644 dansk.aff LIBDIR

%post

%files
LIBDIR/dansk.aff
LIBDIR/dansk.hash

%doc readme.da.html
%doc readme.en.html
%doc readme.sv.html
FIL_SLUT

rpm -ba --clean ${PACKAGE}.spec

