pkgbuilder
index
/home/andrew/Projects/nxpak/src/pkgbuilder.py

# $Id: pkgbuilder.html,v 1.6 2003/08/16 02:07:06 merlin262 Exp $

# (C)opyright 2002, 2003 Andrew McCall
#
# pkgbuilder.py: Package Building Resources part of NxPak
#
# NxPak is small, yet extremely powerful package manager.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

# Contributors:
#    andrew@textux.com
#
# ______________________________________________________________________
#######################################################################
# The Python Package Builder Library
#
# This module is imported immediately before the build package python
# script is imported. Note that the packagebuilder does not support
# building package files with multiple packages.  To do this, simply
# concatenate the uncompressed files together, and then recompress.
#
# Build versions and minor versions should only be written in when
# ABSOLUTELY neccessary.
#

 
Modules
       
nxpackage
nxpk
os
pkgbuilder
sys

 
Classes
       
CommandError
InvalidSoftwareClass
PackageBuilder

 
class CommandError
     Methods defined here:
__init__(self, command, ret)
__str__(self)

 
class InvalidSoftwareClass
     Methods defined here:
__init__(self, softclass)
__str__(self)

 
class PackageBuilder
    # Package Builder Class
# Stores package information, and provides a clean interface to the
# Package manager package / packet creation and management routines
 
  Methods defined here:
INC_CTR(self)
Increment The Global Packet Counter. IMPORTANT: THIS
MUST BE CALLED IF YOU HAVE MANUALLY ADDED A PACKET TO THE
PACKAGE FILE, OTHERWISE THE INFORMATION, AND FILE
PACKET DICTIONARIES WILL BE INCORRECT!
 
Arguments:
     None
Return Value:
     Previous counter value.
Bugs:
     None known.
__init__(self, pkggroup, pkgfile, package_class='application', v_maj=0, v_min=0, v_smin=0, v_build=0)
add_dependencies(self, dependencies)
Set the dependencies string of a package
add_description_html(self, description)
Set the html description text of a package.
add_description_text(self, description)
Set the description text of a package.
add_dir(self, path, s_flags=0, w_flags=0)
Adds a directory to the package file
add_file(self, file, type, path=None, s_flags=0, w_flags=0)
Adds a file speciied by type
add_file_text(self, file, type, path, text, mode=420, s_flags=0, w_flags=0)
add_files_dir(self, filelist, path, type, add_dir='y', s_flags=0, w_flags=0)
add_locales(self, local_path, path='', s_flags=0, w_flags=0)
Adds the locales
add_script_file(self, file)
Adds a script to the package. Note: it is HIGHLY recommended that
you use the default scripts with your package, and not replace
them unless absolutely neccessary.
add_script_text(self, text)
add_short_description(self, shortdescription)
Set the short description text of a package.
chroot_prefix(self)
Returns the directoy of the location where files should be installed
finalize_files_and_dirs(self)
Saves and finalizes the files and directories of the
package.  This function is called by save_and_finalize,
and should not be called from package builders, unless
the builder is implementing the finalization code.
 
Arguments:
     None
Returns:
     None
Bugs
     Non Known.
general_info_html(self, g_id, p_id, text)
Adds a general info text packet
general_info_text(self, g_id, p_id, text)
Adds a general info text packet
general_info_url(self, g_id, p_id, text)
Adds a general info text packet
general_int_list(self, g_id, p_id, list)
Adds an integer list packet.
general_int_list_no_add(self, g_id, p_id, list)
Adds an integer list, but does not increment packet counter.
save_and_finalize(self)
Saves and finalizes the packages

 
Data
        CPU_ARCH = 'i686'
NCONS_BUILD_ROOT = '/tmp/nxpackage/build/'
NCONS_CHROOT_ROOT = '/tmp/nxpackage/chroot/'
NCONS_CLASSES = {'': 'Uncategorized Software', 'application': 'Uncategorized application', 'devel': 'Software development', 'editors': 'Text editors', 'games': 'Fun and games', 'gui': 'GUI toolkits and support', 'media': 'Multimedia Applications', 'service': 'Provides a server or system service', 'system': 'Basic system software', 'util': 'General uncategorized utilities', ...}
NCONS_DEST_ROOT = '/system/nxpkg//packages/'
NCONS_DOWNLOAD_ROOT = '/system/nxpkg/download/'
NCONS_NCONS_BUILD = '/tmp/nxpackage/'
NCONS_NCONS_ROOT = '/system/nxpkg/'
NCONS_SCRIPT_ROOT = '/tmp/nxpackage/script/'
NCONS_SERVICE_TYPES = ['service']
NCONS_TYPE_CONF = 'c'
NCONS_TYPE_DEVEL = 'd'
NCONS_TYPE_DEVICE = 'v'
NCONS_TYPE_EXE = 'e'
NCONS_TYPE_GENERAL = 'g'
NCONS_TYPE_INFO = 'i'
NCONS_TYPE_LIB = 'l'
NCONS_TYPE_LOCALES = 'o'
NCONS_TYPE_MAN = 'm'
NCONS_TYPE_SHARE = 's'
NCONS_VERBOSE = 1
NXPAK_VERSION = '0.2.5'
SYS_ARCH = 'i686-pc-linux-gnu'