File ooRexx.spec of Package ooRexx
#
# spec file for package ooRexx
#
# Copyright (c) 2014 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/
#
%if 0%{?_unknownos}
%define _unknownos 0
%endif
# Red Hat
%if 0%{?_redhat}
# Currently RH does not define these like Fedora does, but they might in the future.
# So we define them using the contents of the release file.
%define build_distro rhel
%if %(if grep -q "release 5.5" /etc/redhat-release; then echo 1; else echo 0; fi;)
%define build_version 55
%endif
%if %(if grep -q "release 5.6" /etc/redhat-release; then echo 1; else echo 0; fi;)
%define build_version 56
%endif
%if %(if grep -q "release 6.0" /etc/redhat-release; then echo 1; else echo 0; fi;)
%define build_version 60
%endif
%if %(if grep -q "release 6.1" /etc/redhat-release; then echo 1; else echo 0; fi;)
%define build_version 61
%endif
%if %(if grep -q "release 6.2" /etc/redhat-release; then echo 1; else echo 0; fi;)
%define build_version 62
%endif
%define _osdistname %{build_distro}%{build_version}
%define _unknownos 0
%endif
# SuSE
%if 0%{?_suse}
%define build_distro %(grep -q "openSUSE" /etc/SuSE-release && echo opensuse || echo sles)
%define build_version %{suse_version}
%define _osdistname %{build_distro}%{build_version}
%define _unknownos 0
%endif
# This is the default
%if 0%{?_unknownos}
%define build_distro unknown
%define build_version 0
%define _osdistname %{build_distro}%{build_version}
%endif
#******************************************************************************
# The base spec tags
#******************************************************************************
Name: ooRexx
Prefix: /usr
Version: 4.1.3
Release: 0
Summary: Open Object Rexx
License: CPL-1.0
Group: Development/Languages/Other
Url: http://www.oorexx.org/
Source: %{name}-%{version}.tar.bz2
Source1: ooRexx-rpmlintrc
# If we don't include the following option we get bogus dependencies generated
AutoReq: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: dos2unix
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: pkgconfig
Patch0: fixes-rpmlint.patch
Patch1: set_default_rexx_path.patch
Patch2: update_init_script.patch
# Specify the libtool library version
# The order of these looks wrong, but that is how it comes out!
%define orx_libversion 4.0.5
%package devel
Summary: Open Object Rexx development files
Group: Development/Languages/Other
Requires: %{name}
Requires: glibc-devel
#******************************************************************************
%description
#******************************************************************************
Open Object Rexx is an object-oriented scripting language. The language
is designed for both beginners and experienced Rexx programmers. It is
easy to learn and use, and provides an excellent vehicle to enter the
world of object-oriented programming without much effort.
It extends the procedural way of Rexx programming with object-oriented
features that allow you to gradually change your programming style as
you learn more about objects.
For more information on ooRexx, visit http://www.oorexx.org/
For more information on Rexx, visit http://www.rexxla.org/
#******************************************************************************
%description devel
This package contains headers and files needed for developing extensions for
Open Object Rexx.
#******************************************************************************
%prep
#******************************************************************************
%setup -q
%patch0 -p0
%patch1 -p1
%patch2 -p1
%{?suse_update_config:%{suse_update_config -f}}
autoreconf -fvi
#******************************************************************************
%build
#******************************************************************************
# Fixes the "undefined reference to dlopen()" error
export SUSE_ASNEEDED=0
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
./configure --disable-static --prefix=%{_prefix}
make %{?_smp_mflags} libdir=%{_libdir} pkgdatadir=%{_datadir}/ooRexx
cat > rpmmacros.rexx << EOF
%_ooRexx $(echo %{version} | cut -d. -f1)
%_rexxclassdir %{_datadir}/ooRexx
%_rexxlibdir %{_libdir}/ooRexx
EOF
cat > %{name}.pc << EOF
prefix=%{_prefix}
exec_prefix=%{_prefix}
libdir=%{_libdir}
includedir=%{_includedir}
%{name}_binary_version=%{version}
%{name}_major=$(echo %{version} | cut -d. -f1)
%{name}_minor=$(echo %{version} | cut -d. -f2)
Name: %{name}
Description: Open Object Rexx
Version: %{version}
Libs: -L\${libdir}/ooRexx -lrexx -lrexxapi
Cflags: -I\${includedir}
EOF
#******************************************************************************
%install
#******************************************************************************
make DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir} mandir=%{_mandir} pkgdatadir=%{_datadir}/ooRexx install
# REXX system-wide RPM macros
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rpm
install -m 644 rpmmacros.rexx $RPM_BUILD_ROOT/%{_sysconfdir}/rpm/macros.rexx
# PKGconfig file
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
install -m 644 %{name}.pc $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/%{name}.pc
# Add links for some ooRexx scripts
cd $RPM_BUILD_ROOT/%{_bindir}
ln -sf %{_datadir}/ooRexx/rexxtry.rex .
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d
echo %{_libdir}/ooRexx > $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d/ooRexx.conf
chmod 0644 $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d/ooRexx.conf
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/init.d
cd $RPM_BUILD_ROOT/%{_sysconfdir}/init.d
ln -s %{_bindir}/rxapid .
# SUSE-style link for the init script
mkdir $RPM_BUILD_ROOT/sbin
cd $RPM_BUILD_ROOT/sbin
ln -s /%{_sysconfdir}/init.d/rxapid rcrxapid
# Fix EOL in classes if needed
for f in $RPM_BUILD_ROOT/%{_datadir}/ooRexx/*cls; do
dos2unix $f
done
#******************************************************************************
%clean
#******************************************************************************
rm -rf $RPM_BUILD_ROOT
#******************************************************************************
%files
#******************************************************************************
%defattr(-,root,root,-)
%doc
%dir %{_libdir}/ooRexx
%dir %{_datadir}/ooRexx
%config %{_sysconfdir}/ld.so.conf.d/ooRexx.conf
%config %{_sysconfdir}/rpm/macros.rexx
%{_sysconfdir}/init.d/rxapid
/sbin/rcrxapid
%{_bindir}/rexx
%{_bindir}/rexxc
%{_bindir}/rxapi
%{_bindir}/rxapid
%{_bindir}/rxqueue
%{_bindir}/rxsubcom
%{_bindir}/rexximage
%{_bindir}/rexx.img
%{_bindir}/rexx.cat
%{_bindir}/rexxtry.rex
%{_datadir}/ooRexx/rxregexp.cls
%{_datadir}/ooRexx/rxftp.cls
%{_datadir}/ooRexx/csvStream.cls
%{_datadir}/ooRexx/socket.cls
%{_datadir}/ooRexx/streamsocket.cls
%{_datadir}/ooRexx/mime.cls
%{_datadir}/ooRexx/smtp.cls
%{_libdir}/ooRexx/librexx.so
%{_libdir}/ooRexx/librexx.so.4
%{_libdir}/ooRexx/librexx.so.%{orx_libversion}
%{_libdir}/ooRexx/librexxapi.so
%{_libdir}/ooRexx/librexxapi.so.4
%{_libdir}/ooRexx/librexxapi.so.%{orx_libversion}
%{_libdir}/ooRexx/librxsock.so
%{_libdir}/ooRexx/librxsock.so.4
%{_libdir}/ooRexx/librxsock.so.%{orx_libversion}
%{_libdir}/ooRexx/librxmath.so
%{_libdir}/ooRexx/librxmath.so.4
%{_libdir}/ooRexx/librxmath.so.%{orx_libversion}
%{_libdir}/ooRexx/librxregexp.so
%{_libdir}/ooRexx/librxregexp.so.4
%{_libdir}/ooRexx/librxregexp.so.%{orx_libversion}
%{_libdir}/ooRexx/librexxutil.so
%{_libdir}/ooRexx/librexxutil.so.4
%{_libdir}/ooRexx/librexxutil.so.%{orx_libversion}
%{_libdir}/ooRexx/libhostemu.so
%{_libdir}/ooRexx/libhostemu.so.4
%{_libdir}/ooRexx/libhostemu.so.%{orx_libversion}
%{_libdir}/ooRexx/librxunixsys.so
%{_libdir}/ooRexx/librxunixsys.so.4
%{_libdir}/ooRexx/librxunixsys.so.%{orx_libversion}
%{_mandir}/man1/rexx.1.gz
%{_mandir}/man1/rexxc.1.gz
%{_mandir}/man1/rxsubcom.1.gz
%{_mandir}/man1/rxqueue.1.gz
%{_datadir}/ooRexx/rexx.sh
%{_datadir}/ooRexx/rexx.csh
%{_datadir}/ooRexx/*.rex
%{_datadir}/ooRexx/readme
#******************************************************************************
%files devel
%defattr(-,root,root,-)
%{_bindir}/oorexx-config
%{_mandir}/man1/oorexx-config.1.gz
%{_includedir}/rexx.h
%{_includedir}/rexxapidefs.h
%{_includedir}/rexxapitypes.h
%{_includedir}/rexxplatformapis.h
%{_includedir}/rexxplatformdefs.h
%{_includedir}/oorexxapi.h
%{_includedir}/oorexxerrors.h
%{_libdir}/ooRexx/librexx.la
%{_libdir}/ooRexx/librexxapi.la
%{_libdir}/ooRexx/librxsock.la
%{_libdir}/ooRexx/librxmath.la
%{_libdir}/ooRexx/librxregexp.la
%{_libdir}/ooRexx/librexxutil.la
%{_libdir}/ooRexx/libhostemu.la
%{_libdir}/ooRexx/librxunixsys.la
%{_libdir}/pkgconfig/%{name}.pc
%post
# Add the rxapi service
%fillup_and_insserv rxapid
ldconfig
exit 0
#******************************************************************************
%preun
#******************************************************************************
%postun
#******************************************************************************
%restart_on_update rxapid
%insserv_cleanup
#******************************************************************************
%changelog