Parcourir la source

This adds package gammu v 1.33.0 to the build tree

Gammu is a tool for cell phone/modem control, including
send/receive SMS, phone directory and other.

Signed-off-by: Vitaly Protsko <villy@sft.ru>
---
 Makefile                                 |   68 +++++++++++++++++++++++++++++++
 files/gammurc                            |   37 ++++++++++++++++
 patches/001-iconv-disabling-option.patch |   51 +++++++++++++++++++++++
 patches/002-no-fstack-protector.patch    |   11 +++++
 patches/003-cmake-cross-toolchain.patch  |   43 +++++++++++++++++++
 patches/010-utils-shell-fix.patch        |   16 +++++++
 6 files changed, 226 insertions(+)
aTanW il y a 10 ans
Parent
révision
f044f11552

+ 68
- 0
utils/gammu/Makefile Voir le fichier

@@ -0,0 +1,68 @@
1
+#
2
+# Copyright (C) 2006-2014 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:=gammu
11
+PKG_VERSION:=1.33.0
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE_URL:=http://dl.cihar.com/gammu/releases/
15
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16
+PKG_MD5SUM:=66b95afbde3085168c4a20266e8cb5c0
17
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18
+PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
19
+PKG_LICENCE:=GPL-2.0
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+include $(INCLUDE_DIR)/nls.mk
23
+
24
+define Package/gammu
25
+	SECTION:=utils
26
+	CATEGORY:=Utilities
27
+	TITLE:=Cell phone/modem SMS and control tool
28
+	URL:=http://dl.cihar.com/gammu/releases/
29
+	DEPENDS:=@BUILD_NLS +libpthread +libcurl +glib2 $(ICONV_DEPENDS) $(INTL_DEPENDS)
30
+	DEPENDS+=+PACKAGE_python:python +PACKAGE_bluez-libs:bluez-libs
31
+	DEPENDS+=+PACKAGE_libmysqlclient:libmysqlclient +PACKAGE_unixodbc:unixodbc
32
+endef
33
+
34
+CONFIGURE_ARGS:= \
35
+	--prefix=/usr \
36
+	--cross-root="$(STAGING_DIR) $(TOOLCHAIN_DIR)" \
37
+	--enable-shared
38
+
39
+define Build/Compile
40
+	$(MAKE) -C $(PKG_BUILD_DIR) \
41
+		$(TARGET_CONFIGURE_OPTS) \
42
+		LDSHARED="$(TARGET_CROSS)ld -shared" \
43
+		CFLAGS="$(TARGET_CFLAGS) $(FPIC)"
44
+endef
45
+
46
+define Build/Install
47
+	$(MAKE) -C $(PKG_BUILD_DIR) \
48
+		DESTDIR="$(PKG_INSTALL_DIR)" \
49
+		install
50
+endef
51
+
52
+define Build/InstallDev
53
+	mkdir -p $(1)/usr/include
54
+	$(CP) -r $(PKG_INSTALL_DIR)/usr/include/gammu $(1)/usr/include/
55
+	mkdir -p $(1)/usr/lib
56
+	$(CP)    $(PKG_INSTALL_DIR)/usr/lib/lib{Gammu*,gsmsd*} $(1)/usr/lib/
57
+endef
58
+
59
+define Package/gammu/install
60
+	$(INSTALL_DIR) $(1)/usr/bin
61
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gammu $(1)/usr/bin
62
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gammu-{smsd,smsd-inject,smsd-monitor} $(1)/usr/bin
63
+	$(INSTALL_DIR) $(1)/usr/lib
64
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lib{Gammu*,gsmsd*} $(1)/usr/lib
65
+	$(INSTALL_BIN) ./files/gammurc $(1)/etc
66
+endef
67
+
68
+$(eval $(call BuildPackage,gammu))

+ 37
- 0
utils/gammu/files/gammurc Voir le fichier

