Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r7692]: main / branches / 4.1 / trunk / platform / unix / oorexx.spec.in Maximize Restore History

Download this file

oorexx.spec.in    288 lines (262 with data), 11.0 kB

#*******************************************************************************
# Copyright (c) 1995, 2004 IBM Corporation. All rights reserved.
# Copyright (c) 2005-2010 Rexx Language Association. All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Common Public License v1.0 which accompanies this
# distribution. A copy is also available at the following address:
# http://www.oorexx.org/license.html
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the distribution.
#
# Neither the name of Rexx Language Association nor the names
# of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#******************************************************************************


#******************************************************************************
# Figure out the operating system and version
#******************************************************************************

%define _fedora %(if [ -f /etc/fedora-release ]; then echo 1; else echo 0; fi)
%define _redhat %(if [ -f /etc/redhat-release ]; then echo 1; else echo 0; fi)
%define _suse %(if [ -f /etc/SuSE-release ]; then echo 1; else echo 0; fi)
%define _unknownos 1

# Note: the order of these is very important!

# Fedora
%if 0%{?_fedora}
%define build_distro fedora
%define build_release %{fedora}
%define _osdistname %{build_distro}%{build_release}
%define _redhat 0
%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
%define _osdistname %{build_distro}%{build_version}
%endif


#******************************************************************************
# The base spec tags
#******************************************************************************

Name: ooRexx
Prefix: /usr
Version: @ORX_SUBST_MAJOR@.@ORX_SUBST_MINOR@.@ORX_SUBST_MOD_LVL@
Release: @SVN_REV@.%{_osdistname}
Summary: Open Object Rexx
Group: Development/Languages
License: CPL
URL: http://www.oorexx.org/
Source: %{name}-%{version}.tar.gz
# If we don't include the following option we get bogus dependencies generated
Autoreq: 0

# Specify the libtool library version
# The order of these looks wrong, but that is how it comes out!
%define orx_libversion @ORX_SUBST_CURRENT@.@ORX_SUBST_AGE@.@ORX_SUBST_REVISION@

#******************************************************************************
%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/

#******************************************************************************
%prep
#******************************************************************************
%setup -q

#******************************************************************************
%build
#******************************************************************************
./configure --disable-static --prefix=%{_prefix}
make %{?_smp_mflags} libdir=%{_libdir}

#******************************************************************************
%install
#******************************************************************************
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} mandir=%{_mandir} install

#******************************************************************************
%clean
#******************************************************************************
rm -rf $RPM_BUILD_ROOT

