Created
February 1, 2017 07:18
-
-
Save m5knt/85bb58067aad136f3b6f98d1115b5a58 to your computer and use it in GitHub Desktop.
Scons でパッケージを作る方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: python; coding: utf-8 -*- | |
# env にパッケージツールを含ませます | |
env = Environment(tools=['packaging']) | |
# または env.Tool('packaging') | |
# 含めるファイルを定義します | |
env.Install('foo/include/foo', 'workspace/include/foo.h') | |
env.Install('foo/bin', 'workspace/bin/foo.exe') | |
env.Install('foo/bin', 'workspace/bin/bar.exe') | |
env.InstallAs('foo/bin/zie.exe', 'workspace/bin/sue.exe') | |
# アーカイブパッケージ作成します | |
# 事前に定義された env.Install env.InstallAs の内容が自動で含まれます | |
# 明示的に指定する場合は source = [~] を指定して下さい | |
# NAME-VERSION というディレクトリに一時ファイルができ | |
# NAME-VERSION.PACKAGETYPE というパッケージファイルが出来ます | |
pkg = env.Package(NAME='foo', # 名称 | |
VERSION='0.1', # バージョン | |
PACKAGETYPE='zip', # targz tarbz2 rpm ipkg msi(メンテされていない?) | |
) | |
# ターゲット名を分かりやすくする為の置き換え | |
env.Alias('pkg', pkg) | |
# scons -c pkg で一時フォルダを消したい場合は明示する必要があります | |
env.Clean(pkg, env.Glob('foo-*')) | |
# デフォルトにする | |
env.Default('pkg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment