You are on page 1of 17

(12) Maintaining Software and

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

System building example


Examples on Web System development and application
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. 321
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
Updating Software Environment

Maintaining software environment


Environment surrounding software changes day by
day, due to new versions of library, software and
protocols
Configuration of software
Software needs to be set up to fit the surrounding
environment
Compiling source code and installing builds
Binary packages
Binary package: software package that includes
compiled software and the other files, in order to run
correctly by putting into adequate directories
Package management tools
up2date, yum, apt-get

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

Reasons for maintaining software environments


Software updated on daily basis
Add or enhance features
Bug fixes
Patch security holes
A lot of FOSS packages in particular are frequently
updated

What happens when software is not maintained


Problem for yourself
Unstable operation or unauthorized access
Problem for others worldwide
Your computer can be taken over and used to attack
other computers or send spam mail

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

These files are typically circulated in one package


Packaging of source 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. 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

Finding and using components


Several repositories are found in the Internet

Types of components (Data, XML, GUI, etc.)


Classifies major components

Language specific components


Major language has its component library and the
repository for them

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

Available libraries and PHP


specifications PEAR
Java http://pear.php.net/

J2EE, Struts Smarty


http://smarty.php.net/
Java Community Process (JCP)
Develops technology Perl
specifications CPAN
C http://www.cpan.org/

Multitude of components such Python


as GTK+, Qt, etc. Python Cheese Shop
XPG (formerly PyPI)
APIs and commands to be http://www.python.org/pypi
provided by Unix Ruby
C++ RAA
STL http://raa.ruby-lang.org/
Standard Template Library
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. 331
Copyright © 2008, University of Puerto Rico at Mayaguez. All Rights Reserved.
System Building Example
Web System
Using software components such as PEAR, Mojavi,
Smarty

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

programmers and designers Linux

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);

Changing DBMS requires


major changes to code
Advantage of using // Declaration of PEAR::DB
PEAR::DB include("DB.php");

Change just one part of // Type of Database


$type = "mysql";
code
// Connection
$db = DB::connect
Other classes for PEAR ("$type://$user:$pass@$host/$dbname");

// 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>

Intuitive for designers <table>


<?
Does not affect input for (i=0; $i<=10; i++) {
print “<tr><td>”.$array[$i].”</td></tr>”;
and output for Web }
?>
design software </table>

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

Contains source code to


CHECKSUMS Checksums for each file build generate necessary builds for
each platform
Contains files used by
COPYING Copyright notice config Autotools

COPYING.LIB Copyright notices for libraries doc Contains documentation

ChangeLog Update history extra Contains files used for testing

INSTALL Installation information man Contains manuals

Contains files necessary for


NEWS News pkg packaging such as for RPM,
deb, etc.

README First file to read src Contains main source code

THANKS Acknowledgements tests Contains code for testing

VERSION Version information tools Contains source code for tools

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.

You might also like