Change to haskell packaging conventions

OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/alex?expand=0&rev=20
This commit is contained in:
Herbert Graeber 2009-02-28 13:10:17 +00:00 committed by Git OBS Bridge
parent 71d9bb65d1
commit d6350f683f

View File

@ -1,24 +1,33 @@
#
# spec file for package ghc-X11
#
# Copyright (c) 2005-2009 Herbert Graeber
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# norootforbuild
# ghc does not emit debug information
%global debug_package %{nil}
Name: alex Name: alex
Summary: The lexer generator for Haskell
Version: 2.3.1 Version: 2.3.1
Release: 0 Release: 0
License: BSD3 Summary: The lexer generator for Haskell
Group: Development/Languages/Haskell Group: Development/Languages/Haskell
Packager: Herbert Graeber <herbert@graeber-clan.de> License: BSD3
URL: http://www.haskell.org/alex/ URL: http://www.haskell.org/alex/
Source: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.bz2 Source: %{name}-%{version}.tar.bz2
%if 0%suse_version >= 1030 BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: licenses Requires: licenses
%endif
BuildRequires: ghc BuildRequires: ghc
BuildRequires: libxslt BuildRequires: libxslt
BuildRequires: sgml-skel BuildRequires: sgml-skel
BuildRequires: docbook-xsl-stylesheets BuildRequires: docbook-xsl-stylesheets
BuildRequires: docbook-utils BuildRequires: docbook-utils
%if 0%suse_version >= 1030
BuildRequires: licenses BuildRequires: licenses
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prefix: /usr Prefix: /usr
%description %description
@ -26,61 +35,66 @@ Alex is a tool for generating lexical analysers in Haskell, given a
description of the tokens to be recognised in the form of regular description of the tokens to be recognised in the form of regular
expressions. It is similar to the tool 'lex' or 'flex' for C/C++. expressions. It is similar to the tool 'lex' or 'flex' for C/C++.
%description -l de
Alex ist ein Tool zum Erzeugen von lexkialischen Analysatoren. Er erzeugt
aus eine Beschreibung von Symbolen durch reguläre Ausdrücke ein
Haskell-Modul, das aus einem Text eine Folge von Symbolen erzeugt. Alex ist
ein vergleichbar mit 'lex' bzw. 'flex' für C und C++.
%package doc %package doc
Summary: Alex Documentation Summary: Alex Documentation
Group: Development/Languages/Haskell Group: Development/Languages/Haskell
Requires: %{name} = %{version}
%description doc %description doc
Alex is a tool for generating lexical analysers in Haskell, given a
description of the tokens to be recognised in the form of regular
expressions. It is similar to the tool 'lex' or 'flex' for C/C++.
This is the documentation for Alex, a lexical analyser generator for Haskell. This is the documentation for Alex, a lexical analyser generator for Haskell.
%description doc -l de
Dieses ist Dokumentation für Alex.
%prep %prep
%setup -q %setup -q
%build %build
export CFLAGS="$RPM_OPT_FLAGS" %cabal_configure --docdir=%{_docdir}/alex
runhaskell Setup.lhs configure --prefix=%{_prefix} --libdir=%{_libdir} \ %cabal build
--libexecdir=%{_libexecdir} --datadir=%{_datadir} --docdir=%{_docdir}/%{name} pushd doc
runhaskell Setup.lhs build autoreconf
cd doc ./configure --prefix=%{_prefix} --libdir=%{_libdir}
test -f configure || autoreconf
./configure
make html make html
popd
%install %install
%if 0%suse_version >= 1030 rm -rf $RPM_BUILD_ROOT
%cabal_install
mkdir -p %{buildroot}%{_datadir}/doc/ghc/%{name}
cp -r doc %{buildroot}%{_datadir}/doc/ghc/%{name}
for FILE in LICENSE ; do for FILE in LICENSE ; do
MD5SUM=$(md5sum $FILE | sed 's/ .*//') MD5SUM=$(md5sum $FILE | sed 's/ .*//')
if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then
ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE
fi fi
done done
%endif
runhaskell Setup.lhs copy --destdir=${RPM_BUILD_ROOT}
%clean
rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%doc ANNOUNCE %doc ANNOUNCE LICENSE README TODO examples
%doc LICENSE %{_bindir}/%{name}
%doc README %{_datadir}/%{name}-%{version}
%doc TODO
%{_bindir}/alex
%{_datadir}/alex-%{version}
%files doc %files doc
%defattr (-,root, root) %defattr (-,root, root)
%doc examples %{_datadir}/doc/ghc/%{name}
%doc doc/alex
%changelog %changelog
* Sat Feb 28 2009 Herbert Graeber <herbert@links2linux.de> - 2.3.1
- Changed to haskell packaging conventions
* Wed Dec 4 2008 Herbert Graeber <herbert@links2linux.de> 2.3.1 * Wed Dec 4 2008 Herbert Graeber <herbert@links2linux.de> 2.3.1
- Update to version 2.3.1 - Update to version 2.3.1