Actions API

From PardusWiki
(Difference between revisions)
Jump to: navigation, search
(Undo revision 3092 by Itycajofa (Talk) Spam.)
 
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://akekuqegify.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
----
 
=[http://akekuqegify.co.cc CLICK HERE]=
 
----
 
</div>
 
 
= About the document =
 
= About the document =
 
The main components of a PISI package are the pspec.xml, actions.py files and the source code. actions.py is a python script that contains information of the operations to be executed on the source code. This document is an overview of the Actions API library which includes the functions that are available for use in actions.py scripts.The document is currently being developed by A. Murat Eren, please mail your ideas and suggestions to meren{{at}}pardus.org.tr instead of directly editing for keeping exactness.
 
The main components of a PISI package are the pspec.xml, actions.py files and the source code. actions.py is a python script that contains information of the operations to be executed on the source code. This document is an overview of the Actions API library which includes the functions that are available for use in actions.py scripts.The document is currently being developed by A. Murat Eren, please mail your ideas and suggestions to meren{{at}}pardus.org.tr instead of directly editing for keeping exactness.
Line 30: Line 22:
 
Moves the '''sourceFile''' in work directory to '''destinationDirectory'''. The default value for '''destinationDirectory'' is /usr/bin.
 
Moves the '''sourceFile''' in work directory to '''destinationDirectory'''. The default value for '''destinationDirectory'' is /usr/bin.
  
::* pisitools.dobin(&quot;sed/sed&quot;, &quot;/bin&quot;)
+
::* pisitools.dobin("sed/sed", "/bin")
::* pisitools.dobin(&quot;zipsplit&quot;)
+
::* pisitools.dobin("zipsplit")
  
  
Line 39: Line 31:
 
Creates the '''(destinationDirectory)''' in the install path.
 
Creates the '''(destinationDirectory)''' in the install path.
  
::* pisitools.dodir(&quot;/usr/include/awk&quot;)
+
::* pisitools.dodir("/usr/include/awk")
::* pisitools.dodir(&quot;/usr/&quot; + get.HOST() + &quot;/include&quot;)
+
::* pisitools.dodir("/usr/" + get.HOST() + "/include")
::* pisitools.dodir(&quot;/usr/share/doc/%s/examples&quot; % get.srcTAG())
+
::* pisitools.dodir("/usr/share/doc/%s/examples" % get.srcTAG())
  
  
Line 49: Line 41:
 
Copies the '''sourceFiles''' into /usr/share/doc/PACKAGE under the install directory.
 
Copies the '''sourceFiles''' into /usr/share/doc/PACKAGE under the install directory.
  
::* pisitools.dodoc(&quot;README&quot;)
+
::* pisitools.dodoc("README")
::* pisitools.dodoc(&quot;*.html&quot;)
+
::* pisitools.dodoc("*.html")
::* pisitools.dodoc(&quot;FAQ&quot;, &quot;README&quot;, &quot;ChangeLog.*&quot;, &quot;algorithm.txt&quot;)
+
::* pisitools.dodoc("FAQ", "README", "ChangeLog.*", "algorithm.txt")
  
  
Line 59: Line 51:
 
Copies the '''sourceFile''' executable from work directory to destination directory.
 
Copies the '''sourceFile''' executable from work directory to destination directory.
  
::* pisitools.doexe(&quot;extras/scsi-devfs.sh&quot;, &quot;/etc/udev/scripts/&quot;)
+
::* pisitools.doexe("extras/scsi-devfs.sh", "/etc/udev/scripts/")
::* pisitools.doexe(&quot;etc/hotplug/*.rc&quot;, &quot;/etc/hotplug/&quot;)
+
::* pisitools.doexe("etc/hotplug/*.rc", "/etc/hotplug/")
  
  
Line 68: Line 60:
 
Copies the '''sourceFiles''' into /usr/share/doc/PACKAGE/html under the install directory.
 
Copies the '''sourceFiles''' into /usr/share/doc/PACKAGE/html under the install directory.
  
::* pisitools.dohtml(&quot;index.html&quot;)
+
::* pisitools.dohtml("index.html")
::* pisitools.dohtml(&quot;doc/*&quot;)
+
::* pisitools.dohtml("doc/*")
  
  
Line 77: Line 69:
 
Copies the '''sourceFiles''' into /usr/share/info under the install directory.
 
Copies the '''sourceFiles''' into /usr/share/info under the install directory.
  
::* pisitools.doinfo(&quot;*.info&quot;)
+
::* pisitools.doinfo("*.info")
  
  
Line 85: Line 77:
 
Copies the '''sourceFile''' library to /usr/lib under the install directory.
 
Copies the '''sourceFile''' library to /usr/lib under the install directory.
  
::* pisitools.dolib(&quot;libz.a&quot;)
+
::* pisitools.dolib("libz.a")
::* pisitools.dolib(&quot;lib/libpci.a&quot;)
+
::* pisitools.dolib("lib/libpci.a")
::* pisitools.dolib(&quot;libbz2.so.1.0.2&quot;, &quot;/lib&quot;)
+
::* pisitools.dolib("libbz2.so.1.0.2", "/lib")
  
  
Line 95: Line 87:
 
Copies the '''sourceFile''' static library to /usr/lib under the install directory.
 
Copies the '''sourceFile''' static library to /usr/lib under the install directory.
  
::* pisitools.dolib_a(&quot;lib/libpci.a&quot;)
+
::* pisitools.dolib_a("lib/libpci.a")
::* pisitools.dolib_a(&quot;libdb1.a&quot;)
+
::* pisitools.dolib_a("libdb1.a")
  
  
Line 104: Line 96:
 
Copies the '''sourceFile''' shared library to /usr/lib under the install directory.
 
Copies the '''sourceFile''' shared library to /usr/lib under the install directory.
  
::* pisitools.dolib_so(&quot;libdb1.so.2&quot;)
+
::* pisitools.dolib_so("libdb1.so.2")
  
  
Line 112: Line 104:
 
Copies the '''sourceFile''' manual to /usr/share/man/ under the install directory.
 
Copies the '''sourceFile''' manual to /usr/share/man/ under the install directory.
  
::* pisitools.doman(&quot;logrotate.8&quot;)
+
::* pisitools.doman("logrotate.8")
::* pisitools.doman(&quot;doc/bash.1&quot;, &quot;doc/bashbug.1&quot;, &quot;doc/builtins.1&quot;, &quot;doc/rbash.1&quot;)
+
::* pisitools.doman("doc/bash.1", "doc/bashbug.1", "doc/builtins.1", "doc/rbash.1")
::* pisitools.doman(&quot;*.[1-8]&quot;)
+
::* pisitools.doman("*.[1-8]")
  
  
Line 122: Line 114:
 
Makes a mo '''destinationFile''' for '''locale''' language from the '''sourceFile''' po file in /usr/share/locale/LOCALE/LC_MESSAGES.
 
Makes a mo '''destinationFile''' for '''locale''' language from the '''sourceFile''' po file in /usr/share/locale/LOCALE/LC_MESSAGES.
  
::* pisitools.domo(&quot;po/tr.po&quot;, &quot;tr&quot;, &quot;pam_login.mo&quot;)
+
::* pisitools.domo("po/tr.po", "tr", "pam_login.mo")
  
  
Line 130: Line 122:
 
Moves the '''sourceFile''' to '''destination''' directory.
 
Moves the '''sourceFile''' to '''destination''' directory.
  
::* pisitools.domove(&quot;/usr/bin/passwd&quot;, &quot;/bin/&quot;)
+
::* pisitools.domove("/usr/bin/passwd", "/bin/")
::* pisitools.domove(&quot;/usr/bin/yacc&quot;, &quot;/usr/bin&quot;, &quot;yacc.bison&quot;)
+
::* pisitools.domove("/usr/bin/yacc", "/usr/bin", "yacc.bison")
::* pisitools.domove(&quot;/usr/docs/&quot;, &quot;/usr/share/doc/%s/html/&quot; % get.srcTAG())
+
::* pisitools.domove("/usr/docs/", "/usr/share/doc/%s/html/" % get.srcTAG())
  
  
Line 140: Line 132:
 
Replaces the '''findPattern''' to '''replacePattern''' in '''sourceFile''' via sed.
 
Replaces the '''findPattern''' to '''replacePattern''' in '''sourceFile''' via sed.
  
::* pisitools.dosed(&quot;gcc/version.c&quot;, &quot;&lt;URL:http://gcc.gnu.org/bugs.html&gt;&quot; , &quot;&lt;URL:http://bugs.uludag.org.tr&gt;&quot;)
+
::* pisitools.dosed("gcc/version.c", "<URL:http://gcc.gnu.org/bugs.html>" , "<URL:http://bugs.uludag.org.tr>")
::* pisitools.dosed(&quot;sshd_config&quot;, &quot;(?m)(#UsePAM ).*&quot;, r&quot;UsePAM yes&quot;)
+
::* pisitools.dosed("sshd_config", "(?m)(#UsePAM ).*", r"UsePAM yes")
::* pisitools.dosed(&quot;unix/Makefile&quot;, &quot;-O3&quot;, get.CFLAGS())
+
::* pisitools.dosed("unix/Makefile", "-O3", get.CFLAGS())
::* pisitools.dosed(&quot;Make.Rules&quot;, &quot;HAVE_NDBM_H=yes&quot;, &quot;HAVE_NDBM_H=no&quot;)
+
::* pisitools.dosed("Make.Rules", "HAVE_NDBM_H=yes", "HAVE_NDBM_H=no")
::* pisitools.dosed(&quot;Makefile.def&quot;, &quot;CC=cc&quot;, &quot;CC=%s&quot; % get.CC())
+
::* pisitools.dosed("Makefile.def", "CC=cc", "CC=%s" % get.CC())
::* pisitools.dosed(&quot;automake.texi&quot;, &quot;(?m)(@setfilename.*)automake&quot;, r&quot;\1automake1.7&quot;)
+
::* pisitools.dosed("automake.texi", "(?m)(@setfilename.*)automake", r"\1automake1.7")
  
  
Line 153: Line 145:
 
Moves the '''sourceFile''' in work directory to '''destinationDirectory'''. The default value for '''destinationDirectory'' is /usr/sbin.
 
Moves the '''sourceFile''' in work directory to '''destinationDirectory'''. The default value for '''destinationDirectory'' is /usr/sbin.
  
::* pisitools.dosbin(&quot;traceroute6&quot;)
+
::* pisitools.dosbin("traceroute6")
::* pisitools.dosbin(&quot;extras/scsi_id/scsi_id&quot;, &quot;/sbin&quot;)
+
::* pisitools.dosbin("extras/scsi_id/scsi_id", "/sbin")
  
  
Line 162: Line 154:
 
Creates a symlink of the '''sourceFile''' as '''destinationFile'''.
 
Creates a symlink of the '''sourceFile''' as '''destinationFile'''.
  
::* pisitools.dosym(&quot;gzip&quot;, &quot;/bin/gunzip&quot;)
+
::* pisitools.dosym("gzip", "/bin/gunzip")
::* pisitools.dosym(&quot;libdb1.so.2&quot;, &quot;/usr/lib/libdb.so.2&quot;)
+
::* pisitools.dosym("libdb1.so.2", "/usr/lib/libdb.so.2")
::* pisitools.dosym(&quot;../bin/lsmod&quot;, &quot;/sbin/lsmod&quot;)
+
::* pisitools.dosym("../bin/lsmod", "/sbin/lsmod")
::* pisitools.dosym(&quot;/usr/X11R6/include/X11&quot;, &quot;/usr/include/X11&quot;)
+
::* pisitools.dosym("/usr/X11R6/include/X11", "/usr/include/X11")
  
  
Line 173: Line 165:
 
Copies the '''sourceFile''' to '''destinationDirectory. destinationFile parameter is optional and changes the name of the copy if used.
 
Copies the '''sourceFile''' to '''destinationDirectory. destinationFile parameter is optional and changes the name of the copy if used.
  
::* pisitools.insinto(&quot;/opt/rar/bin&quot;, &quot;rar&quot;)
+
::* pisitools.insinto("/opt/rar/bin", "rar")
::* pisitools.insinto(&quot;/etc/&quot;, &quot;doc/nanorc.sample&quot;, &quot;nanorc&quot;)
+
::* pisitools.insinto("/etc/", "doc/nanorc.sample", "nanorc")
::* pisitools.insinto(&quot;/etc/hotplug&quot;, &quot;etc/hotplug/*map&quot;)
+
::* pisitools.insinto("/etc/hotplug", "etc/hotplug/*map")
  
  
Line 183: Line 175:
 
Copies the '''sourceFile''' to /usr/share/doc/PACKAGE/.
 
Copies the '''sourceFile''' to /usr/share/doc/PACKAGE/.
  
::* pisitools.newdoc(&quot;extras/volume_id/README&quot;, &quot;README_volume_id&quot;)
+
::* pisitools.newdoc("extras/volume_id/README", "README_volume_id")
::* pisitools.newdoc(&quot;gprof/ChangeLog.linux&quot;, &quot;gprof/ChangeLog.linux&quot;)
+
::* pisitools.newdoc("gprof/ChangeLog.linux", "gprof/ChangeLog.linux")
::* pisitools.newdoc(&quot;bfd/PORTING&quot;, &quot;bfd/PORTING&quot;)
+
::* pisitools.newdoc("bfd/PORTING", "bfd/PORTING")
  
  
Line 193: Line 185:
 
Copies the '''sourceFile''' to /usr/share/man/manPREFIX/.
 
Copies the '''sourceFile''' to /usr/share/man/manPREFIX/.
  
::* pisitools.newman(&quot;less.nro&quot;, &quot;less.1&quot;)  
+
::* pisitools.newman("less.nro", "less.1")  
  
  
Line 201: Line 193:
 
Deletes the '''sourceFile''' under the install directory.
 
Deletes the '''sourceFile''' under the install directory.
  
::* pisitools.remove(&quot;/usr/lib/libdb_cxx.so&quot;)
+
::* pisitools.remove("/usr/lib/libdb_cxx.so")
  
  
Line 209: Line 201:
 
Renames the '''sourceFile''' as '''destinationFile'''.
 
Renames the '''sourceFile''' as '''destinationFile'''.
  
::* pisitools.rename(&quot;/usr/bin/bash&quot;, &quot;bash.old&quot;)
+
::* pisitools.rename("/usr/bin/bash", "bash.old")
  
  
Line 217: Line 209:
 
Deletes the ''''destinationDirectory''' and all files inside.
 
Deletes the ''''destinationDirectory''' and all files inside.
  
::* pisitools.removeDir(&quot;/usr/lib&quot;)
+
::* pisitools.removeDir("/usr/lib")
  
  
Line 227: Line 219:
  
 
::* autotools.configure()
 
::* autotools.configure()
::* autotools.configure(&quot;--prefix=/usr&quot;)
+
::* autotools.configure("--prefix=/usr")
  
  
Line 236: Line 228:
  
 
::* autotools.rawConfigure()
 
::* autotools.rawConfigure()
::* autotools.rawConfigure(&quot;--prefix %s/usr --with-doxywizard&quot; % get.installDIR())
+
::* autotools.rawConfigure("--prefix %s/usr --with-doxywizard" % get.installDIR())
::* autotools.rawConfigure(&quot;--enable-nls --enable-freetype --disable-xmltest'')
+
::* autotools.rawConfigure("--enable-nls --enable-freetype --disable-xmltest'')
  
  
Line 250: Line 242:
  
 
::* autotools.make()
 
::* autotools.make()
::* autotools.make(&quot;local-all&quot;)
+
::* autotools.make("local-all")
::* autotools.make(&quot;LIBS=%s&quot; % get.LDFLAGS())
+
::* autotools.make("LIBS=%s" % get.LDFLAGS())
::* autotools.make(&quot;-j1&quot;)
+
::* autotools.make("-j1")
  
  
Line 261: Line 253:
  
 
::* autotools.install()
 
::* autotools.install()
::* autotools.install(&quot;libdir=%s/usr/lib&quot; % get.installDIR())
+
::* autotools.install("libdir=%s/usr/lib" % get.installDIR())
  
  
Line 269: Line 261:
 
Install the package according to the parameters given by the user.
 
Install the package according to the parameters given by the user.
  
::* autotools.rawInstall(&quot;DESTDIR=%s&quot; % get.installDIR())
+
::* autotools.rawInstall("DESTDIR=%s" % get.installDIR())
::* autotools.rawInstall(&quot;DESTDIR=\&quot;%s\&quot; docdir=/usr/share/doc/%s/html&quot; % (get.installDIR(), get.srcTAG()))
+
::* autotools.rawInstall("DESTDIR=\"%s\" docdir=/usr/share/doc/%s/html" % (get.installDIR(), get.srcTAG()))
  
  
Line 278: Line 270:
 
Creates an aclocal.m4 file according to the configure.in file.
 
Creates an aclocal.m4 file according to the configure.in file.
  
::* autotools.aclocal(&quot;-I cmulocal -I config&quot;)
+
::* autotools.aclocal("-I cmulocal -I config")
::* autotools.aclocal(&quot;-I m4&quot;)
+
::* autotools.aclocal("-I m4")
 
::* autotools.aclocal()
 
::* autotools.aclocal()
  
Line 304: Line 296:
 
Creates the makefile.
 
Creates the makefile.
  
::* autotools.automake(&quot;-afc&quot;)
+
::* autotools.automake("-afc")
::* autotools.automake(&quot;--add-missing&quot;)
+
::* autotools.automake("--add-missing")
 
::* autotools.automake()
 
::* autotools.automake()
  
Line 324: Line 316:
  
 
::* cmaketools.configure()
 
::* cmaketools.configure()
::* cmaketools.configure(installPrefix = &quot;%s&quot; % (get.kdeDIR()))
+
::* cmaketools.configure(installPrefix = "%s" % (get.kdeDIR()))
::* cmaketools.configure(&quot;-DCMAKE_BUILD_TYPE=None -DKDEDIR=%s&quot; % get.kdeDIR(), sourceDir = &quot;..&quot;)
+
::* cmaketools.configure("-DCMAKE_BUILD_TYPE=None -DKDEDIR=%s" % get.kdeDIR(), sourceDir = "..")
  
  
Line 334: Line 326:
  
 
::* cmaketools.make()
 
::* cmaketools.make()
::* cmaketools.make(&quot;LIBS=%s&quot; % get.LDFLAGS())
+
::* cmaketools.make("LIBS=%s" % get.LDFLAGS())
::* cmaketools.make(&quot;-j1&quot;)
+
::* cmaketools.make("-j1")
  
  
Line 345: Line 337:
  
 
::* cmaketools.install()
 
::* cmaketools.install()
::* cmaketools.install(&quot;libdir=%s/usr/lib&quot; % get.installDIR())
+
::* cmaketools.install("libdir=%s/usr/lib" % get.installDIR())
  
  
Line 353: Line 345:
 
Installs the source with the parameters given by the user.
 
Installs the source with the parameters given by the user.
  
::* cmaketools.rawInstall(&quot;PREFIX=%s&quot; % get.installDIR())
+
::* cmaketools.rawInstall("PREFIX=%s" % get.installDIR())
  
  
Line 384: Line 376:
 
Checks if the '''sourceFile''' is accessible.
 
Checks if the '''sourceFile''' is accessible.
  
::* shelltools.can_access_file(&quot;/usr/share/terminfo/%s&quot; % termfile)
+
::* shelltools.can_access_file("/usr/share/terminfo/%s" % termfile)
  
  
Line 398: Line 390:
 
Creates the '''destinationDirectory'''.
 
Creates the '''destinationDirectory'''.
  
::* shelltools.makedirs(&quot;%s/build&quot; % get.workDIR())
+
::* shelltools.makedirs("%s/build" % get.workDIR())
::* shelltools.makedirs(&quot;%s/build-default-i686-pc-linux-gnu-nptl&quot; % get.workDIR())
+
::* shelltools.makedirs("%s/build-default-i686-pc-linux-gnu-nptl" % get.workDIR())
  
  
Line 407: Line 399:
 
Changes permissions of '''sourceFile'''.
 
Changes permissions of '''sourceFile'''.
  
::* shelltools.chmod(&quot;config/config.sub&quot;)
+
::* shelltools.chmod("config/config.sub")
::* shelltools.chmod(get.installDIR() + &quot;/lib/libz.so.*&quot;)
+
::* shelltools.chmod(get.installDIR() + "/lib/libz.so.*")
::* shelltools.chmod(&quot;%s/usr/lib/misc/pt_chown&quot; % get.installDIR(), 4711)
+
::* shelltools.chmod("%s/usr/lib/misc/pt_chown" % get.installDIR(), 4711)
::* shelltools.chmod(get.installDIR() + &quot;/etc/ssh/sshd_config&quot;, 0600)
+
::* shelltools.chmod(get.installDIR() + "/etc/ssh/sshd_config", 0600)
  
  
Line 418: Line 410:
 
Deletes the '''sourceFile'''.
 
Deletes the '''sourceFile'''.
  
::* shelltools.unlink(get.workDIR() + '/' + get.srcDIR() + &quot;/missing&quot;)
+
::* shelltools.unlink(get.workDIR() + '/' + get.srcDIR() + "/missing")
  
  
Line 426: Line 418:
 
Deletes the '''sourceDirectory''' and all subdirectories.
 
Deletes the '''sourceDirectory''' and all subdirectories.
  
::* shelltools.unlinkDir(get.workDIR() + &quot;/tmpbuild&quot;)
+
::* shelltools.unlinkDir(get.workDIR() + "/tmpbuild")
  
  
Line 434: Line 426:
 
Moves the '''sourceFile''' to '''destinationFile'''.
 
Moves the '''sourceFile''' to '''destinationFile'''.
  
::* shelltools.move(&quot;ac-wrapper.sh&quot;, &quot;%s/usr/lib/misc/&quot; % get.installDIR())
+
::* shelltools.move("ac-wrapper.sh", "%s/usr/lib/misc/" % get.installDIR())
::* shelltools.move(&quot;proc/*.h&quot;, &quot;%s/usr/include/proc/&quot; % get.installDIR())
+
::* shelltools.move("proc/*.h", "%s/usr/include/proc/" % get.installDIR())
  
  
Line 443: Line 435:
 
Copies the '''sourceFile''' to '''destinationFile'''.
 
Copies the '''sourceFile''' to '''destinationFile'''.
  
::* shelltools.copy(&quot;Makefile.pre.in&quot;, &quot;%s/usr/lib/python2.3/config/&quot; % get.installDIR())
+
::* shelltools.copy("Makefile.pre.in", "%s/usr/lib/python2.3/config/" % get.installDIR())
::* shelltools.copy(&quot;scripts/*&quot;, &quot;%s/usr/bin/&quot; % get.installDIR())
+
::* shelltools.copy("scripts/*", "%s/usr/bin/" % get.installDIR())
  
  
Line 452: Line 444:
 
Copies the '''source''' directory to '''destination''' directory.
 
Copies the '''source''' directory to '''destination''' directory.
  
::* shelltools.copytree(&quot;include/linux/&quot;, &quot;%s/usr/include/linux/&quot; % get.installDIR())
+
::* shelltools.copytree("include/linux/", "%s/usr/include/linux/" % get.installDIR())
::* shelltools.copytree(&quot;include/asm-generic/&quot;, &quot;%s/usr/include/asm-generic/&quot; % get.installDIR())
+
::* shelltools.copytree("include/asm-generic/", "%s/usr/include/asm-generic/" % get.installDIR())
  
  
Line 461: Line 453:
 
Sets the last access date of '''sourceFile''' to current time.
 
Sets the last access date of '''sourceFile''' to current time.
  
::* shelltools.touch(get.workDIR() + &quot;aclocal.m4&quot;)
+
::* shelltools.touch(get.workDIR() + "aclocal.m4")
::* shelltools.touch(&quot;gcc/c-gperf.h&quot;)
+
::* shelltools.touch("gcc/c-gperf.h")
  
  
Line 470: Line 462:
 
Changes the current working directory to '''directoryName'''.
 
Changes the current working directory to '''directoryName'''.
  
::* shelltools.cd(&quot;build_unix&quot;)
+
::* shelltools.cd("build_unix")
::* shelltools.cd(&quot;%s/build-default-i686-pc-linux-gnu-nptl&quot; % get.workDIR())
+
::* shelltools.cd("%s/build-default-i686-pc-linux-gnu-nptl" % get.workDIR())
  
  
Line 479: Line 471:
 
Returns a list of all files and directories in the '''source''' directory.
 
Returns a list of all files and directories in the '''source''' directory.
  
::* shelltools.ls(get.installDIR() + &quot;/usr/lib/*w.*&quot;)
+
::* shelltools.ls(get.installDIR() + "/usr/lib/*w.*")
  
  
Line 487: Line 479:
 
Sets the value for '''key''' environment variable to '''value'''.
 
Sets the value for '''key''' environment variable to '''value'''.
  
::* shelltools.export(&quot;WANT_AUTOCONF&quot;, &quot;2.5&quot;)
+
::* shelltools.export("WANT_AUTOCONF", "2.5")
::* shelltools.export(&quot;CXX&quot;, get.CXX())
+
::* shelltools.export("CXX", get.CXX())
::* shelltools.export(&quot;LDFLAGS&quot;, get.LDFLAGS() + &quot;-Wl,-z,now&quot;)
+
::* shelltools.export("LDFLAGS", get.LDFLAGS() + "-Wl,-z,now")
::* shelltools.export(&quot;LC_ALL&quot;, &quot;C&quot;)
+
::* shelltools.export("LC_ALL", "C")
  
  
Line 498: Line 490:
 
Executes the '''command''' in the system shell.
 
Executes the '''command''' in the system shell.
  
::* shelltools.system(&quot;./update-pciids.sh &amp;&gt; /dev/null&quot;)
+
::* shelltools.system("./update-pciids.sh &> /dev/null")
  
  
Line 726: Line 718:
 
Configures the perl source code with the given parameters.
 
Configures the perl source code with the given parameters.
  
::* perlmodules.configure(&quot;/usr&quot;)
+
::* perlmodules.configure("/usr")
 
::* perlmodules.configure()  
 
::* perlmodules.configure()  
  

Latest revision as of 13:58, 30 November 2010

Contents

About the document

The main components of a PISI package are the pspec.xml, actions.py files and the source code. actions.py is a python script that contains information of the operations to be executed on the source code. This document is an overview of the Actions API library which includes the functions that are available for use in actions.py scripts.The document is currently being developed by A. Murat Eren, please mail your ideas and suggestions to meren@ @.pngpardus.org.tr instead of directly editing for keeping exactness.

Actions API

Actions API has a modular structure that makes the packaging process easier for the packager. The major modules of the Actions API are:

  • Autotools: Standard functions for building and installing applications.
  • Cmaketools: Functions for building the applications that are configured with cmake.
  • Pisitools: Fundamentally used for moving files to install directory from work directory, the functions included in pisitools are convenient for most operations i.e. symlinking, file manipulation via sed, deleting files or directories.
  • Shelltools: Functions for specific operations. Apart from pisitools, shelltools is capable of operating in absolute paths instead of relative paths. Granting the ability to operate in the darkest corners of the system to the packager shelltools has to be used responsibly.
  • Libtools: Pre-build and post-build operations for configuring libraries.
  • Get: Functions for getting information about evnironment variables or packages needed in building and installation phases.
  • Kde: Functions for configuring, building and installing KDE applications.
  • Perlmodules: Functions for installing perl modules.
  • Pythonmodules: Functions for installing python modules.
  • Scons: Counterpart of autotools for the new generation building tools, scons.

Pisitools

dobin

(sourceFile, destinationDirectory = '/usr/bin')

Moves the sourceFile' in work directory to destinationDirectory. The default value for destinationDirectory is /usr/bin.

  • pisitools.dobin("sed/sed", "/bin")
  • pisitools.dobin("zipsplit")


dodir

(destinationDirectory)

Creates the (destinationDirectory) in the install path.

  • pisitools.dodir("/usr/include/awk")
  • pisitools.dodir("/usr/" + get.HOST() + "/include")
  • pisitools.dodir("/usr/share/doc/%s/examples" % get.srcTAG())


dodoc

(sourceFiles)

Copies the sourceFiles into /usr/share/doc/PACKAGE under the install directory.

  • pisitools.dodoc("README")
  • pisitools.dodoc("*.html")
  • pisitools.dodoc("FAQ", "README", "ChangeLog.*", "algorithm.txt")


doexe

(sourceFile, destinationDirectory)

Copies the sourceFile executable from work directory to destination directory.

  • pisitools.doexe("extras/scsi-devfs.sh", "/etc/udev/scripts/")
  • pisitools.doexe("etc/hotplug/*.rc", "/etc/hotplug/")


dohtml

(sourceFiles)

Copies the sourceFiles into /usr/share/doc/PACKAGE/html under the install directory.

  • pisitools.dohtml("index.html")
  • pisitools.dohtml("doc/*")


doinfo

(sourceFiles)

Copies the sourceFiles into /usr/share/info under the install directory.

  • pisitools.doinfo("*.info")


dolib

(sourceFile, destinationDirectory = '/usr/lib')

Copies the sourceFile library to /usr/lib under the install directory.

  • pisitools.dolib("libz.a")
  • pisitools.dolib("lib/libpci.a")
  • pisitools.dolib("libbz2.so.1.0.2", "/lib")


dolib_a

(sourceFile, destinationDirectory = '/usr/lib')

Copies the sourceFile static library to /usr/lib under the install directory.

  • pisitools.dolib_a("lib/libpci.a")
  • pisitools.dolib_a("libdb1.a")


dolib_so

(sourceFile, destinationDirectory = '/usr/lib')

Copies the sourceFile shared library to /usr/lib under the install directory.

  • pisitools.dolib_so("libdb1.so.2")


doman

(sourceFiles)

Copies the sourceFile manual to /usr/share/man/ under the install directory.

  • pisitools.doman("logrotate.8")
  • pisitools.doman("doc/bash.1", "doc/bashbug.1", "doc/builtins.1", "doc/rbash.1")
  • pisitools.doman("*.[1-8]")


domo

(sourceFile, locale, destinationFile )

Makes a mo destinationFile for locale language from the sourceFile po file in /usr/share/locale/LOCALE/LC_MESSAGES.

  • pisitools.domo("po/tr.po", "tr", "pam_login.mo")


domove

(sourceFile, destination, destinationFile)

Moves the sourceFile to destination directory.

  • pisitools.domove("/usr/bin/passwd", "/bin/")
  • pisitools.domove("/usr/bin/yacc", "/usr/bin", "yacc.bison")
  • pisitools.domove("/usr/docs/", "/usr/share/doc/%s/html/" % get.srcTAG())


dosed

(sourceFile, findPattern, replacePattern)

Replaces the findPattern to replacePattern in sourceFile via sed.

  • pisitools.dosed("gcc/version.c", "<URL:http://gcc.gnu.org/bugs.html>" , "<URL:http://bugs.uludag.org.tr>")
  • pisitools.dosed("sshd_config", "(?m)(#UsePAM ).*", r"UsePAM yes")
  • pisitools.dosed("unix/Makefile", "-O3", get.CFLAGS())
  • pisitools.dosed("Make.Rules", "HAVE_NDBM_H=yes", "HAVE_NDBM_H=no")
  • pisitools.dosed("Makefile.def", "CC=cc", "CC=%s" % get.CC())
  • pisitools.dosed("automake.texi", "(?m)(@setfilename.*)automake", r"\1automake1.7")


dosbin

(sourceFile, destinationDirectory = '/usr/sbin')

Moves the sourceFile' in work directory to destinationDirectory. The default value for destinationDirectory is /usr/sbin.

  • pisitools.dosbin("traceroute6")
  • pisitools.dosbin("extras/scsi_id/scsi_id", "/sbin")


dosym

(sourceFile, destinationFile)

Creates a symlink of the sourceFile as destinationFile.

  • pisitools.dosym("gzip", "/bin/gunzip")
  • pisitools.dosym("libdb1.so.2", "/usr/lib/libdb.so.2")
  • pisitools.dosym("../bin/lsmod", "/sbin/lsmod")
  • pisitools.dosym("/usr/X11R6/include/X11", "/usr/include/X11")


insinto

 (destinationDirectory, sourceFile,  destinationFile)

Copies the sourceFile to destinationDirectory. destinationFile parameter is optional and changes the name of the copy if used.

  • pisitools.insinto("/opt/rar/bin", "rar")
  • pisitools.insinto("/etc/", "doc/nanorc.sample", "nanorc")
  • pisitools.insinto("/etc/hotplug", "etc/hotplug/*map")


newdoc

(sourceFile, destinationFile)

Copies the sourceFile to /usr/share/doc/PACKAGE/.

  • pisitools.newdoc("extras/volume_id/README", "README_volume_id")
  • pisitools.newdoc("gprof/ChangeLog.linux", "gprof/ChangeLog.linux")
  • pisitools.newdoc("bfd/PORTING", "bfd/PORTING")


newman

(sourceFile, destinationFile)

Copies the sourceFile to /usr/share/man/manPREFIX/.

  • pisitools.newman("less.nro", "less.1")


remove

(sourceFile)

Deletes the sourceFile under the install directory.

  • pisitools.remove("/usr/lib/libdb_cxx.so")


rename

(sourceFile, destinationFile)

Renames the sourceFile as destinationFile.

  • pisitools.rename("/usr/bin/bash", "bash.old")


removeDir

(destinationDirectory)

Deletes the 'destinationDirectory and all files inside.

  • pisitools.removeDir("/usr/lib")


Autotools

configure

(parameters)

Configures the package according to the parameters given by the user and PISI's default parameters.

  • autotools.configure()
  • autotools.configure("--prefix=/usr")


rawConfigure

(parameters)

Configures the package according to the parameters given by the user.

  • autotools.rawConfigure()
  • autotools.rawConfigure("--prefix %s/usr --with-doxywizard" % get.installDIR())
  • autotools.rawConfigure("--enable-nls --enable-freetype --disable-xmltest)


compile

(parameters)


make

(parameters)

Builds the package according to the parameters given by the user.

  • autotools.make()
  • autotools.make("local-all")
  • autotools.make("LIBS=%s" % get.LDFLAGS())
  • autotools.make("-j1")


install

(parameters)

Install the package according to the parameters given by the user and PISI's default parameters.

  • autotools.install()
  • autotools.install("libdir=%s/usr/lib" % get.installDIR())


rawInstall

(parameters)

Install the package according to the parameters given by the user.

  • autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  • autotools.rawInstall("DESTDIR=\"%s\" docdir=/usr/share/doc/%s/html" % (get.installDIR(), get.srcTAG()))


aclocal

(parameters)

Creates an aclocal.m4 file according to the configure.in file.

  • autotools.aclocal("-I cmulocal -I config")
  • autotools.aclocal("-I m4")
  • autotools.aclocal()


autoconf

(parameters)

Creates the configure script.

  • autotools.autoconf()


autoreconf

(parameters)

Recreates the configure script.

  • autotools.autoreconf()


automake

(parameters)

Creates the makefile.

  • autotools.automake("-afc")
  • autotools.automake("--add-missing")
  • autotools.automake()


autoheader

(parameters)

Creates the header file for the configure script.

  • autotools.autoheader()


Cmaketools

configure

(parameters, sourceDir, installPrefix = '%s' % get.defaultprefixDIR())

Configures the source with the given parameters.

  • cmaketools.configure()
  • cmaketools.configure(installPrefix = "%s" % (get.kdeDIR()))
  • cmaketools.configure("-DCMAKE_BUILD_TYPE=None -DKDEDIR=%s" % get.kdeDIR(), sourceDir = "..")


make

(parameters)

Builds the source with the given parameters.

  • cmaketools.make()
  • cmaketools.make("LIBS=%s" % get.LDFLAGS())
  • cmaketools.make("-j1")


install

(parameters, argument = 'install')

Installs the source with the parameters given by the user and PISI's default parameters.


  • cmaketools.install()
  • cmaketools.install("libdir=%s/usr/lib" % get.installDIR())


rawInstall

(parameters, argument = 'install')

Installs the source with the parameters given by the user.

  • cmaketools.rawInstall("PREFIX=%s" % get.installDIR())


Libtools

preplib

(sourceDirectory)

Executes ldconfig command in the sourceDirectory.


gnuconfig_update

Copies the newest config.* files to the source.


libtoolize

(parameters)

Makes it possible to execute libtool on the source.


gen_usr_ldscript

(dynamicLib)


Shelltools

can_access_file

(sourceFile)

Checks if the sourceFile is accessible.

  • shelltools.can_access_file("/usr/share/terminfo/%s" % termfile)


can_access_directory

(destinationDirectory)

Checks if the destinationDirectory is accessible.


makedirs

(destinationDirectory)

Creates the destinationDirectory.

  • shelltools.makedirs("%s/build" % get.workDIR())
  • shelltools.makedirs("%s/build-default-i686-pc-linux-gnu-nptl" % get.workDIR())


chmod

(sourceFile, mode)

Changes permissions of sourceFile.

  • shelltools.chmod("config/config.sub")
  • shelltools.chmod(get.installDIR() + "/lib/libz.so.*")
  • shelltools.chmod("%s/usr/lib/misc/pt_chown" % get.installDIR(), 4711)
  • shelltools.chmod(get.installDIR() + "/etc/ssh/sshd_config", 0600)


unlink

(sourceFile)

Deletes the sourceFile.

  • shelltools.unlink(get.workDIR() + '/' + get.srcDIR() + "/missing")


unlinkDir

(sourceDirectory)

Deletes the sourceDirectory and all subdirectories.

  • shelltools.unlinkDir(get.workDIR() + "/tmpbuild")


move

(sourceFile, destinationFile)

Moves the sourceFile to destinationFile.

  • shelltools.move("ac-wrapper.sh", "%s/usr/lib/misc/" % get.installDIR())
  • shelltools.move("proc/*.h", "%s/usr/include/proc/" % get.installDIR())


copy

(sourceFile, destinationFile)

Copies the sourceFile to destinationFile.

  • shelltools.copy("Makefile.pre.in", "%s/usr/lib/python2.3/config/" % get.installDIR())
  • shelltools.copy("scripts/*", "%s/usr/bin/" % get.installDIR())


copytree

(source, destination, sym=False)

Copies the source directory to destination directory.

  • shelltools.copytree("include/linux/", "%s/usr/include/linux/" % get.installDIR())
  • shelltools.copytree("include/asm-generic/", "%s/usr/include/asm-generic/" % get.installDIR())


touch

(sourceFile)

Sets the last access date of sourceFile to current time.

  • shelltools.touch(get.workDIR() + "aclocal.m4")
  • shelltools.touch("gcc/c-gperf.h")


cd

(directoryName)

Changes the current working directory to directoryName.

  • shelltools.cd("build_unix")
  • shelltools.cd("%s/build-default-i686-pc-linux-gnu-nptl" % get.workDIR())


ls

(source)

Returns a list of all files and directories in the source directory.

  • shelltools.ls(get.installDIR() + "/usr/lib/*w.*")


export

(key, value)

Sets the value for key environment variable to value.

  • shelltools.export("WANT_AUTOCONF", "2.5")
  • shelltools.export("CXX", get.CXX())
  • shelltools.export("LDFLAGS", get.LDFLAGS() + "-Wl,-z,now")
  • shelltools.export("LC_ALL", "C")


system

(command)

Executes the command in the system shell.

  • shelltools.system("./update-pciids.sh &> /dev/null")


isLink

(sourceFile)

Checks if the sourceFile is a link.

  • shelltools.isLink(get.installDIR() + '/maybe/link')


realPath

(sourceFile)

Returns the real path of the sourceFile link.

  • shelltools.realPath(get.installDIR() + link)


baseName

(sourceName)

Returns the name of the sourceName real path.

  • shelltools.baseName(shelltools.realPath(link))


dirName

(sourceName)

Returns the directory of sourceName.


sym

(sourceFile, destinationFile)

Links the destinationFile to sourceFile.


Get

curDIR

(None) 
  • get.curDIR()


curKERNEL

(None)
  • get.curKERNEL()


curPYTHON

(None)

Returns currently used python's version (i.e python2.5)

curPERL

(None)
  • get.curPERL()


pkgDIR

(None)

Returns the paths of work and install directories of the package.

  • get.pkgDIR()


workDIR

(None)

Returns the path of work directory.

  • get.workDIR()


installDIR

(None)

Returns the path of install directory.

  • get.installDIR()


srcNAME

(None)

Returns the name of source package.


srcVERSION

(None)

Returns the version of source package.


srcRELEASE

(None)

Returns the release number of source package.


srcTAG

(None)

Returns the name, version and release number of source package.


srcDIR

(None)


HOST

(None)


CFLAGS

(None)


CXXFLAGS

(None)


LDFLAGS

(None)


docDIR

(None)


sbinDIR

(None)


infoDIR

(None)


manDIR

(None)


dataDIR

(None)


confDIR

(None)


localstateDIR

(None)


defaultprefixDIR

(None)


kdeDIR

(None)


qtDIR

(None)


qtLIBDIR

(None)


AR

(None)


AS

(None)


CC

(None)


CXX

(None)

LD

(None)


NM

(None)


RANLIB

(None)


F77

(None)


GCJ

(None)

Kde

configure

(parameters)


make

(None)


install

(None)


Perlmodules

configure

(parameters)

Configures the perl source code with the given parameters.

  • perlmodules.configure("/usr")
  • perlmodules.configure()


make

(parameters)

Builds the perl source code with the given parameters.

  • perlmodules.make()


install

(parameters)

Installs the perl source code with the given parameters.

  • perlmodules.install()


Pythonmodules

compile

(parameters)

Compiles the python source code with the given parameters.


install

(parameters)

Executes python setup.py install command in the install directory with the given parameters.

run

(parameters)

Runs the python script with the given parameters.


Scons

make

(parameters)


install

(parameters)
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox
In other languages