File libtaobao.spec of Package libtaobao

# spec file for package libtaobao (Version 0.1.1)
# the orginal project name called tb-common-utils
#
# 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

Name:		libtaobao
Version:	0.1
Release:	1
Summary:	Taobao system and network library
Group:		System/Libraries
URL:		http://yum.corp.alimama.com
#Packager: AvengerMoJo<avengermojo@gmail.com>
License:	GPL
Vendor:		TaoBao
Prefix:		%{_prefix}
Source:		%{name}-%{version}.tar.bz2
Patch0:		build_service_linking.patch
Patch1:		dos2unix_control_m.patch
BuildRoot:	%{_tmppath}/%{name}-root
Requires:	libtbnet libtbsys
BuildRequires:	pkgconfig gcc-c++ automake autoconf libtool glibc-devel
#Requires: 

%description
Taobao system library for their internal applications.

%package -n libtbsys0
Summary:	Taobao system library
Group:		System/Libraries
Provides:	libtbsys

%package -n libtbsys0-devel
Summary:	Taobao system library development package
Group:		Development/Libraries/C and C++
Requires:	libtbsys

%description -n libtbsys0
Taobao system library for their internal applications.

%description -n libtbsys0-devel
Taobao system library development package for their internal applications.

%package -n libtbnet0 
Summary:	Taobao network library
Group:		System/Libraries
Requires:	libtbsys
Provides:	libtbnet

%package -n libtbnet0-devel
Summary:	Taobao network library development package
Group:		Development/Libraries/C and C++
Requires:	libtbnet

%description -n libtbnet0
Taobao network library for their internal applications.

%description -n libtbnet0-devel
Taobao network library development package for their internal applications.

%prep
%setup -n %name-%version
%patch0 -p1 
%patch1 -p1 

%build
export TBLIB_ROOT=/usr

cd tbsys-0.1
#CPPFLAGS="-Isrc/"
libtoolize --force
aclocal
autoconf
automake --add-missing --force
%configure 
make

cd ../tbnet-0.1
libtoolize --force
aclocal
autoconf
automake --add-missing --force
%configure 
make

%install
rm -rf $RPM_BUILD_ROOT
cd tbsys-0.1
make DESTDIR=$RPM_BUILD_ROOT install
cd ../tbnet-0.1
make DESTDIR=$RPM_BUILD_ROOT install
rm $RPM_BUILD_ROOT/%{_libdir}/*.la
rm $RPM_BUILD_ROOT/%{_libdir}/*.a

%clean
rm -rf $RPM_BUILD_ROOT

%files -n libtbsys0
%defattr(-, root, root)
%{_libdir}/libtbsys.so.0
%{_libdir}/libtbsys.so.0.0.0

%files -n libtbsys0-devel
%defattr(-, root, root)
%dir %{_includedir}/tbsys/
%{_libdir}/libtbsys.so
#%{_libdir}/libtbsys.a
%{_includedir}/tbsys/*

%files -n libtbnet0
%defattr(-, root, root)
%{_libdir}/libtbnet.so.0
%{_libdir}/libtbnet.so.0.0.0

%files -n libtbnet0-devel
%defattr(-, root, root)
%dir %{_includedir}/tbnet/
%{_includedir}/tbnet/*
%{_libdir}/libtbnet.so

%post -n libtbsys0
ldconfig

%postun -n libtbsys0
ldconfig

%post -n libtbnet0
ldconfig

%postun -n libtbnet0
ldconfig
openSUSE Build Service is sponsored by