First days of the internship period at Pardus can be defined as an orientation. I had my own desk and PC, and I installed the last version of Pardus, Pardus 2009.2 Geronticus eremita. During these first days, the activities can be listed as meeting with the staff and other interns, observing the specific responsibilities of each Pardus developers, observing the general working environment of software/kernel developers. I reviewed my operating systems and especially Linux usage knowledge, bash commands, usage of Linux text editors like Vim, Vi, Emacs etc. Moreover, I have started learning the general system architecture of Pardus. They prepared a handbook for interns, which involves the list of things to examine during the orientation and I followed this handbook as a tutorial.
In this handbook/tutorial, the necessary information was given about most frequently used Pardus components such as Yalı, Çomar, Pisi, Tasma, Müdür, Kaptan etc. For more information, I searched them on Pardus Wiki which involves the documentation, how to manuals and all necessary information about Pardus. You can visit Pardus Wiki from “http://tr.pardus-wiki.org”, or the English version from “http://en.pardus-wiki.org/Main_Page”. In short, we can say that Yalı is a system component responsible for the setup and installation of Pardus OS, Kaptan helps to guide the user for the personalization of desktop and connection settings, Müdür is responsible for automatically recognizing the hardware devices connected, Çomar is the Configuration Manager of Pardus and Tasma is the graphical interface that transmits the user settings to Çomar architecture. The most important system component of Pardus is PiSi, which stands for Packages Installed Successfully as Intended.
Before understanding the structure of PiSi and PiSi packages, I reviewed the concepts like packages, scripts, APIs and Actions API. In general, a software package refers to computer software packaged in an archive format to be installed by a package manager system. Linux distributions are generally segmented into packages. Each package contains a specific application or service and each package contains meta-information such as a package description, version, and dependencies. The package management system can evaluate this meta-information to allow package searches, to perform an automatic upgrade to a newer version, to check that all dependencies of a package are fulfilled and sometimes to fulfill them automatically. Furthermore, "scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the end users. Scripts are often interpreted from source code, whereas the applications they control are traditionally compiled to native machine code. In addition, an application programming interface (API) is an interface implemented by a software program which enables it to interact with other software. An API is implemented by applications, libraries and OS to determine their vocabularies and calling conversions, and is used to access their services. Actions APIs are used in PiSi packages, which I will mention later in detail.
In this handbook/tutorial, the necessary information was given about most frequently used Pardus components such as Yalı, Çomar, Pisi, Tasma, Müdür, Kaptan etc. For more information, I searched them on Pardus Wiki which involves the documentation, how to manuals and all necessary information about Pardus. You can visit Pardus Wiki from “http://tr.pardus-wiki.org”, or the English version from “http://en.pardus-wiki.org/Main_Page”. In short, we can say that Yalı is a system component responsible for the setup and installation of Pardus OS, Kaptan helps to guide the user for the personalization of desktop and connection settings, Müdür is responsible for automatically recognizing the hardware devices connected, Çomar is the Configuration Manager of Pardus and Tasma is the graphical interface that transmits the user settings to Çomar architecture. The most important system component of Pardus is PiSi, which stands for Packages Installed Successfully as Intended.
Before understanding the structure of PiSi and PiSi packages, I reviewed the concepts like packages, scripts, APIs and Actions API. In general, a software package refers to computer software packaged in an archive format to be installed by a package manager system. Linux distributions are generally segmented into packages. Each package contains a specific application or service and each package contains meta-information such as a package description, version, and dependencies. The package management system can evaluate this meta-information to allow package searches, to perform an automatic upgrade to a newer version, to check that all dependencies of a package are fulfilled and sometimes to fulfill them automatically. Furthermore, "scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the end users. Scripts are often interpreted from source code, whereas the applications they control are traditionally compiled to native machine code. In addition, an application programming interface (API) is an interface implemented by a software program which enables it to interact with other software. An API is implemented by applications, libraries and OS to determine their vocabularies and calling conversions, and is used to access their services. Actions APIs are used in PiSi packages, which I will mention later in detail.
After gaining these basic knowledge, I was ready to examine PiSi package structure. As I mentioned before, PiSi is a binary package management system which have been developed within Pardus project. It is the tool that installs, upgrades and removes the software packages successfully. PiSi stores and handles the dependencies for the other packages, libraries and tasks. You can have more information about PiSi from “http://tr.pardus-wiki.org/Pisi”. PiSi is implemented in Python, a programming language that I did not know, and thus learning Python would be one of my internship missions. By the way, Pardus graphical designs and codes for GUIs are written using Qt, fortunately which we have learned in Cmpe230 Systems Porgramming course. However, I would need to review my Qt knowledge during my internship too.
After that, I have learned how to use PiSi commands which are invoked in the command-line trough the `pisi` executable. You can see the document that provides an overview of Pisi usage on the command line (pisi-cli) from “ http://en.pardus-wiki.org/Pisi_CLI_Usage ”. PiSi package sources are written in XML and Python. The structure of a Pisi source package consists of an XML file named “pspec.xml” which is for description, a Python script named “actions.py” which is for construction (setup, build, install), another optional XML file named “translations.xml” which is for language supports, and a directiory named files/ for optional additional files (like pathces).
I have examined the general structure of these two basic files for a Pisi package, “pspec.xml” and “actions.py”. Pspec.xml is an XML file containing at least 3 child nodes: Source, Package, History. There can be multiple Package nodes in here, which means that one source package may generate multiple binary packages. Source node contains general package and packager information, sha1sum, type and location of source archive, Patches and BuildDependencies. Package node contains RuntimeDependencies and locations of different file types, AdditionalFiles and Comar scripts if needed. History node simply contains information about package history. The Package may contain the AdditionalFiles tag, which can be used to copy files from the files subdirectory of your source tree into the .pisi. After gaining this general information on pspec.xml file, I moved into the actions.py file. Actions.py file contains Python codes that would compile and install the source package into a specific install directory. In this actions.py file, we use Actions API that comes with Pisi. Actions API has all functions for us to compile and install our package. You can see all Actions API definitions and usages from “http://tr.pardus-wiki.org/Pardus:ActionsAPI”.
After preparing pspec.xml and actions.py properly, we can easily build a Pisi package by typing “sudo pisi build pspec.xml” command in the console. If the package is successfully built, then a file with .pisi extension is formed in the current directory. If we want to install this package, we should type “sudo pisi install mypackage-x-y-z.pisi” command in the console. I will explain the details of how to prepare a package by preparing pspec.xml and actions.py later, since this was the second weeks job.
Before moving forward, the concept of subversion (SVN) is needed to be learned in order to understand the Pardus source repository structure and usage. The development process in Pardus is maintained via a Subversion version control system. Subversion is an open source version tracking system. Its a development infrastructure which makes it possible for more than one application developer to work together not worried about destroying each others' changes. By SVN, any single software's development process can be tracked backwards, the changes made gradually can be watched and can be easily returned to any version of a particular time. After understanding the SVN system, the concept of repository came next. A repository is a disk area on which the last version, all the previous versions and the changes between versions of the software packages every developer works on, information including their user, date and cause are stored which can be reached. We can view Pardus repositories using svn form “http://svn.pardus.org.tr”. I have examined Pardus official packages repository, Contrib packages repository, Uludag repository and Websvn (for svn logs). There are also different subdirectories within them like devel/, stable/, trunk/, branches/ etc. with different meanings and usages. After surfing around these repositories, I learned how to use SVN from console using basic SVN commands. For instance, to get a directory/file from a repository, you should type >svn checkout http://...source link.... You can olsa type >svn add ..., >svn update, >svn diff (for diff output of what you have changed). All these changes are not reflected in the repositories until you commit them with >svn ci -m “commit comment” command. You can learn about svn, repository and all from “http://tr.pardus-wiki.org/Pardus:Yeni_geli%C5%9Ftirici_k%C4%B1lavuzu”.
My next mission in the handbook for interns was preparing a patch and applying it to the Pardus sources. The aim was to change the text on one of the buttons used in Kaptan's GUI. I wanted to change the text “next” on the moving forward button of Kaptan and make it to “Eda”. To do this, first of all I needed to checkout Kaptan's sources from Uludag repository with “svn co http://svn.pardus.org.tr/uludag/trunk/kde/kaptan/” command. Then I moved into src/gui/ and opened the file kaptanMain.ui with Qt Designer. I changed the text on the button from “next” to “Eda” and saved. I could see the changes I have made by typing “svn diff”. Then, I saved these changes into a file by typing “svn diff > change-button-text-to-eda.patch”. At this step, my patch was ready. To apply this patch into the system, I needed to checkout the kaptan package from Pardus repository into my workspace with “svn co http://svn.pardus.org.tr/pardus/2009/devel/desktop/kde/addon/kaptan/”. In this kaptan/ directory we have pspec.xml, action.py, translations.xml and files/.Since all patches should be located into files/, I copied the patch that I have created into files/. Then I needed to define this patch to the package, and I opened pspec.xml for that purpose. I needed to add “change-button-text-to-eda.patch ” line into pspec.xml. This time, my patched package was ready to be built and I typed “sudo pisi bi pspec.xml” command. This command creates a kaptan-x-y-z.pisi (x-y-z for any versions) which is a Pisi package ready to be installed. Finally, I installed it by typing “sudo pisi it kaptan-x-y-z.pisi”command. After doing all these, I have tried to run Kaptan and saw that “Eda” is written on the next button! It was nice to see that I can change nearly anything in the system, play with Gui's and source codes in whatever way I like. If anyone wants to send his/her patch or any changes to the developer of this package, he/she can use svn Contrib repository which is an unofficial repository that contains packages provided by the users. As an intern, we had our own svn accounts activated so that we can commit anything into playground directory of Uludag repository where source codes and gui designs of Pardus developers are found. The exact place where internship projects are located is http://svn.pardus.org.tr/uludag/trunk/playground/intern/.
Hiç yorum yok:
Yorum Gönder