diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-07-01 14:07:12 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-07-01 14:07:55 +0000 |
commit | 99131d5aea78b7c1afa0d8107f962aac8c7adf02 (patch) | |
tree | fc44ee5c9026bef821e95a6c5f72e8d61bb1d13e | |
parent | 22a93d7a70c0d1c2bbd00711b835b616d51dc68a (diff) | |
download | dh-illumos-99131d5aea78b7c1afa0d8107f962aac8c7adf02.tar.gz |
Added dh_illumos_make
-rw-r--r-- | debian/control | 9 | ||||
-rw-r--r-- | debian/install | 1 | ||||
-rw-r--r-- | debian/manpages | 1 | ||||
-rwxr-xr-x | debian/rules | 3 | ||||
-rwxr-xr-x | dh_illumos_make | 101 |
5 files changed, 111 insertions, 4 deletions
diff --git a/debian/control b/debian/control index 824aced..c16f57c 100644 --- a/debian/control +++ b/debian/control @@ -8,9 +8,12 @@ Standards-Version: 3.9.3 Package: dh-illumos Architecture: all Multi-Arch: foreign -Depends: ${perl:Depends}, ${misc:Depends}, debhelper (>=8) +Depends: ${perl:Depends}, ${misc:Depends}, debhelper (>=8), + ksh93, sunmake, illumos-source Enhances: debhelper -Recommends: autopoint Description: debhelper addons to work with illumos sources + This package provides debhelper addons configuring and building + illumos sources while making deb packages: + . dh_illumos_gate - unpacks illumos sources, apply specific fixes and patches. - + dh_illumos_make - build illumos components. diff --git a/debian/install b/debian/install index 2ecf63a..0ca375e 100644 --- a/debian/install +++ b/debian/install @@ -1 +1,2 @@ dh_illumos_gate usr/bin +dh_illumos_make usr/bin diff --git a/debian/manpages b/debian/manpages index 56b3605..9423ee7 100644 --- a/debian/manpages +++ b/debian/manpages @@ -1 +1,2 @@ dh_illumos_gate.1 +dh_illumos_make.1 diff --git a/debian/rules b/debian/rules index 451c21e..d8e88c7 100755 --- a/debian/rules +++ b/debian/rules @@ -7,6 +7,7 @@ pod2man := pod2man -r "dh-illumos v$(version)" -c dh-illumos override_dh_auto_build: $(pod2man) --section=1 dh_illumos_gate dh_illumos_gate.1 + $(pod2man) --section=1 dh_illumos_make dh_illumos_make.1 override_dh_clean: - dh_clean dh_illumos_gate.1 + dh_clean dh_illumos_gate.1 dh_illumos_make.1 diff --git a/dh_illumos_make b/dh_illumos_make new file mode 100755 index 0000000..2f36a5c --- /dev/null +++ b/dh_illumos_make @@ -0,0 +1,101 @@ +#!/usr/bin/perl -w + +=head1 NAME + +dh_illumos_make - build illumos sources + +=cut + +use strict; +use Debian::Debhelper::Dh_Lib; + +=head1 SYNOPSIS + +B<dh_illumos_make> [S<I<debhelper options>>] [B<-m>I<make program>] +[B<-t>I<target>] [directories] + +=head1 DESCRIPTION + +C<dh_illumos_make> is responsible for building illumos sources. +If no directories specified, it will build entire illumos gate (not recommended, +and probably will fail). If directories are given, it will build within those directories +in order. Illumos sources should be previously unpacked with L<dh_illumos_gate(1)>. + +=head1 EXAMPLES + + dh_illumos_gate -t install_h usr/src/uts is equivalent to + + cd illumos-gate + ksh93 bldenv.sh -d illumos.sh -c "cd usr/src/uts && /usr/bin/sunmake install_h" + + + dh_illumos_gate -m /opt/SUNWspro/bin/dmake usr/src/lib is equivalent to + + cd illumos-gate + ksh93 bldenv.sh -d illumos.sh -c "cd usr/src/lib && /opt/SUNWspro/bin/dmake install" + + +=head1 OPTIONS + +=over 4 + +=item B<-m>I<make program> B<--make=>I<make program> + +Make program to use. Default is F</usr/bin/sunmake>. + +=item B<-t>I<target> B<--target=>I<target> + +Target for I<make program>. Default is C<install> which will build +sources and install into proto area. + +=back + +=head1 NOTES + +If illumos sources were unpacked with L<dh_illumos_gate(1)>, +proto area is F<debian/tmp>. + +=cut + +$dh{'MAKE'} = '/usr/bin/sunmake'; +$dh{'TARGET'} = 'install'; + +init(options => { + 'make|m=s' => \$dh{'MAKE'}, + 'target|t=s' => \$dh{'TARGET'}, +}); + +my @dirs = ('usr/src'); +if (@ARGV) { + @dirs = @ARGV; +} + +# Check whether all dirs exist before doing anything: +foreach (@dirs) { + s,.*illumos-gate/+,,; + if (! -d "illumos-gate/$_") { + error("`illumos-gate/$_' does not exist or not a directory"); + } +} + +# Build in each dir: +chdir('illumos-gate'); +# Sanity checks: +foreach (qw/bldenv.sh illumos.sh/) { + if (! -r $_) { + error("`$_' not found under illumos-gate. Maybe illumos sources were not properly unpacked.") + } +} +foreach (@dirs) { + doit('ksh93', 'bldenv.sh', '-d', 'illumos.sh', '-c', "cd $_ && $dh{'MAKE'} $dh{'TARGET'}"); +} + +=head1 SEE ALSO + +L<debhelper(7)>, L<dh_illumos_gate(1)>. + +=head1 AUTHOR + +Igor Pashev <pashev.igor@gmail.com> + +=cut |