diff --git a/libports/lib/import/import-libssh.mk b/libports/lib/import/import-libssh.mk new file mode 100644 index 000000000..ba492020d --- /dev/null +++ b/libports/lib/import/import-libssh.mk @@ -0,0 +1 @@ +REP_INC_DIR += include/libssh diff --git a/libports/lib/mk/libssh.mk b/libports/lib/mk/libssh.mk new file mode 100644 index 000000000..90740eb41 --- /dev/null +++ b/libports/lib/mk/libssh.mk @@ -0,0 +1,55 @@ +include $(REP_DIR)/ports/libssh.inc + +LIBSSH_DIR = $(REP_DIR)/contrib/$(LIBSSH) + +SRC_C = \ + agent.c \ + auth.c \ + base64.c \ + buffer.c \ + callbacks.c \ + channels.c \ + client.c \ + config.c \ + connect.c \ + crc32.c \ + crypt.c \ + dh.c \ + error.c \ + getpass.c \ + gcrypt_missing.c \ + gzip.c \ + init.c \ + kex.c \ + keyfiles.c \ + keys.c \ + known_hosts.c \ + legacy.c \ + libcrypto.c \ + libgcrypt.c \ + log.c \ + match.c \ + messages.c \ + misc.c \ + options.c \ + packet.c \ + pcap.c \ + pki.c \ + poll.c \ + session.c \ + scp.c \ + socket.c \ + string.c \ + threads.c \ + wrapper.c + +#INC_DIR += $(LIBSSH_DIR) +INC_DIR += $(REP_DIR)/src/lib/libssh + +CC_OPT += -DHAVE_CONFIG_H + +LIBS += libc zlib libcrypto + +SHARED_LIB = yes + +vpath %.c $(LIBSSH_DIR)/src diff --git a/libports/ports/libssh.inc b/libports/ports/libssh.inc new file mode 100644 index 000000000..cadf1c634 --- /dev/null +++ b/libports/ports/libssh.inc @@ -0,0 +1,2 @@ +LIBSSH_VERSION = 0.5.4 +LIBSSH = libssh-$(LIBSSH_VERSION) diff --git a/libports/ports/libssh.mk b/libports/ports/libssh.mk new file mode 100644 index 000000000..ff2873ffe --- /dev/null +++ b/libports/ports/libssh.mk @@ -0,0 +1,31 @@ +include ports/libssh.inc + +LIBSSH_TGZ = $(LIBSSH).tar.gz +LIBSSH_URL = https://red.libssh.org/attachments/download/41/$(LIBSSH_TGZ) + +# +# Interface to top-level prepare Makefile +# +PORTS += $(LIBSSH) + +prepare-libssh: $(CONTRIB_DIR)/$(LIBSSH) include/libssh + +$(CONTRIB_DIR)/$(LIBSSH): clean-libssh + +# +# Port-specific local rules +# +$(DOWNLOAD_DIR)/$(LIBSSH_TGZ): + $(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(LIBSSH_URL) && touch $@ + +$(CONTRIB_DIR)/$(LIBSSH): $(DOWNLOAD_DIR)/$(LIBSSH_TGZ) + $(VERBOSE)tar xfz $< -C $(CONTRIB_DIR) && touch $@ + +include/libssh: + $(VERBOSE)mkdir -p $@ + $(VERBOSE)for f in $(shell find $(CONTRIB_DIR)/$(LIBSSH)/include -name *.h); do \ + ln -sf ../../$$f $@; done + +clean-libssh: + $(VERBOSE)rm -rf $(CONTRIB_DIR)/$(LIBSSH) + $(VERBOSE)rm -rf include/libssh diff --git a/libports/src/lib/libssh/config.h b/libports/src/lib/libssh/config.h new file mode 100644 index 000000000..d8d308da8 --- /dev/null +++ b/libports/src/lib/libssh/config.h @@ -0,0 +1,126 @@ +/* Name of package */ +#define PACKAGE "libssh" + +/* Version number of package */ +#define VERSION "0.5.2" + +/* #undef LOCALEDIR */ +#define DATADIR "/share/libssh" +#define LIBDIR "/lib" +#define PLUGINDIR "/lib/libssh-4" +#define SYSCONFDIR "/etc" + +/************************** HEADER FILES *************************/ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARGP_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_AES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WSPIAPI_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_BLOWFISH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_DES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PTHREAD_H */ + + +/*************************** FUNCTIONS ***************************/ + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `_snprintf' function. */ +/* #undef HAVE__SNPRINTF */ + +/* Define to 1 if you have the `_snprintf_s' function. */ +/* #undef HAVE__SNPRINTF_S */ + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the `_vsnprintf' function. */ +/* #undef HAVE__VSNPRINTF */ + +/* Define to 1 if you have the `_vsnprintf_s' function. */ +/* #undef HAVE__VSNPRINTF_S */ + +/* Define to 1 if you have the `strncpy' function. */ +#define HAVE_STRNCPY 1 + +/* Define to 1 if you have the `cfmakeraw' function. */ +/* #unfdef HAVE_CFMAKERAW */ + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `poll' function. */ +/* #undef HAVE_POLL */ + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `regcomp' function. */ +#define HAVE_REGCOMP 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the `ntohll' function. */ +/* #undef HAVE_NTOHLL */ + +/*************************** LIBRARIES ***************************/ + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#define HAVE_LIBCRYPTO 1 + +/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ +/* #undef HAVE_LIBGCRYPT */ + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +/* #undef HAVE_PTHREAD */ + + +/**************************** OPTIONS ****************************/ + +/* Define to 1 if you want to enable ZLIB */ +#define WITH_LIBZ 1 + +/* Define to 1 if you want to enable SFTP */ +#define WITH_SFTP 1 + +/* Define to 1 if you want to enable SSH1 */ +/* #undef WITH_SSH1 */ + +/* Define to 1 if you want to enable server support */ +/* #undef WITH_SERVER */ + +/* Define to 1 if you want to enable debug output for crypto functions */ +/* #undef DEBUG_CRYPTO */ + +/* Define to 1 if you want to enable pcap output support (experimental) */ +/* #undef WITH_PCAP */ + +/* Define to 1 if you want to enable calltrace debug output */ +#define DEBUG_CALLTRACE 1 + +/*************************** ENDIAN *****************************/ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +/* #undef WORDS_BIGENDIAN */ diff --git a/libports/src/test/libports/libssh/target.mk b/libports/src/test/libports/libssh/target.mk new file mode 100644 index 000000000..9b287223a --- /dev/null +++ b/libports/src/test/libports/libssh/target.mk @@ -0,0 +1,5 @@ +TARGET = test-libssh +LIBS = base libcrypto libssh +SRC_CC = main.cc + +vpath main.cc $(PRG_DIR)/..