Alien::Package::Deb(3pm) User Contributed Perl Documentation Alien::Package::Deb(3pm)NAME
Alien::Package::Deb - an object that represents a deb package
DESCRIPTION
This is an object class that represents a deb package. It is derived from Alien::Package.
FIELDS
have_dpkg_deb
Set to a true value if dpkg-deb is available.
dirtrans
After the build stage, set to a hash reference of the directories we moved files from and to, so these moves can be reverted in the
cleantree stage.
fixperms
If this is set to true, the generated debian/rules will run dh_fixperms.
METHODS
init
Sets have_dpkg_deb if dpkg-deb is in the path. I prefer to use dpkg-deb, if it is available since it is a lot more future-proof.
checkfile
Detect deb files by their extention.
install
Install a deb with dpkg. Pass in the filename of the deb to install.
test
Test a deb with lintian. Pass in the filename of the deb to test.
getcontrolfile
Helper method. Pass it the name of a control file, and it will pull it out of the deb and return it.
scan
Implement the scan method to read a deb file.
unpack
Implement the unpack method to unpack a deb file.
getpatch
This method tries to find a patch file to use in the prep stage. If it finds one, it returns it. Pass in a list of directories to
search for patches in.
prep
Adds a populated debian directory the unpacked package tree, making it ready for building. This can either be done automatically, or
via a patch file.
build
Build a deb.
cleantree
Delete the entire debian/ directory.
package
Set/get package name.
Always returns the packge name in lowercase with all invalid characters rmoved. The name is however, stored unchanged.
version
Set/get package version.
When the version is set, it will be stripped of any epoch. If there is a release, the release will be stripped away and used to set the
release field as a side effect. Otherwise, the release will be set to 1.
More sanitization of the version is done when the field is retrieved, to make sure it is a valid debian version field.
release
Set/get package release.
Always returns a sanitized release version. The release is however, stored unchanged.
description
Set/get description
Although the description is stored internally unchanged, this will always return a sanitized form of it that is compliant with Debian
standards.
date
Returns the date, in rfc822 format.
email
Returns an email address for the current user.
username
Returns the user name of the real uid.
postinst
Returns the postinst. This may include generated shell code to set owners and groups from the owninfo field, and update modes from the
modeinfo field.
AUTHOR
Joey Hess <joey@kitenet.net>
perl v5.12.3 2011-06-11 Alien::Package::Deb(3pm)
Check Out this Related Man Page
Alien::Package(3pm) User Contributed Perl Documentation Alien::Package(3pm)NAME
Alien::Package - an object that represents a package
DESCRIPTION
This is a perl object class that represents a package in an internal format usable by alien. The package may be a deb, a rpm, a tgz, or a
slp package, etc. Objects in this class hold various fields of metadata from the actual packages they represent, as well as some fields
pointing to the actual contents of the package. They can also examine an actual package on disk, and populate those fields. And they can
build the actual package using the data stored in the fields.
A typical use of this object class will be to instantiate an object from a class derived from this one, such as Alien::Package::Rpm. Feed
the object a rpm file, thus populating all of its fields. Then rebless the object into the destination class, such as Alien::Package::Deb.
Finally, ask the object to build a package, and the package has been converted.
FIELDS
These fields are of course really just methods that all act similarly; allowing a value to be passed in to set them, or simply returning
the value of the field if nothing is passed in. Child classes may override these fields to process input data, or to format output data.
The general rule is that input data is modified to get things into a package-independant form, which is how the data is stored in the
fields. When the value of a field is read, it too may be modified before it is returned, to change things into a form more suitable for the
particular type of package.
name
The package's name.
version
The package's upstream version.
release
The package's distribution specific release number.
arch
The package's architecture, in the format used by Debian.
maintainer
The package's maintainer.
depends
The package's dependancies. Only dependencies that should exist on all target distributions can be put in here though (ie: lsb).
group
The section the package is in.
summary
A one line description of the package.
description
A longer description of the package. May contain multiple paragraphs.
copyright
A short statement of copyright.
origformat
What format the package was originally in.
distribution
What distribution family the package originated from.
binary_info
Whatever the package's package tool says when told to display info about the package.
conffiles
A reference to a list of all the conffiles in the package.
files
A reference to a list of all the files in the package.
changelogtext
The text of the changelog
postinst
The postinst script of the package.
postrm
The postrm script of the package.
preinst
The preinst script of the package.
prerm
The prerm script of the package.
usescripts
Only use the above scripts fields when generating the package if this is set to a true value.
unpacked_tree
Points to a directory where the package has been unpacked.
owninfo
If set this will be a reference to a hash, with filename as key, that holds ownership/group information for files that cannot be
represented on the filesystem. Typically that is because the owners or groups just don't exist yet. It will be set at unpack time.
modeinfo
If set this will be a reference to a hash, with filename as key, that holds mode information for setuid files that have an entry in
owninfo. It will be set at unpack time.
METHODS
init
This is called by new(). It's a handy place to set fields, etc, without having to write your own new() method.
install
Simply installs a package file. The filename is passed. This has to be overridden in child classes.
test
Test a package file. The filename is passed, should return an array of lines of test results. Child classses may implement this.
filename
Set/get the filename of the package the object represents.
When it is set, it performs a scan of the file, populating most other fields with data from it.
(This is just a stub; child classes should override it to actually do something.)
scripts
Returns a list of all non-empty maintainer scripts in the package.
scan
This method scans the file associated with an object, and populates as many other fields as it can with data from it.
unpack
This method unpacks the package into a temporary directory. It sets unpacked_tree to point to that directory.
(This is just a stub method that makes a directory below the current working directory, and sets unpacked_tree to point to it. It
should be overridden by child classes to actually unpack the package as well.)
prep
This method causes the object to prepare a build tree to be used in building the object. It expects that the unpack method has already
been called. It takes the tree generated by that method, and mangles it somehow, to produce a suitable build tree.
(This is just a stub method that all child classes should override.)
cleantree
This method should clean the unpacked_tree of any effects the prep and build methods might have on it.
revert
This method should ensure that the object is in the same state it was in before the prep method was called.
build
This method takes a prepped build tree, and simply builds a package from it. It should put the package in the current directory, and
should return the filename of the generated package.
(This is just a stub method that all child classes should override.)
incrementrelease
This method should increment the release field of the package by the specified number.
DESTROY
When an object is destroyed, it cleans some stuff up. In particular, if the package was unpacked, it is time now to wipe out the
temporary directory.
AUTOLOAD
Handles all fields, by creating accessor methods for them the first time they are accessed.
CLASS DATA
$Alien::Package::verbose
If set to a nonzero value, the shell commands that are run should be output. If set to a value greater than 1, any output of the
commands should also be output.
CLASS METHODS
These methods can be called on either an object or on the class itself.
new Returns a new object of this class. Optionally, you can pass in named parameters that specify the values of any fields in the class.
checkfile
Pass it a filename, and it will return true if it looks like the file is a package of the type handled by the class.
do Runs a shell command. Is verbose or not depending on the value of $Alien::Package::verbose. Returns true if the command succeeds, false
on failure.
runpipe
This is similar to backticks, but honors $Alien::Package::verbose, logging the command run if asked to. The output of the command is
returned.
The first parameter controls what to do on error. If it's true then any errors from the command will be ignored (and $? will be set).
If it's false, errors will abort alien.
AUTHOR
Joey Hess <joey@kitenet.net>
perl v5.14.2 2011-07-07 Alien::Package(3pm)