From a25935f612d83507ae3687d992ab07b9701a85d8 Mon Sep 17 00:00:00 2001 From: yuqing Date: Tue, 24 Jun 2014 14:35:33 +0800 Subject: [PATCH] add libfastcommon.spec for building RPM --- HISTORY | 3 +- libfastcommon.spec | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 libfastcommon.spec diff --git a/HISTORY b/HISTORY index 608b33f..febe9eb 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,5 @@ -Version 1.06 2014-06-18 +Version 1.06 2014-06-24 * update source code from FastDFS V5.02 * add function short2buff and buff2short * add object memory pool (fast_mblock.h and fast_mblock.c) @@ -11,6 +11,7 @@ Version 1.06 2014-06-18 * add connection pool * logger can log header line * #include to use C99 bool + * add libfastcommon.spec for building RPM Version 1.05 2012-07-08 * update source code from FastDFS V3.09 diff --git a/libfastcommon.spec b/libfastcommon.spec new file mode 100644 index 0000000..5b3d676 --- /dev/null +++ b/libfastcommon.spec @@ -0,0 +1,75 @@ +Name: libfastcommon +Version: 1.0.6 +Release: 1%{?dist} +Summary: c common functions library extracted from my open source projects FastDFS +License: GPL +Group: Arch/Tech +URL: http://github.com/happyfish100/libfastcommon/ +Source: http://github.com/happyfish100/libfastcommon/ + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +#Requires: /sbin/chkconfig +#Requires: sh-utils textutils grep fileutils /etc/cron.d +#BuildRequires: perl %{_includedir}/linux/if.h gettext +Requires: %__cp %__mv %__chmod %__grep %__mkdir %__install %__id + + + +%description +c common functions library extracted from my open source projects FastDFS. +this library is very simple and stable. functions including: string, logger, +chain, hash, socket, ini file reader, base64 encode / decode, +url encode / decode, fasttimer etc. + +%package devel +Summary: Development header file +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This pakcage provides the header files of libfastcommon + + +%prep +%setup -q + +%build +# FIXME: I need to fix the upstream Makefile to use LIBDIR et al. properly and +# send the upstream maintainer a patch. +# add DOCDIR to the configure part +./make.sh + +%install +rm -rf %{buildroot} +DESTDIR=$RPM_BUILD_ROOT ./make.sh install +#make install IGNORE_MAN_GROUP=y DOC_DIR=%{_docdir}/%{name}-%{version} INIT_DIR=%{_initrddir} + +#install -m 0644 sysstat.crond %{buildroot}/%{_sysconfdir}/cron.d/sysstat + +#%find_lang %{name} + +%post +ln -fs /usr/local/lib/libfastcommon.so.1 %{_libdir}/libfastcommon.so +/sbin/ldconfig + +%preun + +%postun +rm -f %{_libdir}/libfastcommon.so +/sbin/ldconfig + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +/usr/local/lib/libfastcommon.so* +#/usr/local/include/* +#%{_libdir}/libfastcommon.* +%files devel +%defattr(-,root,root,-) +/usr/local/include/* + +%changelog +* Mon Jun 23 2014 Zaixue Liao +- first RPM release (1.0)