Summary: Easy to use web server
Name:    mongoose26
Version: 2.6
Release: 3%{?dist}
License: MIT
URL: http://code.google.com/p/mongoose/
Source0: http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mongoose/mongoose-%{version}.tgz

Patch:   mongoose-Add-options-support.patch
Patch:   mongoose-dont_strip.patch
Patch:   mongoose-generic_v2.6.patch
Patch:   mongoose-reorder-buildargs.patch

%global VERSION %{version}
%global MAJOR_VERSION 2

BuildRequires: gcc

%description
Simple, functional, embeddable web server to make it easy for application
and device developers to implement web interface for their application and
devices, and to offer a simple web development environment.


%package        lib
Summary:        Development files for %{name}


%description    lib
The %{name}-lib package contains libraries and header files for
developing applications that use %{name}.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}-lib%{?_isa} = %{version}-%{release}
Conflicts:      mongoose-devel >= 3.1

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%autosetup -n mongoose


%build
%set_build_flags
gcc ${CFLAGS} -c -D_POSIX_SOURCE -D_BSD_SOURCE mongoose.c -fPIC -o mongoose.o
gcc ${LDFLAGS} -ldl -pthread -shared -Wl,-soname,libmongoose.so.%{VERSION} mongoose.o -o libmongoose.so.%{VERSION}


%install
install -pDm755 libmongoose.so.%{VERSION} %{buildroot}%{_libdir}/libmongoose.so.%{VERSION}
ln -sf libmongoose.so.%{MAJOR_VERSION} %{buildroot}%{_libdir}/libmongoose.so
ln -sf libmongoose.so.%{VERSION} %{buildroot}%{_libdir}/libmongoose.so.%{MAJOR_VERSION}
install -pDm644 mongoose.h %{buildroot}%{_includedir}/mongoose.h


%files lib
%license RDK_README
%{_libdir}/libmongoose.so.*


%files devel
%{_includedir}/mongoose.h
%{_libdir}/libmongoose.so


%changelog
* Wed Feb 05 2025 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 2.6-3
- Rebuild for new Fedora

* Fri Oct 28 2022 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 2.6-2
- Fix symlink between .so and .so.2

* Tue Oct 25 2022 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 2.6-1
- Initla RPM packaging