nocat makefile from solar
[openwrt/openwrt.git] / obsolete-buildroot / make / nocat-auth.mk
1 #############################################################
2 #
3 # nocatauth.c
4 #
5 # There exists a real need in the embedded community for a
6 # captive portal with authentication. Till now I've been hording
7 # this sweet little creation to myself.
8 #
9 # NoCatSplash is a Open Public Network Gateway Daemon. It performs as a
10 # [captive/open/active] portal. When run on a gateway/router on a
11 # network, all web requests are redirected until the client clicks I
12 # Accept to an AUP. The gateway daemon then changes the firewall rules
13 # on the gateway to pass traffic for that client (based on IP address
14 # and MAC address).
15 #
16 # NoCatSplash is the successor to NoCatAuth, which was written in Perl.
17 # NoCatSplash is written in multi-threaded ANSI C in order to be smaller
18 # and work better on embedded style devices.
19 #
20 # NoCatSplash-Auth is the successor to them all which is NoCatSplash
21 # with the features found on NoCatAuth but written in ANSI C in order to
22 # be smaller and work better on embedded style devices.
23 #
24 #############################################################
25 NOCATSPLASHAUTH_SOURCE_URL:=
26 NOCATSPLASHAUTH_SOURCE=NoCatSplash-auth.tgz
27 NOCATSPLASHAUTH_BUILD_DIR=$(BUILD_DIR)/NoCatSplash-auth
28
29 $(DL_DIR)/$(NOCATSPLASHAUTH_SOURCE):
30 $(WGET) -P $(DL_DIR) $(NOCATSPLASHAUTH_SOURCE_URL)/$(NOCATSPLASHAUTH_SOURCE)
31
32 $(NOCATSPLASHAUTH_BUILD_DIR)/.unpacked: $(DL_DIR)/$(NOCATSPLASHAUTH_SOURCE)
33 zcat $(DL_DIR)/$(NOCATSPLASHAUTH_SOURCE) | tar -C $(BUILD_DIR) -xvf -
34 touch $(NOCATSPLASHAUTH_BUILD_DIR)/.unpacked
35
36 $(NOCATSPLASHAUTH_BUILD_DIR)/.configured: $(NOCATSPLASHAUTH_BUILD_DIR)/.unpacked
37 # Allow patches. Needed for openwrt for instance.
38 #$(SOURCE_DIR)/patch-kernel.sh $(NOCATSPLASHAUTH_BUILD_DIR) $(SOURCE_DIR) nocatsplash-*.patch
39 (cd $(NOCATSPLASHAUTH_BUILD_DIR); \
40 ./configure \
41 --prefix=/usr \
42 --disable-glibtest \
43 --with-glib-prefix=$(TARGET_DIR)/usr \
44 --with-mode=passive \
45 )
46 touch $(NOCATSPLASHAUTH_BUILD_DIR)/.configured
47
48 $(NOCATSPLASHAUTH_BUILD_DIR)/splashd: $(NOCATSPLASHAUTH_BUILD_DIR)/.configured
49 $(TARGET_CONFIGURE_OPTS) \
50 $(MAKE) -C $(NOCATSPLASHAUTH_BUILD_DIR) \
51 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)"
52
53 $(TARGET_DIR)/sbin/splashd: $(NOCATSPLASHAUTH_BUILD_DIR)/splashd
54 $(TARGET_CONFIGURE_OPTS) \
55 $(MAKE) -C $(NOCATSPLASHAUTH_BUILD_DIR) \
56 PREFIX=/usr \
57 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
58 DESTDIR=$(TARGET_DIR) install
59 $(STRIP) $(TARGET_DIR)/usr/bin/nocat*
60 rm -rf $(TARGET_DIR)/usr/man
61
62 nocatauth: $(TARGET_DIR)/sbin/splashd
63
64 nocatauth-source: $(DL_DIR)/$(NOCATSPLASHAUTH_SOURCE)
65
66 nocatauth-clean:
67 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NOCATSPLASHAUTH_BUILD_DIR) uninstall
68 -$(MAKE) -C $(NOCATSPLASHAUTH_BUILD_DIR) clean
69
70 nocatauth-dirclean:
71 rm -rf $(NOCATSPLASHAUTH_BUILD_DIR)
72