##
##  libmsgque.spec -- OpenPKG RPM Package Specification
##  Copyright (c) 2000-2025 OpenPKG Project <http://openpkg.org/>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  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.
##

#   package version
%define       V_nhi1      0.10
%define       V_libmsgque 4.8

#   package information
Name:         libmsgque
Summary:      Message Queuing Infrastructure Library
URL:          http://nhi1.berlios.de/
Vendor:       Andreas Otto
Packager:     OpenPKG Project
Distribution: OpenPKG Community
Class:        EVAL
Group:        Libraries
License:      GPL
Version:      %{V_libmsgque}
Release:      20101201

#   list of sources
Source0:      http://download.berlios.de/nhi1/NHI1-%{V_nhi1}.tar.gz
Patch0:       libmsgque.patch

#   build information
BuildPreReq:  OpenPKG, openpkg >= 20160101
PreReq:       OpenPKG, openpkg >= 20160101

%description
    The libmsgque project is an infrastructure for linking applications
    together to act like a single application. This is done using unix
    or inet domain sockets. The framework handles all aspects of setting
    up and maintaining the link.

%track
    prog libmsgque = {
        version   = %{V_nhi1}
        url       = http://developer.berlios.de/project/showfiles.php?group_id=11384
        regex     = NHI1-(__VER__)\.tar\.gz
    }

%prep
    %setup -q -n NHI1-%{V_nhi1}
    %patch -p0

%build
    ( echo "#!/bin/sh"
      echo "true"
    ) >tclConfig.sh
    chmod a+x tclConfig.sh
    CC="%{l_cc}" \
    CFLAGS="%{l_cflags -O}" \
    CPPFLAGS="%{l_cppflags}" \
    LDFLAGS="%{l_ldflags}" \
    ./configure \
        --prefix=%{l_prefix} \
        --mandir=%{l_prefix}/man \
        --with-tclcfg-path=`pwd` \
        --disable-shared
    ( cd theLink/libmsgque
      %{l_make} %{l_mflags -O}
    ) || exit $?

%install
    ( cd theLink/libmsgque
      %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
    ) || exit $?
    %{l_shtool} mkdir -f -p -m 755 \
        $RPM_BUILD_ROOT%{l_prefix}/man/man3
    %{l_shtool} install -c -m 644 \
        man/mann/msgque.h.n $RPM_BUILD_ROOT%{l_prefix}/man/man3/msgque.h.3
    %{l_shtool} install -c -m 644 \
        man/mann/libmsgqueref.n $RPM_BUILD_ROOT%{l_prefix}/man/man3/libmsgqueref.3
    %{l_shtool} install -c -m 644 \
        man/mann/libmsgquetut.n $RPM_BUILD_ROOT%{l_prefix}/man/man3/libmsgquetut.3
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}

%files -f files

%clean

