Logoj0ke.net Open Build Service > Projects > home:jg > haproxy > Changes
Sign Up | Log In

Changes of Revision 6

[-] Changed haproxy.spec
x
 
1
@@ -1,13 +1,31 @@
2
-Summary:   HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
3
-Name:      haproxy
4
-Version:   1.4.6
5
-Release:   1   1
6
-License:   GPL
7
-Group:         System Environment/Daemons
8
-Source0:   %{name}-%{version}.tar.gz
9
-BuildRoot:     %{_tmppath}/%{name}-%{version}-root
10
-BuildRequires:     pcre-devel
11
-Requires:  /sbin/chkconfig, /sbin/service
12
+%define haproxy_user    haproxy
13
+%define haproxy_group   %{haproxy_user}
14
+%define haproxy_home    %{_localstatedir}/lib/haproxy
15
+%define haproxy_confdir %{_sysconfdir}/haproxy
16
+%define haproxy_datadir %{_datadir}/haproxy
17
+
18
+Name:           haproxy
19
+Version:        1.4.8
20
+Release:        1%{?dist}
21
+Summary:        HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
22
+
23
+Group:          System Environment/Daemons
24
+License:        GPLv2+
25
+
26
+URL:            http://haproxy.1wt.eu/
27
+Source0:        http://haproxy.1wt.eu/download/1.3/src/haproxy-%{version}.tar.gz
28
+Source1:        %{name}.init
29
+Source2:        %{name}.cfg
30
+Source3:        %{name}.logrotate
31
+
32
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
33
+BuildRequires:  pcre-devel 
34
+
35
+
36
+Requires(pre):      %{_sbindir}/useradd
37
+Requires(post):     /sbin/chkconfig
38
+Requires(preun):    /sbin/chkconfig, /sbin/service
39
+Requires(postun):   /sbin/service
40
 
41
 %description
42
 HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high
43
@@ -21,102 +39,210 @@
44
 - add/modify/delete HTTP headers both ways
45
 - block requests matching a particular pattern
46
 
47
-It needs very little resource. Its event-driven architecture allows it to easily
48
-handle thousands of simultaneous connections on hundreds of instances without
49
-risking the system's stability.
50
 
51
 %prep
52
 %setup -q
53
 
54
+
55
 %build
56
-# %{__make} REGEX="pcre" "COPTS.pcre=-DUSE_PCRE $(pcre-config --cflags)" DEBUG="" TARGET=linux24e
57
-%{__make} REGEX=pcre DEBUG="" LIBS.pcre="-L\$(PCREDIR)/lib -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynamic" TARGET=linux26
58
+# No configure script is present, it is all done via make flags
59
+# FC 7 and up is linux 2.6 so using linux26 as target.
60
 
61
+# Recommended optimization option for x86 builds
62
+regparm_opts=
63
+%ifarch %ix86 x86_64
64
+regparm_opts="USE_REGPARM=1"
65
+%endif
66
+
67
+make %{?_smp_mflags} CPU="generic" TARGET="linux26" USE_PCRE=1 ${regparm_opts} ADDINC="%{optflags}" USE_LINUX_TPROXY=1
68
+
69
+# build the halog contrib program.  It has 2 version halog64 and halog.  Make
70
+# sure it is installed as 'halog' no matter what.
71
+halog="halog"
72
+%ifarch x86_64
73
+halog="halog64"
74
+%endif
75
+
76
+pushd contrib/halog
77
+make ${halog}
78
+mv ${halog} halog.tmp
79
+mv halog.tmp halog
80
+popd
81
 
82
 %install
83
-[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
84
- 
85
-%{__install} -d %{buildroot}%{_sbindir}
86
-%{__install} -d %{buildroot}%{_sysconfdir}/rc.d/init.d
87
-%{__install} -d %{buildroot}%{_sysconfdir}/%{name}
88
-
89
-%{__install} -s %{name} %{buildroot}%{_sbindir}/
90
-%{__install} -c -m 644 examples/%{name}.cfg %{buildroot}%{_sysconfdir}/%{name}/
91
-%{__install} -c -m 755 examples/%{name}.init %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name}
92
- 
93
+rm -rf %{buildroot}
94
+make install-bin DESTDIR=%{buildroot} PREFIX=%{_prefix}
95
+make install-man DESTDIR=%{buildroot} PREFIX=%{_prefix}
96
+
97
+%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
98
+%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{haproxy_confdir}/%{name}.cfg
99
+%{__install} -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
100
+%{__install} -d -m 0755 %{buildroot}%{haproxy_home}
101
+%{__install} -d -m 0755 %{buildroot}%{haproxy_datadir}
102
+%{__install} -d -m 0755 %{buildroot}%{_bindir}
103
+%{__install} -p -m 0755 ./contrib/halog/halog %{buildroot}%{_bindir}/halog
104
+
105
+for httpfile in $(find ./examples/errorfiles/ -type f) 
106
+do
107
+    %{__install} -p -m 0644 $httpfile %{buildroot}%{haproxy_datadir}
108
+done
109
+
110
+# convert all text files to utf8
111
+for textfile in $(find ./ -type f -name '*.txt')
112
+do
113
+    mv $textfile $textfile.old
114
+    iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old
115
+    rm -f $textfile.old
116
+done 
117
+
118
+
119
 %clean
