def __init__(self, subdir_name=DEB_BINARY_BUILD_DIR): super(BuilderLinuxDebBinary, self).__init__(subdir_name) version = getOutwikerVersion() self._architecture = self._getDebArchitecture() self._debName = "outwiker-{}+{}_{}".format(version[0], version[1], self._architecture)
def __init__(self, root_dir): self.root_dir = os.path.abspath(root_dir) self.version_items = getOutwikerVersion() self.version = self.version_items[0] + u'.' + self.version_items[1] self.version_dir = os.path.join(self.root_dir, self.version) self.temp_dir = os.path.join(self.root_dir, u'tmp')
def ppaunstable(): """ Upload the current OutWiker version in PPA(unstable) """ version = getOutwikerVersion() for distname in UBUNTU_RELEASE_NAMES: with lcd(os.path.join(BUILD_DIR, DEB_SOURCE_BUILD_DIR)): local("dput ppa:outwiker-team/unstable outwiker_{}+{}~{}_source.changes".format(version[0], version[1], distname))
def _ppa_upload(ppa_path, deb_path): ''' Upload the current OutWiker version in PPA ''' version = getOutwikerVersion() for distname in UBUNTU_RELEASE_NAMES: with lcd(deb_path): local("dput {} outwiker_{}+{}~{}_source.changes".format( ppa_path, version[0], version[1], distname))
def deb_install(is_stable=False): ''' Assemble deb package for current Ubuntu release ''' result_path = deb_single(tobool(is_stable)) version = getOutwikerVersion() with lcd(result_path): local("sudo dpkg -i outwiker_{}+{}~{}_all.deb".format( version[0], version[1], getCurrentUbuntuDistribName()))
def _build(self): version = getOutwikerVersion() local('git archive --prefix=outwiker-{}.{}/ -o "{}" HEAD'.format( version[0], version[1], self._fullfname)) with lcd("src"): local("7z a -r -aoa -xr!*.pyc -xr!.ropeproject -xr!tests.py -xr!profile.py -xr!setup_tests.py -xr!tests_*.py -xr!setup.py -xr!test -xr!profiles ../{} ./*".format(self._minfname)) self._remove(self._build_dir)
def debinstall(): """ Assemble deb package for current Ubuntu release """ debsingle() version = getOutwikerVersion() with lcd(os.path.join(BUILD_DIR, DEB_SOURCE_BUILD_DIR)): local("sudo dpkg -i outwiker_{}+{}~{}_all.deb".format( version[0], version[1], getCurrentUbuntuDistribName()))
def __init__(self, dir_name=DEB_BINARY_BUILD_DIR, is_stable=False): super().__init__(dir_name, is_stable) version = getOutwikerVersion() architecture = self._getDebArchitecture() self.debName = "outwiker-{version}+{build}_{architecture}".format( version=version[0], build=version[1], architecture=architecture) # tmp/outwiker-x.x.x+xxx_.../ self.debPath = self.facts.getTempSubpath(self.debName) self.debFileName = u'{}.deb'.format(self.debName) self.pluginsDir = os.path.join(self._getExecutableDir(), PLUGINS_DIR) self._files_to_remove = [ 'LICENSE.txt', ]
def __init__(self): # x.x.x.xxx self.version = getOutwikerVersionStr() # Version tuple ('x.x.x', 'xxx') self.version_items = getOutwikerVersion() # build/ self.root_dir = os.path.abspath(defines.BUILD_DIR) # build/x.x.x.xxx/ self.version_dir = os.path.join(self.root_dir, self.version) # build/x.x.x.xxx/windows/ self.build_dir_windows = os.path.join(self.version_dir, defines.WINDOWS_BUILD_DIR) # build/x.x.x.xxx/linux/ self.build_dir_linux = os.path.join(self.version_dir, defines.LINUX_BUILD_DIR) # build/x.x.x.xxx/versions.xml self.versions_file = os.path.join(self.version_dir, defines.OUTWIKER_VERSIONS_FILENAME) # build/tmp/ self.temp_dir = os.path.join(self.root_dir, u'tmp') # need_for_build/ self.need_for_build = os.path.abspath(defines.NEED_FOR_BUILD_DIR) # need_for_build/windows self.nfb_win = os.path.join(self.need_for_build, u'windows') # need_for_build/linux self.nfb_linux = os.path.join(self.need_for_build, u'linux') # need_for_build/virtual self.nfb_virtual = os.path.join(self.need_for_build, u'virtual') # need_for_build/snap self.nfb_snap = os.path.join(self.need_for_build, u'snap') # need_for_build/linux self.nfb_linux = os.path.join(self.need_for_build, u'linux') # Source plugins dir self.src_plugins_dir = os.path.abspath(defines.PLUGINS_DIR)
def _create_control_file(self, debian_dir): ''' Create DEBIAN/control file from template (insert version number) ''' version = getOutwikerVersion() template_file = os.path.join(debian_dir, 'control.tpl') with open(template_file) as fp: template = fp.read() control_text = template.replace('{{version}}', version[0]) control_text = control_text.replace('{{build}}', version[1]) with open(os.path.join(debian_dir, 'control'), 'w') as fp: fp.write(control_text) os.remove(template_file)
def __init__(self): # x.x.x.xxx self.version = getOutwikerVersionStr() # Version tuple ('x.x.x', 'xxx') self.version_items = getOutwikerVersion() # build/ self.root_dir = os.path.abspath(defines.BUILD_DIR) # build/x.x.x.xxx/ self.version_dir = os.path.join(self.root_dir, self.version) # build/x.x.x.xxx/windows/ self.build_dir_windows = os.path.join(self.version_dir, defines.WINDOWS_BUILD_DIR) # build/x.x.x.xxx/linux/ self.build_dir_linux = os.path.join(self.version_dir, defines.LINUX_BUILD_DIR) # build/x.x.x.xxx/versions.xml self.versions_file = os.path.join(self.version_dir, defines.OUTWIKER_VERSIONS_FILENAME) # build/tmp/ self.temp_dir = os.path.join(self.root_dir, u'tmp') # need_for_build/ self.need_for_build = os.path.abspath(defines.NEED_FOR_BUILD_DIR) # need_for_build/windows self.nfb_win = os.path.join(self.need_for_build, u'windows') # need_for_build/linux self.nfb_linux = os.path.join(self.need_for_build, u'linux') # need_for_build/virtual self.nfb_virtual = os.path.join(self.need_for_build, u'virtual') # need_for_build/snap self.nfb_snap = os.path.join(self.need_for_build, u'snap') # Source plugins dir self.src_plugins_dir = os.path.abspath(defines.PLUGINS_DIR)
def upload_distribs(is_stable=False): ''' Upload binary version to site ''' facts = BuildFacts() version = getOutwikerVersion() if is_stable: deploy_path = DEPLOY_STABLE_PATH else: deploy_path = DEPLOY_UNSTABLE_PATH windows_binary_path = os.path.join(PATH_TO_WINDOWS_DISTRIBS, facts.version) binary_uploader = DistribsUploader(version, is_stable, windows_binary_path, deploy_path) print_info('Uploading distribs to {}...'.format(DEPLOY_SERVER_NAME)) binary_uploader.deploy()
def __init__(self, dir_name=DEB_BINARY_BUILD_DIR, is_stable=False): super(BuilderDebBinaryBase, self).__init__(dir_name, is_stable) distrib_info = get_linux_distrib_info() version = getOutwikerVersion() architecture = self._getDebArchitecture() self.debName = "outwiker-{version}+{build}_{architecture}".format( version=version[0], build=version[1], distrib=distrib_info['DISTRIB_ID'], codename=distrib_info['DISTRIB_CODENAME'], architecture=architecture) # tmp/outwiker-x.x.x+xxx_.../ self.debPath = self.facts.getTempSubpath(self.debName) self.debFileName = u'{}.deb'.format(self.debName) self._files_to_remove = [ u'LICENSE.txt', ]
def vm_linux_binary(is_stable=0): ''' Create 64-bit assembly on virtual machines ''' vm_run() version_str = getOutwikerVersionStr() version = getOutwikerVersion() path_to_result = os.path.abspath( os.path.join(BUILD_DIR, version_str, LINUX_BUILD_DIR)) if not os.path.exists(path_to_result): os.makedirs(path_to_result) with lcd(u'need_for_build/virtual/build_machines'): local( u'ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook build_linux_binaries.yml --extra-vars "version={version} build={build} save_to={save_to} is_stable={is_stable}"' .format(version=version[0], build=version[1], save_to=path_to_result, is_stable=is_stable))
def __init__(self, dir_name=DEB_BINARY_BUILD_DIR, is_stable=False): super().__init__(dir_name, is_stable) distrib_info = get_linux_distrib_info() version = getOutwikerVersion() architecture = self._getDebArchitecture() self.debName = "outwiker-{version}+{build}_{architecture}".format( version=version[0], build=version[1], distrib=distrib_info['DISTRIB_ID'], codename=distrib_info['DISTRIB_CODENAME'], architecture=architecture) # tmp/outwiker-x.x.x+xxx_.../ self.debPath = self.facts.getTempSubpath(self.debName) self.debFileName = u'{}.deb'.format(self.debName) self.pluginsDir = os.path.join(self._getExecutableDir(), PLUGINS_DIR) self._files_to_remove = [ u'LICENSE.txt', ]
def vm_linux_binary(is_stable=0): ''' Create 64-bit assembly on virtual machines ''' vm_run() version_str = getOutwikerVersionStr() version = getOutwikerVersion() path_to_result = os.path.abspath( os.path.join(BUILD_DIR, version_str, LINUX_BUILD_DIR) ) if not os.path.exists(path_to_result): os.makedirs(path_to_result) with lcd(u'need_for_build/virtual/build_machines'): local(u'ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook build_linux_binaries.yml --extra-vars "version={version} build={build} save_to={save_to} is_stable={is_stable}"'.format( version=version[0], build=version[1], save_to=path_to_result, is_stable=is_stable) )
def __init__(self, dir_name=DEB_BINARY_BUILD_DIR, is_stable=False): super(BuilderDebBinaryBase, self).__init__(dir_name, is_stable) version = getOutwikerVersion() architecture = self._getDebArchitecture() self.debName = "outwiker-{}+{}_{}".format(version[0], version[1], architecture) # tmp/outwiker-x.x.x+xxx_.../ self.debPath = self.facts.getTempSubpath(self.debName) self.debFileName = u'{}.deb'.format(self.debName) self._files_to_remove = [ u'LICENSE.txt', # u'libcrypto.so.1.0.0', # u'libexpat.so.1', # u'libfreetype.so.6', # u'libz.so.1', # u'libpng16.so.16', # u'libxml2.so.2', # u'libtiff.so.5', # u'libtinfo.so.5', # u'libjpeg.so.8', ]
def _getOrigName(self, distname): version = getOutwikerVersion() return "outwiker_{}+{}~{}.orig.tar".format(version[0], version[1], distname)
def _getDebName(self): """ Return a folder name for sources for building the deb package """ version = getOutwikerVersion() return "outwiker-{}+{}".format(version[0], version[1])