ActionsAPI'ye eklemeler başladı, build.py içinde ufak bir yer ve metod ismi değişikliği yaptım kafa karıştırmamak adına...
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os, shutil
|
||||||
|
|
||||||
|
def dodoc(*documentList):
|
||||||
|
install_dir = os.getenv('INSTALL_DIR')
|
||||||
|
src_name = os.getenv('SRC_NAME')
|
||||||
|
src_version = os.getenv('SRC_VERSION')
|
||||||
|
src_release = os.getenv('SRC_RELEASE')
|
||||||
|
|
||||||
|
srcTag = src_name + '-' + src_version + '-' + src_release
|
||||||
|
|
||||||
|
# FIXME: Exception yiyoruz eğer klasör mevcutsa, adam edilecek!
|
||||||
|
os.makedirs(install_dir + '/' + 'usr/share/doc/' + srcTag)
|
||||||
|
|
||||||
|
for document in documentList:
|
||||||
|
if os.access(document, os.F_OK):
|
||||||
|
shutil.copyfile(document, os.path.join(install_dir, \
|
||||||
|
'usr/share/doc/' + srcTag + '/' + os.path.basename(document)))
|
||||||
|
|
||||||
+18
-13
@@ -56,24 +56,17 @@ class PisiBuild:
|
|||||||
curDir = os.getcwd()
|
curDir = os.getcwd()
|
||||||
|
|
||||||
locals = globals = {}
|
locals = globals = {}
|
||||||
# put the evironment variables for actions API to use.
|
|
||||||
evn = {
|
|
||||||
"PKG_DIR": self.ctx.pkg_dir(),
|
|
||||||
"WORK_DIR": self.ctx.pkg_work_dir(),
|
|
||||||
"INSTALL_DIR": self.ctx.pkg_install_dir(),
|
|
||||||
"SRC_NAME": self.spec.source.name,
|
|
||||||
"SRC_VERSION": self.spec.source.version
|
|
||||||
}
|
|
||||||
os.environ.update(evn)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
exec compile(self.actionScript , "error", "exec") in locals,globals
|
exec compile(self.actionScript , "error", "exec") in locals,globals
|
||||||
except SyntaxError, e:
|
except SyntaxError, e:
|
||||||
ui.error ("Error : %s\n" % e)
|
ui.error ("Error : %s\n" % e)
|
||||||
return
|
return
|
||||||
|
# Go to source directory
|
||||||
self.goToWorkDir(globals)
|
self.gotoSrcDir(globals)
|
||||||
|
# Set needed evironment variables for actions API
|
||||||
|
self.setEnvorinment()
|
||||||
|
# Run configure, build and install phase
|
||||||
self.configureSource(locals)
|
self.configureSource(locals)
|
||||||
self.buildSource(locals)
|
self.buildSource(locals)
|
||||||
self.installSource(locals)
|
self.installSource(locals)
|
||||||
@@ -89,7 +82,19 @@ class PisiBuild:
|
|||||||
def applyPatches(self):
|
def applyPatches(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def goToWorkDir(self, globals):
|
def setEnvorinment(self):
|
||||||
|
# put the evironment variables for actions API to use.
|
||||||
|
evn = {
|
||||||
|
"PKG_DIR": self.ctx.pkg_dir(),
|
||||||
|
"WORK_DIR": self.ctx.pkg_work_dir(),
|
||||||
|
"INSTALL_DIR": self.ctx.pkg_install_dir(),
|
||||||
|
"SRC_NAME": self.spec.source.name,
|
||||||
|
"SRC_VERSION": self.spec.source.version,
|
||||||
|
"SRC_RELEASE": self.spec.source.release
|
||||||
|
}
|
||||||
|
os.environ.update(evn)
|
||||||
|
|
||||||
|
def gotoSrcDir(self, globals):
|
||||||
"""Changes the current working directory to package_work_dir() for
|
"""Changes the current working directory to package_work_dir() for
|
||||||
actions.py to do its work."""
|
actions.py to do its work."""
|
||||||
if 'WorkDir' in globals:
|
if 'WorkDir' in globals:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pisi.actionsapi import autotools
|
from pisi.actionsapi import autotools
|
||||||
|
from pisi.actionsapi import pisitools
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
autotools.configure()
|
autotools.configure()
|
||||||
@@ -11,3 +12,4 @@ def build():
|
|||||||
|
|
||||||
def install():
|
def install():
|
||||||
autotools.install()
|
autotools.install()
|
||||||
|
pisitools.dodoc('AUTHORS','ChangeLog','INSTALL', 'NEWS', 'README', 'doc/startup-notification.txt')
|
||||||
|
|||||||
Reference in New Issue
Block a user