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
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,
58 # --- Process Command line options
59 pod2usage(1) if $help;
62 my $out = new Maemian::Output;
65 $out->v_msg("Verbose on");
75 my ($filename, $path);
78 ($filename, $path) = fileparse($file);
81 die "Cannot read $file\n";
83 # --- maemo is a trademarked term
84 if ($filename =~ /maemo/) {
85 $out->v_msg("Any use of the word \"maemo\" in the package name (not package version) is subject to trademark.");
87 $out->v_msg("File name is $filename");
88 $out->v_msg("Path is $path");
90 # We push the entire file into an array
91 # If the file is signed, the sig is separated by a blank line
92 my @control = slurp $file, { irs => qr/\n\n/xms };
95 @lines = split /\n/, $control[1];
98 @lines = split /\n/, $control[0];
100 print map { $_ } grep /Maintainer/, @lines;
104 file_tests($inputfile);
106 croak "No input file found: $!\n";
109 my $schedule = new Maemian::Schedule(verbose => $verbose);
111 if ($inputfile =~ /\.deb$/) {
112 $out->v_msg("Lab is $LINTIAN_LAB");
114 # schedule is a hash containing two hashes followed by an array
115 $schedule->add_deb('b', $inputfile)
116 or warning("$inputfile is a zero-byte file, skipping");