diff --git a/.gitignore b/.gitignore index b92d662..044a701 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -build/ +test_package/build/ *.pyc diff --git a/conanfile.py b/conanfile.py index 04d61d6..e238f60 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,39 +1,58 @@ from conans import ConanFile, CMake - - -class KAuthConan(ConanFile): - name = "kauth" - version = "5.50.0" - license = "GPLv2" - url = "https://api.kde.org/frameworks/kauth/html/index.html" - description = "Library that helps execute actions as privileged user." +import yaml +import re +import os.path + + +def getVersion(): + if(os.path.exists("CMakeLists.txt")): + regx = re.compile(r"^set\(.*VERSION\s(\"|')[0-9.]+(\"|')\)") + with open("CMakeLists.txt") as f: + for line in f: + if regx.match(line): + version = re.search("\"[0-9\.]+\"", line) + version = version.group().replace("\"", "") + return version + return None + + +def getMetaField(field): + if(os.path.exists("metainfo.yaml")): + with open("metainfo.yaml") as f: + metainfo = yaml.load(f.read()) + return metainfo[field] + return None + + +class KauthConan(ConanFile): + name = getMetaField('name') + version = getVersion() + license = getMetaField('license') + url = getMetaField('url') + description = getMetaField('description') settings = "os", "compiler", "build_type", "arch" requires = ( - "extra-cmake-modules/5.50.0@kde/testing", - - "Qt/5.11.1@bincrafters/stable", - # "qt-core/5.8.0@qt/testing", - # "qt-widgets/5.8.0@qt/testing", - # "qt-dbus/5.8.0@qt/testing", - # "qt-test/5.8.0@qt/testing", + "qt/[>=5.11.3]@bincrafters/stable", + "extra-cmake-modules/[>=5.60.0]@kde/testing", - "kcoreaddons/5.50.0@kde/testing", + "kcoreaddons/[>=5.60.0]@kde/testing", + "polkit-qt-1/[>=0.99.0]@kde/testing" ) generators = "cmake" scm = { "type": "git", "url": "auto", "revision": "auto" - } + } def build(self): cmake = CMake(self) cmake.configure() cmake.build() cmake.install() def package_info(self): self.cpp_info.resdirs = ["share"] diff --git a/metainfo.yaml b/metainfo.yaml index 31f9553..dd4b701 100644 --- a/metainfo.yaml +++ b/metainfo.yaml @@ -1,20 +1,23 @@ maintainer: -description: Abstraction to system policy and authentication features +name: kauth +license: GPLv2 +url: https://api.kde.org/frameworks/kauth/html/index.html +description: Library that helps execute actions as privileged user tier: 2 type: integration platforms: - name: MacOSX - name: Linux - name: FreeBSD portingAid: false deprecated: false release: true libraries: - qmake: KAuth cmake: "KF5::Auth" cmakename: KF5Auth public_lib: true group: Frameworks subgroup: Tier 2 public_example_dir: examples/