#******************************************************************************
%files
#******************************************************************************
%defattr(-,root,root,-)
%doc
%{_bindir}/rexx
%{_bindir}/rexxc
%{_bindir}/rxapi
%{_bindir}/rxapid
%{_bindir}/rxqueue
%{_bindir}/rxsubcom
%{_bindir}/rexximage
%{_bindir}/rexx.img
%{_bindir}/rexx.cat
%{_bindir}/rxregexp.cls
%{_bindir}/rxftp.cls
%{_bindir}/csvStream.cls
%{_bindir}/socket.cls
%{_bindir}/streamsocket.cls
%{_bindir}/mime.cls
%{_bindir}/smtp.cls
%{_bindir}/oorexx-config
%{_libdir}/ooRexx/librexx.so
%{_libdir}/ooRexx/librexx.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/librexx.so.%{orx_libversion}
%{_libdir}/ooRexx/librexx.la
%{_libdir}/ooRexx/librexxapi.so
%{_libdir}/ooRexx/librexxapi.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/librexxapi.so.%{orx_libversion}
%{_libdir}/ooRexx/librexxapi.la
%{_libdir}/ooRexx/librxsock.so
%{_libdir}/ooRexx/librxsock.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/librxsock.so.%{orx_libversion}
%{_libdir}/ooRexx/librxsock.la
%{_libdir}/ooRexx/librxmath.so
%{_libdir}/ooRexx/librxmath.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/librxmath.so.%{orx_libversion}
%{_libdir}/ooRexx/librxmath.la
%{_libdir}/ooRexx/librxregexp.so
%{_libdir}/ooRexx/librxregexp.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/librxregexp.so.%{orx_libversion}
%{_libdir}/ooRexx/librxregexp.la
%{_libdir}/ooRexx/librexxutil.so
%{_libdir}/ooRexx/librexxutil.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/librexxutil.so.%{orx_libversion}
%{_libdir}/ooRexx/librexxutil.la
%{_libdir}/ooRexx/libhostemu.so
%{_libdir}/ooRexx/libhostemu.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/libhostemu.so.%{orx_libversion}
%{_libdir}/ooRexx/libhostemu.la
%{_libdir}/ooRexx/librxunixsys.so
%{_libdir}/ooRexx/librxunixsys.so.@ORX_SUBST_CURRENT@
%{_libdir}/ooRexx/librxunixsys.so.%{orx_libversion}
%{_libdir}/ooRexx/librxunixsys.la
%{_includedir}/rexx.h
%{_includedir}/rexxapidefs.h
%{_includedir}/rexxapitypes.h
%{_includedir}/rexxplatformapis.h
%{_includedir}/rexxplatformdefs.h
%{_includedir}/oorexxapi.h
%{_includedir}/oorexxerrors.h
%{_mandir}/man1/oorexx-config.1.gz
%{_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

#******************************************************************************
%post
#******************************************************************************
ln -sf %{_libdir}/librexx.so %{_libdir}/librexx.so.2
ln -sf %{_libdir}/librexx.so %{_libdir}/librexx.so.3
ln -sf %{_libdir}/librexxapi.so %{_libdir}/librexxapi.so.2
ln -sf %{_libdir}/librexxapi.so %{_libdir}/librexxapi.so.3
ln -sf %{_libdir}/librxsock.so %{_libdir}/librxsock.so.2
ln -sf %{_libdir}/librxsock.so %{_libdir}/librxsock.so.3
ln -sf %{_libdir}/librxmath.so %{_libdir}/librxmath.so.2
ln -sf %{_libdir}/librxmath.so %{_libdir}/librxmath.so.3
ln -sf %{_libdir}/librxregexp.so %{_libdir}/librxregexp.so.2
ln -sf %{_libdir}/librxregexp.so %{_libdir}/librxregexp.so.3
ln -sf %{_libdir}/librexxutil.so %{_libdir}/librexxutil.so.2
ln -sf %{_libdir}/librexxutil.so %{_libdir}/librexxutil.so.3
ln -sf %{_libdir}/libhostemu.so %{_libdir}/libhostemu.so.2
ln -sf %{_libdir}/libhostemu.so %{_libdir}/libhostemu.so.3
ln -sf %{_libdir}/librxunixsys.so %{_libdir}/librxunixsys.so.2
ln -sf %{_libdir}/librxunixsys.so %{_libdir}/librxunixsys.so.3
# Add links for some ooRexx scripts
ln -sf %{_datadir}/ooRexx/rexxtry.rex %{_bindir}/rexxtry.rex
# Add the rxapi service
ln -sf %{_bindir}/rxapid /etc/init.d/rxapid
if [ -x /sbin/insserv ]; then
   # try insserv first (for Suse)
   insserv -f rxapid
else
   # else, try good old chkconfig
   chkconfig --add rxapid
fi
echo %{_libdir}/ooRexx > /etc/ld.so.conf.d/ooRexx.conf
ldconfig
service rxapid start

#******************************************************************************
%preun
#******************************************************************************
# Remove rxapi service
service rxapid stop
if [ -x /sbin/insserv ]; then
   # try insserv first (for Suse)
   insserv -f rxapid
else
   # else, try good old chkconfig
   chkconfig --del rxapid
fi
# Remove links
rm -f /etc/init.d/rxapid
rm -f %{_bindir}/rexxtry.rex
rm -f %{_libdir}/librexxapi.*
rm -f %{_libdir}/librexx.*

#******************************************************************************
%postun
#******************************************************************************
rm -f /etc/ld.so.conf.d/ooRexx.conf
ldconfig

#******************************************************************************
%changelog
#******************************************************************************