]> git.pld-linux.org Git - packages/mongoose.git/commitdiff
- initial; from fc
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 27 Sep 2013 08:16:08 +0000 (10:16 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 27 Sep 2013 08:16:08 +0000 (10:16 +0200)
mongoose-fix-libmongoose-so-build.patch [new file with mode: 0644]
mongoose-fix-no-ssl-dl-build-error.patch [new file with mode: 0644]
mongoose.conf [new file with mode: 0644]
mongoose.spec [new file with mode: 0644]

diff --git a/mongoose-fix-libmongoose-so-build.patch b/mongoose-fix-libmongoose-so-build.patch
new file mode 100644 (file)
index 0000000..4c44133
--- /dev/null
@@ -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 (file)
index 0000000..30517c4
--- /dev/null
@@ -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\r
\r
+ #if defined(NO_SSL_DL)\r
+-extern void SSL_free(SSL *);\r
+-extern int SSL_accept(SSL *);\r
+-extern int SSL_connect(SSL *);\r
+-extern int SSL_read(SSL *, void *, int);\r
+-extern int SSL_write(SSL *, const void *, int);\r
+-extern int SSL_get_error(const SSL *, int);\r
+-extern int SSL_set_fd(SSL *, int);\r
+-extern SSL *SSL_new(SSL_CTX *);\r
+-extern SSL_CTX *SSL_CTX_new(SSL_METHOD *);\r
+-extern SSL_METHOD *SSLv23_server_method(void);\r
+-extern int SSL_library_init(void);\r
+-extern void SSL_load_error_strings(void);\r
+-extern int SSL_CTX_use_PrivateKey_file(SSL_CTX *, const char *, int);\r
+-extern int SSL_CTX_use_certificate_file(SSL_CTX *, const char *, int);\r
+-extern int SSL_CTX_use_certificate_chain_file(SSL_CTX *, const char *);\r
+-extern void SSL_CTX_set_default_passwd_cb(SSL_CTX *, mg_callback_t);\r
+-extern void SSL_CTX_free(SSL_CTX *);\r
+-extern unsigned long ERR_get_error(void);\r
+-extern char *ERR_error_string(unsigned long, char *);\r
+-extern int CRYPTO_num_locks(void);\r
+-extern void CRYPTO_set_locking_callback(void (*)(int, int, const char *, int));\r
+-extern void CRYPTO_set_id_callback(unsigned long (*)(void));\r
++#include <openssl/ssl.h>\r
++#include <openssl/err.h>\r
+ #else\r
+ // Dynamically loaded SSL functionality\r
+ struct ssl_func {\r
diff --git a/mongoose.conf b/mongoose.conf
new file mode 100644 (file)
index 0000000..ade7aa1
--- /dev/null
@@ -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
diff --git a/mongoose.spec b/mongoose.spec
new file mode 100644 (file)
index 0000000..9f2a01b
--- /dev/null
@@ -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
This page took 0.12916 seconds and 4 git commands to generate.