LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File libapr1.spec of Package libapr1 (Project openSUSE:Factory)

#
# spec file for package libapr1
#
# Copyright (c) 2012 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/
#


Name:           libapr1
BuildRequires:  libtool
BuildRequires:  libuuid-devel
BuildRequires:  lksctp-tools-devel
BuildRequires:  python
%if %{?suse_version:1}0
BuildRequires:  doxygen
# for the test suite
BuildRequires:  netcfg
%endif
%if %{?suse_version:1}0 && 0%{?sles_version} != 9
BuildRequires:  pkg-config
%endif
Url:            http://apr.apache.org/
# bug437293
%ifarch ppc64
Obsoletes:      libapr1-64bit
%endif
%ifarch  %ix86 ppc
Obsoletes:      libapr1-32bit
%endif
#
Version:        1.4.6
Release:        0
Summary:        Apache Portable Runtime (APR) Library
License:        Apache-2.0
Group:          Development/Libraries/Other
Source:         http://www.apache.org/dist/apr/apr-%{version}.tar.bz2
Source2:        baselibs.conf
Patch1:         string-compare.diff
Patch3:         apr-1.3.0-testshm-apr_shm_remove.patch
Patch4:         apr-1.4.5-linux3.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define aprver 1
%define installbuilddir %{_libdir}/apr-%{aprver}/build
%define includedir %{_includedir}/apr-%{aprver}

%description
The mission of the Apache Portable Runtime (APR) project is to create
and maintain software libraries that provide a predictable and
consistent interface to underlying platform-specific implementations.
The primary goal is to provide an API to which software developers may
code and be assured of predictable if not identical behaviour
regardless of the platform on which their software is built, relieving
them of the need to code special-case conditions to work around or take
advantage of platform-specific deficiencies or features.

The APR is used by both Open Source and Commercial projects, prominent
examples being the Apache HTTP server.

%package devel
Summary:        Apache Portable Runtime (APR) Library
Group:          Development/Libraries/Other
Requires:       glibc-devel
Requires:       libapr1 = %{version}
# bug437293
%ifarch ppc64
Obsoletes:      libapr1-devel-64bit
%endif
%ifarch  %ix86 ppc
Obsoletes:      libapr1-devel-32bit
%endif
#

%description devel
The mission of the Apache Portable Runtime (APR) project is to create
and maintain software libraries that provide a predictable and
consistent interface to underlying platform-specific implementations.
The primary goal is to provide an API to which software developers may
code and be assured of predictable if not identical behaviour
regardless of the platform on which their software is built, relieving
them of the need to code special-case conditions to work around or take
advantage of platform-specific deficiencies or features.

The APR is used by both Open Source and Commercial projects, prominent
examples being the Apache HTTP server.

%prep
%setup -q -n apr-%{version}
%patch1
%patch3 -p1
%patch4
#
# workaround for ugly bug 400488
# Xen kernel on sles9 x86_64 is set up to behave different than all other kernels
# skip sockets test on that platform
ls -l /lib/modules/ ||:
%if 0%{?sles_version} == 9
%ifarch x86_64
sed -i '/testsockets/ d' test/abts_tests.h
#sed -i '/testatomic/ d' test/abts_tests.h
%endif
%endif
#
# this test fails on sles9-x86_64, not only in Xen though.
# disable it for a moment to get packages for testing at least...
%if 0%{?sles_version} == 9
%ifarch x86_64
sed -i '/testatomic/ d' test/abts_tests.h
%endif
%endif
#
# this test also fails on sles10, both 32 and 64 bit. But only in the OBS.
# Run manually, it works. Must be either Xen- or ulimit-related. (It doesn't
# seem to be possible to increase ulimit -v in the OBS, unfortunately.)
%if 0%{?sles_version} == 10 || %{?centos_version:1}0
sed -i '/testatomic/ d' test/abts_tests.h
%endif
#
# the following test currently is broken on hppa:
%ifarch hppa
sed -i '/testatomic/ d' test/abts_tests.h
%endif

%build
export CFLAGS="$RPM_OPT_FLAGS -fPIC"
#
#rm -rf aclocal.m4 autom4te*.cache
#autoheader
#%if %{?suse_version:1}0 && 0%{?sles_version} != 9 && 0%{?sles_version} != 10
#autoconf
#%endif
#
# --enable-pool-debug[=yes|no|verbose|verbose-alloc|lifetime|owner|all]
./buildconf
export ac_cv_search_shm_open=no

%configure --enable-other-child \
	--with-installbuilddir=%{installbuilddir} \
	--includedir=%{includedir} \
%if %{?build_with_memory_pool_debug:1}0
	--enable-debug --enable-pool-debug=verbose \
%endif
%ifarch %ix86
	--enable-nonportable-atomics=yes \
%endif
    --enable-allocator-uses-mmap \
    --with-devrandom=/dev/urandom \
    --disable-static \
    --with-pic 
%{__make} %{?jobs:-j%jobs}
%if %{?suse_version:1}0
make dox
%endif

%install
make install DESTDIR=$RPM_BUILD_ROOT
%if %{?suse_version:1}0
# Move docs to more convenient location
mv docs/dox/html html
%endif
# Unpackaged files:
%{__rm} -f $RPM_BUILD_ROOT/%{_libdir}/apr.exp
%{__rm} -f %{buildroot}%{_libdir}/libapr-%{aprver}.la

# Trim exported dependecies
sed -ri '/^LIBS=/{s,-l(uuid|crypt) ,,g;s/  */ /g}' \
      $RPM_BUILD_ROOT%{_bindir}/apr-%{aprver}-config
sed -ri '/^Libs/{s,-l(uuid|crypt) ,,g}' \
      $RPM_BUILD_ROOT%{_libdir}/pkgconfig/apr-%{aprver}.pc

%check
%ifnarch %arm
make check
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc CHANGES
%doc LICENSE
%doc NOTICE
%{_libdir}/libapr-%{aprver}.so.*

%files devel
%defattr(-,root,root)
%doc docs/APRDesign.html
%doc docs/canonical_filenames.html
%doc docs/incomplete_types
%doc docs/non_apr_programs
%if %{?suse_version:1}0
%doc --parents html
%endif
%doc emacs-mode
%{includedir}
%{_libdir}/libapr-%{aprver}.so
%{_bindir}/apr-%{aprver}-config
%{_libdir}/pkgconfig/apr-%{aprver}.pc
%{_libdir}/apr-%{aprver}

%changelog