Haskell/RPM

Материал из ALT Linux Wiki
50px-Gnome globe current event.png
Данная статья периодически обновляется.
Последнее обновление
17:27 22 апреля 2025


На данный момент поддерживается два вида сборки - с динамической линковкой и Setup.hs

Макросы находятся в пакете rpm-build-haskell

Пример спека библиотеки

%def_with docs

%define pkg_name $name
%define pkgid $name-%version

Name: ghc-$name
Version: $version
Release: alt1
License: $license

Group: Development/Haskell
Url: https://hackage.haskell.org/package/$name

Source: %name-%version.tar
Summary: $synopsis

BuildRequires(Pre): rpm-build-haskell
BuildRequires(Pre): ghc-devel

%description
$description

%package devel
Summary: Haskell %pkg_name library development files
Group: Development/Haskell

Requires: %name = %EVR

%description devel
This package provides %pkg_name development files for GHC

%if_with docs
%package doc
Summary: Haskell %pkg_name library documentation
Group: Documentation
BuildArch: noarch

%description doc
This package contains documentation for %pkg_name built with GHC
%endif

%prep
%setup

%build
%ghc_lib_build

%install
%ghc_lib_install
%ghc_gen_filelist %pkg_name %version

%files -f %pkgid-files.runtime

%files devel -f %pkgid-files.devel

%if_with docs
%files doc -f %pkgid-files.doc
%endif

%changelog

Пример спека для программы

%def_with docs

%define pkg_name alex
%define pkgid %pkg_name-%version

Name: alex
Version: 3.5.2.0
Release: alt1
License: BSD-3-Clause

Group: Development/Haskell
Url: http://hackage.haskell.org/package/alex

Source: %name-%version.tar

Summary: Alex is a tool for generating lexical analysers in Haskell

BuildRequires(Pre): ghc-devel
BuildRequires(Pre): rpm-build-haskell

%description
Alex is a tool for generating lexical analysers in Haskell. It takes a
description of tokens based on regular expressions and generates a Haskell
module containing code for scanning text efficiently. It is similar to the
tool lex or flex for C/C++.

%prep
%setup

%build
%ghc_bin_build

%install
%ghc_bin_install
%ghc_gen_filelist %pkg_name %version

%files -f %pkgid-files.all
%_bindir/alex

%changelog

Важные моменты

TODO

Автоматическая генерация спеков

TODO

Использование ghc-solver

TODO