82307f
Name:           xgap
f77890
Version:        4.23
3a545f
Release:        1%{?dist}
82307f
Summary:        GUI for GAP
82307f
82307f
License:        GPLv2+
82307f
URL:            http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/%{name}4.html
3a545f
Source0:        http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/%{name}4/%{name}-%{version}.tar.gz
f77890
# Created by Jerry James <loganjerry@gmail.com>
82307f
Source1:        %{name}.desktop
f77890
# Created by Paulo C├ęsar Pereira de Andrade
f77890
# <paulo.cesar.pereira.de.andrade@gmail.com>
f77890
Source2:        XGap
f77890
# Sent upstream 9 May 2012.  This patch quiets some compiler warnings.
82307f
Patch0:         %{name}-warning.patch
82307f
82307f
BuildRequires:  desktop-file-utils
72cca8
BuildRequires:  gap-devel
82307f
BuildRequires:  libXaw-devel
82307f
Requires:       gap-core
82307f
82307f
%description
82307f
A X Windows GUI for GAP.
82307f
82307f
%prep
3a545f
%setup -q -n %{name}
82307f
%patch0
82307f
f77890
# Autoloading this package interferes with SAGE (bz 819705).
f77890
sed -i "/^Autoload/s/true/false/" PackageInfo.g 
f77890
82307f
%build
82307f
export LDFLAGS="$RPM_LD_FLAGS -Wl,--as-needed"
3a545f
%configure --with-gaproot=%{_gap_arch_dir}
82307f
make %{?_smp_mflags}
82307f
82307f
%install
3a545f
mkdir -p $RPM_BUILD_ROOT%{_gap_dir}/pkg/%{name}
3a545f
cp -a *.g README doc examples htm lib $RPM_BUILD_ROOT%{_gap_dir}/pkg/%{name}
82307f
82307f
mkdir -p $RPM_BUILD_ROOT%{_bindir}
82307f
cp -p bin/*/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}.bin
82307f
82307f
# The xgap.sh generated during build contains paths in the build root
3a545f
sed -e "s|@gapdir@|%{_gap_dir}|" \
f77890
    -e "s|^GAP_PRG=.*|GAP_PRG=%{_bindir}/gap|" \
82307f
    -e "s|^XGAP_PRG=.*|XGAP_PRG=%{_bindir}/%{name}.bin|" \
82307f
    -e "s|\$XGAP_DIR/pkg/%{name}/bin/||" \
82307f
    -e "s|\$GAP_DIR/bin/\$GAP_PRG|\$GAP_PRG|" \
82307f
    %{name}.shi > $RPM_BUILD_ROOT%{_bindir}/%{name}
82307f
chmod 0755 $RPM_BUILD_ROOT%{_bindir}/%{name}
82307f
82307f
# Install the desktop file
82307f
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
82307f
desktop-file-install --mode=644 --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
82307f
  %{SOURCE1}
82307f
f77890
# Install the X resource file
f77890
mkdir -p $RPM_BUILD_ROOT%{_datadir}/X11/app-defaults
f77890
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/X11/app-defaults
f77890
82307f
%posttrans -p %{_bindir}/update-gap-workspace
82307f
82307f
%post
82307f
update-desktop-database %{_datadir}/applications &>/dev/null ||:
82307f
82307f
%postun
82307f
%{_bindir}/update-gap-workspace
82307f
update-desktop-database %{_datadir}/applications &>/dev/null ||:
82307f
82307f
%files
82307f
%doc Changelog.*
82307f
%{_bindir}/%{name}*
82307f
%{_datadir}/applications/%{name}.desktop
f77890
%{_datadir}/X11/app-defaults/XGap
3a545f
%{_gap_dir}/pkg/%{name}
82307f
82307f
%changelog
f77890
* Wed May  9 2012 Jerry James <loganjerry@gmail.com> - 4.23-1
f77890
- New upstream release
f77890
- Fix bz 819705 issues:
f77890
- Fix xgap shell script
f77890
- Install X11 resource file
f77890
- Turn off autoloading, as that interferes with SAGE
f77890
3a545f
* Mon Apr 23 2012 Jerry James <loganjerry@gmail.com> - 4.22-1
3a545f
- New upstream release
72cca8
- Add gap-devel BR to get _gap_dir and _gap_arch_dir macros
3a545f
82307f
* Wed Mar 28 2012 Jerry James <loganjerry@gmail.com> - 4.21-3
82307f
- Fix binary permissions
82307f
82307f
* Fri Feb 17 2012 Jerry James <loganjerry@gmail.com> - 4.21-2
82307f
- Add desktop file
82307f
- Fix inconsistent macro use
82307f
82307f
* Mon Jan 23 2012 Jerry James <loganjerry@gmail.com> - 4.21-1
82307f
- Initial RPM