diff --git a/examples/haproxy.spec b/examples/haproxy.spec index 956334ee2..d6d0c8400 100644 --- a/examples/haproxy.spec +++ b/examples/haproxy.spec @@ -4,13 +4,9 @@ Version: 1.2.9 Release: 1 License: GPL Group: System Environment/Daemons -URL: http://w.ods.org/tools/haproxy/ - -Source0: http://w.ods.org/tools/haproxy/haproxy-%{version}.tar.gz -Source1: haproxy.cfg -Source2: haproxy.init -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root - +URL: http://w.ods.org/tools/%{name}/ +Source0: http://w.ods.org/tools/%{name}/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: pcre-devel Requires: /sbin/chkconfig, /sbin/service @@ -31,48 +27,71 @@ handle thousands of simultaneous connections on hundreds of instances without risking the system's stability. %prep -%setup +%setup -q %build %{__make} REGEX="pcre" "COPTS.pcre=-DUSE_PCRE $(pcre-config --cflags)" DEBUG="" TARGET=linux24e +#%{__make} REGEX=pcre DEBUG="" LIBS.pcre="-L\$(PCREDIR)/lib -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynamic" + %install -%{__rm} -rf %{buildroot} +[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} -%{__install} -d -m0755 %{buildroot}%{_datadir}/haproxy/ +%{__install} -d %{buildroot}%{_sbindir} +%{__install} -d %{buildroot}%{_sysconfdir}/rc.d/init.d +%{__install} -d %{buildroot}%{_sysconfdir}/%{name} -%{__install} -D -m0755 haproxy %{buildroot}%{_sbindir}/haproxy -%{__install} -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/haproxy/haproxy.cfg -%{__install} -D -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/haproxy +%{__install} -s %{name} %{buildroot}%{_sbindir}/ +%{__install} -c -m 644 examples/%{name}.cfg %{buildroot}%{_sysconfdir}/%{name}/ +%{__install} -c -m 755 examples/%{name}.init %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name} %clean -%{__rm} -rf %{buildroot} +[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} %post -/sbin/chkconfig --add haproxy +/sbin/chkconfig --add %{name} %preun -if [ $1 -eq 0 ]; then - /sbin/service haproxy stop &>/dev/null || : - /sbin/chkconfig --del haproxy +if [ $1 = 0 ]; then + /sbin/service %{name} stop >/dev/null 2>&1 || : + /sbin/chkconfig --del %{name} fi %postun -if [ $1 -ge 1 ]; then - /sbin/service haproxy condrestart &>/dev/null || : +if [ "$1" -ge "1" ]; then + /sbin/service %{name} condrestart >/dev/null 2>&1 || : fi %files -%defattr(-, root, root, 0755) -%doc CHANGELOG README TODO doc/* examples/ -%config(noreplace) %{_sysconfdir}/haproxy/ -%config %{_initrddir}/haproxy -%{_sbindir}/haproxy -%dir %{_datadir}/haproxy/ +%defattr(-,root,root) +%doc CHANGELOG TODO examples doc/haproxy-en.txt doc/haproxy-fr.txt doc/architecture.txt +%attr(0755,root,root) %{_sbindir}/%{name} +%dir %{_sysconfdir}/%{name} +%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.cfg +%attr(0755,root,root) %config %{_sysconfdir}/rc.d/init.d/%{name} %changelog -* Wed Mar 15 2006 Willy Tarreau - 1.2.9-1 -- ported to 1.2.9. +* Wed Mar 15 2006 Willy Tarreau +- updated to 1.2.9 -* Tue Feb 07 2006 Dag Wieers - 1.1.34-1 -- Initial package. (using DAR) +* Sat Jan 22 2005 Willy Tarreau +- updated to 1.2.3 (1.1.30) + +* Sun Nov 14 2004 Willy Tarreau +- updated to 1.1.29 +- fixed path to config and init files +- statically linked PCRE to increase portability to non-pcre systems + +* Sun Jun 6 2004 Willy Tarreau +- updated to 1.1.28 +- added config check support to the init script + +* Tue Oct 28 2003 Simon Matter +- updated to 1.1.27 +- added pid support to the init script + +* Wed Oct 22 2003 Simon Matter +- updated to 1.1.26 + +* Thu Oct 16 2003 Simon Matter +- initial build