From 17a1fd91159f59a36eddac7061afe6531143ff01 Mon Sep 17 00:00:00 2001 From: gregory guy Date: Tue, 17 Nov 2020 16:31:13 +0100 Subject: Drop tqmake build support. Add basic cmake build instructions. Rework of the README file. Signed-off-by: gregory guy --- INSTALL | 29 +++ README | 27 +-- configure | 598 ------------------------------------------------------------ openssl.qcm | 80 -------- prepare | 5 - qca-tls.pro | 26 --- qca-tls.qc | 9 - qcextra | 9 - 8 files changed, 44 insertions(+), 739 deletions(-) create mode 100644 INSTALL delete mode 100755 configure delete mode 100644 openssl.qcm delete mode 100755 prepare delete mode 100644 qca-tls.pro delete mode 100644 qca-tls.qc delete mode 100755 qcextra diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..8c88833 --- /dev/null +++ b/INSTALL @@ -0,0 +1,29 @@ +Basic Installation +================== + +tqca-tls relies on cmake to build. + +Here are suggested default options: + + -DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \ + -DCMAKE_INSTALL_PREFIX="/usr" \ + -DCONFIG_INSTALL_DIR="/etc/trinity" \ + -DSYSCONF_INSTALL_DIR="/etc/trinity" \ + -DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_VERBOSE_MAKEFILE="ON" \ + -DCMAKE_SKIP_RPATH="OFF" \ + -DWITH_ALL_OPTIONS="ON" + + + +Requirements: +============= + +- OpenSSL + + +Optional: +========= + +- tqca diff --git a/README b/README index eb3d5b3..b4fdde4 100644 --- a/README +++ b/README @@ -1,16 +1,19 @@ -TQCA TLS Plugin v1.0 -------------------- -Author: Justin Karneges -Date: September 15th, 2003 -This is a plugin to provide SSL/TLS capability to programs that -utilize the TQt Cryptographic Architecture (TQCA). + tqca-tls - TQCA TLS Plugin -Requirements: - OpenSSL Library (http://www.openssl.org/) -Installation procedure: - ./configure - make - su -c "make install" +tqca-tls is a plugin to provide SSL/TLS capability to programs that +use the TQt Cryptographic Architecture (TQCA). + + +CONTRIBUTING +============== + +If you wish to contribute to tqca-tls, you might do so: + +- TDE Gitea Workspace (TGW) collaboration tool. + https://mirror.git.trinitydesktop.org/gitea + +- TDE Weblate Translation Workspace (TWTW) collaboration tool. + https://mirror.git.trinitydesktop.org/weblate diff --git a/configure b/configure deleted file mode 100755 index d5e2250..0000000 --- a/configure +++ /dev/null @@ -1,598 +0,0 @@ -#!/bin/sh - -show_usage() { -cat <$1/modules.cpp <getenv("QC_WITH_OPENSSL_INC"); - if(!s.isEmpty()) { - if(!conf->checkHeader(s, "openssl/ssl.h")) - return false; - inc = s; - } - else { - if(!conf->findHeader("openssl/ssl.h", TQStringList(), &s)) - return false; - inc = s; - } - - s = conf->getenv("QC_WITH_OPENSSL_LIB"); - if(!s.isEmpty()) { - if(!conf->checkLibrary(s, "ssl")) - return false; - lib = s; - } - else { - if(!conf->findLibrary("ssl", &s)) - return false; - lib = s; - } - - // is it at least openssl 0.9.7? - TQString str = - "#include\n" - "int main()\n" - "{\n" - " unsigned long x = OPENSSL_VERSION_NUMBER;\n" - " if(x >= 0x00907000) return 0; else return 1;\n" - "}\n"; - TQString ext; - if(!inc.isEmpty()) - ext += TQString("-I") + inc + ' '; - if(kb) - ext += TQString("-I") + kbdir + ' '; - if(!lib.isEmpty()) - ext += TQString("-L") + lib + " -lssl -lcrypto "; - int ret; - if(!conf->doCompileAndLink(str, ext, &ret)) - return false; - if(ret == 0) - conf->addDefine("OSSL_097"); - - if(!inc.isEmpty()) - conf->addIncludePath(inc); - if(kb) - conf->addIncludePath(kbdir); - if(!lib.isEmpty()) - conf->addLib(TQString("-L") + s); - conf->addLib("-lssl -lcrypto"); - - // Make sure tqtinterface can be found - conf->addIncludePath("/usr/include/tqt"); - - return true; - } -}; - -EOT -cat >$1/modules_new.cpp <required = true; - o->disabled = false; - -EOT -cat >$1/conf.cpp < -#include -#include -#include -#include -#include -#include -#include -#include - -class Conf; - -class ConfObj -{ -public: - ConfObj(Conf *c); - virtual ~ConfObj(); - - virtual TQString name() const=0; - virtual TQString shortname() const=0; - virtual bool exec()=0; - - Conf *conf; - bool required; - bool disabled; -}; - -typedef TQPtrList ConfObjList; -typedef TQPtrListIterator ConfObjListIt; - -class Conf -{ -public: - Conf() : vars(17) - { - list.setAutoDelete(true); - vars.setAutoDelete(true); - - vars.insert("QMAKE_INCDIR_X11", new TQString(X11_INC)); - vars.insert("QMAKE_LIBDIR_X11", new TQString(X11_LIBDIR)); - vars.insert("QMAKE_LIBS_X11", new TQString(X11_LIB)); - vars.insert("QMAKE_CC", new TQString(CC)); - } - - ~Conf() - { - } - - void added(ConfObj *o) - { - list.append(o); - } - - TQString getenv(const TQString &var) - { - char *p = ::getenv(var.latin1()); - if(!p) - return TQString::null; - return TQString(p); - } - - bool exec() - { - ConfObjListIt it(list); - for(ConfObj *o; (o = it.current()); ++it) { - // if this was a disabled-by-default option, check if it was enabled - if(o->disabled) { - TQString v = TQString("QC_ENABLE_") + o->shortname(); - if(getenv(v) != "Y") - continue; - } - // and the opposite? - else { - TQString v = TQString("QC_DISABLE_") + o->shortname(); - if(getenv(v) == "Y") - continue; - } - - printf("Checking for %s ...", o->name().latin1()); - fflush(stdout); - bool ok = o->exec(); - if(ok) - printf(" yes\n"); - else - printf(" no\n"); - if(!ok && o->required) { - printf("\nError: need %s!\n", o->name().latin1()); - return false; - } - } - return true; - } - - const TQString & qvar(const TQString &s) - { - TQString *p = vars.find(s); - if(p) - return *p; - else - return blank; - } - - TQString expandIncludes(const TQString &inc) - { - return TQString("-I") + inc; - } - - TQString expandLibs(const TQString &lib) - { - return TQString("-L") + lib; - } - - int doCommand(const TQString &s) - { - //printf("[%s]\n", s.latin1()); - int r = system((s + " 1>/dev/null 2>/dev/null").latin1()); - //printf("returned: %d\n", r); - return r; - } - - bool doCompileAndLink(const TQString &filedata, const TQString &flags, int *retcode=0) - { - TQDir dir("."); - TQString fname = "atest.c"; - TQString out = "atest"; - TQFile f(fname); - TQCString cs = filedata.latin1(); - if(!f.open(IO_WriteOnly | IO_Truncate)) - return false; - f.writeBlock(cs.data(), cs.length()); - f.close(); - - TQString str = qvar("QMAKE_CC") + ' ' + fname + " -o " + out + ' ' + flags; - int r = doCommand(str); - if(r == 0 && retcode) - *retcode = doCommand(TQString("./") + out); - dir.remove(fname); - dir.remove(out); - if(r != 0) - return false; - return true; - } - - bool checkHeader(const TQString &path, const TQString &h) - { - TQFileInfo fi(path + '/' + h); - if(fi.exists()) - return true; - return false; - } - - bool findHeader(const TQString &h, const TQStringList &ext, TQString *inc) - { - if(checkHeader("/usr/include", h)) { - *inc = ""; - return true; - } - TQStringList dirs; - dirs += "/usr/local/include"; - dirs += ext; - for(TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) { - if(checkHeader(*it, h)) { - *inc = *it; - return true; - } - } - return false; - } - - bool checkLibrary(const TQString &path, const TQString &name) - { - TQString str = - "int main()\n" - "{\n" - " return 0;\n" - "}\n"; - - TQString extra; - if(!path.isEmpty()) - extra += TQString("-L") + path + ' '; - extra += TQString("-l") + name; - if(!doCompileAndLink(str, extra)) - return false; - return true; - } - - bool findLibrary(const TQString &name, TQString *lib) - { - if(checkLibrary("", name)) { - *lib = ""; - return true; - } - if(checkLibrary("/usr/local/lib", name)) { - *lib = "/usr/local/lib"; - return true; - } - if(checkLibrary("/usr/local/lib64", name)) { - *lib = "/usr/local/lib64"; - return true; - } - return false; - } - - void addDefine(const TQString &str) - { - if(DEFINES.isEmpty()) - DEFINES = str; - else - DEFINES += TQString(" ") + str; - } - - void addLib(const TQString &str) - { - if(LIBS.isEmpty()) - LIBS = str; - else - LIBS += TQString(" ") + str; - } - - void addIncludePath(const TQString &str) - { - if(INCLUDEPATH.isEmpty()) - INCLUDEPATH = str; - else - INCLUDEPATH += TQString(" ") + str; - } - - void addExtra(const TQString &str) - { - extra += str + '\n'; - } - - TQString DEFINES; - TQString INCLUDEPATH; - TQString LIBS; - TQString extra; - -private: - ConfObjList list; - TQDict vars; - TQString blank; -}; - -ConfObj::ConfObj(Conf *c) -{ - conf = c; - conf->added(this); - required = false; - disabled = false; -} - -ConfObj::~ConfObj() -{ -} - -#include"modules.cpp" - -//---------------------------------------------------------------------------- -// main -//---------------------------------------------------------------------------- -int main() -{ - Conf *conf = new Conf; - ConfObj *o; - o = 0; -#include"modules_new.cpp" - - printf("ok\n"); - bool success = false; - if(conf->exec()) { - TQFile f("conf.pri"); - if(!f.open(IO_WriteOnly | IO_Truncate)) { - printf("Error writing %s\n", f.name().latin1()); - return 1; - } - - TQString str; - str += "# qconf\n"; - str += "QT_PATH_PLUGINS = " + TQString(tqInstallPathPlugins()) + '\n'; - if(!conf->DEFINES.isEmpty()) - str += "DEFINES += " + conf->DEFINES + '\n'; - if(!conf->INCLUDEPATH.isEmpty()) - str += "INCLUDEPATH += " + conf->INCLUDEPATH + '\n'; - if(!conf->LIBS.isEmpty()) - str += "LIBS += " + conf->LIBS + '\n'; - if(!conf->extra.isEmpty()) - str += conf->extra; - str += '\n'; - - char *p = getenv("BINDIR"); - if(p) { - str += TQString("target.path = ") + p + '\n'; - str += "INSTALLS += target\n"; - } - - TQCString cs = str.latin1(); - f.writeBlock(cs.data(), cs.length()); - f.close(); - success = true; - } - delete conf; - - if(success) - return 0; - else - return 1; -} - -EOT -cat >$1/conf.pro </dev/null - TQTDIR=$TQTDIR make clean >/dev/null 2>&1 - TQTDIR=$TQTDIR make >../conf.log 2>&1 -) - -if [ "$?" != "0" ]; then - rm -rf .qconftemp - echo fail - echo - echo "There was an error compiling 'conf'. Be sure you have a proper" - echo "TQt 3.x Multithreaded (MT) build environment set up." - if [ ! -f "$TQTDIR/lib/libtqt-mt.so.3" ]; then - if [ ! -f "$TQTDIR/lib64/libtqt-mt.so.3" ]; then - echo - echo "One possible reason is that you don't have" - echo "libtqt-mt.so.3 installed in $TQTDIR/lib/" - echo "or $TQTDIR/lib64/." - fi - fi - echo - exit 1; -fi - -.qconftemp/conf -ret="$?" -if [ "$ret" = "1" ]; then - rm -rf .qconftemp - echo - exit 1; -else - if [ "$ret" != "0" ]; then - rm -rf .qconftemp - echo fail - echo - echo Unexpected error launching 'conf' - echo - exit 1; - fi -fi -rm -rf .qconftemp - -if [ -x "./qcextra" ]; then - ./qcextra -fi -# run tqmake -if expr "$DEB_BUILD_OPTIONS" : ".*nostrip"; then - $qm QMAKE_STRIP=true qca-tls.pro -else - $qm qca-tls.pro -fi -if [ "$?" != "0" ]; then - echo - exit 1; -fi -cat >Makefile.tmp <> Makefile.tmp -rm -f Makefile -cp -f Makefile.tmp Makefile -rm -f Makefile.tmp - -echo -echo Good, your configure finished. Now run \'make\'. -echo diff --git a/openssl.qcm b/openssl.qcm deleted file mode 100644 index 242ad20..0000000 --- a/openssl.qcm +++ /dev/null @@ -1,80 +0,0 @@ -/* ------BEGIN QCMOD----- -name: OpenSSL -arg: with-openssl-inc=[path],Path to OpenSSL include files -arg: with-openssl-lib=[path],Path to OpenSSL library files ------END QCMOD----- -*/ -class qc_openssl : public ConfObj -{ -public: - qc_openssl(Conf *c) : ConfObj(c) {} - QString name() const { return "OpenSSL"; } - QString shortname() const { return "openssl"; } - bool exec() - { - QString inc, lib; - QString s; - bool kb = false; - QString kbdir = "/usr/kerberos/include"; - - // Redhat 9? - if(QFileInfo(kbdir).exists()) - kb = true; - - s = conf->getenv("QC_WITH_OPENSSL_INC"); - if(!s.isEmpty()) { - if(!conf->checkHeader(s, "openssl/ssl.h")) - return false; - inc = s; - } - else { - if(!conf->findHeader("openssl/ssl.h", QStringList(), &s)) - return false; - inc = s; - } - - s = conf->getenv("QC_WITH_OPENSSL_LIB"); - if(!s.isEmpty()) { - if(!conf->checkLibrary(s, "ssl")) - return false; - lib = s; - } - else { - if(!conf->findLibrary("ssl", &s)) - return false; - lib = s; - } - - // is it at least openssl 0.9.7? - QString str = - "#include\n" - "int main()\n" - "{\n" - " unsigned long x = OPENSSL_VERSION_NUMBER;\n" - " if(x >= 0x00907000) return 0; else return 1;\n" - "}\n"; - QString ext; - if(!inc.isEmpty()) - ext += QString("-I") + inc + ' '; - if(kb) - ext += QString("-I") + kbdir + ' '; - if(!lib.isEmpty()) - ext += QString("-L") + lib + " -lssl -lcrypto "; - int ret; - if(!conf->doCompileAndLink(str, ext, &ret)) - return false; - if(ret == 0) - conf->addDefine("OSSL_097"); - - if(!inc.isEmpty()) - conf->addIncludePath(inc); - if(kb) - conf->addIncludePath(kbdir); - if(!lib.isEmpty()) - conf->addLib(QString("-L") + s); - conf->addLib("-lssl -lcrypto"); - - return true; - } -}; diff --git a/prepare b/prepare deleted file mode 100755 index d7936f4..0000000 --- a/prepare +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -cp ../../src/qca.h . -cp ../../src/qcaprovider.h . - diff --git a/qca-tls.pro b/qca-tls.pro deleted file mode 100644 index 74bd997..0000000 --- a/qca-tls.pro +++ /dev/null @@ -1,26 +0,0 @@ -# tqca-tls qmake profile - -TEMPLATE = lib -CONFIG += qt thread release plugin -TARGET = tqca-tls - -!exists(qcaprovider.h) { - Q_PREFIX = ../../src - INCLUDEPATH += $$Q_PREFIX -} -HEADERS += ($$Q_PREFIX)qcaprovider.h - -HEADERS = tqca-tls.h -SOURCES = tqca-tls.cpp - -DEFINES += TQCA_PLUGIN -win32:{ - DEFINES += TQCA_PLUGIN_DLL OSSL_097 - INCLUDEPATH += c:\local\include - LIBS += c:\local\lib\libeay32.lib c:\local\lib\ssleay32.lib -} - -include(conf.pri) -include(extra.pri) - -QMAKE_PROJECT_DEPTH=0 diff --git a/qca-tls.qc b/qca-tls.qc deleted file mode 100644 index 91179cf..0000000 --- a/qca-tls.qc +++ /dev/null @@ -1,9 +0,0 @@ - - tqca-tls - qca-tls.pro - - - - - . - diff --git a/qcextra b/qcextra deleted file mode 100755 index fef4f18..0000000 --- a/qcextra +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -cat >extra.pri <