Blob Blame History Raw
diff -up qoauth-2.0.0/oauth.prf.qt5 qoauth-2.0.0/oauth.prf
--- qoauth-2.0.0/oauth.prf.qt5	2016-11-28 11:52:39.000000000 -0600
+++ qoauth-2.0.0/oauth.prf	2017-01-20 08:16:12.736976439 -0600
@@ -1,9 +1,6 @@
 QOAUTH_INCDIR = $$[QT_INSTALL_HEADERS]
 QOAUTH_LIBDIR = $$[QT_INSTALL_LIBS]
 
-QOAUTH_INCDIR ~= s!/qt4*!!
-QOAUTH_LIBDIR ~= s!/qt4*!!
-
 CONFIG *= qt
 CONFIG += crypto
 
@@ -33,7 +30,11 @@ isEmpty(LINKAGE) {
     exists($$PWD/qoauth.pro): INCLUDEPATH += $$QOAUTH_INCDIR
     else: INCLUDEPATH += $$QOAUTH_INCDIR/QtOAuth
     LIBS += -L$$QOAUTH_LIBDIR
-    LINKAGE = -lqoauth
+    greaterThan(QT_MAJOR_VERSION, 4) {
+        LINKAGE = -lqoauth-qt$${QT_MAJOR_VERSION}
+    } else {
+        LINKAGE = -lqoauth
+    }
     CONFIG(debug, debug|release) {
         windows:LINKAGE = -lqoauthd1
         mac:LINKAGE = -lqoauth_debug
diff -up qoauth-2.0.0/src/pcfile.sh.qt5 qoauth-2.0.0/src/pcfile.sh
--- qoauth-2.0.0/src/pcfile.sh.qt5	2016-11-28 11:52:39.000000000 -0600
+++ qoauth-2.0.0/src/pcfile.sh	2017-01-20 08:16:12.736976439 -0600
@@ -2,14 +2,19 @@
 # This "script" creates a pkg-config file basing on values set
 # in project file
 
+case $3 in
+4) requires="QtCore QtNetwork qca2" ;;
+*) requires="Qt${3}Core Qt${3}Network qca2-qt${3}" ;;
+esac
+
 echo "prefix=$1
 exec_prefix=\${prefix}
-libdir=\${prefix}/lib
-includedir=\${prefix}/include/QtOAuth
+libdir=\${prefix}/lib64
+includedir=\${prefix}/include/qt$3/QtOAuth
 
 Name: QOAuth
 Description: Qt OAuth support library
 Version: $2
-Requires: QtCore QtNetwork qca2
-Libs: -L\${libdir} -lqoauth
-Cflags: -I\${includedir}" > qoauth.pc
+Requires: $requires
+Libs: -L\${libdir} -l$4
+Cflags: -I\${includedir}" > $4.pc
diff -up qoauth-2.0.0/src/src.pro.qt5 qoauth-2.0.0/src/src.pro
--- qoauth-2.0.0/src/src.pro.qt5	2016-11-28 11:52:39.000000000 -0600
+++ qoauth-2.0.0/src/src.pro	2017-01-20 08:17:33.585764730 -0600
@@ -1,4 +1,9 @@
-TARGET = qoauth
+greaterThan(QT_MAJOR_VERSION, 4) {
+   TARGET = qoauth-qt$${QT_MAJOR_VERSION}
+} else {
+   TARGET = qoauth
+}
+
 DESTDIR = ../lib
 win32:DLLDESTDIR = $${DESTDIR}
 
@@ -77,22 +82,17 @@ else:unix {
     else:INSTALL_PREFIX = $${PREFIX}
 
     # this creates a pkgconfig file
-    system( ./pcfile.sh $${INSTALL_PREFIX} $${VERSION} )
-    pkgconfig.files = qoauth.pc
+    system( ./pcfile.sh $${INSTALL_PREFIX} $${VERSION} $${QT_MAJOR_VERSION} $${TARGET} )
+    pkgconfig.files = $${TARGET}.pc
     
-    contains(QMAKE_HOST.arch, x86_64) {
-      target.path = $${INSTALL_PREFIX}/lib64
-    } else {
-      target.path = $${INSTALL_PREFIX}/lib
-    }
+    target.path = $$[QT_INSTALL_LIBS]
 
-    headers.path = $${INSTALL_PREFIX}/include/QtOAuth
-    docs.path = $${INSTALL_PREFIX}/share/doc/$${TARGET}-$${VERSION}/html
+    headers.path = $$[QT_INSTALL_HEADERS]/QtOAuth
+    docs.path = $$[QT_INSTALL_DOCS]/html
     pkgconfig.path = $${target.path}/pkgconfig
     INSTALLS += \
         target \
         headers \
-        docs \
         pkgconfig \
         features
 }