3 # Copyright (C) Jeremiah C. Foster 2009, based on:
4 # Lintian -- Debian package checker
5 # Copyright (C) 1998 Christian Schwarz and Richard Braakman
9 minimae - A small, cuddly version of maemian
13 This document describes minimae version 0.1
17 Maemian is the maemo version of lintian - a policy checker designed to
18 assure the quality of a package uploaded into the maemo.org repositories.
19 The goal of maemian is to improve quality by checking that the maemo
20 packaging policy is followed. In order to do that it reads files in the
21 uploaded deb. Currently maemian only looks at the .dsc file and tries to
22 ascertain who uploaded it, and if they used the correct email address.
26 # Check a debian description file
30 minimae -b package_name.deb
39 use lib qw(/home/jeremiah/maemian/lib/);
41 use Maemian::Schedule;
43 my $LINTIAN_LAB = "/home/jeremiah/maemian/lab";
45 # --- Command line options
46 my $pkg_mode = 'a'; # auto -- automatically search for
47 # binary and source pkgs
48 my $inputfile; # --- A file passed on the command line
49 my ($help, $verbose, );
54 'verbose' => \$verbose,
55 'inputfile|i=s' => \$inputfile,
56 'binary|b' => \&record_pkgmode,
59 # Record what type of data is specified
60 # Options: -b|--binary, -s|--source, --udeb
62 print "in record_pkgmode\n";
63 $pkg_mode = 'b' if $_[0] eq 'binary';
64 $pkg_mode = 's' if $_[0] eq 'source';
65 $pkg_mode = 'u' if $_[0] eq 'udeb';
69 # --- Process Command line options
70 pod2usage(1) if $help;
73 my $out = new Maemian::Output;
76 $out->v_msg("Verbose on");
86 my ($filename, $path);
89 ($filename, $path) = fileparse($file);
92 die "Cannot read $file\n";
94 # --- maemo is a trademarked term
95 if ($filename =~ /maemo/) {
96 $out->v_msg("Any use of the word \"maemo\" in the package name (not package version) is subject to trademark.");
98 $out->v_msg("File name is $filename");
99 $out->v_msg("Path is $path");
101 # We push the entire file into an array
102 # If the file is signed, the sig is separated by a blank line
103 my @control = slurp $file, { irs => qr/\n\n/xms };
104 my @lines = split /\n/, $control[1];
105 print map { $_ } grep /Maintainer/, @lines;
109 file_tests($inputfile);
111 croak "No input file found: $!\n";
114 my $schedule = new Maemian::Schedule(verbose => $verbose);
116 if ($inputfile =~ /\.deb$/) {
117 $out->v_msg("Lab is $LINTIAN_LAB");
119 # schedule is a hash containing two hashes followed by an array
120 $schedule->add_deb('b', $inputfile)
121 or warning("$inputfile is a zero-byte file, skipping");