File swipl.spec of Package swipl

#
# spec file for package swipl
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           swipl
BuildRequires:  fdupes
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  gmp-devel
BuildRequires:  java-devel >= 1.6.0
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  mysql-devel
BuildRequires:  openssl-devel
BuildRequires:  postgresql-devel
BuildRequires:  readline-devel
BuildRequires:  texlive
BuildRequires:  texlive-latex
BuildRequires:  unixODBC-devel
BuildRequires:  xorg-x11
BuildRequires:  xorg-x11-Xvfb
BuildRequires:  xorg-x11-devel
Version:        5.10.2
Release:        0
Summary:        Prolog Compiler
License:        GPL-2.0+ and LGPL-2.1+
Group:          Development/Languages/Other
Source:         pl-%{version}.tar.bz2
Source1:        refman.pdf
Patch0:         pl.patch
Patch1:         pkgconfig.patch
# This is now upstream
Patch2:         internal_fix.patch
Patch3:         swipl-ppc64.patch
Url:            http://www.swi-prolog.org
Provides:       swi-prolog = %{version}
Provides:       swi_pl = %{version}
Obsoletes:      swi-prolog < %{version}
Obsoletes:      swi_pl < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Edinburgh-style Prolog compiler including modules, autoload, libraries,
Garbage collector, stack expandor, C interface, GNU readline and GNU
Emacs interface, a very fast compiler,and an X11 interface using XPCE
(see http://www.swi.psy.uva.nl/projects/xpce).



Authors:
--------
    Jan Wielemaker <jan@swi.psy.uva.nl>


%prep
%setup -q -n pl-%{version}
%patch0 -p 1
%patch1 -p 1
%patch2 -p 1
%patch3 -p 1

%build
cp build.templ build

export COFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"

./build --prefix=%{_prefix} --config --libdir=%{_libdir} --enable-shared
./build --prefix=%{_prefix} --make %{?jobs:-j %{jobs}}

unset COFLAGS

%install

DESTDIR=$RPM_BUILD_ROOT ./build --prefix=%{_prefix} --install

# Add another symlink
cd $RPM_BUILD_ROOT/%{_prefix}/bin
ln -s ../%{_lib}/%{name}-%{version}/bin/*/swipl pl

# Add a link to the documentation in docdir.
mkdir -p $RPM_BUILD_ROOT/%{_docdir}
cd $RPM_BUILD_ROOT/%{_docdir}
ln -s %{_libdir}/%{name}-%{version}/doc swipl

chmod -x $RPM_BUILD_ROOT/%{_libdir}/%{name}-%{version}/doc/packages/examples/pldoc/man_server.pl

%fdupes $RPM_BUILD_ROOT/%{_libdir}/%{name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_prefix}/bin/pl
%{_prefix}/bin/swipl
%{_prefix}/bin/swipl-ld
%{_prefix}/bin/swipl-rc
%{_prefix}/bin/xpce-client
%{_libdir}/%{name}-%{version}
%{_libdir}/pkgconfig/%{name}.pc
%{_docdir}/%{name}
%{_mandir}/man1/swipl-ld.1.gz
%{_mandir}/man1/swipl-rc.1.gz
%{_mandir}/man1/swipl.1.gz

%changelog
openSUSE Build Service is sponsored by