summaryrefslogtreecommitdiff
path: root/security/bjorb/files/patch-aa
blob: 0f8c5eb490f9cb5bceb13c94c085a5272dcfd00e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- Makefile.in.orig	Mon Feb 22 05:01:20 1999
+++ Makefile.in	Sun Jan 12 14:46:10 2003
@@ -29,7 +29,7 @@
 LDFLAGS =
 LIBS = @LIBS@
 
-PREFIX = @prefix@
+PREFIX ?= @prefix@
 exec_prefix = $(PREFIX)
 sbindir = $(exec_prefix)/sbin
 etcdir = $(exec_prefix)/etc
@@ -81,7 +81,7 @@
 	$(INSTALL_DATA) ../doc/sample/bjorb.conf.sample $(etcdir)/bjorb.conf.sample
 
 $(TARGET): $(OBJS)
-	$(CC) -o $(TARGET) $(ALL_LDFLAGS) $(OBJS) $(ALL_LIBS)
+	$(CXX) -o $(TARGET) $(ALL_LDFLAGS) $(OBJS) $(ALL_LIBS)
 
 debug::
 	$(MAKE) CFLAGS="-g -DDEBUG"
@@ -116,13 +116,13 @@
 	$(CC) -c $(ALL_CFLAGS)  $<
 
 .cc.o: Makefile
-	$(CC) -c $(ALL_CFLAGS)  $<
+	$(CXX) -c $(ALL_CFLAGS)  $<
 
 Makefile: Makefile.in
 	CONFIG_FILES=./$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 cmd.o: cmd.cc cmd-def.h
-	$(CC) -c $(ALL_CFLAGS)  $<
+	$(CXX) -c $(ALL_CFLAGS)  $<
 cmd.cc: cmd.list
 	gperf -aptCT -N in_word_set_cmdlist $? > $@
 bool.cc:bool.list
@@ -135,9 +135,13 @@
 	autoconf
 
 certificate::
-	$(SSLTOP)/bin/req -new -x509 -out new.pem -nodes -days 365
-	cat new.pem privkey.pem > $(etcdir)/bjorb.pem
-	@rm new.pem privkey.pem
+	(\
+	[ -f $(PREFIX)/certs/bjorb.pem ] && exit 0; \
+	cd $(PREFIX)/certs; \
+	openssl req -new -x509 -nodes -days 365 -out bjorb.pem -keyout bjorb.pem; \
+	ln -s bjorb.pem `openssl x509 -noout -hash < bjorb.pem`.0 ;\
+	chmod 644 $(PREFIX)/certs/bjorb.pem; \
+	)
 
 install-bsd::
 	@if test -f /etc/rc.bjorb ; then chmod +w /etc/rc.bjorb; fi