diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-10-17 22:54:07 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-10-17 22:54:07 +0300 |
commit | 89b0037a6090bff3cd2c2693ea52313b935b9fcd (patch) | |
tree | 3cc57154272c0c8d0eefd203427f482ac0404ce7 | |
parent | 78bc78be53d5096e65a81cf5b0717855e1173b95 (diff) | |
download | dh-illumos-89b0037a6090bff3cd2c2693ea52313b935b9fcd.tar.gz |
ROOT should known outside: --root=path
-rwxr-xr-x | dh_illumos_gate | 17 | ||||
-rwxr-xr-x | dh_illumos_make | 26 |
2 files changed, 37 insertions, 6 deletions
diff --git a/dh_illumos_gate b/dh_illumos_gate index 407b95e..76a681e 100755 --- a/dh_illumos_gate +++ b/dh_illumos_gate @@ -86,6 +86,12 @@ unless specified by B<--repository>. You should also set B<--destdir>. illumos-gate git repository. Default is https://github.com/illumos/illumos-gate.git. +=item B<--root=>I<path> + +Defines root directory where build result will be installed: executables, libraries, headers, etc. +Defaults to F<./debian/tmp>. This can be overrided by L<dh_illumos_make(1)>. +If absent, it will be created. + =back =head1 EXAMPLES @@ -159,6 +165,7 @@ Here are things which this helper does after unpacking illumos sources. =cut +$dh{ROOT} = 'debian/tmp'; $dh{CHECKOUT} = undef; $dh{DESTDIR} = '.'; $dh{REPOSITORY} = 'https://github.com/illumos/illumos-gate.git'; @@ -171,6 +178,7 @@ init( 'create-orig' => \$dh{CREATE_ORIG}, 'destdir=s' => \$dh{DESTDIR}, 'repository=s' => \$dh{REPOSITORY}, + 'root=s' => \$dh{ROOT}, 'unpack-only' => \$dh{UNPACK_ONLY}, } ); @@ -193,7 +201,7 @@ if ( defined $dh{CHECKOUT} ) { error("Destination path `$dh{DESTDIR}' exists."); } if ( !$dh{CHECKOUT} ) { - $dh{CHECKOUT} = $version =~ s!.*\.git\.(\w+)-[^-]+$!$1!r; + $dh{CHECKOUT} = $version =~ s!.*\Wgit\W?(\w+)-[^-]+$!$1!r; } doit( 'git', 'clone', '-n', $dh{REPOSITORY}, $dh{DESTDIR} ); doit( 'git', '-C', $dh{DESTDIR}, 'checkout', $dh{CHECKOUT} ); @@ -486,6 +494,11 @@ chdir $dh{DESTDIR}; my $codemgr_ws = getcwd(); chdir $cwd; +doit( 'mkdir', '-p', $dh{ROOT} ); +chdir $dh{ROOT}; +my $root = getcwd(); +chdir $cwd; + my $env = $dh{DESTDIR} . '/usr/env.sh'; my $mach = `uname -p`; chomp $mach; @@ -493,7 +506,7 @@ if ( open( ENV, '>', $env ) ) { print ENV "# This file was generated by dh_illumos_gate(1)\n"; print ENV "export VERSION='$version'\n"; print ENV "export CODEMGR_WS='$codemgr_ws'\n"; - print ENV "export ROOT='$codemgr_ws/root'\n"; + print ENV "export ROOT='$root'\n"; print ENV "export SRC='$codemgr_ws/usr/src'\n"; print ENV "export MULTI_PROTO='no'\n"; print ENV "export CW_NO_SHADOW=1\n"; diff --git a/dh_illumos_make b/dh_illumos_make index f02cefb..9daa786 100755 --- a/dh_illumos_make +++ b/dh_illumos_make @@ -8,6 +8,7 @@ dh_illumos_make - build illumos sources use strict; use Debian::Debhelper::Dh_Lib; +use Cwd; =head1 SYNOPSIS @@ -39,6 +40,13 @@ in order. Illumos sources should be previously unpacked with L<dh_illumos_gate(1 =over 4 +=item B<--root=>I<path> + +Defines root directory where build result will be installed: executables, libraries, headers, etc. +Overrides one configured by L<dh_illumos_gate(1)>. + +Proto directory to install build results in. If absent, it will be created. + =item B<-m>I<make program> B<--make=>I<make program> Make program to use. Default is F</usr/bin/make --sun>. @@ -94,14 +102,17 @@ $dh{'TARGET'} = 'install'; $dh{'CTF'} = 0; $dh{'NO_ONBLD'} = 0; +my $cwd = getcwd(); + init( options => { - 'make|m=s' => \$dh{'MAKE'}, - 'target|t=s' => \$dh{'TARGET'}, - 'debug' => \$dh{'DEBUG'}, 'ctf!' => \$dh{'CTF'}, - 'no-onbld' => \$dh{'NO_ONBLD'}, + 'debug' => \$dh{'DEBUG'}, + 'make|m=s' => \$dh{'MAKE'}, 'native' => \$dh{'NATIVE'}, + 'no-onbld' => \$dh{'NO_ONBLD'}, + 'root=s' => \$dh{'ROOT'}, + 'target|t=s' => \$dh{'TARGET'}, } ); @@ -127,6 +138,13 @@ my $override = ''; $override .= ' CTFCONVERT=:' if not $dh{'CTF'}; $override .= ' CTFMERGE=:' if not $dh{'CTF'}; +if ( $dh{ROOT} ) { + doit( 'mkdir', '-p', $dh{ROOT} ); + chdir $dh{ROOT}; + $override .= ' ROOT="' . getcwd() . '"'; + chdir $cwd; +} + if ( $dh{'NATIVE'} ) { my $deb_host_arch_cpu = `dpkg-architecture -qDEB_HOST_ARCH_CPU`; chomp $deb_host_arch_cpu; |