usr bin env python coding utf-8 from conans import ConanFile tools Aut

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, tools, AutoToolsBuildEnvironment
import os
from shutil import copyfile
class UnrarConan(ConanFile):
name = "unrar"
version = "5.9.2"
license = "unrar"
settings = "os", "arch", "compiler", "build_type"
homepage = "https://www.rarlab.com"
_source_subfolder = "unrar"
exports_sources = "unrarsrc-{0}.tar.gz".format(version)
def source(self):
tools.unzip("unrarsrc-{0}.tar.gz".format(self.version))
def build(self):
with tools.chdir(self._source_subfolder):
env_build = AutoToolsBuildEnvironment(self)
env_build.make(target='lib')
copyfile("dll.hpp", "unrar.hpp")
def package(self):
self.copy("*license.txt", dst="licenses", keep_path=False)
self.copy("*unrar.hpp", dst="include", src=".")
self.copy("*.a", dst="lib", src=".", keep_path=False)
self.copy("*.so", dst="lib", src=".", keep_path=False)
def package_info(self):
self.cpp_info.name = "unrar"
self.cpp_info.libdirs = ['lib'] # Directories where libraries can be found
self.cpp_info.includedirs = ['include'] # Ordered list of include paths