Blob Blame History Raw
Name:      mongoose
Group:     Applications/System 
Summary:   An easy-to-use self-sufficient web server
Version:   3.0
Release:   2%{?dist}
License:   MIT
URL:       http://code.google.com/p/mongoose
Source0:   http://mongoose.googlecode.com/files/mongoose-%{version}.tgz
Source1:   mongoose.conf
BuildRequires: openssl-devel

# FIX CVE-2011-2900
# https://code.google.com/p/mongoose/source/detail?r=556f4de91eae4bac40dc5d4ddbd9ec7c424711d0#
Patch0:    mongoose-fix-buffer-overflow-put_dir.patch    

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
Mongoose web server executable is self-sufficient, it does not depend on 
anything to start serving requests. If it is copied to any directory and 
executed, it starts to serve that directory on port 8080 (so to access files, 
go to http://localhost:8080). If some additional configuration is required - 
for example, different listening port or IP-based access control, then a 
'mongoose.conf' file with respective options can be created in the same 
directory where executable lives. This makes Mongoose perfect for all sorts 
of demos, quick tests, file sharing, and Web programming.

%prep
%setup -q -n %{name}
%patch0 -p1 -b .fixcve
%{__install} -p -m 0644  %{SOURCE1} .

%build
# get dinamically the correct version to SSL shlib
LIBV=$(find '%{_libdir}' | grep -E '/libssl.so.[0-9]?[0-9]?$' | sed -e 's!%{_libdir}/libssl.so.!!')

%{__make} %{?_smp_mflags} CFLAGS="%{optflags} -DSSL_LIB='\"libssl.so.${LIBV}\"' -DCRYPTO_LIB='\"libcrypto.so.${LIBV}\"'" linux 

%install
%{__rm} -rf %{buildroot}
%{__install} -D -p -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
%{__install} -D -p -m 0644 %{name}.1 %{buildroot}/%{_mandir}/man1/%{name}.1

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc %{name}.conf LICENSE
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

%changelog
* Sat Aug 27 2011 Rafael Azenha Aquini <aquini at linux dot com> - 3.0-2
- Add upstream patch to fix CVE-2011-2900 (729146) 

* Mon Jul 25 2011 Rafael Azenha Aquini <aquini at linux dot com> - 3.0-1
- Rebuilt for Fedora's inclusion, after scracth-build successful tests. 

* Mon Jul 25 2011 Rafael Azenha Aquini <aquini at linux dot com> - 3.0-0
- Packaged mongoose's upstream 3.0 release. 

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Sep 28 2010 Rafael Azenha Aquini <aquini at linux dot com> - 2.11-0
- Packaged the mongoose's upstream 2.11 release. 

* Wed Jul 21 2010 Rafael Azenha Aquini <aquini at linux dot com> - 2.8-6
- Adjust the approach to grab correct OpenSSL versioned shared libs in 
  build time, as suggested by Toshio Ernie Kuratomi (592670#c25)
- Open an upstream issue asking for shipping a license file within mongoose's
  .tar file (http://code.google.com/p/mongoose/issues/detail?id=159)

* Tue Jul 13 2010 Rafael Azenha Aquini <aquini at linux dot com> - 2.8-5
- Get dinamically the correct OpenSSL versioned shared libs in build time, 
  as suggested by Douglas Schilling Landgraf (592670#c21)

* Wed May 19 2010 Rafael Azenha Aquini <aquini at linux dot com> - 2.8-4
- Drop off all source files from doc dir, including the examples
- Add patch to define correct OpenSSL versioned shared libs in build time, 
  as suggested by Ralf Corsepius (592670#c19)

* Tue May 18 2010 Rafael Azenha Aquini <aquini at linux dot com> - 2.8-3
- Several improvements to the Spec, by Terje Røsten's review (592670#c3)
- Added /examples dir to docs, as suggested by Chen Lei's review (592670#c4)

* Mon May 17 2010 Rafael Azenha Aquini <aquini at linux dot com> - 2.8-2
- Set of fixes to the Spec file, suggested by Chen Lei's review (592670#c1)

* Sat May 15 2010 Rafael Azenha Aquini <aquini at linux dot com> - 2.8-1
- initial packaging.