pkgsrc/security/stud/patches/patch-Makefile

52 lines
1.5 KiB
Text
Raw Normal View History

$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)