blob: 666e27ae5910d72f0b57510619da96724339c313 [file] [log] [blame]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Build mandoc package."""
from __future__ import print_function
import os
import sys
FILESDIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(FILESDIR, '..', '..', 'bin'))
import ssh_client # pylint: disable=wrong-import-position
ARCHIVES = ('%(P)s.tar.gz',)
def src_configure(_metadata):
"""Configure the source."""
for var in ('AR', 'CC', 'CFLAGS', 'CPPFLAGS', 'LDFLAGS'):
os.environ.pop(var, None)
if not os.path.exists('Makefile.local'):
ssh_client.run(['./configure'])
def src_compile(_metadata):
"""Compile the source."""
ssh_client.emake('mandoc')
def src_install(_metadata):
"""Install the package."""
target = os.path.join(os.getcwd(), 'mandoc')
path = os.path.join(ssh_client.OUTPUT, 'mandoc')
ssh_client.symlink(target, path)
ssh_client.build_package(sys.modules[__name__])