[packages] freeradius2: Package rlm_always (#8291)
[openwrt/svn-archive/archive.git] / net / freeradius2 / Makefile
index 8a6f35a..dba08f4 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,14 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=freeradius2
-PKG_VERSION:=2.1.7
-PKG_RELEASE:=2
+PKG_VERSION:=2.1.9
+PKG_RELEASE:=4
 
 PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/
-PKG_MD5SUM:=b8df6cf0c3df1dded205ad5f954feb78
+PKG_MD5SUM:=5e16a0869acdf448b191c7e30f6507d8
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
+PKG_FIXUP:=libtool
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -130,6 +131,16 @@ define Package/freeradius2-mod-expiration/conffiles
 /etc/freeradius2/modules/expiration
 endef
 
+define Package/freeradius2-mod-always
+  $(call Package/freeradius2/Default)
+  DEPENDS:=freeradius2
+  TITLE:=Always module
+endef
+
+define Package/freeradius2-mod-always/conffiles
+/etc/freeradius2/modules/always
+endef
+
 define Package/freeradius2-mod-expr
   $(call Package/freeradius2/Default)
   DEPENDS:=freeradius2
@@ -253,13 +264,15 @@ endef
 
 define Package/freeradius2-mod-sql-mysql
   $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libmysqlclient
+  DEPENDS:=freeradius2-mod-sql \
+       +PACKAGE_freeradius2-mod-sql-mysql:libmysqlclient
   TITLE:=MySQL module
 endef
 
 define Package/freeradius2-mod-sql-pgsql
   $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libpq
+  DEPENDS:=freeradius2-mod-sql \
+       +PACKAGE_freeradius2-mod-sql-pgsql:libpq
   TITLE:=PostgreSQL module
 endef
 
@@ -426,6 +439,12 @@ else
   CONFIGURE_ARGS+= --without-rlm_expiration
 endif
 
+ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-always),)
+  CONFIGURE_ARGS+= --with-rlm_always
+else
+  CONFIGURE_ARGS+= --without-rlm_always
+endif
+
 CONFIGURE_VARS+= \
        LDFLAGS="$$$$LDFLAGS" \
        LIBS="$(CONFIGURE_LIBS)" \
@@ -443,6 +462,7 @@ define Package/freeradius2/install
        $(INSTALL_DIR) $(1)/etc/freeradius2
        $(INSTALL_DIR) $(1)/etc/freeradius2/modules
        $(INSTALL_DIR) $(1)/etc/freeradius2/sites
+       chmod 771 $(1)/etc/freeradius2
        for f in clients.conf dictionary radiusd.conf policy.conf; do \
                $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$${f} $(1)/etc/freeradius2/ ; \
        done
@@ -456,6 +476,8 @@ define Package/freeradius2/install
        done
        $(INSTALL_DIR) $(1)/usr/lib/freeradius2
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-radius{,-*}.so $(1)/usr/lib/freeradius2
+       ln -s freeradius2/libfreeradius-radius-$(PKG_VERSION).so $(1)/usr/lib/
+       ln -s freeradius2/libfreeradius-eap-$(PKG_VERSION).so $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/init.d
@@ -523,4 +545,5 @@ $(eval $(call BuildPlugin,freeradius2-mod-logintime,rlm_logintime,modules/logint
 $(eval $(call BuildPlugin,freeradius2-mod-expr,rlm_expr,modules/expr,modules,))
 $(eval $(call BuildPlugin,freeradius2-mod-attr-filter,rlm_attr_filter,modules/attr_filter attrs attrs.access_reject attrs.accounting_response attrs.pre-proxy,modules,,))
 $(eval $(call BuildPlugin,freeradius2-mod-expiration,rlm_expiration,modules/expiration,modules,))
+$(eval $(call BuildPlugin,freeradius2-mod-always,rlm_always,modules/always,modules,))
 $(eval $(call BuildPackage,freeradius2-utils))