Blob Blame History Raw
## This package has not architecture dependent files, 
## except for the -static library that uses.
%global debug_package %{nil}

%if 0%{?fedora} < 20
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
%endif


Name:    epix
Summary: Utilities for mathematically accurate figures
Version: 1.2.14
Release: 6%{?dist}
License: GPLv2+
Group:   Applications/Engineering
URL:     http://mathcs.holycross.edu/~ahwang/current/ePiX.html
Source0: http://mathcs.holycross.edu/~ahwang/epix/epix-%{version}.tar.bz2

BuildRequires: ghostscript
BuildRequires: texinfo
BuildRequires: texlive 
BuildRequires: texlive-comment
BuildRequires: texlive-eepic
BuildRequires: texlive-kpathsea-bin
BuildRequires: texlive-latex-bin-bin
BuildRequires: texlive-pst-tools
BuildRequires: texlive-texconfig 

## ePiX needs a static library to work; it's packaged in the -devel subpackage
Requires: %{name}-devel = %{version}-%{release}

Requires: ghostscript
Requires: ImageMagick
Requires: texlive-comment
Requires: texlive-epstopdf-bin
Requires: texlive-eepic 
Requires: texlive-pst-tools
Requires: texlive-tetex


Requires(post): info
Requires(preun): info


%description
ePiX (pronounced like "epic" with a soft "k", playing on "TeX"), a
collection of command line utilities for *nix, creates mathematically
accurate figures, plots, and movies using easy-to-learn syntax. The
output is expressly designed for use with LaTeX.

%package devel
Summary: Header and static files for %{name}
Group: Applications/Engineering
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: %{name}-static = %{version}-%{release}
%description devel
Header and static files for %{name}

%package bash-completion
Summary: Bash completion support for %{name} 
Group: Applications/Engineering
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: bash
%description bash-completion
Bash completion support for the %{name}'s utilities

%package emacs
Summary: Emacs support for %{name} 
Group: Applications/Engineering
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: emacs-common
%description emacs
Emacs support for the %{name}

%prep
%setup -q -n %{name}-%{version}

## UTF-8 validating and timestamps preserving
for f in THANKS; do
 iconv -f iso8859-1 -t utf8 $f > $f.new && \
 touch -r $f $f.new && \
 mv $f.new $f
done


%build
%configure --enable-epix-el
make %{?_smp_mflags}

%install
make install DESTDIR=$RPM_BUILD_ROOT

## These directories are not useful
rm -f $RPM_BUILD_ROOT%{_datadir}/info/dir
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}/notes

## Rearrangement of documentation files 
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/samples
%if 0%{?fedora} < 20
install -pm 644  $RPM_BUILD_ROOT%{_docdir}/%{name}/manual.pdf.gz $RPM_BUILD_ROOT%{_pkgdocdir}
install -pm 644  $RPM_BUILD_ROOT%{_docdir}/%{name}/manual.ps.gz $RPM_BUILD_ROOT%{_pkgdocdir}
rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}/manual.pdf.gz $RPM_BUILD_ROOT%{_docdir}/%{name}/manual.ps.gz
%endif
tar -xf $RPM_BUILD_ROOT%{_docdir}/%{name}/sample_src.tar.gz -C $RPM_BUILD_ROOT%{_pkgdocdir}/samples
rm -f  $RPM_BUILD_ROOT%{_docdir}/%{name}/*.tar.gz

## Make bash completion file
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
cp -p $RPM_BUILD_ROOT%{_docdir}/%{name}/config/bash_completions  $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/%{name}
rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}/config/bash_completions

## Make emacs plugin
mkdir -p  $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/%{name}
cp -p $RPM_BUILD_ROOT%{_docdir}/%{name}/config/%{name}.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/%{name}
rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}/config/%{name}.el

## Remove config dir
rm -rf $RPM_BUILD_ROOT%{_pkgdocdir}/config


%post
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%preun
if [ $1 = 0 ] ; then
  /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi


%files
%doc README THANKS ChangeLog COPYING NEWS POST-INSTALL 
%{_bindir}/elaps
%{_bindir}/epix
%{_bindir}/flix
%{_bindir}/laps
%{_datadir}/%{name}/
%{_infodir}/%{name}*
%{_mandir}/man1/epix.1*
%{_mandir}/man1/elaps.1*
%{_mandir}/man1/laps.1*
%{_mandir}/man1/flix.1*

%files devel
%{_includedir}/%{name}/
%{_includedir}/%{name}.h
%{_libdir}/%{name}/

%files bash-completion
%config(noreplace) %{_sysconfdir}/bash_completion.d/%{name}

%files emacs
%{_datadir}/emacs/site-lisp/%{name}/


%changelog
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.14-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.14-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat May 17 2014 Antonio Trande <sagitterATfedoraproject.org> 1.2.14-4
- Added a conditional macro for docdir in fedora<20
- Rearrangement of documentation files

* Sat May 17 2014 Antonio Trande <sagitterATfedoraproject.org> 1.2.14-3
- doc sub-package not built anymore

* Fri May 16 2014 Antonio Trande <sagitterATfedoraproject.org> 1.2.14-2
- Fixed documentation directories definition

* Wed May 14 2014 Antonio Trande <sagitterATfedoraproject.org> 1.2.14-1
- Update to 1.2.14

* Wed Dec 18 2013 Antonio Trande <sagitterATfedoraproject.org> 1.2.13-3
- Fix Requires for emacs and bash-completion subpackages

* Wed Dec 18 2013 Antonio Trande <sagitterATfedoraproject.org> 1.2.13-2
- BR lines rearranged
- Unzip all manuals and 'sample_src' archive
- Added bash-completion subpackage
- Added -emacs subpackage
- Added bash Requires

* Sun Dec 15 2013 Antonio Trande <sagitterATfedoraproject.org> 1.2.13-1
- First package