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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
$NetBSD: patch-am,v 1.7 2012/03/22 14:13:29 taca Exp $
--- popper/Makefile.in.orig 2011-05-30 19:13:39.000000000 +0000
+++ popper/Makefile.in
@@ -99,6 +99,7 @@ CC = @CC@
GPERF = @GPERF@
MAKEFILE = Makefile
INSTALL = @INSTALL@
+DESTDIR =
@SET_MAKE@
@@ -109,6 +110,8 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
installdir = @sbindir@
+libexecdir = @libexecdir@
+sbindir = @sbindir@
popper_srcdir = ${top_srcdir}/popper
qd_srcdir = ${top_srcdir}/qd
@@ -127,7 +130,7 @@ password_dir = ${base_dir}/password
OBJS = pop_dele.o pop_dropcopy.o \
- pop_get_command.o pop_get_subcommand.o pop_init.o \
+ pop_get_command.o pop_get_subcommand.o \
pop_last.o pop_list.o pop_log.o pop_lower.o \
pop_msg.o pop_parse.o pop_pass.o pop_quit.o \
pop_rset.o pop_send.o pop_stat.o pop_updt.o \
@@ -137,7 +140,10 @@ OBJS = pop_dele.o pop_dropc
pop_extend.o scram.o hmac.o pop_util.o \
get_sub_opt.o msg_ptr.o drac.o pop_config.o pop_tls.o \
pop_tls_openssl.o pop_tls_sslplus.o sslplus_utils.o \
- main.o pop_cache.o genpath.o pop_sasl.o
+ pop_cache.o genpath.o pop_sasl.o
+
+INETDOBJ = main.o pop_init.o
+STANDOBJ = main-stand.o pop_init-stand.o
SRCS = pop_dele.c pop_dropcopy.c \
pop_get_command.c pop_get_subcommand.c pop_init.c \
@@ -198,7 +204,7 @@ pam_sample = ${top_srcdir}/sample
.SUFFIXES: .c .o
-all: popper ${pop_auth} mangler_library common_library ${poppassd}
+all: mangler_library common_library popper popper-standalone ${pop_auth} ${poppassd}
mangler_library:
cd ${mmangle_dir} && ${MAKE} all
@@ -206,14 +212,20 @@ mangler_library:
common_library:
cd ${common_dir} && ${MAKE} all
-popper: ${OBJS} ${MISSING_OBJS} mangler_library common_library
- ${CC} ${OBJS} ${MISSING_OBJS} -o popper \
+popper: ${INETDOBJ} ${OBJS} ${MISSING_OBJS} mangler_library common_library
+ ${CC} ${INETDOBJ} ${OBJS} ${MISSING_OBJS} -o popper \
+ ${mmangle_dir}/libmangle.a \
+ -I${common_srcdir} ${common_dir}/libcommon.a \
+ ${LIBS} ${LDFLAGS}
+
+popper-standalone: ${STANDOBJ} ${OBJS} ${MISSING_OBJS} mangler_library common_library
+ ${CC} ${STANDOBJ} ${OBJS} ${MISSING_OBJS} -o popper-standalone \
${mmangle_dir}/libmangle.a \
-I${common_srcdir} ${common_dir}/libcommon.a \
${LIBS} ${LDFLAGS}
popauth: ${POPAUTHOBJS} ${MISSING_OBJS}
- ${CC} -o popauth ${POPAUTHOBJS} ${NETWORK_LIBS} \
+ ${CC} -o popauth ${POPAUTHOBJS} ${LIBS} ${NETWORK_LIBS} \
${DBM_LIBS} ${MISSING_OBJS} \
${common_dir}/libcommon.a
@@ -225,47 +237,36 @@ poppassd: common_library
-I${mmangle_srcdir} -I${common_srcdir} ${SSL_INC} \
${CFLAGS} ${DEFS} ${CDEFS} ${OS_DEFS} $< -o $@
+main-stand.o: main.c
+ ${CC} -c -I${base_dir} -I${top_srcdir} -I${srcdir} \
+ -I${mmangle_srcdir} -I${common_srcdir} ${SSL_INC} \
+ ${CFLAGS} ${DEFS} ${CDEFS} ${OS_DEFS} -DSTANDALONE \
+ -o $@ main.c
+
+pop_init-stand.o: pop_init.c
+ ${CC} -c -I${base_dir} -I${top_srcdir} -I${srcdir} \
+ -I${mmangle_srcdir} -I${common_srcdir} ${SSL_INC} \
+ ${CFLAGS} ${DEFS} ${CDEFS} ${OS_DEFS} -DSTANDALONE \
+ -o $@ pop_init.c
+
${SRCS}:
${POPAUTHSRCS}:
${MISSING_SRCS}:
install: popper ${pop_auth}
- @if [ ! -d ${installdir} ]; then \
- ${base_dir}/mkdir-sh "${installdir}" "0755" "root:wheel" ; \
- fi
-
- @${INSTALL} -s -m 0755 -o root popper ${installdir}/popper
- @echo "Installed popper as ${installdir}/popper"
+ ${BSD_INSTALL_PROGRAM} popper ${DESTDIR}${libexecdir}/qpopper
+ @echo "Installed popper as ${libexecdir}/qpopper"
+ ${BSD_INSTALL_PROGRAM} popper-standalone ${DESTDIR}${sbindir}/qpopper
+ @echo "Installed standalone popper as ${sbindir}/qpopper"
@if [ "x${poppassd}" != "x" ]; then \
cd ${password_dir} && ${MAKE} install ;\
fi
- @if [ "x${pop_auth}" != "x" ]; then \
- ${INSTALL} -s -m 4755 -o ${apop_uid} -g 0 ${pop_auth} \
- ${installdir}/${pop_auth}; \
- echo "Installed popauth as ${installdir}/${pop_auth} " \
- "with uid ${apop_uid}"; \
- if [ "x${apop_dir}" != "x" ]; then \
- if [ ! -d "${apop_dir}" ]; then \
- ${base_dir}/mkdir-sh "${apop_dir}" "0700" "${apop_uid}:0" ; \
- echo "Created directory ${apop_dir}" ; \
- fi \
- fi ; \
- echo "Initializing popauth database"; \
- ${installdir}/${pop_auth} -init -safe; \
- fi
-
- @if [ "x${USE_PAM}" != "x" ]; then \
- echo "Checking for pam.d file..."; \
- if [ ! -e ${pam_file} ]; then \
- if [ -e ${pam_sample} ]; then \
- ${INSTALL} -m 0444 -o root ${pam_sample} ${pam_file} ; \
- echo "Created ${pam_file}"; \
- else \
- echo "can't find ${pam_sample} file"; \
- fi \
- fi \
+ @if [ "x${pop_auth}" != "x" ]; then \
+ ${BSD_INSTALL_PROGRAM} ${pop_auth} \
+ ${DESTDIR}${sbindir}/q${pop_auth}; \
+ echo "Installed popauth as ${sbindir}/q${pop_auth}" ;\
fi
clean:
|