# -*- coding: utf-8 -*-

import os
from conans import ConanFile, tools

class {package_name}Conan(ConanFile):
    name = '{name}'
    version = '{version}'
    description = '<Description of {package_name} here>.'
    url = 'https://github.com/birsoyo/sesame'
    homepage = 'https://github.com/original_author/original_lib'
    author = 'Orhun Birsoy <orhunbirsoy@gmail.com>'

    license = '<Indicates License type of the packaged library>'

    no_copy_source = True

    source_subfolder = "source_subfolder"

    def source(self):
        source_url = 'https://github.com/libauthor/libname'
        tools.get(f'{{source_url}}/archive/v{{self.version}}.tar.gz')
        extracted_dir = f'{{self.name}}-{{self.version}}'

        #Rename to "source_folder" is a convention to simplify later steps
        os.rename(extracted_dir, self.source_subfolder)

    def package(self):
        include_folder = os.path.join(self.source_subfolder, 'include')
        self.copy(pattern='*', dst='include', src=include_folder)

    def package_id(self):
        self.info.header_only()
