[packages] pepperspot: update to 0.3 (closes: #7191)
authorNicolas Thill <nico@openwrt.org>
Mon, 19 Apr 2010 05:19:16 +0000 (05:19 +0000)
committerNicolas Thill <nico@openwrt.org>
Mon, 19 Apr 2010 05:19:16 +0000 (05:19 +0000)
SVN-Revision: 21017

net/pepperspot/Makefile
net/pepperspot/patches/101-cflags.patch [new file with mode: 0644]
net/pepperspot/patches/102-no_warnings.patch [new file with mode: 0644]

index 17fc5a073315a91a66fa7123eff65009f1aa3c5c..9f29b434794d6aaba814c55eaa31b60bce910ff9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2009 OpenWrt.org
+# Copyright (C) 2008-2010 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pepperspot
-PKG_VERSION:=0.2
+PKG_VERSION:=0.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/pepperspot
-PKG_MD5SUM:=a7ac2c8f93799f7d23d9ad2a0841fe4a
+PKG_MD5SUM:=10e6d42be577c231135c36440d86012a
 
 PKG_INSTALL:=1
 
@@ -23,9 +23,9 @@ define Package/pepperspot
   SUBMENU:=Captive Portals
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+kmod-tun +kmod-ipv6
   TITLE:=Wireless LAN HotSpot controller
   URL:=http://pepperspot.sourceforge.net/
+  DEPENDS:=+kmod-tun +kmod-ipv6
 endef
 
 define Package/pepperspot/description
@@ -41,11 +41,21 @@ endef
 
 # uses GNU configure
 
+define Build/Prepare
+$(call Build/Prepare/Default)
+       # prevent autoconf invocation, since one the patches touched
+       # configure
+       (cd $(PKG_BUILD_DIR); \
+               touch -r Makefile.am configure.in; \
+               touch -r Makefile.in configure; \
+       )
+endef
+
 define Package/pepperspot/install
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/pepper
        $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/pepper.conf $(1)/etc/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/extra/pepper.conf $(1)/etc/
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pepper $(1)/usr/sbin/
 endef
diff --git a/net/pepperspot/patches/101-cflags.patch b/net/pepperspot/patches/101-cflags.patch
new file mode 100644 (file)
index 0000000..a63dad6
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/configure
++++ b/configure
+@@ -2801,8 +2801,6 @@ am__tar='${AMTAR} chof - "$$tardir"'; am
+ ac_config_headers="$ac_config_headers config.h"
+-CFLAGS=""
+-
+ # Checks for programs.
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+--- a/configure.in
++++ b/configure.in
+@@ -9,8 +9,6 @@ AM_INIT_AUTOMAKE
+ AM_CONFIG_HEADER([config.h])
+-CFLAGS=""
+-
+ # Checks for programs.
+ AC_PROG_CC
diff --git a/net/pepperspot/patches/102-no_warnings.patch b/net/pepperspot/patches/102-no_warnings.patch
new file mode 100644 (file)
index 0000000..2767ae0
--- /dev/null
@@ -0,0 +1,134 @@
+--- a/src/pepper.c
++++ b/src/pepper.c
+@@ -389,7 +389,7 @@ static int set_env(char *name, char *val
+   }
+   else if(mac != NULL)
+   {
+-    (void) snprintf(s, sizeof(s) - 1, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X",
++    (void) snprintf(s, sizeof(s) - 1, "%.2hX-%.2hX-%.2hX-%.2hX-%.2hX-%.2hX",
+                     mac[0], mac[1],
+                     mac[2], mac[3],
+                     mac[4], mac[5]);
+@@ -447,7 +447,7 @@ static int set_envv6(char *name, char *v
+   }
+   else if(mac != NULL)
+   {
+-    (void) snprintf(s, sizeof(s) - 1, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X",
++    (void) snprintf(s, sizeof(s) - 1, "%.2hX-%.2hX-%.2hX-%.2hX-%.2hX-%.2hX",
+                     mac[0], mac[1],
+                     mac[2], mac[3],
+                     mac[4], mac[5]);
+@@ -958,7 +958,7 @@ static int set_macallowed(char *macallow
+     for(i = 0; i < strlen(p1); i++)
+       if(!isxdigit(p1[i])) p1[i] = 0x20;
+-    if(sscanf(p1, "%2x %2x %2x %2x %2x %2x",
++    if(sscanf(p1, "%2hhx %2hhx %2hhx %2hhx %2hhx %2hhx",
+                 &options.macok[options.macoklen][0],
+                 &options.macok[options.macoklen][1],
+                 &options.macok[options.macoklen][2],
+@@ -973,7 +973,7 @@ static int set_macallowed(char *macallow
+     }
+     if(options.debug & DEBUG_CONF)
+     {
+-      printf("Macallowed address #%d: %.2X-%.2X-%.2X-%.2X-%.2X-%.2X\n",
++      printf("Macallowed address #%d: %.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX\n",
+              options.macoklen,
+              options.macok[options.macoklen][0],
+              options.macok[options.macoklen][1],
+--- a/src/redir.c
++++ b/src/redir.c
+@@ -178,7 +178,7 @@ static int redir_hextochar(char *src, in
+ {
+   char x[3];
+   int n = 0;
+-  int y = 0;
++  unsigned int y = 0;
+   int nb = len / 2;
+   for(n = 0 ; n < nb ; n++)
+--- a/src/radius.c
++++ b/src/radius.c
+@@ -971,7 +971,7 @@ int radius_getattr(struct radius_packet_
+       }
+       offset +=  t->l;
+     }
+-    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
++    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
+   }
+   else       /* Need to check pack -> length */
+   {
+@@ -992,7 +992,7 @@ int radius_getattr(struct radius_packet_
+       }
+       offset +=  t->l;
+     }
+-    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
++    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
+   }
+   return -1; /* Not found */
+@@ -1040,7 +1040,7 @@ int radius_getattrv6(struct radius_packe
+       }
+       offset +=  t->l;
+     }
+-    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
++    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
+   }
+   else       /* Need to check pack -> length */
+   {
+@@ -1061,7 +1061,7 @@ int radius_getattrv6(struct radius_packe
+       }
+       offset +=  t->l;
+     }
+-    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
++    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
+   }
+   return -1; /* Not found */
+@@ -1090,7 +1090,7 @@ int radius_getattrv6(struct radius_packe
+     }
+     offset +=  2 + t->l;
+   }
+-  while(offset < ntohs(pack->length));
++  while(offset < (int)ntohs(pack->length));
+   if(0) printf("Count %d\n", count);
+   return count;
+@@ -1903,7 +1903,7 @@ int radius_decaps(struct radius_t *this)
+     return -1;
+   }
+-  if(ntohs(pack.length) != status)
++  if((int)ntohs(pack.length) != status)
+   {
+     sys_err(LOG_WARNING, __FILE__, __LINE__, errno,
+             "Received radius packet with wrong length field %d != %d!",
+@@ -2107,7 +2107,7 @@ int radius_proxy_ind(struct radius_t *th
+     return -1;
+   }
+-  if(ntohs(pack.length) != status)
++  if((int)ntohs(pack.length) != status)
+   {
+     sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
+             "Received radius packet with wrong length field %d != %d!",
+--- a/src/dhcp.c
++++ b/src/dhcp.c
+@@ -240,7 +240,7 @@ static int dhcp_tcp_checkv6(struct dhcp_
+   struct dhcp_tcphdr_t *tcph = NULL;
+   int tcp_len = 0;
+-  if(ntohs(pack->ip6h.payload_length) > (length - DHCP_ETH_HLEN))
++  if((int)ntohs(pack->ip6h.payload_length) > (length - DHCP_ETH_HLEN))
+     return -1; /* Wrong length of packet */
+   tcp_len = ntohs(pack->ip6h.payload_length);
+@@ -347,7 +347,7 @@ static int dhcp_tcp_check(struct dhcp_ip
+   struct dhcp_tcphdr_t *tcph;
+   int tcp_len = 0;
+-  if(ntohs(pack->iph.tot_len) > (length - DHCP_ETH_HLEN))
++  if((int)ntohs(pack->iph.tot_len) > (length - DHCP_ETH_HLEN))
+     return -1; /* Wrong length of packet */
+   tcp_len = ntohs(pack->iph.tot_len) - pack->iph.ihl * 4;