標籤:rpmbulid學習redis打包
線上redis製作rpm包的過程:
# Check for status of man pages# http://code.google.com/p/redis/issues/detail?id=202Name:             redisVersion:          2.8.17Release:          3%{?dist}Summary:          A persistent key-value databaseGroup:            Applications/DatabasesLicense:          BSDURL:              http://redis.ioSource0:          %{name}-%{version}.tar.gz#source1 為redis的開機檔案#source2 為redis的設定檔Source1:          redisSource2:          redis.conf_2.8BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)BuildRequires:    tcl >= 8.5ExcludeArch:      ppc64#Requires:         logrotateRequires(post):   chkconfigRequires(postun): initscriptsRequires(pre):    shadow-utilsRequires(preun):  chkconfigRequires(preun):  initscripts%descriptionRedis is an advanced key-value store. It is similar to memcached but the dataset is not volatile, and values can be strings, exactly like in memcached, butalso lists, sets, and ordered sets. All this data types can be manipulated withatomic operations to push/pop elements, add/remove elements, perform server sideunion, intersection, difference between sets, and so forth. Redis supportsdifferent kind of sorting abilities.%prep%setup -q%buildmake %{?_smp_mflags}   DEBUG=‘‘   CFLAGS=‘%{optflags}‘   V=1   all#%check#make test%installrm -fr %{buildroot}make install PREFIX=%{buildroot}%{_prefix}# Install misc other#install -p -D -m 644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.confinstall -p -D -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/%{name}install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}.confinstall -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}install -d -m 755 %{buildroot}%{_localstatedir}/log/%{name}install -d -m 755 %{buildroot}%{_localstatedir}/run/%{name}#install -d -m 755 %{buildroot}%{_localstatedir}/run/%{name}# Fix non-standard-executable-perm errorchmod 755 %{buildroot}%{_bindir}/%{name}-*# Ensure redis-server location doesn‘t changemkdir -p %{buildroot}%{_sbindir}mv %{buildroot}%{_bindir}/%{name}-server %{buildroot}%{_sbindir}/%{name}-server%cleanrm -fr %{buildroot}%post/sbin/chkconfig --add redis%pregetent group redis &> /dev/null || groupadd -r redis &> /dev/nullgetent passwd redis &> /dev/null || useradd -r -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c ‘Redis Server‘ redis &> /dev/nullexit 0%preunif [ $1 = 0 ]; then  /sbin/service redis stop &> /dev/null  /sbin/chkconfig --del redis &> /dev/nullfi%files%defattr(-,root,root,-)%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING README#%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}%config(noreplace) %{_sysconfdir}/%{name}.conf%config(noreplace) %{_sysconfdir}/init.d/%{name}%dir %attr(0755, redis, root) %{_localstatedir}/lib/%{name}%dir %attr(0755, redis, root) %{_localstatedir}/log/%{name}%dir %attr(0755, redis, root) %{_localstatedir}/run/%{name}%{_bindir}/%{name}-*%{_sbindir}/%{name}-*#%{_initrddir}/%{name}%changelog* Sat Mar 31 2014 yanliang wang <[email protected]> - 2.8.17-1- Update to redis 2.8.17
rpmbulid學習redis打包