Ticket #9138: google-authenticator_qrencode.patch

File google-authenticator_qrencode.patch, 5.1 KB (added by DkSoul, 5 years ago)

Patch to add both Google Authenticator and QR Encode

  • package/qrencode/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 
     8include $(TOPDIR)/rules.mk 
     9 
     10PKG_NAME:=qrencode 
     11PKG_VERSION:=3.3.1 
     12PKG_RELEASE:=1 
     13 
     14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     15PKG_SOURCE_URL:=http://fukuchi.org/works/qrencode/ 
     16PKG_MD5SUM:=07a0b45d0226054f2fac05ba5bbaf65f 
     17 
     18include $(INCLUDE_DIR)/package.mk 
     19 
     20define Package/libqrencode 
     21  SECTION:=libs 
     22  CATEGORY:=Libraries 
     23  TITLE:=Library for encoding data in a QR Code symbol 
     24  URL:=http://fukuchi.org/works/qrencode/ 
     25endef 
     26 
     27define Package/libqrencode/description 
     28Libqrencode is a C library for encoding data in a QR Code symbol, 
     29a kind of 2D symbology that can be scanned by handy terminals such 
     30as a mobile phone with CCD. The capacity of QR Code is up to 7000 
     31digits or 4000 characters, and is highly robust. 
     32 
     33 
     34endef 
     35 
     36CONFIGURE_ARGS+= \ 
     37        --enable-shared \ 
     38        --enable-static \ 
     39        --disable-rpath \ 
     40        --disable-sdltest \ 
     41        --without-tools \ 
     42        --without-tests 
     43 
     44TARGET_LDFLAGS+= -s 
     45 
     46define Build/Compile 
     47        $(MAKE) -C $(PKG_BUILD_DIR) \ 
     48                $(TARGET_CONFIGURE_OPTS) \ 
     49                CFLAGS="$(TARGET_CFLAGS)" \ 
     50                LDFLAGS="$(TARGET_LDFLAGS)" \ 
     51                DESTDIR="$(PKG_INSTALL_DIR)" \ 
     52                all install 
     53endef 
     54 
     55define Build/InstallDev 
     56        $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig 
     57        $(CP) $(PKG_INSTALL_DIR)/usr/include/qrencode.h $(1)/usr/include/ 
     58        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libqrencode.{a,so*} $(1)/usr/lib/ 
     59        $(CP) $(PKG_BUILD_DIR)/libqrencode.pc $(1)/usr/lib/pkgconfig/ 
     60endef 
     61 
     62define Package/libqrencode/install 
     63        $(INSTALL_DIR) $(1)/usr/lib 
     64        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libqrencode.so* $(1)/usr/lib/ 
     65endef 
     66 
     67$(eval $(call BuildPackage,libqrencode)) 
  • package/google-authenticator/patches/000-makefile-fix

     
     1--- a/libpam/Makefile 
     2+++ b/libpam/Makefile 
     3@@ -18,16 +18,9 @@ 
     4  
     5 .SUFFIXES: .so 
     6  
     7-ifeq ($(origin CC), default) 
     8-  CC := gcc 
     9-endif 
     10- 
     11-DEF_CFLAGS := $(shell [ `uname` = SunOS ] &&                                  \ 
     12-                echo ' -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT')              \ 
     13-              -fvisibility=hidden $(CFLAGS) 
     14-DEF_LDFLAGS := $(shell [ `uname` = SunOS ] && echo ' -mimpure-text') $(LDFLAGS) 
     15-LDL_LDFLAGS := $(shell $(CC) -shared -ldl -xc -o /dev/null /dev/null          \ 
     16-                       >/dev/null 2>&1 && echo ' -ldl') 
     17+DEF_CFLAGS  := -fvisibility=hidden $(CFLAGS) 
     18+DEF_LDFLAGS := $(LDFLAGS) 
     19+LDL_LDFLAGS := '-ldl' 
     20  
     21 all: google-authenticator pam_google_authenticator.so demo                    \ 
     22      pam_google_authenticator_unittest 
  • package/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 
     8include $(TOPDIR)/rules.mk 
     9 
     10PKG_NAME:=google-authenticator 
     11PKG_REV:=a096a628455a 
     12PKG_VERSION:=1.0 
     13PKG_RELEASE:=1 
     14 
     15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
     16PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 
     17PKG_SOURCE_PROTO:=git 
     18PKG_SOURCE_URL:=http://code.google.com/p/google-authenticator/ 
     19PKG_SOURCE_VERSION:=$(PKG_REV) 
     20 
     21include $(INCLUDE_DIR)/package.mk 
     22 
     23define 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/ 
     29endef 
     30 
     31define Package/libpam-google-authenticator/description 
     32The Google Authenticator project includes implementations of one-time 
     33passcode generators for several mobile platforms, as well as a pluggable 
     34authentication module (PAM). One-time passcodes are generated using open 
     35standards developed by the Initiative for Open Authentication (OATH) 
     36(which is unrelated to OAuth). 
     37 
     38These implementations support the HMAC-Based One-time Password (HOTP) 
     39algorithm specified in RFC 4226 and the Time-based One-time Password 
     40(TOTP) algorithm specified in RFC 6238.  
     41 
     42 
     43endef 
     44 
     45define Build/Configure 
     46endef 
     47 
     48TARGET_CFLAGS+= -I$(STAGING_DIR)/usr/include 
     49TARGET_LDFLAGS+= -s 
     50 
     51define Build/Compile 
     52        $(MAKE) -C $(PKG_BUILD_DIR)/libpam \ 
     53                $(TARGET_CONFIGURE_OPTS) \ 
     54                CFLAGS="$(TARGET_CFLAGS)" \ 
     55                LDFLAGS="$(TARGET_LDFLAGS)" \ 
     56                all 
     57endef 
     58 
     59define Package/libpam-google-authenticator/install 
     60        $(INSTALL_DIR) $(1)/usr/sbin $(1)/lib/security 
     61        $(INSTALL_BIN) $(PKG_BUILD_DIR)/libpam/google-authenticator $(1)/usr/sbin/ 
     62        $(CP) $(PKG_BUILD_DIR)/libpam/pam_google_authenticator.so $(1)/lib/security/ 
     63endef 
     64 
     65$(eval $(call BuildPackage,libpam-google-authenticator))