Steps:
- Have a CentOS 5.2 development system created with gcc which will be required to build the rpm
- Download the memcached tarball and copy it to /usr/src/redhat/SOURCES/
- Create a rpmbuild spec file as below. Call it memcached.spec.
- Run the command "rpmbuild -ba memcached.spec" on it. This command will build three rpm files - for the binary, for sources and one with debuginfo.
- Copy the rpms from /usr/src/redhat/RPMS/ and /usr/src/redhat/SRPMS/. These can now be distributed to the production systems and installed.
Summary: Memcached Server
Name: memcached
Version: 1.2.6
Release: 1
Source0: %{name}-%{version}.tar.gz
License: BSD
Group: Applications/Databases
BuildRoot: %{_builddir}/%{name}-root
%description
memcached is a high-performance, distributed memory object caching system.
%prep
%setup -q
%build
./configure
make
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/local/bin/memcached
/usr/local/bin/memcached-debug
/usr/local/share/man/man1/memcached.1
%doc COPYING AUTHORS README NEWS
One hurdle I faced with rpmbuild was that it was introducing a dependency for a version of libevent that was seemingly not present on our systems. It was inserting a dependency to libevent 1.3 whereas if I do a "rpm -qa" it showed only libevent 1.1. Eventually a ldd of the memcached binary showed that it was linked to libevent in /usr/local/lib which was of version 1.3. It must have been installed manually and not through rpms.
No comments:
Post a Comment