Blob Blame History Raw
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%global debug_package %{nil}
%global tex_dir %{_datadir}/texmf/tex/latex

# Hevea is not universally available, so HTML documentation cannot be produced
# on some arches.
%ifarch ppc64
%global build_html 0
%global build_html 1

# Upstream includes option for generation of optimized binaries,
# however, specifically generates bytecode versions for certain
# executables even when optimized option is set, namely the following:

# coq-tex, coq_makefile, coq-interface, coqwc, coqdoc, parser, coqdep,
# gallina

# (coqtop.byte, coqide.byte binaries are also made available.)

# .coqide-gtk2rc also produces an rpmlint warning due to its name,
# however, this name is proper as per the Coq documentation

Name:           coq
Version:        8.4pl2
Release:        1%{?dist}
Summary:        Proof management system

Group:          Applications/Engineering
License:        LGPLv2
Source1:        coqide.desktop
Source2:        README.coq-emacs
Source4:        coq.xml

BuildRequires:  ocaml
BuildRequires:  ocaml-camlp5-devel
BuildRequires:  ocaml-lablgtk-devel
BuildRequires:  csdp-tools
BuildRequires:  desktop-file-utils
BuildRequires:  emacs-nox
BuildRequires:  emacs-proofgeneral

# For documentation
%if %{build_html}
BuildRequires:  hevea
BuildRequires:  tex(latex)
BuildRequires:  tex(comment.sty)
BuildRequires:  tex(epic.sty)
BuildRequires:  tex(fullpage.sty)
BuildRequires:  tex(moreverb.sty)
BuildRequires:  tex(multirow.sty)
BuildRequires:  tex(stmaryrd.sty)
BuildRequires:  tex(utf8x.def)
BuildRequires:  tex-cm-super
BuildRequires:  tex-courier
BuildRequires:  tex-ec
BuildRequires:  tex-helvetic
BuildRequires:  tex-symbol
BuildRequires:  tex-times
BuildRequires:  tex-zapfchan
BuildRequires:  tex-zapfding

Requires:       csdp-tools
Requires(posttrans): tex(tex)
Requires(postun): tex(tex)

ExclusiveArch: %{ocaml_arches}

# Remove these once Fedora 18 goes EOL
Obsoletes:      %{name}-xemacs < 8.3pl4
Provides:       %{name}-xemacs = %{version}-%{release}
Obsoletes:      %{name}-xemacs-el < 8.3pl4
Provides:       %{name}-xemacs-el = %{version}-%{release}

Coq is a formal proof management system. It allows for the development
of theorems through first order logic that are mechanically checked by
the machine. Sets of definitions and theorems can be saved as compiled
modules and loaded into the system.

This package provides the main Coq binary without an optional IDE,

# The IDE's package name will become "coq-coqide".  That way,
# searching for either "coqide" (the Ubuntu/Debian package name, and
# also the full name of the IDE) or "coq" and "ide" will find
# this. (If the package were named "coq-ide", the former would fail.)
%package coqide
Group:          Applications/Engineering
Summary:        Coqide IDE for Coq proof management system
Requires:       %{name} = %{version}-%{release}, xdg-utils

%description coqide
Coq is a formal proof management system. It allows for the development
of theorems through first order logic that are mechanically checked by
the machine. Sets of definitions and theorems can be saved as compiled
modules and loaded into the system.

This package provides Coqide, a lightweight IDE for Coq.

%package doc
Group:          Applications/Engineering
License:        Open Publication
Summary:        Documentation for Coq proof management system
BuildArch:      noarch

%description doc
Coq is a formal proof management system. It allows for the development
of theorems through first order logic that are mechanically checked by
the machine. Sets of definitions and theorems can be saved as compiled
modules and loaded into the system.

This package provides documentation and tutorials for the system. The
main documentation comes in two parts: the main Library documentation,
which describes all Coq.* modules, and the Reference Manual, which
gives a more complete description of the whole system. Included are
also HTML versions of both. Furthermore, there are two tutorials, the
main one, and one specifically on recursive types. The example code
for the latter is also included.

%package emacs
Group:          Applications/Engineering
Summary:        GNU Emacs support for Coq proof management system
Requires:       %{name} = %{version}-%{release}
Requires:       emacs(bin) >= %{_emacs_version}
Requires:       emacs-proofgeneral
BuildArch:      noarch

%description emacs
This package provides GNU Emacs mode files for formatting Coq input.

%package emacs-el
Group:          Applications/Engineering
Summary:        Elisp source files for Coq proof management system
Requires:       %{name}-emacs = %{version}-%{release}
BuildArch:      noarch

