gammu: remove nls.mk
authorRosen Penev <redacted>
Sun, 29 Mar 2020 01:22:49 +0000 (18:22 -0700)
committerRosen Penev <redacted>
Sun, 29 Mar 2020 03:46:29 +0000 (20:46 -0700)
It's causing issues with newer glib2:

../libgammu/libGammu.so.8.1.41.0: undefined reference to `libiconv'
../libgammu/libGammu.so.8.1.41.0: undefined reference to `libiconv_open'
../libgammu/libGammu.so.8.1.41.0: undefined reference to `libiconv_close'

It's because the libiconv-stub does not include a shared library that
gammu can link to.

Removed most patches since they don't seem to be needed.

Ran init script through shellcheck.

Signed-off-by: Rosen Penev <redacted>
utils/gammu/Makefile
utils/gammu/files/gammu.init
utils/gammu/patches/001-iconv-disabling-option.patch [deleted file]
utils/gammu/patches/003-cmake-cross-toolchain.patch [deleted file]
utils/gammu/patches/004-cmake_libdbi_optional.patch [deleted file]

index cfb22d0e584fd1bac7a2d36dc69a5ed6e916ff46..7281a180e3092f36efadf0292f055836eca7c56d 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gammu
 PKG_VERSION:=1.41.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://dl.cihar.com/gammu/releases
@@ -24,7 +24,6 @@ CMAKE_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/cmake.mk
 
 define Package/gammu
@@ -32,22 +31,14 @@ define Package/gammu
        CATEGORY:=Utilities
        TITLE:=Cell phone/modem SMS and control tool
        URL:=https://wammu.eu/gammu/
-       DEPENDS:=+libpthread +libcurl +glib2 $(ICONV_DEPENDS) $(INTL_DEPENDS)
+       DEPENDS:=+libpthread +libcurl +glib2
        DEPENDS+=+PACKAGE_bluez-libs:bluez-libs
        DEPENDS+=+PACKAGE_libmariadb:libmariadb +PACKAGE_unixodbc:unixodbc +PACKAGE_libpq:libpq
        DEPENDS+=+PACKAGE_libusb-1.0:libusb-1.0
 endef
 
-CMAKE_OPTIONS += -DWITH_LibDBI:BOOL=OFF
-ifneq ($(INTL_FULL),)
-CMAKE_OPTIONS += -DLIBINTL_INCLUDE_DIRS:PATH=$(INTL_PREFIX)/include
-CMAKE_OPTIONS += -DLIBINTL_LIBRARIES:STRING=intl
-endif
-ifneq ($(ICONV_FULL),)
-CMAKE_OPTIONS += -DDISABLE_ICONV=OFF
-CMAKE_OPTIONS += -DICONV_INCLUDE_DIRS:PATH=$(ICONV_PREFIX)/include
-CMAKE_OPTIONS += -DICONV_LIBRARIES:STRING=iconv
-endif
+CMAKE_OPTIONS += \
+       -DWITH_LibDBI:BOOL=OFF
 
 define Package/gammu/install
        $(INSTALL_DIR) $(1)/usr/bin
index 37232457770b5e79f90aee8694a8dddcd2e6a0ac..a022697d9bdcca0e972e4562285e12fd547c1001 100755 (executable)
@@ -13,73 +13,74 @@ start_instance() {
        local conffile="$CONFPFX-$conf.conf"
 
        config_get_bool item "$conf" enabled 0
-       [ $item = 0 ] && return
+       [ "$item" = 0 ] && return
 
-       echo -e "; don't edit. instead look into /etc/config/gammu\n[gammu]\n" > $conffile
+       {
+       printf "; don't edit. instead look into /etc/config/gammu\n[gammu]\n\n"
 
        config_get item "$conf" device
        [ -z "$item" ] && return
-       echo "device = $item" >> $conffile
+       echo "device = $item"
 
        config_get item "$conf" connection
        [ -z "$item" ] && return
-       echo "connection = $item" >> $conffile
+       echo "connection = $item"
 
        config_get item "$conf" logfile
        [ -z "$item" ] && item=syslog
-       echo "logfile = $item" >> $conffile
+       echo "logfile = $item"
 
-       echo -e "\n[smsd]\nphoneid = $conf\nservice = files\nlogfile = $item" >> $conffile
-       echo -e "checkbattery = 0\nhangupcalls = 1" >> $conffile
+       printf "\n[smsd]\nphoneid = %s\nservice = files\nlogfile = %s\n" "$conf" "$item"
+       printf "checkbattery = 0\nhangupcalls = 1\n"
 
        config_get item "$conf" pin
-       [ -n "$item" ] && echo "pin = $item" >> $conffile
-
+       [ -n "$item" ] && echo "pin = $item"
        config_get item "$conf" phonecode
-       [ -n "$item" ] && echo "phonecode = $item" >> $conffile
+       [ -n "$item" ] && echo "phonecode = $item"
 
        config_get item "$conf" send
-       [ -n "$item" ] && echo "send = $item" >> $conffile
+       [ -n "$item" ] && echo "send = $item"
 
        config_get item "$conf" receive
-       [ -n "$item" ] && echo "receive = $item" >> $conffile
+       [ -n "$item" ] && echo "receive = $item"
 
        config_get item "$conf" timeout
-       [ -n "$item" ] && echo "commtimeout = $item" >> $conffile
+       [ -n "$item" ] && echo "commtimeout = $item"
 
        config_get item "$conf" sleep
-       [ -n "$item" ] && echo "loopsleep = $item" >> $conffile
+       [ -n "$item" ] && echo "loopsleep = $item"
 
        config_get item "$conf" report
-       [ -n "$item" ] && echo "deliveryreport = $item" >> $conffile
+       [ -n "$item" ] && echo "deliveryreport = $item"
 
        config_get item "$conf" onreceive
-       [ -n "$item" ] && echo "runonreceive = $item" >> $conffile
+       [ -n "$item" ] && echo "runonreceive = $item"
 
        config_get item "$conf" onerror
-       [ -n "$item" ] && echo "runonfailure = $item" >> $conffile
+       [ -n "$item" ] && echo "runonfailure = $item"
 
        config_get item "$conf" spool
        [ -z "$item" ] && item=/var/sms
-       [ ! -d $item ] && {
-         mkdir $item
-         mkdir $item/inbox
-         mkdir $item/outbox
-         mkdir $item/sent
-         mkdir $item/error
+       [ -d "$item" ] || {
+         mkdir "$item"
+         mkdir "$item/inbox"
+         mkdir "$item/outbox"
+         mkdir "$item/sent"
+         mkdir "$item/error"
        }
-       echo -e "inboxpath = $item/inbox/\noutboxpath = $item/outbox/" >> $conffile
-       echo -e "sentsmspath = $item/sent/\nerrorsmspath = $item/error/" >> $conffile
+       printf "inboxpath = %s/inbox/\noutboxpath = %s/outbox/\n" "$item" "$item"
+       printf "sentsmspath = %s/sent/\nerrorsmspath = %s/error/\n" "$item" "$item"
+       } > "$conffile"
 
        config_get item "$conf" allow
        [ -n "$item" ] && {
          local data
          local allowfile=$CONFPFX-$conf.allow
          for data in $item ; do
-           echo $data >> $allowfile
+           echo $data >> "$allowfile"
          done
 
-         echo "includenumbersfile = $allowfile" >> $conffile
+         echo "includenumbersfile = $allowfile" >> "$conffile"
        }
 
        config_get item "$conf" deny
@@ -87,18 +88,18 @@ start_instance() {
          local data
          local denyfile=$CONFPFX-$conf.deny
          for data in $item ; do
-           echo $data >> $denyfile
+           echo $data >> "$denyfile"
          done
 
-         echo "excludenumbersfile = $denyfile" >> $conffile
+         echo "excludenumbersfile = $denyfile" >> "$conffile"
        }
 
        procd_open_instance
 
        config_get_bool item "$conf" respawn 0
-       [ $item != 0 ] && procd_set_param respawn
+       [ "$item" = 0 ] || procd_set_param respawn
 
-       procd_set_param command $PROG --config=$conffile
+       procd_set_param command $PROG --config="$conffile"
 
        config_get item "$conf" pidfile
        [ -n "$item" ] && procd_append_param command --pid=$item
diff --git a/utils/gammu/patches/001-iconv-disabling-option.patch b/utils/gammu/patches/001-iconv-disabling-option.patch
deleted file mode 100644 (file)
index 9cc4315..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
---- a/cmake/FindIconv.cmake
-+++ b/cmake/FindIconv.cmake
-@@ -9,10 +9,10 @@
- include(CheckCCompilerFlag)
- include(CheckCSourceCompiles)
--IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
-+IF(NOT DISABLE_ICONV AND ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
-   # Already in cache, be silent
-   SET(ICONV_FIND_QUIETLY TRUE)
--ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
-+ENDIF(NOT DISABLE_ICONV AND ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
- IF(APPLE)
-     FIND_PATH(ICONV_INCLUDE_DIR iconv.h
---- a/configure
-+++ b/configure
-@@ -33,6 +33,7 @@ Usage: ./configure [options]
- --enable-backup     enable backup support
- --enable-win32      enable mingw crosscomilation
- --enable-protection enable compile time protections
-+--disable-iconv     disable iconv support
- --without-gnapplet  disable installation of gnapplet
- --without-completion disable installation of bash completion script
-@@ -57,6 +58,7 @@ CMAKE_CROSS=
- CMAKE_PROTECTION=
- CMAKE_GNAP=
- CMAKE_COMPLETE=
-+CMAKE_ICONV=
- # process command line
- while [ "$#" -gt 0 ] ; do
-@@ -91,6 +93,12 @@ while [ "$#" -gt 0 ] ; do
-         --disable-protection)
-             CMAKE_PROTECTION="-DENABLE_PROTECTION=OFF"
-             ;;
-+        --enable-iconv)
-+            CMAKE_ICONV="-DDISABLE_ICONV=OFF"
-+            ;;
-+        --disable-iconv)
-+            CMAKE_ICONV="-DDISABLE_ICONV=ON"
-+            ;;
-         --enable-debug)
-             CMAKE_DEBUG="-DCMAKE_BUILD_TYPE=Debug"
-             ;;
-@@ -139,4 +147,4 @@ fi
- cd "$BUILD_DIR"
- # invoke cmake to do configuration
--cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE
-+cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
diff --git a/utils/gammu/patches/003-cmake-cross-toolchain.patch b/utils/gammu/patches/003-cmake-cross-toolchain.patch
deleted file mode 100644 (file)
index 30a749b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
---- /dev/null
-+++ b/cmake/Toolchain-cross.cmake
-@@ -0,0 +1,5 @@
-+# search for programs in the build host directories
-+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-+# for libraries and headers in the target directories
-+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
---- a/configure
-+++ b/configure
-@@ -27,6 +27,7 @@ Usage: ./configure [options]
- --help|-h           shows this help
- --prefix=<path>     installation prefix
-+--cross-root=<path> cross-compilation prefix
- --enable-shared     enables shared build
- --enable-debug      enables debug build
- --enable-tiger      enables Mac OS X 10.4 (Tiger) build
-@@ -51,6 +52,7 @@ BUILD_DIR="$SOURCE_DIR/build-configure"
- # cmake parameters
- CMAKE_PREFIX=
-+CMAKE_ROOT=
- CMAKE_SHARED=
- CMAKE_DEBUG=
- CMAKE_BACKUP=
-@@ -69,6 +71,10 @@ while [ "$#" -gt 0 ] ; do
-         --prefix=*)
-             CMAKE_PREFIX="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
-             ;;
-+        --cross-root=*)
-+            CMAKE_ROOT="-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/Toolchain-cross.cmake"
-+            echo "SET(CMAKE_FIND_ROOT_PATH ${1##--cross-root=})" >> $SOURCE_DIR/cmake/Toolchain-cross.cmake
-+            ;;
-         --enable-backup)
-             CMAKE_BACKUP="-DWITH_BACKUP=ON"
-             ;;
-@@ -147,4 +153,4 @@ fi
- cd "$BUILD_DIR"
- # invoke cmake to do configuration
--cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
-+cmake $SOURCE_DIR $CMAKE_ROOT $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
diff --git a/utils/gammu/patches/004-cmake_libdbi_optional.patch b/utils/gammu/patches/004-cmake_libdbi_optional.patch
deleted file mode 100644 (file)
index 0067ad1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -37,6 +37,7 @@ Usage: ./configure [options]
- --disable-iconv     disable iconv support
- --without-gnapplet  disable installation of gnapplet
- --without-completion disable installation of bash completion script
-+--without-libdbi      disable libdbi support
- All enable params have their disable counterparts.
-@@ -61,6 +62,7 @@ CMAKE_PROTECTION=
- CMAKE_GNAP=
- CMAKE_COMPLETE=
- CMAKE_ICONV=
-+CMAKE_LIBDBI=
- # process command line
- while [ "$#" -gt 0 ] ; do
-@@ -117,6 +119,9 @@ while [ "$#" -gt 0 ] ; do
-         --without-completion)
-             CMAKE_COMPLETE="-DINSTALL_BASH_COMPLETION=OFF"
-             ;;
-+        --without-libdbi)
-+            CMAKE_LIBDBI="-DWITH_LibDBI=OFF"
-+            ;;
-         --build=*)
-             ;;
-         --disable-dependency-tracking)
-@@ -153,4 +158,4 @@ fi
- cd "$BUILD_DIR"
- # invoke cmake to do configuration
--cmake $SOURCE_DIR $CMAKE_ROOT $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
-+cmake $SOURCE_DIR $CMAKE_ROOT $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV $CMAKE_LIBDBI
git clone https://git.99rst.org/PROJECT