parent
51faafcb3d
commit
19ed8e7497
4 changed files with 61 additions and 60 deletions
50
srcpkgs/mongoose/patches/add-makefile.patch
Normal file
50
srcpkgs/mongoose/patches/add-makefile.patch
Normal file
|
@ -0,0 +1,50 @@
|
|||
--- /dev/null
|
||||
+++ Makefile
|
||||
@@ -0,0 +1,47 @@
|
||||
+PROG = mongoose
|
||||
+LIB = lib$(PROG).so.0
|
||||
+
|
||||
+ifndef PREFIX
|
||||
+ PREFIX=/usr/local
|
||||
+endif
|
||||
+
|
||||
+ifndef DOCDIR
|
||||
+ DOCDIR=$(PREFIX)/share/$(PROG)/doc
|
||||
+endif
|
||||
+
|
||||
+CPPFLAGS+=-DMONGOOSE_ENABLE_THREADS -DMG_ENABLE_SSL
|
||||
+CFLAGS+=-fPIC -c -Wall
|
||||
+LDFLAGS+=-shared -lssl -pthread -lcrypto
|
||||
+
|
||||
+SRCS=mongoose.c
|
||||
+OBJS=mongoose.o
|
||||
+INCLUDE=.
|
||||
+
|
||||
+all: $(LIB)
|
||||
+
|
||||
+$(LIB): $(OBJS)
|
||||
+ $(CC) $(OBJS) $(LDFLAGS) -o $(LIB)
|
||||
+
|
||||
+$(OBJS): $(SRCS)
|
||||
+ $(CC) $(CPPFLAGS) $(CFLAGS) -I$(INCLUDE) $(SRCS) -o $(OBJS)
|
||||
+
|
||||
+install:
|
||||
+ install -d $(DESTDIR)$(PREFIX)/include
|
||||
+ install -m644 mongoose.h $(DESTDIR)$(PREFIX)/include
|
||||
+ install -d $(DESTDIR)$(PREFIX)/lib
|
||||
+ ln -sf $(LIB) $(LIB).0; cp -a $(LIB).0 $(DESTDIR)$(PREFIX)/lib
|
||||
+ ln -sf $(LIB) libmongoose.so; cp -a libmongoose.so $(DESTDIR)$(PREFIX)/lib
|
||||
+ install -m755 $(LIB) $(DESTDIR)$(PREFIX)/lib
|
||||
+ install -dm755 $(DESTDIR)$(DOCDIR)
|
||||
+ cp -a examples $(DESTDIR)$(DOCDIR)
|
||||
+ cp -a docs/* $(DESTDIR)$(DOCDIR)/
|
||||
+
|
||||
+
|
||||
+test:
|
||||
+ $(MAKE) -C test/
|
||||
+clean:
|
||||
+ rm -f $(OBJS) $(LIB)
|
||||
+ $(MAKE) -C test/ clean
|
||||
+
|
||||
+.PHONY: clean test all
|
||||
+
|
|
@ -1,43 +0,0 @@
|
|||
--- Makefile.orig 2013-04-23 09:56:44.031317155 +0200
|
||||
+++ Makefile 2013-04-23 10:01:52.126993442 +0200
|
||||
@@ -17,7 +17,9 @@
|
||||
# -DUSE_LUA - embed Lua in Mongoose (+100kb)
|
||||
|
||||
PROG = mongoose
|
||||
-CFLAGS = -std=c99 -O2 -W -Wall -pedantic -pthread $(COPT)
|
||||
+LIB = lib$(PROG).so.0
|
||||
+CFLAGS += -std=c99 -O2 -W -Wall -pedantic -pthread $(COPT)
|
||||
+
|
||||
|
||||
# To build with Lua, download and unzip Lua 5.2.1 source code into the
|
||||
# mongoose directory, and then add $(LUA_SOURCES) to CFLAGS
|
||||
@@ -79,7 +81,9 @@ all:
|
||||
# "-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 main.c -o $(PROG) -ldl $(CFLAGS)
|
||||
+ $(CC) mongoose.c -shared -fPIC -fpic -Wl,-soname,$(LIB) \
|
||||
+ -o $(LIB) -ldl -lpthread $(CFLAGS)
|
||||
+ $(CC) main.c -o $(PROG) -ldl -lpthread -L. $(LIB) $(CFLAGS)
|
||||
|
||||
mac: bsd
|
||||
bsd:
|
||||
@@ -94,6 +98,18 @@ bsd_yassl:
|
||||
solaris:
|
||||
$(CC) mongoose.c main.c -lnsl -lsocket -o $(PROG) $(CFLAGS)
|
||||
|
||||
+install:
|
||||
+ install -d $(DESTDIR)$(PREFIX)/include
|
||||
+ install -m644 mongoose.h $(DESTDIR)$(PREFIX)/include
|
||||
+ install -d $(DESTDIR)$(PREFIX)/bin
|
||||
+ install -m755 $(PROG) $(DESTDIR)$(PREFIX)/bin
|
||||
+ install -d $(DESTDIR)$(PREFIX)/lib
|
||||
+ ln -sf $(LIB) $(LIB).0; cp -a $(LIB).0 $(DESTDIR)$(PREFIX)/lib
|
||||
+ ln -sf $(LIB) libmongoose.so; cp -a libmongoose.so $(DESTDIR)$(PREFIX)/lib
|
||||
+ install -m755 $(LIB) $(DESTDIR)$(PREFIX)/lib
|
||||
+ install -d $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
|
||||
+ -install -m644 mongoose.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
|
||||
+
|
||||
# For codesign to work in non-interactive mode, unlock login keychain:
|
||||
# security unlock ~/Library/Keychains/login.keychain
|
||||
# See e.g. http://lists.apple.com/archives/apple-cdsa/2008/Jan/msg00027.html
|
|
@ -1,22 +1,16 @@
|
|||
# Template file for 'mongoose'
|
||||
pkgname=mongoose
|
||||
version=3.7
|
||||
revision=14
|
||||
wrksrc=$pkgname
|
||||
version=6.9
|
||||
revision=1
|
||||
makedepends="libressl-devel"
|
||||
build_style=gnu-makefile
|
||||
make_use_env=compliant
|
||||
short_desc="An Easy to use Web server"
|
||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||
license="MIT"
|
||||
homepage="https://code.google.com/p/mongoose/"
|
||||
distfiles="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mongoose/mongoose-${version}.tgz"
|
||||
checksum=8376ede0378b6dd80ded78953726e9d3c18a2a8fd1a52a03efe949fd09d2ea68
|
||||
|
||||
do_build() {
|
||||
COPT="$CFLAGS $LDFLAGS -DNO_SSL_DL -lcrypto -lssl" make linux
|
||||
}
|
||||
do_install() {
|
||||
make PREFIX=/usr DESTDIR=$DESTDIR install
|
||||
}
|
||||
license="GPL-2"
|
||||
homepage="https://cesanta.com/"
|
||||
distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
|
||||
checksum=d316b24d4ed23851d81b0ac4e5285b778c684bff27f398b01f779696e5b2711a
|
||||
|
||||
mongoose-devel_package() {
|
||||
depends="libmongoose>=${version}_${revision}"
|
||||
|
@ -27,9 +21,9 @@ mongoose-devel_package() {
|
|||
}
|
||||
}
|
||||
|
||||
libmongoose_package() {
|
||||
short_desc+=" - runtime library"
|
||||
mongoose-doc_package() {
|
||||
short_desc+=" - documentation"
|
||||
pkg_install() {
|
||||
vmove "usr/lib/*.so.*"
|
||||
vmove usr/share
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue