File: make-module.sh

package info (click to toggle)
libcgi-application-extra-plugin-bundle-perl 0.1%2Bnmu1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 376 kB
  • ctags: 7
  • sloc: perl: 166; sh: 54; makefile: 45
file content (65 lines) | stat: -rwxr-xr-x 1,424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh

PERL=$(which perl)
MAKE=$(which make)
PERL5LIB="$DESTDIR/usr/share/perl5/"

echo "=========================================================================="
echo "Make $1"
echo "PERL5LIB = $PERL5LIB"
echo "DESTDIR = $DESTDIR"
echo "=========================================================================="

#--- unpacking tar.gz in proper folders
if [ "$1" = "unpack" ]; then
    test -d build-area || mkdir build-area
    
    cd tarballs
    for dir in *
    do
    	if [ -d $dir ]; then
    		cd $dir
			for file in *.tar.gz
			do 
				test -d ../../build-area/$dir || mkdir ../../build-area/$dir
				tar -C ../../build-area/$dir -xzf $file
			done
			cd ..
		fi
    done
    cd ..

    # special hack for broken CSRF
    # See #593102
    perl debian/fixcsrf.pl
fi

if [ "$1" = "build" ]; then

	cd build-area
	for dir in *
	do
		if [ -d $dir ]; then
    		cd $dir
			for module in *
			do 
				cd $module
        		if [ -r Build.PL ];
		        then
					PERL5LIB=$PERL5LIB $PERL Build.PL installdirs=vendor
					PERL5LIB=$PERL5LIB $PERL Build
					PERL5LIB=$PERL5LIB TEST_POD=1 $PERL Build test
					PERL5LIB=$PERL5LIB $PERL Build install destdir=$DESTDIR
	        	else
					PERL5LIB=$PERL5LIB $PERL Makefile.PL INSTALLDIRS=vendor
					PERL5LIB=$PERL5LIB $MAKE
					PERL5LIB=$PERL5LIB TEST_POD=1 $MAKE test
					$MAKE install DESTDIR=$DESTDIR
	    	    fi
				cd ..
			done
			cd ..
		fi
	done
cd ..
fi