summaryrefslogtreecommitdiff
path: root/dh_illumos_gate
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-10-19 08:38:48 +0400
committerIgor Pashev <pashev.igor@gmail.com>2012-10-19 09:07:28 +0400
commit8a67bfb88f23533e4d80670023c65c5962fb6d85 (patch)
tree685f036afbdc2501e7c65b3a8841d7d240f592df /dh_illumos_gate
parent5f2ad9111e365ab7910b65fdf7472f1f91895084 (diff)
downloaddh-illumos-8a67bfb88f23533e4d80670023c65c5962fb6d85.tar.gz
Strip illumos-gate/ to ease importing patches from Git
Diffstat (limited to 'dh_illumos_gate')
-rwxr-xr-xdh_illumos_gate47
1 files changed, 25 insertions, 22 deletions
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