File libt3config.spec of Package libt3config

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

# norootforbuild
%define debug_package %{nil}
%if 0%{?suse_version}
%if 0%{?suse_version} < 1500
%define extra_args CFLAGS="-D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L"
%else
%define extra_args %{nil}
%endif
%else
%define extra_args %{nil}
%endif

Name:           libt3config
Version:        1.0.0
Release:        2
Summary:        A library for reading and writing configuration files
Group:          Development/Libraries/C and C++
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

License:        GPL-3.0-only
URL:            http://os.ghalkes.nl/t3/libt3config.html
Source0:        http://os.ghalkes.nl/dist/libt3config-1.0.0.tar.bz2

BuildRequires:  gcc-c++, libtool, gettext
%if 0%{?suse_version}
BuildRequires:  pkg-config
%endif
%if 0%{?fedora}%{?rhel_version}%{?centos_version}%{?mdkversion}%{?rhel}
BuildRequires:  pkgconfig
%endif


%description
The libt3config library provides functions for reading and writing simple
structured configuration files.

%package -n %{name}0
Summary:        A library for manipulating UTF-8 encoded text
Group:          Development/Libraries/C and C++

%description -n %{name}0
The libt3config library provides functions for reading and writing simple
structured configuration files.


%package        devel
Group:          Development/Libraries/C and C++
Summary:        Development files for %{name}
Requires:       %{name}0 = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%setup -q


%build
./configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}0 --dump-log %{extra_args}
make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot}
find %{buildroot} '(' -name '*.la' -o -name '*.a' ')' -exec rm -f {} ';'
install -d %{buildroot}/%{_docdir}/%{name}-dev
cp %{buildroot}/%{_docdir}/%{name}0/COPYING %{buildroot}/%{_docdir}/%{name}-dev/
%if 0%{?fedora}%{?rhel_version}%{?centos_version}%{?rhel}
find %{buildroot}/%{_libdir} -type f -name '*.so.*' | xargs chmod +x
%endif

%clean
rm -rf %{buildroot}


%post -n %{name}0 -p /sbin/ldconfig

%postun -n %{name}0 -p /sbin/ldconfig


%files -n %{name}0
%defattr(-, root, root, -)
%{_libdir}/*.so.*
%docdir %{_docdir}/%{name}0
%{_docdir}/%{name}0

%files devel
%defattr(-, root, root, -)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%docdir %{_docdir}/%{name}-dev
%{_docdir}/%{name}-dev
openSUSE Build Service is sponsored by