diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-10-19 08:38:48 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-10-19 09:07:28 +0400 |
commit | 8a67bfb88f23533e4d80670023c65c5962fb6d85 (patch) | |
tree | 685f036afbdc2501e7c65b3a8841d7d240f592df | |
parent | 5f2ad9111e365ab7910b65fdf7472f1f91895084 (diff) | |
download | dh-illumos-8a67bfb88f23533e4d80670023c65c5962fb6d85.tar.gz |
Strip illumos-gate/ to ease importing patches from Git
-rw-r--r-- | debian/changelog | 6 | ||||
-rwxr-xr-x | debian/rules | 1 | ||||
-rwxr-xr-x | dh_illumos_gate | 47 | ||||
-rwxr-xr-x | dh_illumos_make | 24 |
4 files changed, 43 insertions, 35 deletions
diff --git a/debian/changelog b/debian/changelog index cad74b6..784ebdb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dh-illumos (9.2) UNRELEASED; urgency=low + + * Strip illumos-gate/ to ease importing patches from Git. + + -- Igor Pashev <pashev.igor@gmail.com> Fri, 19 Oct 2012 09:06:10 +0400 + dh-illumos (9.1) unstable; urgency=low * Export all DEB_* variables into illumos-gate/env.sh diff --git a/debian/rules b/debian/rules index af662d8..1cde0cd 100755 --- a/debian/rules +++ b/debian/rules @@ -6,6 +6,7 @@ pod2man := pod2man -r "dh-illumos v$(version)" -c dh-illumos dh $@ override_dh_auto_build: + perl -c dh_illumos_make dh_illumos_gate $(pod2man) --section=1 dh_illumos_gate dh_illumos_gate.1 $(pod2man) --section=1 dh_illumos_make dh_illumos_make.1 $(pod2man) --section=1 ld-gnu-to-sun.pod ld-gnu-to-sun.1 diff --git a/dh_illumos_gate b/dh_illumos_gate index eb9894e..fe81b08 100755 --- a/dh_illumos_gate +++ b/dh_illumos_gate @@ -23,13 +23,15 @@ for Debian build environment (paths to programs, command options, linker and com It unpacks illumos gate sources, creates F<bldenv.sh> and F<env.sh> in the root of source tree, configures build environment in F<env.sh>. -Sources are always unpacked into F<illumos-gate> subdirectory of the current directory. +Sources are always unpacked into the current directory. +And only one - F<usr/> - top-level directory is unpacked. +F<illumos-gate/> prefix is stripped. This allow using +upstream patches as is directly from Git. After executing C<dh_illumos_gate> one can use commands like this to configure or build components of illumos gate: - cd illumos-gate - ksh93 bldenv.sh env.sh -c "cd usr/src/lib/libzfs && make --sun install" + ksh93 usr/bldenv.sh usr/env.sh -c "cd usr/src/lib/libzfs && make --sun install" L<dh_illumos_make(1)> provides more convenient way to do this. @@ -100,18 +102,19 @@ if (defined($dh{'EXCLUDE'}) && $dh{'EXCLUDE'}) { } } -doit('tar', '-x', '-f', $tarball, @tar_X); +# Strip "illumos-gate/", unpack only "usr/" +doit('tar', '-x', '-f', $tarball, @tar_X, '--strip-components=1', 'illumos-gate/usr'); =item Saving original files Any files from illumos sources, changed by this helper, are saved with F<.orig> suffix, so you can investigate changes. -For example, you can use C<cd illumos-gate && diff -dub usr/src/Makefile.master.orig usr/src/Makefile.master> +For example, you can use C<diff -dub usr/src/Makefile.master.orig usr/src/Makefile.master> to see all changes. =cut -=item Changes to F<illumos-gate/usr/src/Makefile.master>: +=item Changes to Fusr/src/Makefile.master>: Remove option C<-s> (strip) from install command for directories and files. This options does not make sense for directories and GNU L<install(1)> is @@ -146,7 +149,7 @@ if ($bits == 64) { $usrlibdir64 = "usr/$libdir64"; } -my $Makefile_master = 'illumos-gate/usr/src/Makefile.master'; +my $Makefile_master = 'usr/src/Makefile.master'; my $Makefile_master_orig = $Makefile_master . '.orig'; if (! -f $Makefile_master) { @@ -167,7 +170,7 @@ doit('sed', '-r', '-i', ' ); -=item Changes to F<illumos-gate/usr/src/lib/Makefile.lib>: +=item Changes to F<usr/src/lib/Makefile.lib>: Append C<CFLAGS> to C<BUILD.SO> command, because C<BUILD.SO> by default uses C compiler to create shared library. @@ -180,7 +183,7 @@ in some cases C<ROOTLIBDIR> will be overriden by C<ROOTFS_LIBDIR> within makefil =cut -my $Makefile_lib = 'illumos-gate/usr/src/lib/Makefile.lib'; +my $Makefile_lib = 'usr/src/lib/Makefile.lib'; my $Makefile_lib_orig = $Makefile_lib . '.orig'; if (-f $Makefile_lib) { if (! -e $Makefile_lib_orig) { @@ -199,9 +202,9 @@ if (-f $Makefile_lib) { ); } -=item Create F<illumos-gate/env.sh> +=item Create F<usr/env.sh> -Set C<CODEMGR_WS> to be F<current_dir/illumos-gate>. +Set C<CODEMGR_WS> to be current directry. Set C<VERSION> from F<./debian/chnagelog>. For example it can be C<2.10-3>. @@ -233,14 +236,14 @@ to make them available from makefiles. =cut my $cwd = getcwd(); -my $env = 'illumos-gate/env.sh'; +my $env = 'usr/env.sh'; my $mach = `uname -p`; chomp $mach; 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='$cwd/illumos-gate'\n"; + print ENV "export CODEMGR_WS='$cwd'\n"; print ENV "export ROOT='$cwd/debian/tmp'\n"; - print ENV "export SRC='$cwd/illumos-gate/usr/src'\n"; + print ENV "export SRC='$cwd/usr/src'\n"; print ENV "export MULTI_PROTO='no'\n"; print ENV "export CW_NO_SHADOW=1\n"; print ENV "export LD_ALTEXEC='/usr/bin/ld-gnu-to-sun'\n"; @@ -268,10 +271,10 @@ if (open (ENV, '>', $env)) { error("Failed to write `$env': $!"); } -=item Create F<illumos-gate/bldenv.sh> +=item Create F<usr/bldenv.sh> -Copy F<illumos-gate/usr/src/tools/scripts/bldenv.sh> -to F<illumos-gate/bldenv.sh>. +Copy F<usr/src/tools/scripts/bldenv.sh> +to F<usr/bldenv.sh>. Fix definition of C<CTF*> variables, so this script will not override them if they are already defined. These variables @@ -280,23 +283,23 @@ with option C<--without-ctf>. =cut -my $bldenv_sh = 'illumos-gate/usr/src/tools/scripts/bldenv.sh'; +my $bldenv_sh = 'usr/src/tools/scripts/bldenv.sh'; if (! -f $bldenv_sh) { error("Could not find `$bldenv_sh'. Is it accidently excluded via -X option?"); } -doit('cp', '-f', $bldenv_sh, 'illumos-gate/bldenv.sh'); +doit('cp', '-f', $bldenv_sh, 'usr/bldenv.sh'); doit('sed', '-r', '-i', ' s,export +(CTF.+)="(.+)",export \1="${\1:-\2}",; - ', 'illumos-gate/bldenv.sh' + ', 'usr/bldenv.sh' ); =back =head1 NOTES -To clean package (via C<./debian/rules clean>) you should just remove F<illumos-gate> directory: +To clean package (via C<./debian/rules clean>) you should just remove F<usr/> directory: - rm -rf illumos-gate + rm -rf usr =head1 SEE ALSO diff --git a/dh_illumos_make b/dh_illumos_make index 2b9bee5..1ae4316 100755 --- a/dh_illumos_make +++ b/dh_illumos_make @@ -12,7 +12,7 @@ use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B<dh_illumos_make> [S<I<debhelper options>>] [B<-m>I<make program>] -[B<-t>I<target>] [B<--debug>] [B<--without-ctf>] [B<--without-mcs>] +[B<-t>I<target>] [B<--debug>] [B<--without-ctf>] [B<--no-onbld>] [B<--native>] [directories] @@ -27,14 +27,12 @@ in order. Illumos sources should be previously unpacked with L<dh_illumos_gate(1 dh_illumos_make -t install_h usr/src/uts is equivalent to - cd illumos-gate - ksh93 bldenv.sh env.sh -c "cd usr/src/uts && /usr/bin/make --sun install_h" + ksh93 usr/bldenv.sh usr/env.sh -c "cd usr/src/uts && /usr/bin/make --sun install_h" dh_illumos_make -m /opt/SUNWspro/bin/dmake usr/src/lib is equivalent to - cd illumos-gate - ksh93 bldenv.sh env.sh -c "cd usr/src/lib && /opt/SUNWspro/bin/dmake install" + ksh93 usr/bldenv.sh usr/env.sh -c "cd usr/src/lib && /opt/SUNWspro/bin/dmake install" =head1 OPTIONS @@ -54,11 +52,11 @@ sources and install into proto area. Turn on debug build. This will execute - ksh93 bldenv.sh -d env.sh ... + ksh93 usr/bldenv.sh -d usr/env.sh ... instead of - ksh93 bldenv.sh env.sh ... + ksh93 usr/bldenv.sh usr/env.sh ... =item B<--without-ctf> @@ -71,7 +69,7 @@ implemented by setting corresponding environment variables to ":". =item B<--no-onbld> Do not use C<onbld> tools installed in system (F</opt/onbld>). Normally it only works -and useful for building C<onbld> itself. Otherwise F<illumos-gate/usr/src/tools> +and useful for building C<onbld> itself. Otherwise F<usr/src/tools> must be unpacked and built before any other component. If this option is given, F<bldenv.sh> is called with C<-t> option instead of C<+t>. @@ -113,16 +111,16 @@ if (@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"); + if (! -d "$_") { + error("`$_' does not exist or not a directory"); } } # Build in each dir: # Sanity checks: foreach (qw/bldenv.sh env.sh/) { - if (! -r "illumos-gate/$_") { - error("`$_' not found under illumos-gate. Maybe illumos sources were not properly unpacked.") + if (! -r "usr/$_") { + error("`$_' not found under 'usr/'. Maybe illumos sources were not properly unpacked.") } } @@ -143,7 +141,7 @@ if ($dh{'NATIVE'}) { $env = "export $env &&" if $env; foreach (@dirs) { - complex_doit(qq!cd illumos-gate && ksh93 bldenv.sh $opts env.sh -c "cd $_ && $env $dh{'MAKE'} $dh{'TARGET'}"!); + complex_doit(qq!ksh93 usr/bldenv.sh $opts usr/env.sh -c "cd $_ && $env $dh{'MAKE'} $dh{'TARGET'}"!); } =head1 SEE ALSO |