# TODO
# - other language's descriptions look weird, backslashes and quotes
-%define SSLVER 2.8.22
-%define APACHEVER 1.3.33
+%define SSLVER 2.8.25
+%define APACHEVER 1.3.34
%define apxs /usr/sbin/apxs1
%define mod_name ssl
Summary: An SSL module for the Apache Web server
Summary(uk): íÏÄÕÌØ Ð¦ÄÔÒÉÍËÉ SSL × Apache
Name: apache1-mod_%{mod_name}
Version: %{SSLVER}_%{APACHEVER}
-Release: 1.10
+Release: 1
License: BSD
Group: Networking/Daemons
Source0: http://www.modssl.org/source/mod_%{mod_name}-%{SSLVER}-%{APACHEVER}.tar.gz
-# Source0-md5: cdfdf1f576f77768c90825b43b462405
+# Source0-md5: 1ef2a6cb47573444779b2fd10502514b
Source1: %{name}.conf
Source2: %{name}-server.crt
Source3: %{name}-server.key
BuildRequires: openssl-tools >= 0.9.7d
BuildRequires: sed >= 4.0
Requires(post,preun): apache1
-Requires(post,preun): grep
-Requires(preun): fileutils
+Requires(triggerpostun): grep
+Requires(triggerpostun): sed >= 4.0
Requires: apache1 >= %{APACHEVER}
-Conflicts: apache1 < 1.3.33-2
+Requires: apache1 >= 1.3.33-2
+# see the config
+Requires: apache1-mod_setenvif
+Requires: apache1-mod_log_config
+Provides: apache(mod_ssl) = %{version}-%{release}
+Obsoletes: apache-mod_ssl < 2
Obsoletes: mod_ssl
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _pkglibdir %(%{apxs} -q LIBEXECDIR)
-%define _sysconfdir %(%{apxs} -q SYSCONFDIR)
+%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
+%define _pkglogdir %(%{apxs} -q PREFIX 2>/dev/null)/logs
%description
The mod_ssl project provides strong cryptography for the Apache 1.3
Summary(fr): Module d'Extranet Fort pour Apache et mod_ssl
Summary(pl): Modu³ Strong Extranet dla pakietu mod_ssl i serwera WWW Apache
Group: Networking/Daemons
-Requires(post,preun): %{apxs}
+Requires(triggerpostun): %{apxs}
Requires: apache1(EAPI) >= %{APACHEVER}
+Requires: apache1 >= 1.3.33-2
+Obsoletes: apache-mod_sxnet < 2
%description -n apache1-mod_sxnet
The Strong Extranet allows you to use digital certificates to
%{__perl} -pi -e 's@ /lib /usr/lib @ /%{_lib} /usr/%{_lib} @' pkg.sslmod/libssl.module
+cd pkg.contrib
+tar xvf sxnet.tar
+
%build
SSL_BASE=SYSTEM; export SSL_BASE
%configure \
%{__make}
-cd pkg.contrib
-tar xvf sxnet.tar
-cd sxnet
+cd pkg.contrib/sxnet
%{apxs} -DMalloc=malloc -DFree=free -I%{_includedir}/openssl -L%{_libdir} -l ssl -l crypto -c mod_sxnet.c
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libdir}/mod_%{mod_name},%{_pkglibdir}} \
+install -d $RPM_BUILD_ROOT{%{_libdir}/mod_%{mod_name},%{_pkglibdir},%{_pkglogdir}} \
$RPM_BUILD_ROOT%{_includedir}/apache1 \
$RPM_BUILD_ROOT%{_sysconfdir}/conf.d \
$RPM_BUILD_ROOT/etc/logrotate.d
cp -a pkg.ssldoc ssl-doc
install %{SOURCE4} sxnet.html
-CFG="$RPM_BUILD_ROOT%{_sysconfdir}/conf.d"
-echo "LoadModule sxnet_module modules/mod_sxnet.so" > $CFG/41_mod_sxnet.conf
+echo 'LoadModule sxnet_module modules/mod_sxnet.so' > \
+ $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_sxnet.conf
install pkg.sslmod/*.h $RPM_BUILD_ROOT%{_includedir}/apache1
+> $RPM_BUILD_ROOT%{_pkglogdir}/ssl_engine_log
+> $RPM_BUILD_ROOT%{_pkglogdir}/ssl_request_log
+
%clean
rm -rf $RPM_BUILD_ROOT
echo "Run \"/etc/rc.d/init.d/apache start\" to start apache HTTP daemon."
fi
-%preun
+%postun
if [ "$1" = "0" ]; then
if [ -f /var/lock/subsys/apache ]; then
/etc/rc.d/init.d/apache restart 1>&2
fi
%triggerpostun -- apache1-mod_ssl < 2.8.22_1.3.33-1.7
-if grep -q '^Include conf.d' /etc/apache/apache.conf; then
+if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then
sed -i -e '
/^Include.*mod_%{mod_name}.conf/d
' /etc/apache/apache.conf
%triggerpostun -- apache1-mod_sxnet < 2.8.22_1.3.33-1.9
# check that they're not using old apache.conf
-if ! grep -q '^Include conf.d' /etc/apache/apache.conf; then
+if grep -q '^Include conf\.d' /etc/apache/apache.conf; then
%{apxs} -e -A -n sxnet %{_pkglibdir}/mod_sxnet.so 1>&2
fi
/etc/rc.d/init.d/apache restart 1>&2
fi
-%preun -n apache1-mod_sxnet
+%postun -n apache1-mod_sxnet
if [ "$1" = "0" ]; then
if [ -f /var/lock/subsys/apache ]; then
/etc/rc.d/init.d/apache restart 1>&2
%files
%defattr(644,root,root,755)
%doc ANNOUNCE CHANGES CREDITS NEWS README* ssl-doc
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_ssl.conf
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/server.crt
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/server.key
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_ssl.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/server.crt
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/server.key
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
+%attr(640,root,root) %ghost %{_pkglogdir}/*
%attr(755,root,root) %{_pkglibdir}/libssl.so
%files -n apache1-mod_sxnet
%defattr(644,root,root,755)
%doc sxnet.html
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_sxnet.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_sxnet.conf
%attr(755,root,root) %{_pkglibdir}/mod_sxnet.so