]> git.pld-linux.org Git - packages/haproxy.git/blob - haproxy.spec
ae35be6da99cdfa8be0f58a130d3891732a828d2
[packages/haproxy.git] / haproxy.spec
1 # TODO
2 # - examples/seamless_reload.txt
3 #
4 # Conditional build:
5 %bcond_without  lua             # LUA support
6 %bcond_without  zlib            # zlib support
7 %bcond_without  pcre            # pcre support
8 %bcond_without  ssl             # SSL support
9
10 Summary:        haproxy - high-performance TCP/HTTP load balancer
11 Summary(pl.UTF-8):      haproxy - wysoko wydajny load balancer TCP/HTTP
12 Name:           haproxy
13 Version:        1.7.1
14 Release:        2
15 License:        GPL v2
16 Group:          Networking/Daemons
17 Source0:        http://www.haproxy.org/download/1.7/src/%{name}-%{version}.tar.gz
18 # Source0-md5:  d0acaae02e444039e11892ea31dde478
19 Source1:        https://github.com/makinacorpus/haproxy-1.5/raw/master/debian/halog.1
20 # Source1-md5:  df4631f3cbc59893a2cd5e4364c9e755
21 Source2:        https://github.com/janeczku/haproxy-acme-validation-plugin/raw/master/acme-http01-webroot.lua
22 # Source2-md5:  b68e49e7f7a862d504a4ab335a7cee2a
23 Source3:        %{name}.cfg
24 Source4:        %{name}-ft.vim
25 Source5:        %{name}.init
26 URL:            http://www.haproxy.org/
27 %{?with_lua:BuildRequires:  lua53-devel}
28 %{?with_ssl:BuildRequires:      openssl-devel}
29 %{?with_pcre:BuildRequires:     pcre-devel}
30 BuildRequires:  rpmbuild(macros) >= 1.268
31 %{?with_zlib:BuildRequires:     zlib-devel}
32 Requires(post,preun):   /sbin/chkconfig
33 Requires(postun):       /usr/sbin/groupdel
34 Requires(postun):       /usr/sbin/userdel
35 Requires(pre):  /bin/id
36 Requires(pre):  /usr/bin/getgid
37 Requires(pre):  /usr/sbin/groupadd
38 Requires(pre):  /usr/sbin/useradd
39 Requires:       rc-scripts
40 Requires:       uname(release) >= 2.6
41 Suggests:       vim-syntax-haproxy
42 Provides:       group(haproxy)
43 Provides:       user(haproxy)
44 Conflicts:      rpm < 4.4.2-45
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %define         _vimdatadir     %{_datadir}/vim/vimfiles
48
49 %description
50 HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for
51 high availability environments. Indeed, it can:
52 - route HTTP requests depending on statically assigned cookies;
53 - spread the load among several servers while assuring server
54   persistence through the use of HTTP cookies;
55 - switch to backup servers in the event a main one fails;
56 - accept connections to special ports dedicated to service monitoring;
57 - stop accepting connections without breaking existing ones;
58 - add/modify/delete HTTP headers both ways;
59 - block requests matching a particular pattern.
60
61 It needs very little resource. Its event-driven architecture allows it
62 to easily handle thousands of simultaneous connections on hundreds of
63 instances without risking the system's stability.
64
65 %description -l pl.UTF-8
66 HA-Proxy to odwrotne proxy TCP/HTTP przeznaczone w szczególności dla
67 środowisk o wysokiej dostępności. W rzeczywistości może:
68 - przekazywać żądania HTTP w zależności od statycznie przypisanych
69   ciasteczek;
70 - rozdzielać obciążenie między różne serwery zapewniając ciągłość
71   łączności z serwerem poprzez użycie ciasteczek HTTP;
72 - przełączać na serwery zapasowe w przypadku, gdy główny zawiedzie;
73 - przyjmować połączenia na specjalne porty przeznaczone do
74   monitorowania usług;
75 - zaprzestać przyjmowania połączeń bez zrywania istniejących;
76 - dodawać/modyfikować/usuwać nagłówki HTTP w obie strony;
77 - blokować żądania pasujące do określonego wzorca.
78
79 Wymaga bardzo niewiele zasobów. Jego sterowana zdarzeniami
80 architektura pozwala łatwo obsługiwać tysiące jednoczesnych połączeń
81 do setek instancji bez ryzykowania stabilności systemu.
82
83 %package -n vim-syntax-haproxy
84 Summary:        Vim syntax: haproxy configuration files syntax
85 Summary(pl.UTF-8):      Opis składni dla Vima: podświetlanie składni dla plików konfiguracyjnych haproxy
86 Group:          Applications/Editors/Vim
87 Requires:       vim-rt >= 4:6.3.058-3
88 %if "%{_rpmversion}" >= "5"
89 BuildArch:      noarch
90 %endif
91
92 %description -n vim-syntax-haproxy
93 This plugin provides syntax highlighting for haproxy configuration
94 files.
95
96 %description -n vim-syntax-haproxy -l pl.UTF-8
97 Ta wtyczka dostarcza podświetlanie składni dla plików konfiguracyjnych
98 haproxy.
99
100 %prep
101 %setup -q
102
103 cp -p %{SOURCE2} .
104 mv examples/haproxy.vim .
105 mv examples/errorfiles .
106 mv doc/gpl.txt .
107
108 %build
109 regparm_opts=
110 %ifarch %{ix86} %{x8664}
111 regparm_opts="USE_REGPARM=1"
112 %endif
113
114 %{__make} $regparm_opts \
115         TARGET="linux2628" \
116         CPU="generic" \
117         %{?with_lua:USE_LUA=1 LUA_LIB_NAME=lua5.3 LUA_INC=%{_includedir}/lua5.3} \
118         %{?with_ssl:USE_OPENSSL=1} \
119         %{?with_pcre:USE_PCRE=1} \
120         %{?with_zlib:USE_ZLIB=1} \
121         CC="%{__cc}" \
122         ADDINC="%{rpmcflags}" \
123         ADDLIB="%{rpmldflags}"
124
125 %{__make} -C contrib/halog halog \
126         CC="%{__cc}" \
127         OPTIMIZE="%{optflags}"
128
129 %{__make} -C contrib/iprange iprange \
130         CC="%{__cc}" \
131         OPTIMIZE="%{optflags}"
132
133 %install
134 rm -rf $RPM_BUILD_ROOT
135 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_datadir}/%{name}/lua,/etc/rc.d/init.d} \
136         $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect}
137
138 %{__make} install-bin install-man \
139         TARGET="linux2628" \
140         PREFIX=%{_prefix} \
141         DESTDIR=$RPM_BUILD_ROOT \
142
143 install -p contrib/halog/halog $RPM_BUILD_ROOT%{_sbindir}/halog
144 install -p contrib/iprange/iprange $RPM_BUILD_ROOT%{_sbindir}/iprange
145 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
146 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man1
147 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/haproxy.cfg
148 cp -p haproxy.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax
149 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/haproxy.vim
150 cp -a errorfiles $RPM_BUILD_ROOT%{_datadir}/%{name}
151 cp -p acme-http01-webroot.lua $RPM_BUILD_ROOT%{_datadir}/%{name}/lua
152
153 %clean
154 rm -rf $RPM_BUILD_ROOT
155
156 %pre
157 %groupadd -g 185 %{name}
158 %useradd -u 185 -d /usr/share/empty -g %{name} -c "haproxy user" %{name}
159
160 %post
161 /sbin/chkconfig --add %{name}
162 %service %{name} restart
163
164 %preun
165 if [ "$1" = "0" ]; then
166         %service %{name} stop
167         /sbin/chkconfig --del %{name}
168 fi
169
170 %postun
171 if [ "$1" = "0" ]; then
172         %userremove %{name}
173         %groupremove %{name}
174 fi
175
176 %files
177 %defattr(644,root,root,755)
178 %doc CHANGELOG README README ROADMAP examples/* doc/* tests
179 %dir %{_sysconfdir}/%{name}
180 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/haproxy.cfg
181 %attr(754,root,root) /etc/rc.d/init.d/%{name}
182 %attr(755,root,root) %{_sbindir}/halog
183 %attr(755,root,root) %{_sbindir}/haproxy
184 %attr(755,root,root) %{_sbindir}/haproxy-systemd-wrapper
185 %attr(755,root,root) %{_sbindir}/iprange
186 %{_mandir}/man1/halog.1*
187 %{_mandir}/man1/haproxy.1*
188 %{_datadir}/%{name}
189
190 %files -n vim-syntax-haproxy
191 %defattr(644,root,root,755)
192 %{_vimdatadir}/syntax/haproxy.vim
193 %{_vimdatadir}/ftdetect/haproxy.vim
This page took 0.199154 seconds and 2 git commands to generate.