@@ -0,0 +1,37 @@
1
+# Port		: "/dev/ttyS%" or "/dev/ircomm%" ("irda" connection), "/dev/ttyUSB%"
2
+#		  (instead of "%" please put "0", "1", "2", etc.)
3
+# Model		: use only, when Gammu doesn't recognize your phone model.
4
+#		  Put it here. Example values: "6110", "6150", "6210", "8210"
5
+# Connection	: type of connection. Use "fbus" or "mbus" or "dlr3" or
6
+#		  "irda" (Infrared over sockets) or "infrared" (DirectIR)
7
+#		  or "at19200" (AT commands on 19200, 8 bits, None parity,
8
+#		  1 stop bit, no flow control) or "at115200" (AT commands on
9
+#		  115200, 8 bits, None parity, 1 stop bit, no flow control)
10
+#		  or "atblue" (AT over BlueTooth) or "dlr3blue" (FBUS
11
+#		  over BlueTooth)
12
+# SynchronizeTime: If you want to set time from computer to phone during
13
+#		  starting connection. Do not rather use this option when want
14
+#		  to reset phone during connection (in some phones need to
15
+#		  set time again after restart)
16
+# Logfile	: Use, when want to have logfile from communication.
17
+# Logformat	: What debug info and format should be used:
18
+#		  "nothing" - no debug level, "text" - transmission dump in
19
+#		  text format, "textall" - all possible info in text format,
20
+#		  "errors"  - errors in text format, "binary" - transmission
21
+#		  dump in binary format
22
+# Use_Locking	: under Unix/Linux use "yes", if want to lock used device
23
+#		  to prevent using it by other applications
24
+# GammuLoc	: name of localisation file
25
+
26
+[gammu]
27
+
28
+port = /dev/ttyUSB0
29
+#model =
30
+connection = at
31
+#synchronizetime = yes
32
+#logfile =
33
+#logformat = errors
34
+use_locking = yes
35
+#gammuloc =
36
+
37
+# EOF /etc/gammurc

+ 51
- 0
utils/gammu/patches/001-iconv-disabling-option.patch Voir le fichier

@@ -0,0 +1,51 @@
1
+--- a/cmake/FindIconv.cmake
2
++++ b/cmake/FindIconv.cmake
3
+@@ -34,9 +34,9 @@ string(REGEX REPLACE "(.*)/include/?" "\
4
+ 
5
+ FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c HINTS "${ICONV_INCLUDE_BASE_DIR}/lib" PATHS /opt/local/lib)
6
+  
7
+-IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
8
++IF(NOT DISABLE_ICONV AND ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
9
+    SET(ICONV_FOUND TRUE) 
10
+-ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
11
++ENDIF(NOT DISABLE_ICONV AND ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
12
+ 
13
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
14
+ set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
15
+--- a/configure
16
++++ b/configure
17
+@@ -31,6 +31,7 @@ Usage: ./configure [options]
18
+ --enable-backup     enable backup support
19
+ --enable-win32      enable mingw crosscomilation
20
+ --enable-protection enable compile time protections
21
++--disable-iconv     disable iconv support
22
+ --with-python=<path> path to Python interpreter
23
+ --without-gnapplet  disable installation of gnapplet
24
+ --without-completion disable installation of bash completion script
25
+@@ -57,6 +58,7 @@ CMAKE_PROTECTION=
26
+ CMAKE_PYTHON=
27
+ CMAKE_GNAP=
28
+ CMAKE_COMPLETE=
29
++CMAKE_ICONV=
30
+ 
31
+ # process command line
32
+ while [ "$#" -gt 0 ] ; do
33
+@@ -94,6 +96,12 @@ while [ "$#" -gt 0 ] ; do
34
+         --disable-protection)
35
+             CMAKE_PROTECTION="-DENABLE_PROTECTION=OFF"
36
+             ;;
37
++        --enable-iconv)
38
++            CMAKE_ICONV="-DDISABLE_ICONV=OFF"
39
++            ;;
40
++        --disable-iconv)
41
++            CMAKE_ICONV="-DDISABLE_ICONV=ON"
42
++            ;;
43
+         --enable-debug)
44
+             CMAKE_DEBUG="-DCMAKE_BUILD_TYPE=Debug"
45
+             ;;
46
+@@ -142,4 +150,4 @@ fi
47
+ cd "$BUILD_DIR"
48
+ 
49
+ # invoke cmake to do configuration
50
+-cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE
51
++cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV

