## must be matched to descriptions in html files ########
## some other parameters exist in opengatesrv.h ########
##########################################################
-WWWTOP = /usr/local/www
+WWWTOP = /usr/local/www/apache24
DOCDIR = /data
CGIDIR = /cgi-bin
OPENGATEDIR = /opengate
+CONFIGPATH = /etc/opengate
+LOCKFILE = /tmp/opengate.lock
DOCUMENTROOT = ${WWWTOP}${DOCDIR}
INSTALLDOCPATH = ${WWWTOP}${DOCDIR}${OPENGATEDIR}
INSTALLCGIPATH = ${WWWTOP}${CGIDIR}${OPENGATEDIR}
+MAKEDIR != pwd
-CONFIGPATH = /etc/opengate
+CFLAGS= -g -O3 -Wall -I/usr/local/include
+
+.if exists(/usr/local/include/ldap.h)
+LIBLDAP = -lldap -llber
+.endif
+
+.if exists(/usr/local/include/sqlite3.h)
+LIBSQLITE = -lsqlite3 -lpthread
+.endif
-CFLAGS= -O4 -Wall
-LIBS = -lssl -lcrypto -lradius -lpam -lezxml -L../ezxml
-OBJS = utilities.o comm-auth.o comm-cgi.o watch-client.o comm-ipfw.o comm-ip6fw.c comm-arp.o comm-ndp.o error.o tcp_connect.o sock_ntop_host.o wrapper.o signal.o auth-pam.o auth-rad.o auth-pop3s.o comm-userdb.o get-param.o auth-ftps.o htmltemplate.o addr-convert.o get-mac.o ctrl-firewall.o ctrl-alarms.o
+LIBS = -lssl -lcrypto -lradius -lpam -lezxml ${LIBLDAP} ${LIBSQLITE} -L../ezxml -L/usr/local/lib
+
+
+OBJS = utilities.o comm-auth.o comm-cgi.o watch-client.o comm-ipfw.o comm-ip6fw.c comm-arp.o comm-ndp.o error.o tcp_connect.o sock_ntop_host.o wrapper.o signal.o auth-pam.o auth-rad.o auth-pop3s.o comm-userdb.o get-param.o auth-ftps.o auth-ldap.o htmltemplate.o addr-convert.o get-mac.o ctrl-firewall.o ctrl-alarms.o udp-client.o
MAINPROGO = main.o
HDRS = opengatesrv.h
MAINPROG = opengatesrv
FWDPROG = opengatefwd
LIBOPT = ezxml
-TESTPROGS = test-get-param test-comm-auth test-comm-ipfw test-watch-client test-cgi
+TESTPROGS = test-get-param test-comm-auth test-comm-ipfw test-watch-client test-cgi test-comm-userdb
CLEANFILES = *.o *~ *.core
all: ${MAINPROG} ${AUTHPROG} ${FWDPROG} ${TESTPROGS} ${LIBOPT}
test-cgi: ${OBJS} test-cgi.o ${LIBOPT}
${CC} ${CFLAGS} -o $@ ${OBJS} test-cgi.o ${LIBS}
+test-comm-userdb: ${OBJS} test-comm-userdb.o ${LIBOPT}
+ ${CC} ${CFLAGS} -o $@ ${OBJS} test-comm-userdb.o ${LIBS}
+
ezxml:
${MAKE} -C ../ezxml
clean:
rm -f ${MAINPROG} ${AUTHPROG} ${FWDPROG} ${TESTPROGS} ${CLEANFILES}
${MAKE} clean -C ../ezxml
+ rm -f ../*/*~ ../*~ ../*/*/*~
-install: install-cgi install-html install-conf
+install: del-lockfile install-cgi install-html install-conf
+del-lockfile:
+.if exists(${LOCKFILE})
+ # remove lockfile
+ rm ${LOCKFILE}
+.endif
install-cgi: ${MAINPROG} ${AUTHPROG} ${FWDPROG}
## Copy main CGI program and Set S bit ##
#
install-html:
- ## Copy HTML documents and java ##
+ ## Copy HTML documents and etc ##
.if !exists(${INSTALLDOCPATH})
mkdir ${INSTALLDOCPATH}
.endif
cp -R ../javahtml/* ${INSTALLDOCPATH}
+ # Make dummy page for network connectivity check of iOS
+ mkdir -p ${DOCUMENTROOT}/library/test/
+ cp ../javahtml/success.html ${DOCUMENTROOT}/library/test/
+
#
# Replace index.html.var
.if exists(${DOCUMENTROOT}/index.html.var) && !exists(${DOCUMENTROOT}/index.html.var.original)
.endif
mv ${INSTALLDOCPATH}/index.html.var ${DOCUMENTROOT}/index.html.var
#
+ # Remove favicon.ico
+.if exists(${DOCUMENTROOT}/favicon.ico)
+ mv ${DOCUMENTROOT}/favicon.ico ${DOCUMENTROOT}/favicon.ico.original
+.endif
+ #
# Remove index.html
.if exists(${DOCUMENTROOT}/index.html) && !exists(${DOCUMENTROOT}/index.html.original)
mv ${DOCUMENTROOT}/index.html ${DOCUMENTROOT}/index.html.original
.endif
cp ../conf/opengatesrv.conf.sample ${CONFIGPATH}
cp ../conf/rc.firewall.sample ${CONFIGPATH}
- cp ../conf/rc.firewall6.sample ${CONFIGPATH}
cp ../conf/ipfwctrl.pl.sample ${CONFIGPATH}
- sed 's|<DocumentRoot>.*</DocumentRoot>|<DocumentRoot>${DOCUMENTROOT}</DocumentRoot>|' ../conf/opengatesrv.conf.sample | sed 's|<CgiDir>.*</CgiDir>|<CgiDir>${CGIDIR}</CgiDir>|' | sed 's|<OpengateDir>.*</OpengateDir>|<OpengateDir>${OPENGATEDIR}</OpengateDir>|' > ${CONFIGPATH}/opengatesrv.conf.sample
+ sed 's|<DocumentRoot>.*</DocumentRoot>|<DocumentRoot>${DOCUMENTROOT}</DocumentRoot>|' ../conf/opengatesrv.conf.sample | sed 's|<CgiDir>.*</CgiDir>|<CgiDir>${CGIDIR}</CgiDir>|' | sed 's|<OpengateDir>.*</OpengateDir>|<OpengateDir>${OPENGATEDIR}</OpengateDir>|' | sed 's|<LockFile>.*</LockFile>|<LockFile>${LOCKFILE}</LockFile>|' > ${CONFIGPATH}/opengatesrv.conf.sample
#
#------------------------------------------------------#
# COPY above x.sample to x and EDIT it, if you need. #
main.o: ${HDRS}
+ ${CC} ${CFLAGS} -DMAKEDIR='"${MAKEDIR}"' -c $<
utilities.o: ${HDRS}
comm-ndp.o: ${HDRS}
comm-userdb.o: ${HDRS}
-
+.if !exists(/usr/local/include/sqlite3.h)
+ ${CC} ${CFLAGS} -DSQLITE3_NOT_INSTALLED -c $<
+.endif
ctrl-firewall.o: ${HDRS}
ctrl-alarms.o: ${HDRS}
auth-pop3s.o: ${HDRS}
+auth-ftps.o: ${HDRS}
+
+auth-ldap.o: ${HDRS}
+.if !exists(/usr/local/include/ldap.h)
+ ${CC} ${CFLAGS} -DLDAP_NOT_INSTALLED -c $<
+.endif
+
get-param.o: ${HDRS}
get-mac.o: ${HDRS}
opengateauth.o: ${HDRS}
+ ${CC} ${CFLAGS} -DMAKEDIR='"${MAKEDIR}"' -c $<
opengatefwd.o: ${HDRS}
+ ${CC} ${CFLAGS} -DMAKEDIR='"${MAKEDIR}"' -c $<
htmltemplate.o: ${HDRS}
addr-convert.o: ${HDRS}
+udp-client.o: ${HDRS}
+
test-get-param.o: ${HDRS}
test-comm-auth.o: ${HDRS}
test-cgi.o: ${HDRS}
+test-comm-userdb.o: ${HDRS}
+
+
+
+