3 # Emulate autoconf behaviour and do some checks
11 ^--includedir=\$\{prefix\}/include$
12 ^--mandir=\$\{prefix\}/share/man$
13 ^--infodir=\$\{prefix\}/share/info$
15 ^--localstatedir=/var$
16 ^--libexecdir=\$\{prefix\}/lib/.*$
17 ^--disable-maintainer-mode$
18 ^--disable-dependency-tracking$
21 # Verify if all command line arguments were passed
22 my @options = map { { regex => qr/$_/,
24 found => 0 } } @OPTIONS;
26 ARGV_LOOP: foreach my $arg (@ARGV) {
27 foreach my $opt (@options) {
28 if ($arg =~ $opt->{regex}) {
33 # Extra / unrecognized argument
34 push @extra_args, $arg;
37 my @notfound = grep { ! $_->{found} and $_ } @options;
39 print STDERR "Error: the following default options were NOT passed\n";
40 print STDERR " ", $_->{str}, "\n" foreach (@notfound);
44 # Create a simple Makefile
45 open(MAKEFILE, ">", "Makefile");
48 all: stamp_configure \$(CONFIGURE)
49 \@echo Package built > stamp_build
51 # Tests if dh_auto_test executes 'check' target if 'test' does not exist
52 check: \$(CONFIGURE) stamp_build
53 \@echo Tested > stamp_test
56 \@echo DESTDIR=\$(DESTDIR) > stamp_install
58 # Tests whether dh_auto_clean executes distclean but does not touch
61 echo "This should not have been executed" >&2 && exit 1
64 \@rm -f stamp_* Makefile
66 .PHONY: all check install clean distclean
70 open(STAMP, ">", "stamp_configure");
71 print STAMP $_, "\n" foreach (@extra_args);