[packages/mongoose] - initial; from fc

arekm arekm at pld-linux.org
Fri Sep 27 10:16:21 CEST 2013


commit c698e9bd87d730e043dcef5d14c6e2d698890a91
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Sep 27 10:16:08 2013 +0200

    - initial; from fc

 mongoose-fix-libmongoose-so-build.patch  |  23 +++++++
 mongoose-fix-no-ssl-dl-build-error.patch |  34 +++++++++++
 mongoose.conf                            |  30 +++++++++
 mongoose.spec                            | 102 +++++++++++++++++++++++++++++++
 4 files changed, 189 insertions(+)
---
diff --git a/mongoose.spec b/mongoose.spec
new file mode 100644
index 0000000..9f2a01b
--- /dev/null
+++ b/mongoose.spec
@@ -0,0 +1,102 @@
+Summary:	An easy-to-use self-sufficient web server
+Name:		mongoose
+Version:	3.1
+Release:	1
+License:	MIT
+Group:		Applications/System
+URL:		http://code.google.com/p/mongoose
+Source0:	http://mongoose.googlecode.com/files/%{name}-%{version}.tgz
+# Source0-md5:	e718fc287b4eb1bd523be3fa00942bb0
+Source1:	%{name}.conf
+BuildRequires:	openssl-devel
+# Build changes:
+# http://code.google.com/p/mongoose/issues/detail?id=372
+Patch0:		%{name}-fix-libmongoose-so-build.patch
+# http://code.google.com/p/mongoose/issues/detail?id=371
+Patch1:		%{name}-fix-no-ssl-dl-build-error.patch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-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.
+
+%package libs
+Summary:	Shared Object for applications that use %{name} embedded
+Group:		Development/Libraries
+
+%description libs
+This package contains the shared library required by applications that
+are using %{name}'s embeddable API to provide web services.
+
+%package devel
+Summary:	Header files and development libraries for %{name}
+Group:		Development/Libraries
+Requires:	%{name}-lib = %{version}-%{release}
+
+%description devel
+This package contains the header files and development libraries for
+%{name}. If you like to develop programs embedding %{name} on them,
+you will need to install %{name}-devel and check %{name}'s API at its
+comprisable header file.
+
+%prep
+%setup -q -n %{name}
+%patch0 -p1 -b .solib-build
+%patch1 -p1 -b .nossldl-build
+install -p -m 0644  %{SOURCE1} .
+
+%build
+export VERSION=%{version}
+%{__make} \
+	CC="%{__cc}" \
+	VER="$VERSION" \
+	SOVER="${VERSION%.?}" \
+	CFLAGS="%{rpmcflags} -lssl -lcrypto -DNO_SSL_DL" \
+	linux
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -D -p %{name} $RPM_BUILD_ROOT/%{_bindir}/%{name}
+
+install -D -p %{name}.1 $RPM_BUILD_ROOT/%{_mandir}/man1/%{name}.1
+
+# -lib subpackage
+export VERSION=%{version}
+install -D -p lib%{name}.so.%{version} \
+		$RPM_BUILD_ROOT/%{_libdir}/lib%{name}.so.$VERSION
+ln -s %{_libdir}/lib%{name}.so.$VERSION \
+		$RPM_BUILD_ROOT/%{_libdir}/lib%{name}.so.${VERSION%.?}
+
+# -devel subpackage
+install -D -p %{name}.h $RPM_BUILD_ROOT/%{_includedir}/%{name}.h
+ln -s %{_libdir}/lib%{name}.so.$VERSION \
+		$RPM_BUILD_ROOT/%{_libdir}/lib%{name}.so
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post libs -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc %{name}.conf LICENSE
+%attr(755,root,root) %{_bindir}/%{name}
+%{_mandir}/man1/%{name}.1*
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lib%{name}.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/lib%{name}.so.3
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/%{name}.h
+%{_libdir}/lib%{name}.so
diff --git a/mongoose-fix-libmongoose-so-build.patch b/mongoose-fix-libmongoose-so-build.patch
new file mode 100644
index 0000000..4c44133
--- /dev/null
+++ b/mongoose-fix-libmongoose-so-build.patch
@@ -0,0 +1,23 @@
+diff -pruN a/Makefile b/Makefile
+--- a/Makefile	2012-03-11 19:41:34.000000000 -0300
++++ b/Makefile	2012-07-05 21:02:19.380557317 -0300
+@@ -25,7 +25,8 @@ all:
+ CFLAGS = -W -Wall -std=c99 -pedantic -O2 $(COPT)
+ MAC_SHARED = -flat_namespace -bundle -undefined suppress
+ LINFLAGS = -ldl -pthread $(CFLAGS)
+-LIB = _$(PROG).so
++LIB = lib$(PROG).so
++SONAME = $(LIB).$(SOVER)
+ CC = g++
+ 
+ # Make sure that the compiler flags come last in the compilation string.
+@@ -33,7 +34,8 @@ CC = g++
+ # "-Wl,--as-needed" turned on by default  in cc command.
+ # Also, this is turned in many other distros in static linkage builds.
+ linux:
+-	$(CC) mongoose.c -shared -fPIC -fpic -o $(LIB) $(LINFLAGS)
++	$(CC) mongoose.c -shared -fPIC -fpic -Wl,-soname,$(SONAME) \
++	-o $(LIB).$(VER) $(LINFLAGS)
+ 	$(CC) mongoose.c main.c -o $(PROG) $(LINFLAGS)
+ 
+ bsd:
diff --git a/mongoose-fix-no-ssl-dl-build-error.patch b/mongoose-fix-no-ssl-dl-build-error.patch
new file mode 100644
index 0000000..30517c4
--- /dev/null
+++ b/mongoose-fix-no-ssl-dl-build-error.patch
@@ -0,0 +1,34 @@
+diff -pruN a/mongoose.c b/mongoose.c
+--- a/mongoose.c	2012-03-11 19:41:35.000000000 -0300
++++ b/mongoose.c	2012-07-05 18:39:35.734964177 -0300
+@@ -270,28 +270,8 @@ typedef struct ssl_ctx_st SSL_CTX;
+ #define CRYPTO_LOCK  1
+ 
+ #if defined(NO_SSL_DL)
+-extern void SSL_free(SSL *);
+-extern int SSL_accept(SSL *);
+-extern int SSL_connect(SSL *);
+-extern int SSL_read(SSL *, void *, int);
+-extern int SSL_write(SSL *, const void *, int);
+-extern int SSL_get_error(const SSL *, int);
+-extern int SSL_set_fd(SSL *, int);
+-extern SSL *SSL_new(SSL_CTX *);
+-extern SSL_CTX *SSL_CTX_new(SSL_METHOD *);
+-extern SSL_METHOD *SSLv23_server_method(void);
+-extern int SSL_library_init(void);
+-extern void SSL_load_error_strings(void);
+-extern int SSL_CTX_use_PrivateKey_file(SSL_CTX *, const char *, int);
+-extern int SSL_CTX_use_certificate_file(SSL_CTX *, const char *, int);
+-extern int SSL_CTX_use_certificate_chain_file(SSL_CTX *, const char *);
+-extern void SSL_CTX_set_default_passwd_cb(SSL_CTX *, mg_callback_t);
+-extern void SSL_CTX_free(SSL_CTX *);
+-extern unsigned long ERR_get_error(void);
+-extern char *ERR_error_string(unsigned long, char *);
+-extern int CRYPTO_num_locks(void);
+-extern void CRYPTO_set_locking_callback(void (*)(int, int, const char *, int));
+-extern void CRYPTO_set_id_callback(unsigned long (*)(void));
++#include <openssl/ssl.h>
++#include <openssl/err.h>
+ #else
+ // Dynamically loaded SSL functionality
+ struct ssl_func {
diff --git a/mongoose.conf b/mongoose.conf
new file mode 100644
index 0000000..ade7aa1
--- /dev/null
+++ b/mongoose.conf
@@ -0,0 +1,30 @@
+# Mongoose web server configuration file.
+# Lines starting with '#' and empty lines are ignored.
+# For detailed description of every option, visit
+# http://code.google.com/p/mongoose/wiki/MongooseManual
+
+root            /tmp
+ports           80,443s
+access_log      /tmp/mongoose_access_log.txt
+error_log       /tmp/mongoose_error_log.txt
+
+# NOTE FOR PHP USERS:
+# Correct PHP binary to use is php-cgi, NOT php!
+# cgi_interp    /usr/bin/php-cgi
+# cgi_interp    /usr/bin/perl 
+
+# cgi_ext       cgi,pl,php
+# ssi_ext       shtml,shtm
+# auth_realm    mydomain.com
+# dir_list      no
+# index_files   index.html,index.htm,index.php,index.cgi
+# aliases	/my_d_disk=d:\,/my_e_disk=e:\
+# acl           -0.0.0.0/0,+10.0.0.0/8,+192.168.0.0/16
+# admin_uri     /remote_admin
+# protect       /remote_admin=c:\passwords.txt
+# cgi_env       FOO=BAR,BAZ=POO
+# auth_gpass    c:\mongoose_global_web_passwords.txt
+# auth_PUT      c:\mongoose_put_delete_passwords.txt
+# ssl_cert      ssl_cert.pem
+# max_threads	100
+# idle_time	10
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mongoose.git/commitdiff/c698e9bd87d730e043dcef5d14c6e2d698890a91



More information about the pld-cvs-commit mailing list