bc861b7911e448901be153ed61f523cf528d7b44
[packages/coq.git] / coq.spec
1 #
2 # TODO:
3 #       - package and R: Csdp (https://projects.coin-or.org/Csdp)
4 #
5 # Conditional build:
6 %bcond_without  ocaml_opt       # skip building native optimized binaries (bytecode is always built)
7 %bcond_with     tests           # run testsuite (csdp dependant micromega tests fail badly on x86_64)
8 #
9 %ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
10 %undefine       with_ocaml_opt
11 %endif
12
13 Summary:        The Coq Proof Assistant
14 Summary(pl.UTF-8):      Coq - narzędzie pomagające w udowadnianiu
15 Name:           coq
16 Version:        8.13.1
17 Release:        1
18 License:        LGPL v2.1
19 Group:          Applications/Math
20 Source0:        https://github.com/coq/coq/archive/V%{version}/%{name}-%{version}.tar.gz
21 # Source0-md5:  03ebbf1034c224a0a3327db2d5688c29
22 Source1:        coqide.desktop
23 Source2:        coqide.xpm
24 URL:            http://coq.inria.fr/
25 BuildRequires:  bash
26 BuildRequires:  hevea
27 BuildRequires:  netpbm-progs
28 BuildRequires:  ocaml >= 1:4.05
29 BuildRequires:  camlp5 >= 5.01
30 BuildRequires:  ocaml-dune > 2.5.0
31 BuildRequires:  ocaml-findlib >= 1.8.1
32 BuildRequires:  ocaml-zarith-devel >= 1.10
33 BuildRequires:  ocaml-lablgtk3-devel
34 BuildRequires:  ocaml-lablgtk3-gtksourceview-devel
35 BuildRequires:  sed >= 4.0
36 BuildRequires:  texlive-fonts-cmextra
37 BuildRequires:  texlive-fonts-cmsuper
38 BuildRequires:  texlive-fonts-other
39 BuildRequires:  texlive-format-pdflatex
40 BuildRequires:  texlive-latex-ams
41 BuildRequires:  texlive-latex-comment
42 BuildRequires:  texlive-latex-moreverb
43 BuildRequires:  texlive-latex-ucs
44 BuildRequires:  texlive-makeindex
45 BuildRequires:  texlive-psutils
46 # hyperref.sty (from latex) requires ifxexex.sty (from xetex)
47 BuildRequires:  texlive-xetex
48 %requires_eq    ocaml-runtime
49 Obsoletes:      coq-emacs < 8.13.1
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %description
53 Coq is a proof assistant which:
54  - allows to handle calculus assertions,
55  - check mechanically proofs of these assertions,
56  - helps to find formal proofs,
57  - extracts a certified program from the constructive proof of its
58    formal specification.
59
60 %description -l pl.UTF-8
61 Coq to narzędzie pomagające w udowadnianiu, które:
62 - pozwala uporać się z twierdzeniami dotyczącymi rachunku
63   różniczkowego,
64 - mechanicznie sprawdzać dowody tych twierdzeń,
65 - pomagać w znalezieniu formalnych dowodów,
66 - wyciągać program o dowiedzionej poprawności z konstruktywnego dowodu
67   jego formalnej specyfikacji.
68
69 %package latex
70 Summary:        Coq documentation style for latex
71 Summary(pl.UTF-8):      Styl dokumentacji Coq dla latexa
72 Group:          Development/Tools
73 Requires:       %{name} = %{version}-%{release}
74
75 %description latex
76 Coq documentation style for latex.
77
78 %description latex -l pl.UTF-8
79 Styl dokumentacji Coq dla latexa.
80
81 %prep
82 %setup -q
83
84 %{__sed} -ri '/FULLCONFIGDIR/s/OLDROOT|COQINSTALLPREFIX/&2/g' Makefile.install
85 %{__sed} -i 's|-Wall.*-O2|%{rpmcflags} -Wno-unused|' configure.ml
86 %{__sed} -i "s|-oc|-ccopt '%{rpmldflags}' -g &|" Makefile.build
87 %{__sed} -i 's,-shared,& -g,g' tools/CoqMakefile.in Makefile.build
88
89 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
90       tools/make-both-single-timing-files.py \
91       tools/make-both-time-files.py \
92       tools/make-one-time-file.py
93
94 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python3}\1,' \
95       doc/tools/coqrst/notations/fontsupport.py
96
97 %build
98 ./configure \
99         -bindir %{_bindir} \
100         -libdir %{_libdir}/coq \
101         -mandir %{_mandir} \
102         -docdir %{_docdir}/%{name}-%{version} \
103         -configdir %{_sysconfdir}/%{name} \
104         -datadir %{_datadir}/%{name} \
105         -coqdocdir %{_datadir}/texmf/tex/latex/misc \
106 %if %{with ocaml_opt}
107         -native-compiler yes \
108         -coqide opt \
109 %else
110         -byte-only \
111         -native-compiler no \
112         -coqide byte \
113 %endif
114         -browser "xdg-open %s"
115
116 %{__make} world VERBOSE=1 CAML_LD_LIBRARY_PATH=kernel/byterun
117 %{?with_tests:%{__make} check VERBOSE=1 CAML_LD_LIBRARY_PATH=kernel/byterun} # Use native coq to compile theories
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
122
123 %{__make} install \
124         COQINSTALLPREFIX=$RPM_BUILD_ROOT%{_prefix} \
125         COQINSTALLPREFIX2=$RPM_BUILD_ROOT%{_sysconfdir} \
126         OLDROOT=%{_prefix} \
127         OLDROOT2=%{_sysconfdir}
128
129 # To install only locally the binaries compiled with absolute paths
130
131 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
132 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
133
134 cp -p CONTRIBUTING.md README.md $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
135
136 %clean
137 rm -rf $RPM_BUILD_ROOT
138
139 %files
140 %defattr(644,root,root,755)
141 %doc %{_docdir}/%{name}-%{version}
142 %dir %{_sysconfdir}/%{name}
143 %attr(755,root,root) %{_bindir}/coqc
144 %attr(755,root,root) %{_bindir}/coqchk
145 %attr(755,root,root) %{_bindir}/coqdep
146 %attr(755,root,root) %{_bindir}/coqdoc
147 %attr(755,root,root) %{_bindir}/coqide*
148 %attr(755,root,root) %{_bindir}/coq_makefile
149 %attr(755,root,root) %{_bindir}/coqpp
150 %attr(755,root,root) %{_bindir}/coqproofworker.opt
151 %attr(755,root,root) %{_bindir}/coqqueryworker.opt
152 %attr(755,root,root) %{_bindir}/coqtacticworker.opt
153 %attr(755,root,root) %{_bindir}/coq-tex
154 %attr(755,root,root) %{_bindir}/coqtop
155 %attr(755,root,root) %{_bindir}/coqtop.opt
156 %attr(755,root,root) %{_bindir}/coqwc
157 %attr(755,root,root) %{_bindir}/coqworkmgr
158 %attr(755,root,root) %{_bindir}/ocamllibdep
159 %attr(755,root,root) %{_bindir}/votour
160 %dir %{_libdir}/coq
161 %{_libdir}/coq/*
162 %{_mandir}/man1/coq_makefile.1*
163 %{_mandir}/man1/coq-tex.1*
164 %{_mandir}/man1/coqc.1*
165 %{_mandir}/man1/coqchk.1*
166 %{_mandir}/man1/coqdep.1*
167 %{_mandir}/man1/coqdoc.1*
168 %{_mandir}/man1/coqide.1*
169 %{_mandir}/man1/coqtop.1*
170 %{_mandir}/man1/coqtop.byte.1*
171 %{?with_ocaml_opt:%{_mandir}/man1/coqtop.opt.1*}
172 %{_mandir}/man1/coqwc.1*
173 %{_desktopdir}/coqide.desktop
174 %{_pixmapsdir}/coqide.xpm
175 %{_datadir}/%{name}
176
177 %files latex
178 %defattr(644,root,root,755)
179 %{_datadir}/texmf/tex/latex/misc/coqdoc.sty
This page took 0.038995 seconds and 2 git commands to generate.