[packages] add google-authenticator
[openwrt/svn-archive/archive.git] / libs / google-authenticator / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=google-authenticator
11 PKG_REV:=a096a628455a
12 PKG_VERSION:=1.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_PROTO:=git
18 PKG_SOURCE_URL:=http://code.google.com/p/google-authenticator/
19 PKG_SOURCE_VERSION:=$(PKG_REV)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libpam-google-authenticator
24 SECTION:=libs
25 CATEGORY:=Libraries
26 DEPENDS:=+libpam +libqrencode
27 TITLE:=Googles 2-step verification PAM library
28 URL:=http://code.google.com/p/google-authenticator/
29 endef
30
31 define Package/libpam-google-authenticator/description
32 The Google Authenticator project includes implementations of one-time
33 passcode generators for several mobile platforms, as well as a pluggable
34 authentication module (PAM). One-time passcodes are generated using open
35 standards developed by the Initiative for Open Authentication (OATH)
36 (which is unrelated to OAuth).
37
38 These implementations support the HMAC-Based One-time Password (HOTP)
39 algorithm specified in RFC 4226 and the Time-based One-time Password
40 (TOTP) algorithm specified in RFC 6238.
41 endef
42
43 define Build/Configure
44 endef
45
46 TARGET_CFLAGS+= -I$(STAGING_DIR)/usr/include
47 TARGET_LDFLAGS+= -s
48
49 define Build/Compile
50 $(MAKE) -C $(PKG_BUILD_DIR)/libpam \
51 $(TARGET_CONFIGURE_OPTS) \
52 CFLAGS="$(TARGET_CFLAGS)" \
53 LDFLAGS="$(TARGET_LDFLAGS)" \
54 all
55 endef
56
57 define Package/libpam-google-authenticator/install
58 $(INSTALL_DIR) $(1)/usr/sbin $(1)/lib/security
59 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libpam/google-authenticator $(1)/usr/sbin/
60 $(CP) $(PKG_BUILD_DIR)/libpam/pam_google_authenticator.so $(1)/lib/security/
61 endef
62
63 $(eval $(call BuildPackage,libpam-google-authenticator))