Add manual and spec file for log4cpp. On CentOS 6 we should build it manually. Nice idea to add it to EPEL

This commit is contained in:
Pavel Odintsov 2015-03-24 19:42:11 +03:00
parent 42f77ed5de
commit b5b98d6ccc
2 changed files with 125 additions and 0 deletions

View File

@ -22,3 +22,19 @@ wget https://raw.githubusercontent.com/FastVPSEestiOu/fastnetmon/master/src/fast
# http://www.stableit.ru/2013/11/how-to-build-rpm-package-for-rhel5-on.html
rpmbuild -bb fastnetmon.spec
# For CentOS 7 we should build log4cpp library
# Prepare log4cpp spec file:
# yum install -y automake libtool
# cd /usr/src
# wget 'http://sourceforge.net/projects/log4cpp/files/latest/download?source=files' -O/usr/src/log4cpp-1.1.1.tar.gz
# tar -xf log4cpp-1.1.1.tar.gz
# cd log4cpp
# ./configure --prefix=/opt/log4cpp
# In current folder we will get log4cpp file log4cpp.spec
# But it's buggy and pelase get log4cpp.spec from FastNetMon repo
# Build log4cpp rpm package:
# wget 'http://sourceforge.net/projects/log4cpp/files/latest/download?source=files' -O/root/rpmbuild/SOURCES/log4cpp-1.1.1.tar.gz
# rpmbuild -bb log4cpp.spec

109
src/log4cpp.spec Normal file
View File

@ -0,0 +1,109 @@
%define RELEASE 4
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define lib_name log4cpp
%define manualdir /var/www/html/manual/%{name}
Name: log4cpp
# Fixed by Pavel Odintsov
Version: 1.1.1
Release: %rel
Summary: Log for C++
License: LGPL
Group: Development/Libraries
Vendor: Bastiaan Bakker <bastiaan.bakker@lifeline.nl>
Packager: Cedric Le Goater <cedric@legoater.com>
Url: http://log4cpp.sourceforge.net/
Source: ftp://download.sourceforge.net/pub/sourceforge/log4cpp/%name-%version.tar.gz
Prefix: %_prefix
BuildRoot: %_tmppath/%name-%version-root
%description
Log for C++ is a library of classes for flexible logging to files, syslog,
and other destinations. It is modeled after the Log for Java library and
stays as close to its API as is reasonable.
%package devel
Summary: development tools for Log for C++
Group: Development/Libraries
Requires: %name = %version
%description devel
The %name-devel package contains the static libraries and header files
needed for development with %name.
%package doc
Summary: HTML formatted API documention for Log for C++
Group: Development/Libraries
#can't set doc package to noarch without setting the others as well.
#BuildArch: noarch
%{!?_without_doxygenrpm:BuildRequires: doxygen}
%description doc
The %name-doc package contains HTML formatted API documention generated by
the popular doxygen documentation generation tool.
%prep
%{__rm} -rf $RPM_BUILD_ROOT
# Fixed by Pavel Odintsov
%setup -n log4cpp
# Doxygen disabled temporarly by Pavel Odintsov
CC=%{__cc} CXX=%{__cxx} ./configure --prefix=%{prefix} --enable-doxygen
%build
%{__make}
%install
%{__rm} -rf $RPM_BUILD_ROOT
# Space before docdir added by Pavel Odintsov
%{__make} prefix=$RPM_BUILD_ROOT%{prefix} docdir=$RPM_BUILD_ROOT/%{manualdir} install
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%ifnos solaris2.8 solaris2.9 solaris2.10
%post -p /sbin/ldconfig
%endif
%post devel
if test "x$RPM_INSTALL_PREFIX0" != "x" ; then
%{__perl} -pi -e"s|^libdir='[^\']*'|libdir='$RPM_INSTALL_PREFIX0/lib'|" $RPM_INSTALL_PREFIX0/lib/liblog4cpp.la
%{__perl} -pi -e"s|^prefix=\"[^\"]*\"|prefix=\"$RPM_INSTALL_PREFIX0\"|" $RPM_INSTALL_PREFIX0/bin/log4cpp-config
fi
%ifnos solaris2.8 solaris2.9 solaris2.10
%postun -p /sbin/ldconfig
%endif
%files
%defattr(-,root,root,755)
%attr(755,root,root) %prefix/lib/lib*.so.*
%doc AUTHORS COPYING INSTALL NEWS README THANKS ChangeLog
# Enable filtering of symlinks
#%filter_requires_in %prefix/lib/liblog4cpp.so
#%filter_setup
%files devel
%defattr(-,root,root,755)
%prefix/include/*
%prefix/share/man/*
%attr(755,root,root) %prefix/bin/log4cpp-config
# All * patterns replaced by Pavel Odintsov
# It's symlink
#%attr(755,root,root) %prefix/lib/liblog4cpp.so
%attr(755,root,root) %prefix/lib/liblog4cpp.so.5.0.6
%attr(644,root,root) %prefix/lib/liblog4cpp.a
%attr(644,root,root) %prefix/lib/liblog4cpp.la
%attr(644,root,root) %prefix/lib/pkgconfig/log4cpp.pc
%attr(644,root,root) %prefix/share/aclocal/*.m4
%files doc
%defattr(-,root,root)
%doc %{manualdir}