Professional Documents
Culture Documents
Development Examples
Updating software environments
Maintaining software environments and configuration of
software
Compiling source code and installing builds
Management of software packages
Software components
Efficient use of software component enables us to
reduce man-hour of development
Major software components
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 321
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Updating Software Environment
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 322
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Maintaining Software Environments
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 323
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Configuration of Software
Elements that comprise software
Source code alone is not enough
Other elements needed
Data used by software
Icons and image data
Other data such as sample data, etc.
Documentation
Manual pages
Supplementary information, update history
Licensing information
Configuration files
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 324
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Compiling Source Code and Installing
Builds
Common formats for source code distribution
.tgz, .tar.gz or .tar.bz2 extensions
Tar utility for packing multiple files together
Tools for compressing and uncompressing files
Two sets of tools are frequently used, based on different
compression formats
gzip / gunzip
bzip2 / bunzip2
Procedure for unpacking and compiling source
code and installing build
Unpack source code
tar xzvf XXX.tgz
Configure source code to fit environment
./configure
Install build (Install as root)
make; make install
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 325
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Binary Packages
What is a binary package?
Provided for each platform and contains pre-compiled
and pre-configured binary code packaged with other
necessary files
Examples of package management systems
RPM (Redhat Package Manager)
System developed by Red Hat
Deb: Package management system used by Debian
Difficult to apply binary packages to different
environments
Often cannot be used with different versions of same
Red Hat distribution, due to different library
configurations, etc.
If this happens, you can rebuild the binary package
from the source package to install software
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 326
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Package Management Tools
Main features
Update software that has been revised
Simplify installation of new software
Automatically resolve dependencies (information about
necessary libraries, etc.)
Leading package management tools
up2date
Developed for Red Hat Linux
yum (Yellow dog Updater, Modified)
Developed for Yellow Dog Linux
apt-get
Developed for Debian’s deb format
All three tools support RPM format
sGUI-based management tools also available such as
Synaptic, etc.
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 327
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Software Components
Software components
Efficient to reduce man-hour of software development
Avoid “re-invention of the wheel”
Many components are published as FOSS
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 328
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Finding and Using Software
Components
Finding software components
Standard supplied components such as STL, PEAR, etc.
Download from repository such as CPAN, RAA, etc.
Find using search engine
Specialized libraries or those that have recently started
development
Installing and using software components
Include in program source tree
Install to directories for each language # perl -MCPAN -e shell
cpan> install [module-name]
Often the case for scripting languages
Simplified installation using CPAN Perl module
Install as shared libraries
Interface or binding to enable various languages to use library
After installation, library is called from program being created
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 329
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Types of Components
(Data Structure, XML, GUI, Etc.)
Data structure Web page
STL HTMLParser
XML Database
Libxml, libxslt ODBC, JDBC
GUI Device
GTK+, Qt, Glade Libusb, v4l
Network Multimedia
Imlib, SDL
Web service
OpenSOAP, Mono Security
GnuPG (GPG), OpenSSL
Graphics
Mesa, GLUT
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 330
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Language Specific Components
Applications
Application building example
Location of Application Files
1. Find files containing project information
2. Examine subdirectories in source tree
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 332
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Web System
PHP software components
Browser
PEAR
Library for improving
reusability of code Apache
Mojavi HTML
MVC framework PHP
Smarty Mojavi
View Template
Template engine
Controller
Smarty
Model
Advantages
Simplifies support for PEAR::DB
different DBMSs
DB
Simple to reuse code Postgre
MySQL etc...
Divides labor of SQL
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 333
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Web System – PEAR::DB
PEAR::DB // Connection
$connection = mysql_connect($host, $user, $pass);
mysql_select_db($dbname);
Integrated interface for
// SQL execution
DBMSs $sql = "SELECT * FROM testtable";
$result = mysql_query($sql);
PHP uses different
// disconnection
functions for each DBMS mysql_close($connection);
// SQL execution
Authentication, testing, $sql = "SELECT * FROM testtable";
networking, XML, etc. $result = $db->query($sql);
// disconnection
$db->disconnect();
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 334
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Web System – Smarty
Template engine
<h1>
Improves design <? print $title; ?>
presentation </h1>
Smarty
Used for XOOPS and
Rakuten (leading e- <h1>{$title}</h1>
<table>
commerce site in Japan) {section name=i loop=$array max=”10”}
<tr><td>{$array[i]}</td></tr>
systems {/section}
</table>
Many acceleration
features
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 335
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Application Building Example
Desktop application software
Example: mpatrol
Tool for detecting memory leaks and illegal memory
access
Platforms supported
AIX, DG/UX, DRS/NX, DYNX/ptx, FreeBSD, HP/UX, IRIX, Red
Hat Linux, SUSE Linux, LynxOS, SINIX, Solaris, Tru64,
UnixWare, AmigaOS, Windows, etc.
Where to obtain mpatrol
http://www.cbmamiga.demon.co.uk/mpatrol/
$ tar xzvf mpatrol_1.4.8.tar.gz
...
$ cd mpatrol
$ ls
AUTHORS COPYING.LIB NEWS VERSION config man tests
CHECKSUMS ChangeLog README bin doc pkg tools
COPYING INSTALL THANKS build extra src
$
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 336
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Location of Application Files
File configuration after unpacking
AUTHORS Author’s name bin Location for binary code
An Introduction to Free/Open-Source Software Copyright © 2005,2006, Center of the International Cooperation for Computerization (CICC) All Rights Reserved.
Copyright © 2005,2006, Mitsubishi Research Institute, Inc. All Rights Reserved. 337
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.