File libmm14.spec of Package libmm14

# spec file for package libmm14
# Copyright (c) 2015 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

%define pkg_name mm
# note that the maximum size that 2.4 kernel allows is 32 MB by default
# (that's low, but it's runtime configurable).
# but then again, php typically allocates the maximum size possible
# each time it is started, so we don't necessarily want to increase this
# and definitely it must not be higher than /proc/sys/kernel/shmmax because
# mm_create will fail if a larger size is requested.
# mm is not runtime configurable wrt max segment size. Thus we need to
# choose a reasonably low value for all those machines out there.
# Ideally this would be runtime configurable; and in addition php should
# possibly only mm_create a reasonable sized segment and mm_realloc it
# later if need be.
# limit the shared memory maximum segment size to this many MB
%define mm_segment_limit 32
Name:           libmm14
Version:        1.4.2
Release:        0
Summary:        Shared Memory Library
License:        MIT
Group:          System/Libraries
#Repackaged from:
Source:         %{pkg_name}-%{version}.tar.bz2
Patch0:         segment_size.diff
BuildRequires:  libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The MM library is a 2-layer abstraction library that simplifies the
usage of shared memory between forked (and this way strongly related)
processes under Unix platforms. On the first layer, it hides all
platform-dependent implementation details (allocation and locking) when
dealing with shared memory segments and on the second layer it provides
a high-level malloc(3)-style API for a convenient and well-known way to
work with data structures inside those shared memory segments.

%package -n libmm-devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}
Provides:       %{name}-devel = %{version}-%{release}

%description -n libmm-devel
Libraries and Includes for %{name}

%setup -q -n %{pkg_name}-%{version}

%configure \
    --with-shm=IPCSHM \
make %{?_smp_mflags} LIBTOOL=%{_bindir}/libtool

%ifnarch %arm
make %{?_smp_mflags} test

make DESTDIR=%{buildroot} install %{?_smp_mflags} LIBTOOL=%{_bindir}/libtool
rm %{buildroot}/%{_libdir}/libmm.{,l}a

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files -n libmm-devel