%description emacs-el
This package contains the Elisp source files for Coq's Emacs support.
This package is not needed to use the Emacs interface.

%setup -q

# Fix some files that are not in UTF-8 encoding

for f in CREDITS doc/LICENSE; do
  iconv -f ISO-8859-1 -t UTF-8 -o $f.utf8 $f
  touch -r $f $f.utf8
  mv -f $f.utf8 $f

cp -p %SOURCE1 %SOURCE2 .

# Fix a Makefile rule that causes installation to fail

# Use full relro due to network use
sed -i 's/-lunix/& -ccopt -Wl,-z,relro,-z,now/' configure

# Define opt flag based upon prior opt detection and restrictions
%if %{opt}
%global opt_option -opt
%global opt_option -byte-only

%global coqdocdir %{_defaultdocdir}/coq-%{version}

./configure -prefix %{_prefix}     \
            -libdir %{_libdir}/coq \
            -bindir %{_bindir}     \
            -mandir %{_mandir}     \
            -docdir %{coqdocdir}   \
            -configdir %{_sysconfdir}/xdg/%{name} \
            -emacslib %{_emacs_sitelispdir} \
            -lablgtkdir %{_libdir}/ocaml/lablgtk2 \
            -coqdocdir %{tex_dir}  \
            %{opt_option} \
            -browser "xdg-open %s" \
            -camlp5dir %{_libdir}/ocaml/camlp5

export CAML_LD_LIBRARY_PATH=`pwd`/kernel/byterun:${CAML_LD_LIBRARY_PATH}
%if %{build_html}
make world VERBOSE=1
# If documentation wasn't built due to lack of hevea, at least build the PDFs
make world doc-pdf VERBOSE=1

# Strip shared objects (not sure where the best location for a
# makefile patch for this would be).
strip kernel/byterun/
find plugins -name \*.cmxs | xargs strip

make COQINSTALLPREFIX="%{buildroot}%{_prefix}" OLDROOT="%{_prefix}" \
     COQINSTALLPREFIX2="%{buildroot}%{_sysconfdir}" OLDROOT2="%{_sysconfdir}" \

# Install desktop icon and menu entry

%global coqdatadir %{_libdir}/coq
%if %(test -d %{buildroot}%{coqdatadir} && echo 1 || echo 0) != 1
mkdir -p %{buildroot}%{coqdatadir}

sed -i -e 's|ICON-LOCATION-BASE|%{_datadir}/coq/coq.png|' coqide.desktop

desktop-file-install \
%if 0%{?fedora} && 0%{?fedora} < 19
--vendor="fedora"                  \
--dir=%{buildroot}%{_datadir}/applications              \

# Make a MIME type for .v files
mkdir -p %{buildroot}%{_datadir}/mime/packages
cp -p %{SOURCE4} %{buildroot}%{_datadir}/mime/packages

# Install main Coq .v files
for f in `find plugins theories -name '*.v' -type f`; do
mkdir -p %{buildroot}%{coqdatadir}/`dirname $f` && cp -p $f %{buildroot}%{coqdatadir}/`dirname $f`

# Install tutorial code
%global tutorialcodedir %{coqdatadir}/RecTutorial
if [ ! -d %{buildroot}%{tutorialcodedir} ]; then
  mkdir -p %{buildroot}%{tutorialcodedir}
cp -p doc/RecTutorial/RecTutorial.v %{buildroot}%{tutorialcodedir}
ln -s %{tutorialcodedir} %{buildroot}%{coqdatadir}/RecTutorial

# No documentation is installed at all if lacking hevea, so copy the PDFs
%if ! %{build_html}
mkdir -p %{buildroot}%{coqdocdir}/pdf
cp -p doc/faq/FAQ.v.pdf %{buildroot}%{coqdocdir}/pdf/FAQ.pdf
cp -p doc/RecTutorial/RecTutorial.pdf %{buildroot}%{coqdocdir}/pdf
cp -p doc/refman/Reference-Manual.pdf %{buildroot}%{coqdocdir}/pdf
cp -p doc/stdlib/Library.pdf %{buildroot}%{coqdocdir}/pdf
cp -p doc/tutorial/Tutorial.v.pdf %{buildroot}%{coqdocdir}/pdf/Tutorial.pdf

# Install documentation not installed by install-doc in Makefile
do cp -p $f %{buildroot}%{coqdocdir};

# We don't need both PostScript and PDF documentation
rm -fr %{buildroot}%{coqdocdir}/ps

# Don't install libcoqrun.a (it might not exist, but get rid of it if it does)
rm -f %{buildroot}%{coqdatadir}/libcoqrun.a

