SPECS: haproxy.spec - add some default config - run as haproxy use...
glen
glen at pld-linux.org
Tue Jul 17 18:53:26 CEST 2007
Author: glen Date: Tue Jul 17 16:53:26 2007 GMT
Module: SPECS Tag: HEAD
---- Log message:
- add some default config
- run as haproxy user
- rel 2
---- Files affected:
SPECS:
haproxy.spec (1.20 -> 1.21)
---- Diffs:
================================================================
Index: SPECS/haproxy.spec
diff -u SPECS/haproxy.spec:1.20 SPECS/haproxy.spec:1.21
--- SPECS/haproxy.spec:1.20 Tue Jul 10 11:18:28 2007
+++ SPECS/haproxy.spec Tue Jul 17 18:53:21 2007
@@ -5,19 +5,28 @@
Summary(pl.UTF-8): haproxy - wysoko wydajny load balancer TCP/HTTP
Name: haproxy
Version: 1.3.12
-Release: 1
+Release: 2
License: GPL v2
Group: Networking/Daemons
Source0: http://haproxy.1wt.eu/download/1.3/src/%{name}-%{version}.tar.gz
# Source0-md5: cdff6845362b29f9b2be4c207aa1fbb1
Source1: %{name}.init
+Source2: %{name}.cfg
Patch0: %{name}-vim.patch
URL: http://haproxy.1wt.eu/
BuildRequires: pcre-devel
BuildRequires: rpmbuild(macros) >= 1.268
Requires(post,preun): /sbin/chkconfig
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
Requires: rc-scripts
Requires: uname(release) >= 2.6
+Provides: group(haproxy)
+Provides: user(haproxy)
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -73,6 +82,8 @@
%setup -q
%patch0 -p1
+cp -a examples/haproxy.vim .
+
%build
%{__make} \
TARGET=linux26 \
@@ -89,7 +100,8 @@
install haproxy $RPM_BUILD_ROOT%{_sbindir}
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
-install examples/haproxy.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax
+install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/haproxy.cfg
+install haproxy.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax
# Some small cleanups:
rm -f doc/gpl.txt examples/haproxy.vim
@@ -97,6 +109,10 @@
%clean
rm -rf $RPM_BUILD_ROOT
+%pre
+%groupadd -g 185 %{name}
+%useradd -u 185 -d /usr/share/empty -g %{name} -c "haproxy user" %{name}
+
%post
/sbin/chkconfig --add %{name}
%service %{name} restart
@@ -107,17 +123,23 @@
/sbin/chkconfig --del %{name}
fi
+%postun
+if [ "$1" = "0" ]; then
+ %userremove %{name}
+ %groupremove %{name}
+fi
+
%files
%defattr(644,root,root,755)
%doc CHANGELOG ROADMAP TODO examples/* doc/* tests
-%attr(755,root,root) %{_sbindir}/*
%dir %{_sysconfdir}/%{name}
-#%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/haproxy.cfg
%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%attr(755,root,root) %{_sbindir}/haproxy
%files -n vim-syntax-haproxy
%defattr(644,root,root,755)
-%{_vimdatadir}/syntax/*
+%{_vimdatadir}/syntax/haproxy.vim
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -125,6 +147,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.21 2007/07/17 16:53:21 glen
+- add some default config
+- run as haproxy user
+- rel 2
+
Revision 1.20 2007/07/10 09:18:28 blues
- 1.3.12
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SPECS/haproxy.spec?r1=1.20&r2=1.21&f=u
More information about the pld-cvs-commit
mailing list