libplist/libplist.spec

197 lines
5.7 KiB
RPMSpec

#
# spec file for package libplist
#
# Copyright (c) 2013 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: libplist
Version: 1.8
Release: 0
Summary: Library for handling Apple Binary and XML Property Lists
License: LGPL-2.1+
Group: System/Libraries
Url: http://cgit.sukimashita.com/libplist.git
Source: http://cgit.sukimashita.com/libplist.git/snapshot/%{name}-%{version}.tar.bz2
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libxml2-devel
BuildRequires: pkg-config
%if %{?suse_version} > 1140
BuildRequires: python-cython
BuildRequires: python-devel
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#remove when pkgconfig is fixed to handle Requires.private correctly
Patch0: libplist-1.8-pkgconfig.patch
%description
libplist is a library for handling Apple Binary and XML Property Lists.
%package -n libplist1
Summary: Library for handling Apple Binary and XML Property Lists
Group: System/Libraries
Provides: libplist = %{version}
Obsoletes: libplist < %{version}
%description -n libplist1
libplist is a library for handling Apple Binary and XML Property Lists.
%package -n libplist++1
Summary: Library for handling Apple Binary and XML Property Lists
Group: System/Libraries
Provides: libplist++ = %{version}
Obsoletes: libplist++ < %{version}
%description -n libplist++1
libplist is a library for handling Apple Binary and XML Property Lists.
%package -n plutil
Summary: Library for handling Apple Binary and XML Property Lists
Group: System/Libraries
Requires: libplist1 = %{version}
%description -n plutil
libplist is a library for handling Apple Binary and XML Property Lists.
This package contains an utility to convert PList files from binary to XML and
from XML to binary.
%package devel
Summary: Library for handling Apple Binary and XML Property Lists -- Development Files
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libplist1 = %{version}
%description devel
libplist is a library for handling Apple Binary and XML Property Lists.
This package contains the development files for C.
%package -n libplist++-devel
Summary: Library for handling Apple Binary and XML Property Lists -- Development Files
Group: Development/Libraries/C and C++
Requires: libplist++1 = %{version}
Requires: libplist-devel
Requires: libstdc++-devel
%description -n libplist++-devel
libplist is a library for handling Apple Binary and XML Property Lists.
This package contains the development files for C++.
%if %{?suse_version} > 1140
%package -n python-plist
Summary: Library for handling Apple Binary and XML Property Lists -- Python Bindings
Group: Development/Languages/Python
Requires: libplist1 = %{version}
Requires: python-cython >= 0.13
%{py_requires}
%description -n python-plist
libplist is a library for handling Apple Binary and XML Property Lists.
This package contains the python bindings.
%endif
%prep
%setup -q
%patch0
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure || true
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR=%{_lib} \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DPYTHON_VERSION=%{py_ver} \
-DPYTHON_SITEDIR=%{py_sitedir} \
-DCMAKE_FIND_ROOT_PATH=/%{?_sysroot} \
-DPYTHON_LIBRARY=%_libdir/python%{py_ver} \
-DENABLE_SWIG=OFF \
-DPYTHON_INCLUDE_DIR=%{?_sysroot}/usr/include/python \
.
# Workaround in order to make parallel build pass
cd libcnary
make %{?_smp_mflags}
cd ..
make %{?_smp_mflags}
%install
%makeinstall
rm %{buildroot}%{_bindir}/plutil
mv %{buildroot}%{_bindir}/plutil-%{version} %{buildroot}%{_bindir}/plutil
%if 0%{?_crossbuild}
cp -a %{buildroot}%{?_sysroot}/* %{buildroot}/
rm -fr %{buildroot}%{?_sysroot}
%endif
%post -n libplist1 -p /sbin/ldconfig
%postun -n libplist1 -p /sbin/ldconfig
%post -n libplist++1 -p /sbin/ldconfig
%postun -n libplist++1 -p /sbin/ldconfig
%files -n libplist1
%defattr(-,root,root)
%doc AUTHORS COPYING.LESSER README NEWS
%{_libdir}/libplist.so.*
%files -n libplist++1
%defattr(-,root,root)
%doc AUTHORS COPYING.LESSER README NEWS
%{_libdir}/libplist++.so.*
%files -n plutil
%defattr(-,root,root)
%{_bindir}/plutil
%files devel
%defattr(-,root,root,-)
%dir %{_includedir}/plist
%{_includedir}/plist/plist.h
%{_libdir}/libplist.so
%{_libdir}/pkgconfig/libplist.pc
%files -n libplist++-devel
%defattr(-,root,root,-)
%dir %{_includedir}/plist
%{_includedir}/plist/plist++.h
%{_includedir}/plist/Array.h
%{_includedir}/plist/Boolean.h
%{_includedir}/plist/Data.h
%{_includedir}/plist/Date.h
%{_includedir}/plist/Dictionary.h
%{_includedir}/plist/Integer.h
%{_includedir}/plist/Node.h
%{_includedir}/plist/Real.h
%{_includedir}/plist/String.h
%{_includedir}/plist/Structure.h
%{_libdir}/libplist++.so
%{_libdir}/pkgconfig/libplist++.pc
%if %{?suse_version} > 1140
%files -n python-plist
%defattr(-,root,root,-)
%{py_sitedir}/plist.so
%dir %{_includedir}/plist
%dir %{_includedir}/plist/cython
%{_includedir}/plist/cython/plist.pxd
%endif
%changelog