source: trunk/debbuild@ 3

Last change on this file since 3 was 3, checked in by kdeugau, 19 years ago

/trunk

Checkpoint 10/21/2005

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author
File size: 2.4 KB
Line 
1#!/usr/bin/perl
2# debbuild script
3# Shamlessly steals intreface from rpm's "rpmbuild" to create
4# Debian packages. Please note that such packages are highly
5# unlikely to conform to "Debian Policy".
6###
7# SVN revision info
8# $Date: 2005-10-21 21:03:40 +0000 (Fri, 21 Oct 2005) $
9# SVN revision $Rev: 3 $
10# Last update by $Author: kdeugau $
11###
12
13# Program flow:
14# -> Parse/execute "system" config/macros (if any - should be rare)
15# -> Parse/execute "user" config/macros (if any - *my* requirement is %_topdir)
16# -> Parse command line for options, spec file/tarball/.src.deb (NB - also accept .src.rpm)
17
18# User's prefs for dirs, environment, etc,etc,etc.
19# config file ~/.debmacros
20# Default ordered search paths for config/macros:
21# /usr/lib/rpm/rpmrc /usr/lib/rpm/redhat/rpmrc /etc/rpmrc ~/.rpmrc
22# /usr/lib/rpm/macros /usr/lib/rpm/redhat/macros /etc/rpm/macros ~/.rpmmacros
23# **NOTE: May be possible to (ab)use bits of debhelper
24
25# Build tree
26# default is /usr/src/debian/{BUILD,SOURCES,SPECS,DEBS,SDEBS}
27
28# Globals
29my $specfile;
30my $tarball;
31my $srcpkg;
32my $verbosity = 0;
33
34parse_cmd();
35
36## parse_cmd()
37# Parses command line into internal option (array|hash)
38# Options based on rpmbuild's options
39sub parse_cmd {
40 # Don't feel like coding my own option parser...
41 #use Getopt::Long;
42 # ... but I may have to: (OTOH, rpm uses popt, so maybe we can too.)
43 #use Getopt::Popt qw(:all);
44
45 # Stuff it.
46 foreach (@ARGV) {
47 chomp;
48 # Is it an option?
49 if (/^-/) {
50 # Is it a long option?
51 if (/^--/) {
52 print "Long opt $_\n";
53 } else {
54 print "Short opt $_\n";
55 }
56 } else {
57 print "Non-option arg $_\n";
58 }
59 }
60 # Valid options, with example arguments (if any):
61# Build from .spec file; mutually exclusive:
62 # -bp
63 # -bc
64 # -bi
65 # -bl
66 # -ba
67 # -bb
68 # -bs
69# Build from tarball; mutually exclusive:
70 # -tp
71 # -tc
72 # -ti
73 # -ta
74 # -tb
75 # -ts
76# Build from .src.(deb|rpm)
77 # --rebuild
78 # --recompile
79
80# General options
81 # --buildroot=DIRECTORY
82 # --clean
83 # --nobuild
84 # --nodeps
85 # --nodirtokens
86 # --rmsource
87 # --rmspec
88 # --short-circuit
89 # --target=CPU-VENDOR-OS
90
91 #my $popt = new Getopt::Popt(argv => \@ARGV, options => \@optionsTable);
92
93} # end parse_cmd()
94
95## unpack()
96# Unpacks the tarball from the SOURCES directory to the BUILD directory.
97# Speaks gzip and bzip2.
98# Requires the "package name"
99sub unpack(){}
100
101sub patch(){}
102sub configure(){}
103sub build(){}
104sub install(){}
105sub package(){}
106sub srcpackage(){}
Note: See TracBrowser for help on using the repository browser.