120
-[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
121
- 
122
+rm -rf %{buildroot}
123
+
124
+
125
+%pre
126
+%{_sbindir}/useradd -c "HAProxy user" -s /bin/false -r -d %{haproxy_home} %{haproxy_user} 2>/dev/null || :
127
+
128
+
129
 %post
130
 /sbin/chkconfig --add %{name}
131
+    
132
 
133
 %preun
134
 if [ $1 = 0 ]; then
135
-  /sbin/service %{name} stop >/dev/null 2>&1 || :
136
-  /sbin/chkconfig --del %{name}
137
-fi
138
-
139
+    /sbin/service %{name} stop >/dev/null 2>&1
140
+    /sbin/chkconfig --del %{name}
141
+fi  
142
+    
143
+
144
+%postun
145
+if [ $1 -ge 1 ]; then
146
+/sbin/service %{name} condrestart > /dev/null 2>&1 || :
147
+fi  
148
+ 
149
 
150
 %files
151
-%defattr(-,root,root)
152
-%doc CHANGELOG TODO examples doc/haproxy-en.txt doc/haproxy-fr.txt doc/architecture.txt examples/url-switching.cfg
153
-%attr(0755,root,root) %{_sbindir}/%{name}
154
-%dir %{_sysconfdir}/%{name}
155
-%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.cfg
156
-%attr(0755,root,root) %config %{_sysconfdir}/rc.d/init.d/%{name}
157
+%defattr(-,root,root,-)
158
+%doc doc/*
159
+%doc examples/url-switching.cfg
160
+%doc examples/acl-content-sw.cfg
161
+%doc examples/content-sw-sample.cfg
162
+%doc examples/cttproxy-src.cfg
163
+%doc examples/haproxy.cfg
164
+%doc examples/tarpit.cfg
165
+%doc CHANGELOG LICENSE README
166
+%dir %{haproxy_datadir}
167
+%dir %{haproxy_datadir}/*
168
+%dir %{haproxy_confdir}
169
+%config(noreplace) %{haproxy_confdir}/%{name}.cfg
170
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
171
+%{_initrddir}/%{name}
172
+%{_sbindir}/%{name}
173
+%{_bindir}/halog
174
+%{_mandir}/man1/%{name}.1.gz
175
+%attr(-,%{haproxy_user},%{haproxy_group}) %dir %{haproxy_home}
176
+
177
 
178
 %changelog
179
-* Wed May 19 2010 Juergen Gotteswinter <jg@internetx.de>
180
-- updated to 1.4.6
181
+* Sun Jun 20 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.8-1
182
+- update to 1.4.8
183
+
184
+* Sun May 30 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.6-1
185
+- update to 1.4.6
186
+
187
+* Thu Feb 18 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.3.23-1
188
+- update to 1.3.23
189
+
190
+* Sat Oct 17 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.3.22-1
191
+- update to 1.3.22
192
+- added logrotate configuration
193
+
194
+* Mon Oct 12 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.3.21-1
195
+- update to 1.3.21
196
+
197
+* Sun Oct 11 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.3.20-1
198
+- update to 1.3.20
199
+
200
+* Sun Aug 02 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.3.19-1
201
[+] Changed haproxy-1.4.8.tar.gz/CHANGELOG ^
[+] Changed haproxy-1.4.8.tar.gz/VERDATE ^
[+] Changed haproxy-1.4.8.tar.gz/VERSION ^
[+] Changed haproxy-1.4.8.tar.gz/contrib/halog/Makefile ^
[+] Changed haproxy-1.4.8.tar.gz/contrib/halog/halog.c ^
[+] Changed haproxy-1.4.8.tar.gz/doc/configuration.txt ^
[+] Changed haproxy-1.4.8.tar.gz/examples/haproxy.spec ^
[+] Changed haproxy-1.4.8.tar.gz/src/cfgparse.c ^
[+] Changed haproxy-1.4.8.tar.gz/src/client.c ^
[+] Changed haproxy-1.4.8.tar.gz/src/proto_http.c ^
[+] Changed haproxy-1.4.8.tar.gz/src/proto_tcp.c ^
[+] Changed haproxy-1.4.8.tar.gz/src/proto_uxst.c ^
[+] Changed haproxy-1.4.8.tar.gz/src/proxy.c ^
[+] Changed haproxy-1.4.8.tar.gz/src/session.c ^
[+] Changed haproxy-1.4.8.tar.gz/tests/test-fsm.cfg ^
[+] Changed haproxy.cfg ^
[+] Changed haproxy.init ^
[+] Added haproxy.logrotate ^