Sophie

Sophie

distrib > Mandriva > 2008.0 > x86_64 > by-pkgid > 580f361ce2327b023ccc4adde1e8fec9 > files > 6

pound-2.2.3-1mdv2007.1.src.rpm

Summary:	A reverse-proxy and load-balancer
Name:		pound
Version:	2.2.3
Release:	%mkrel 1
Group:		System/Servers
License:	GPL
URL:		http://www.apsis.ch/pound/
Source0:	http://www.apsis.ch/pound/Pound-%{version}.tar.bz2
Source1:	pound.cfg
Source2:	pound.init
Source3:	pound-openssl.cnf
Patch0:		Pound-mdv_conf.diff
Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires:	openssl
BuildRequires:	openssl-devel
BuildRequires:	pcre-devel
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

%description
The Pound program is a reverse proxy, load balancer and HTTPS
front-end for Web server(s).

%prep

%setup -q -n Pound-%{version}
%patch0 -p1

cp %{SOURCE1} %{name}.cfg
cp %{SOURCE2} %{name}.init
cp %{SOURCE3} %{name}-openssl.cnf

%build

%configure2_5x
 
%make

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_mandir}/man8
install -d %{buildroot}%{_sysconfdir}/pound
install -d %{buildroot}%{_sysconfdir}/pki/%{name}/certs
install -d %{buildroot}/var/run/pound

install -m0755 pound %{buildroot}%{_sbindir}
install -m0755 poundctl %{buildroot}%{_sbindir}
install -m0644 *.8 %{buildroot}%{_mandir}/man8/

install -m0644 pound.cfg %{buildroot}%{_sysconfdir}/pound/pound.cfg
install -m0755 %{name}.init %{buildroot}%{_initrddir}/%{name}
install -m0644 %{name}-openssl.cnf %{buildroot}%{_sysconfdir}/pki/%{name}/%{name}.cnf

touch %{buildroot}%{_sysconfdir}/pki/%{name}/certs/%{name}.pem
chmod 600 %{buildroot}%{_sysconfdir}/pki/%{name}/certs/%{name}.pem

%pre
%_pre_useradd %{name} /var/run/pound /bin/false

%post
%_post_service %{name}
if [ -f /var/lock/subsys/%{name} ]; then
    %{_initrddir}/%{name} restart 1>&2;
fi

# create a ssl cert
if [ ! -f %{_sysconfdir}/pki/%{name}/certs/%{name}.pem ]; then
    echo "Generating a SSL certificate for %{name}"
    openssl req -x509 -newkey rsa:1024 -batch -keyout \
    %{_sysconfdir}/pki/%{name}/certs/%{name}.pem \
    -out %{_sysconfdir}/pki/%{name}/certs/%{name}.pem \
    -days 365 -nodes -config %{_sysconfdir}/pki/%{name}/%{name}.cnf
    chmod 600 %{_sysconfdir}/pki/%{name}/certs/%{name}.pem
fi

%preun
%_preun_service %{name}
    
%postun
%_postun_userdel %{name}

if [ "$1" = "0" ]; then
    if [ -f /var/lock/subsys/%{name} ]; then
	%{_initrddir}/%{name} restart 1>&2
    fi
fi

%clean
rm -rf %{buildroot}

%files
%defattr(644,root,root,755)
%doc README
%attr(0755,root,root) %{_initrddir}/%{name}
%attr(0755,root,root) %{_sbindir}/*
%dir %{_sysconfdir}/%{name}
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/%{name}.cfg
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sysconfdir}/pki/%{name}/certs/%{name}.pem
%attr(0644,root,root) %config(missingok,noreplace) %verify(not md5 size mtime) %{_sysconfdir}/pki/%{name}/%{name}.cnf
%{_mandir}/man8/*
%dir /var/run/pound


%changelog
* Fri Jan 26 2007 Oden Eriksson <oeriksson@mandriva.com> 2.2.3-1mdv2007.0
+ Revision: 114141
- 2.2.3
- reworked the config, initscript and added ssl cert generation
- Import pound



* Sat Feb 4 2006 Spencer Anderson <sdander@mandriva.org> 2.0-1mdk
- 2.0
- use mkrel

* Sun Aug 21 2005 Spencer Anderson <sdander@mandriva.org> 1.9-1mdk
- 1.9

* Sun Dec 12 2004 Spencer Anderson <sdander@oberon.ark.com> 1.8-1mdk
- 1.8

* Tue May 25 2004 Spencer Anderson <sdander@oberon.ark.com> 1.7-1mdk
- 1.7

* Fri Feb 27 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 1.6-2mdk
- Own %%{_sysconfdir}/pound

* Sun Jan 4 2004 Spencer Anderson <sdander@oberon.ark.com> 1.6-1mdk
- 1.6
- correct permissions

* Sat Nov 15 2003 Spencer Anderson <sdander@oberon.ark.com> 1.5-1mdk
- initial Mandrake release