# Move Emacs support files to a subdir and byte compile
mkdir -p %{buildroot}%{_emacs_sitelispdir}/coq
cd %{buildroot}%{_emacs_sitelispdir}/coq
mv ../*.el .
%{_emacs_bytecompile} *.el

mktexlsr &> /dev/null || :
update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database -q &> /dev/null || :

update-desktop-database -q &> /dev/null
update-mime-database %{_datadir}/mime &> /dev/null || :
mktexlsr &> /dev/null

# Note: we want to keep both coqtop.opt and coqtop.byte because the
# byte compiled version can be used to compile new version through
# coqmktop

# Exclude libcoqrun.a only when it is installed (this appears to be
# only for the native compile case)

# DON'T use the doc macro here or else it wipes out all the other documentation installed!
%exclude %{_bindir}/coqide*
%exclude %{coqdatadir}/ide
%if %{opt}
%exclude %{coqdatadir}/*/*.cmxa
%exclude %{coqdatadir}/*/*.a
# A few documentation files here should stay in the main package (and
# are excluded from doc), but the bulk of the documentation is in the
# doc subpackage
%dir %{coqdocdir}

%files coqide
%doc INSTALL.ide
%exclude %{coqdatadir}/ide/ide.cmxa
%exclude %{coqdatadir}/ide/ide.a
%if 0%{?fedora} && 0%{?fedora} < 19

%files doc
%exclude %{coqdocdir}/CHANGES
%exclude %{coqdocdir}/COMPATIBILITY
%exclude %{coqdocdir}/COPYRIGHT
%exclude %{coqdocdir}/CREDITS
%exclude %{coqdocdir}/LICENSE.doc
%exclude %{coqdocdir}/README

%files emacs
%dir %{_emacs_sitelispdir}/coq
%doc README.coq-emacs

%files emacs-el

* Tue May 14 2013 Jerry James <> - 8.4pl2-1
- New upstream release
- Harden the build due to network use

* Sat Feb 23 2013 Toshio Kuratomi <> - 8.4pl1-3
- Remove --vendor from desktop-file-install in F19+

* Wed Feb 13 2013 Fedora Release Engineering <> - 8.4pl1-2
- Rebuilt for

* Mon Jan  7 2013 Jerry James <> - 8.4pl1-1
- New upstream release
- Drop upstreamed GDK patch
- Adapt configure arguments to new version
- Add csdp-tools requirement to get csdp binary

* Thu Dec 13 2012 Jerry James <> - 8.4-3
- Use minimal TeXLive BRs

* Wed Oct 17 2012 Jerry James <> - 8.4-2
- Rebuild for OCaml 4.00.1
- Support more GDK key modifiers in the IDE (hyper, meta, release, super)
- New BRs due to the new texlive package layout
- Substitute the geometry package for fullpage.sty, which is not included in
  the latest Fedora TeXLive packages.

* Tue Aug 21 2012 Jerry James <> - 8.4-1
- New upstream release
- Drop patch; merged upstream
- Drop workaround for install bug; fixed in 8.4

* Fri Jul 27 2012 Jerry James <> - 8.3pl4-3
- ProofGeneral dropped support for XEmacs, so we have to drop it too

* Wed Jul 18 2012 Fedora Release Engineering <> - 8.3pl4-3
- Rebuilt for

* Mon Jun 11 2012 Richard W.M. Jones <> - 8.3pl4-2
- Rebuild for OCaml 4.00.0.

* Sat Jun  9 2012 Jerry James <> - 8.3pl4-1
- New upstream release

* Sat Jan  7 2012 Jerry James <> - 8.3pl3-2
- Rebuild for Ocaml 3.12.1

* Tue Dec 27 2011 Jerry James <> - 8.3pl3-1
- New upstream release

* Tue Dec 06 2011 Adam Jackson <> - 8.3pl2-4
- Rebuild for new libpng

* Thu Oct 27 2011 Jerry James <> - 8.3pl2-3
- Rebuild for new ocaml-camlp5; patch for bz 691913 no longer needed
- Drop tar_base_name, no longer necessary
- Drop versioned dependencies for packages that meet the dep in F14
- Build without HTML documentation on arches lacking hevea
- Change ExclusiveArch to %%{ocaml_arches}
- Fix a broken conditional and a typo

* Wed Jun 15 2011 Jerry James <> - 8.3pl2-2
- Remove workaround for bad documentation link in 8.3pl1, fixed in 8.3pl2
- Revert change in 8.3pl1-1 to split arch-specific stuff from noarch stuff.
  Coq tactics are written in ocaml, which compiles to arch-specific files,
  and those files are stored in the same place as the noarch proof files.
- Move tutorial code into main package; it is small and we can then leave
  all the rest of the documentation as noarch

* Tue Apr 26 2011 Jerry James <> - 8.3pl2-1
- New upstream release
- Change the list of supported arches to match the ocaml list, except for
  ppc64, which is missing hevea

* Mon Apr  4 2011 Jerry James <> - 8.3pl1-2
- Change the mime type to application/x-coq, and inherit from text/plain
  (bz 530254)

* Thu Mar 31 2011 Jerry James <> - 8.3pl1-1
- New upstream release
- Drop BuildRoot tag and clean section
- Drop all patches (all merged or otherwise fixed upstream)
- Comply with latest Ocaml packaging specs
- Identify xdg-open as the default web browser
- Comply with the emacs packaging guidelines, and build an XEmacs package
- The -doc and -emacs* subpackages are now noarch
- Workaround bug 691913
- Drop PostScript documentation; it's identical to PDF documentation
- Deal with arch-specific files in /usr/share; install everything to libdir,
  then move the noarch stuff to datadir, but leave symlinks behind
- Add a new mime type application/x-coqide and use it in the desktop file
- Add post and postun scripts

* Tue Feb 08 2011 Fedora Release Engineering <> - 8.2pl1-2
- Rebuilt for

* Wed Aug 05 2009 Alan Dunn <> - 8.2pl1-1
- New upstream release
- Eliminated modification of tar_base_name that occurred for only version 8.2
- Added reference to bugzilla bug for ppc64 ExcludeArch
- HTML form of documentation seems to no longer be distributed -> must generate
  Decided for consistency to generate all documentation
- Additional file for iconv - documentation license file
- Changed tutorial directory name, now also using bundled version
  of tutorial

* Fri Jul 24 2009 Fedora Release Engineering <> - 8.2-2
- Rebuilt for

* Thu Jun 18 2009 Alan Dunn <> - 8.2-1
- New upstream release
- Seems documentation license has changed or wasn't explicitly stated
  before, fixed (is ok Fedora license)
- Added versioning to documentation
- Removed special OCaml, TeX logic for Fedora < 9 (no longer relevant)
- Dropped makefile patch for compiling grammar.cma (fixed in Coq 8.2)
- Dropped cmxa-install patch (fixed in Coq 8.2)
- Changed makefile-strip patch and name (not yet fixed upstream...)
- Changed check.patch -> coq-check-(version).patch, slightly changed
  for 8.2 (not yet fixed upstream...)
- Dropped parser-renaming makefile-parser.patch, parser-man.patch
  (fixed in Coq 8.2)
- Dropped coq-lablgtk-2.12.patch (fixed in Coq 8.2)
- Changed way source (.v) files are installed
- Stopped addition of other icon file (icon fixed in Coq 8.2)
- Bytecode executables are now "clean" (not build with custom -> don't
  need to configure prelink around these)
- define -> global
- Added ExcludeArch sparc64

* Wed Jun 17 2009 S390x secondary arch maintainer <> 8.1pl4-3.1
- ExcludeArch s390, s390x as we don't have OCaml on those archs

* Wed Mar 04 2009 Alan Dunn <> - 8.1pl4-3
- Minor change to cmxa-install patch instruction
- Fixed to work with lablgtk 2.12

* Tue Feb 24 2009 Fedora Release Engineering <> - 8.1pl4-2
- Rebuilt for 

* Fri Dec  5 2008 Richard W.M. Jones <> - 8.1pl4-1
- New upstream version 8.1pl4.
- Attempt to rebuild against OCaml 3.11.0.
- Run make with VERBOSE=1 so we can see the actual commands.
- Pass -camlp5dir to configure so it uses camlp5 (overriding existence
  of camlp4 if it happens to be installed).

* Wed Oct 22 2008 Alan Dunn <> 8.1pl3-5
- Added Coq .v files into the main package at user request.

* Tue Sep 09 2008 Alan Dunn <> 8.1pl3-4
- Added creation of prelink blacklist for any bytecode files.
- Fixed execstack status for binaries.

* Tue Aug 05 2008 Alan Dunn <> 8.1pl3-3
- Changed parser to coq-parser to avoid name conflict with
- Made make process noisy again.

* Sun Jul 20 2008 Alan Dunn <> 8.1pl3-2.1
- Minor bump for Fedora 8 to bring it into line with the rest.

* Thu Jul 17 2008 Alan Dunn <> 8.1pl3-2
- Added check for Fedora distribution number to allow for Fedora 8 release.

* Wed Jun 11 2008 Alan Dunn <> 8.1pl3-1
- Initial Fedora RPM version.