crtmpserver: Fix compilation without deprecated OpenSSL APIs
authorRosen Penev <redacted>
Mon, 26 Nov 2018 02:37:12 +0000 (18:37 -0800)
committerRosen Penev <redacted>
Thu, 27 Dec 2018 02:01:10 +0000 (18:01 -0800)
Switched to codeload to simplify the Makefile.

Removed the website as it is no longer valid.

Renamed .diff file to .patch

Added uclibc++ support. Fixed 060-add-missing-includes.patch , which was
totally wrong to begin with. C headers are generally not used with C++
programs.

Minor cleanups.

Signed-off-by: Rosen Penev <redacted>
multimedia/crtmpserver/Makefile
multimedia/crtmpserver/patches/060-add-missing-includes.patch
multimedia/crtmpserver/patches/090-openssl-1.1-compat.patch [moved from multimedia/crtmpserver/patches/090-openssl-1.1-compat.diff with 100% similarity]
multimedia/crtmpserver/patches/100-openssl-deprecated.patch [new file with mode: 0644]

index 571555d61f52e547dd21ed2dcf5659c2a017b2ee..25a22410f555a35232057ecc47bb9e7300a3e3d0 100644 (file)
@@ -10,27 +10,26 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=crtmpserver
 PKG_REV:=b6fdcdb953d1e99c48a0c37a8c80f2cad2db443b
 PKG_VERSION:=2012-07-18+git-$(PKG_REV)
-PKG_RELEASE:=3
-PKG_BUILD_PARALLEL:=2
+PKG_RELEASE:=4
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/j0sh/crtmpserver/tar.gz/$(PKG_REV)?
+PKG_HASH:=e210eeb99d39334e7beb0a1be27dcf23d1f851383f87cf63d7fb98209ef96cee
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_REV)
+
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=GPL-3.0
 
+PKG_BUILD_PARALLEL:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MIRROR_HASH:=8d887996b6b8cb465ec59f3f713fca46161cbb804cacd2b5405f836083fb58ba
-PKG_SOURCE_URL:=https://github.com/j0sh/crtmpserver.git
-PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_PROTO:=git
-
+include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
 
 define Package/crtmpserver
   SECTION:=multimedia
   CATEGORY:=Multimedia
-  DEPENDS:=+libopenssl +libstdcpp +liblua
+  DEPENDS:=$(CXX_DEPENDS) +libopenssl +liblua
   TITLE:=C++ RTMP Server
-  URL:=http://www.rtmpd.com/
 endef
 
 define Package/crtmpserver/description
index 7b9da39a2b36a3a99e2745e224b38e70d2f14a9f..c5241c27cf06b57d5cd37785dfaa1650ea5e75b6 100644 (file)
@@ -1,26 +1,10 @@
---- a/sources/common/include/common.h
-+++ b/sources/common/include/common.h
-@@ -20,6 +20,10 @@
- #ifndef _COMMON_H
- #define _COMMON_H
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <sys/types.h>
-+
- #include "defines.h"
- #include "platform/platform.h"
- #include "utils/utils.h"
 --- a/sources/common/src/utils/logging/fileloglocation.cpp
 +++ b/sources/common/src/utils/logging/fileloglocation.cpp
-@@ -18,6 +18,10 @@
+@@ -17,6 +17,7 @@
+  *  along with crtmpserver.  If not, see <http://www.gnu.org/licenses/>.
   */
  
++#include <ctime>
  
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <sys/types.h>
-+
  #include "utils/logging/fileloglocation.h"
  #include "utils/lua/luautils.h"
- #include "utils/misc/file.h"
diff --git a/multimedia/crtmpserver/patches/100-openssl-deprecated.patch b/multimedia/crtmpserver/patches/100-openssl-deprecated.patch
new file mode 100644 (file)
index 0000000..60b362b
--- /dev/null
@@ -0,0 +1,46 @@
+--- a/sources/common/src/utils/misc/crypto.cpp
++++ b/sources/common/src/utils/misc/crypto.cpp
+@@ -350,6 +350,7 @@ string unhex(string source) {
+       return result;
+ }
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ void CleanupSSL() {
+       ERR_remove_state(0);
+       ENGINE_cleanup();
+@@ -358,3 +359,4 @@ void CleanupSSL() {
+       EVP_cleanup();
+       CRYPTO_cleanup_all_ex_data();
+ }
++#endif
+--- a/sources/crtmpserver/src/crtmpserver.cpp
++++ b/sources/crtmpserver/src/crtmpserver.cpp
+@@ -298,8 +298,10 @@ void Cleanup() {
+       delete gRs.pConfigFile;
+       gRs.pConfigFile = NULL;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+       WARN("Doing final OpenSSL cleanup");
+       CleanupSSL();
++#endif
+       WARN("Shutting down the logger leaving you in the dark. Bye bye... :(");
+       Logger::Free(true);
+--- a/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
++++ b/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
+@@ -43,6 +43,7 @@ BaseSSLProtocol::~BaseSSLProtocol() {
+ bool BaseSSLProtocol::Initialize(Variant &parameters) {
+       //1. Initialize the SSL library
+       if (!_libraryInitialized) {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+               //3. This is the first time we use the library. So we have to
+               //initialize it first
+               SSL_library_init();
+@@ -55,6 +56,7 @@ bool BaseSSLProtocol::Initialize(Variant &parameters) {
+               OpenSSL_add_all_algorithms();
+               OpenSSL_add_all_ciphers();
+               OpenSSL_add_all_digests();
++#endif
+               //initialize the random numbers generator
+               InitRandGenerator();
git clone https://git.99rst.org/PROJECT