+ 11
- 0
utils/gammu/patches/002-no-fstack-protector.patch Voir le fichier

@@ -0,0 +1,11 @@
1
+--- a/CMakeLists.txt
2
++++ b/CMakeLists.txt
3
+@@ -537,8 +537,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMP
4
+         #    MACRO_TUNE_LINKER("-pie")
5
+         # These do not work on Windows right now
6
+         if (NOT WIN32)
7
+-            # Stack protector
8
+-            MACRO_TUNE_COMPILER("-fstack-protector")
9
+             # Mark code read only
10
+             MACRO_TUNE_LINKER("-Wl,-zrelro")
11
+         endif (NOT WIN32)

+ 43
- 0
utils/gammu/patches/003-cmake-cross-toolchain.patch Voir le fichier

@@ -0,0 +1,43 @@
1
+--- /dev/null
2
++++ b/cmake/Toolchain-cross.cmake
3
+@@ -0,0 +1,5 @@
4
++# search for programs in the build host directories
5
++SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
6
++# for libraries and headers in the target directories
7
++SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
8
++SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
9
+--- a/configure
10
++++ b/configure
11
+@@ -25,6 +25,7 @@ Usage: ./configure [options]
12
+ 
13
+ --help|-h           shows this help
14
+ --prefix=<path>     installation prefix
15
++--cross-root=<path> cross-compilation prefix
16
+ --enable-shared     enables shared build
17
+ --enable-debug      enables debug build
18
+ --enable-tiger      enables Mac OS X 10.4 (Tiger) build
19
+@@ -50,6 +51,7 @@ SOURCE_DIR=`pwd`
20
+ 
21
+ # cmake parameters
22
+ CMAKE_PREFIX=
23
++CMAKE_ROOT=
24
+ CMAKE_SHARED=
25
+ CMAKE_DEBUG=
26
+ CMAKE_BACKUP=
27
+@@ -69,6 +71,10 @@ while [ "$#" -gt 0 ] ; do
28
+         --prefix=*)
29
+             CMAKE_PREFIX="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
30
+             ;;
31
++        --cross-root=*)
32
++            CMAKE_ROOT="-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/Toolchain-cross.cmake"
33
++            echo "SET(CMAKE_FIND_ROOT_PATH ${1##--cross-root=})" >> $SOURCE_DIR/cmake/Toolchain-cross.cmake
34
++            ;;
35
+         --with-python=*)
36
+             CMAKE_PYTHON="-DBUILD_PYTHON=${1##--with-python=}"
37
+             ;;
38
+@@ -150,4 +156,4 @@ fi
39
+ cd "$BUILD_DIR"
40
+ 
41
+ # invoke cmake to do configuration
42
+-cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
43
++cmake $SOURCE_DIR $CMAKE_ROOT $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV

+ 16
- 0
utils/gammu/patches/010-utils-shell-fix.patch Voir le fichier

@@ -0,0 +1,16 @@
1
+--- a/utils/gammu-config
2
++++ b/utils/gammu-config
3
+@@ -1,4 +1,4 @@
4
+-#!/bin/bash
5
++#!/bin/sh
6
+ # Gammu configuration generator
7
+ # Copyright (C) 2003 - 2009 Michal Cihar <michal@cihar.com>
8
+ # vim: expandtab sw=4 ts=4 sts=4:
9
+--- a/utils/jadmaker
10
++++ b/utils/jadmaker
11
+@@ -1,4 +1,4 @@
12
+-#!/bin/bash
13
++#!/bin/sh
14
+ # JAD file generator
15
+ # Copyright © 2008 - 2009 Michal Čihař <michal@cihar.com>
16
+ # vim: expandtab sw=4 ts=4 sts=4: