File Regina-REXX.spec of Package Regina-REXX
#
# spec file for package Regina-REXX
#
# Copyright (c) 2017 SUSE LINUX 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/
#
%define somajor 3
%define libname libregina%{somajor}
Name: Regina-REXX
Version: 3.9.1
Release: 0
Summary: Mark Hessling's implementation of the REXX Interpreter
License: GFDL-1.1 and LGPL-2.1+
Group: Development/Languages/Other
Url: http://regina-rexx.sourceforge.net/
Source: http://downloads.sourceforge.net/project/regina-rexx/regina-rexx/%{version}/Regina-REXX-%{version}.tar.gz
Source1: http://sourceforge.net/projects/regina-rexx/files/regina-documentation/%{version}/regina.pdf#/Regina-REXX-%{version}-doc.pdf
Source2: http://sourceforge.net/projects/regina-rexx/files/regina-documentation/%{version}/regutil.pdf#/Regina-REXX-regutil-%{version}-doc.pdf
Source3: rxstack.service
BuildRequires: distribution-release
BuildRequires: flex
BuildRequires: lsb-release
BuildRequires: ncurses-devel
BuildRequires: systemd-rpm-macros
Conflicts: ooRexx
Provides: rexx
%{?systemd_requires}
%description
Mark Hessling's implementation of the REXX language interpreter.
%package devel
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Provides: regina-devel = %{version}-%{release}
Provides: regina:%{_includedir}/rexxsaa.h
%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.
%package -n %{libname}
Summary: The regina shared library
Group: System/Libraries
%description -n %{libname}
This package provides the shared library for Mark Hessling's implementation
of the REXX Interpreter.
%package doc
Summary: Documentation for the Regina REXX interpreter
Group: Documentation/Other
%description doc
Documentation for both the Regina REXX interpreter and the REXX Utility
Functions (regutil).
%prep
%setup -q
%build
%configure \
--enable-posix-threads
# parallel build seems to randomly fail
make --jobs=1
%install
%make_install
# The supplied init script isn't sufficient for our needs.
rm -v %{buildroot}%{_sysconfdir}/rxstack
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/rxstack.service
cp %{SOURCE1} .
cp %{SOURCE2} .
# Do not ship statical library
rm -f %{buildroot}%{_libdir}/libregina.a
install -m 755 -d %{buildroot}/%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcrxstack
ln -s %{_mandir}/man1/regina.1.gz %{buildroot}/%{_mandir}/man1/rexx.1.gz
# Drop not needed examples/addons
rm -rf %{buildroot}%{_datadir}/Regina-REXX/addons
%pre
%service_add_pre rxstack.service
%post
%service_add_post rxstack.service
%preun
%service_del_preun rxstack.service
%postun
%service_del_postun rxstack.service
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_mandir}/man1/*
%doc COPYING-LIB README.*
%{_bindir}/regina
%{_bindir}/rexx
%{_bindir}/rxqueue
%{_bindir}/rxstack
%{_datadir}/Regina-REXX
%{_sbindir}/rcrxstack
%{_unitdir}/rxstack.service
%files doc
%defattr(-,root,root)
%doc Regina-REXX-%{version}-doc.pdf Regina-REXX-regutil-%{version}-doc.pdf
%files devel
%defattr(-,root,root)
%{_bindir}/regina-config
%{_includedir}/*
%{_libdir}/libregina.so
%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/libregina.so.*
%changelog