From 65c6abb47f7dd7e5dd5fd9f5da6718e706f23c20 Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 21 Apr 2000 09:56:06 +0000 Subject: [PATCH] added framework --- Alien/Package/Deb.pm | 2 +- Alien/Package/Rpm.pm | 2 +- Alien/Package/Slp.pm | 148 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 Alien/Package/Slp.pm diff --git a/Alien/Package/Deb.pm b/Alien/Package/Deb.pm index c345764..a2e249c 100644 --- a/Alien/Package/Deb.pm +++ b/Alien/Package/Deb.pm @@ -72,7 +72,7 @@ Implement the scan method to read a deb file. sub scan { my $this=shift; - $this->SUPER::read_file(@_); + $this->SUPER::scan(@_); my $file=$this->filename; # Extract the control file from the deb file. diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm index d33c9fb..701ae12 100644 --- a/Alien/Package/Rpm.pm +++ b/Alien/Package/Rpm.pm @@ -51,7 +51,7 @@ Implement the scan method to read a rpm file. sub scan { my $this=shift; - $this->SUPER::read_file(@_); + $this->SUPER::scan(@_); my $file=$this->filename; my %fieldtrans=( diff --git a/Alien/Package/Slp.pm b/Alien/Package/Slp.pm new file mode 100644 index 0000000..a38baeb --- /dev/null +++ b/Alien/Package/Slp.pm @@ -0,0 +1,148 @@ +#!/usr/bin/perl -w + +=head1 NAME + +Alien::Package::Slp - an object that represents a slp package + +=cut + +package Alien::Package::Deb; +use strict; +use Alien::Package; # perlbug +use base qw(Alien::Package); + +=head1 DESCRIPTION + +This is an object class that represents a slp package. It is derived from +Alien::Package. + +=head1 CLASS DATA + +The following data is global to the class, and is used to describe the slp +package format, which this class processes directly. + +=over 4 + +=item footer_size + +Complete sizeof(slpformat) from slp.h in the stampede package manager +source. + +=item footer_packstring + +This is the pack format string for the footer. (A=space terminated +character, I=unsigned integer.) + +=item footer_version + +What package format are we up to now? (Lowest one this is still +compatable with.) + +=item archtrans + +This is a translation table between architectures and the number +that represents them in a slp package. + +=cut + +use constant footer_size => 3784, + footer_packstring => "A756IIIIA128A128A80A1536A512A512A30A30IA20A20III", + footer_version => 5, + archtrans => { + 0 => 'all', + 1 => 'i386', + 2 => 'sparc', + 3 => 'alpha', + 4 => 'powerpc', + 5 => 'm68k', + }, + copyrighttrans => { + 0 => 'GPL', + 1 => 'BSD', + 2 => 'LGPL', + 3 => 'unknown', + 254 => 'unknown', + }; + +=back + +=head1 FIELDS + +=over 4 + +=head1 METHODS + +=over 4 + +=item install + +Install a slp. Pass in the filename of the slp to install. + +=cut + +sub install { + my $this=shift; + my $slp=shift; + +} + +=item scan + +Implement the scan method to read a slp file. + +=cut + +sub scan { + my $this=shift; + $this->SUPER::scan(@_); + my $file=$this->filename; + + + return 1; +} + +=item unpack + +Implment the unpack method to unpack a slp file. + +=cut + +sub unpack { + my $this=shift; + $this->SUPER::unpack(@_); + my $file=$this->filename; + + + return 1; +} + +=item prep + +No prep stage is needed for slp files. + +=cut + +sub prep { + my $this=shift; + my $dir=$this->unpacked_tree || die "The package must be unpacked first!"; +} + +=item build + +Build a slp. + +=cut + +sub build { + my $this=shift; + + return # filename +} + +=head1 AUTHOR + +Joey Hess + +=cut + +1