pkgsrc/security/stud/patches/patch-Makefile
jym 67372736ca Import stud-0.3pl53.
Description:

stud is a network proxy that terminates TLS/SSL connections and forwards
the unencrypted traffic to some backend. It's designed to handle 10s
of thousands of connections efficiently on multicore machines.
stud has very few features. It is designed to be paired with an
intelligent backend like haproxy or nginx.
2013-03-16 19:41:35 +00:00

51 lines
1.5 KiB
Text

$NetBSD: patch-Makefile,v 1.1 2013/03/16 19:41:36 jym Exp $
pkgsrc standards. SunOS fixes as per https://github.com/bumptech/stud/pull/71
--- Makefile.orig 2012-08-15 10:33:39.000000000 +0000
+++ Makefile
@@ -2,15 +2,25 @@
#
# USE_SHARED_CACHE : enable/disable a shared session cache (disabled by default)
-DESTDIR =
-PREFIX = /usr/local
+DESTDIR?=
+PREFIX ?= @PREFIX@
BINDIR = $(PREFIX)/bin
-MANDIR = $(PREFIX)/share/man
+MANDIR = $(PREFIX)/$(PKGMANDIR)
-CFLAGS = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include
-LDFLAGS = -lssl -lcrypto -lev -L/usr/local/lib
+CFLAGS += -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I$(PREFIX)/include
+LDFLAGS+= -lssl -lcrypto -lev -L$(PREFIX)/lib
OBJS = stud.o ringbuffer.o configuration.o
+UNAME := $(shell uname)
+
+ifeq ($(UNAME),SunOS)
+ # need __EXTENSIONS__ to get signal handling and getopt
+ CFLAGS += -D__EXTENSIONS__
+ LDFLAGS += -lnsl -lsocket
+else
+ CFLAGS += -DUSE_KEEPIDLE
+endif
+
all: realall
# Shared cache feature
@@ -40,10 +50,10 @@ stud: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
install: $(ALL)
- install -d $(DESTDIR)$(BINDIR)
- install stud $(DESTDIR)$(BINDIR)
- install -d $(DESTDIR)$(MANDIR)/man8
- install -m 644 stud.8 $(DESTDIR)$(MANDIR)/man8
+ $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_PROGRAM) stud $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(MANDIR)/man8
+ $(BSD_INSTALL_MAN) stud.8 $(DESTDIR)$(MANDIR)/man8
clean:
rm -f stud $(OBJS)