summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-07-01 23:26:50 +0000
committerIgor Pashev <pashev.igor@gmail.com>2012-07-01 23:26:50 +0000
commitb684bd6e2631138c199c0995efdfb35810678511 (patch)
tree274f8c5b0f057080c48697a9e267503ed68ae55a
parenta5041fd7f520ed6f675f0051797045c64bccccfa (diff)
downloaddh-illumos-b684bd6e2631138c199c0995efdfb35810678511.tar.gz
Added --bootstrap options and more detailed manpage
-rwxr-xr-xdh_illumos_gate121
1 files changed, 99 insertions, 22 deletions
diff --git a/dh_illumos_gate b/dh_illumos_gate
index babee1d..d6d9973 100755
--- a/dh_illumos_gate
+++ b/dh_illumos_gate
@@ -14,6 +14,7 @@ use Cwd;
=head1 SYNOPSIS
B<dh_illumos_gate> [S<I<debhelper options>>] [B<-X>I<PATTERN>]
+[B<--bootstrap>]
=head1 DESCRIPTION
@@ -58,17 +59,26 @@ illumos kernel (F<usr/src/uts>), you do not need libraries or programs and
use F<-XI<usr/src/lib>> F<-XI<usr/src/cmd>>. These options passed
as is to L<tar(1)> via I<--exclude=PATTERN>.
+=item B<--bootstrap>
+
+Disable some features of illumos gate for easy bootstrapping.
+This includes disabling executing of CTF tools (C<ctfconvert>, C<ctfmerge>),
+C<mcs> and others which may not be present on host system.
+
=back
-=head1 NOTES
+=head1 DETAILS
-To clean package (via C<./debian/rules clean>) you should just remove F<illumos-gate> directory:
+Here are things which this helper does after unpacking illumos sources.
- rm -rf illumos-gate
+=over 4
=cut
-init(options => { });
+init(options => {
+ 'bootstrap' => \$dh{'BOOTSTRAP'},
+ });
+
my $tarball = '/usr/src/illumos-gate/illumos-gate.tar.xz';
my $changelogfile = 'debian/changelog';
@@ -82,7 +92,14 @@ if (defined($dh{'EXCLUDE'}) && $dh{'EXCLUDE'}) {
doit('tar', '-x', '-f', $tarball, @tar_X);
-# Fix usr/src/Makefile.master
+=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<diff -dub usr/src/Makefile.master.orig usr/src/Makefile.master>
+to see all changes.
+
+=cut
my $Makefile_master = 'illumos-gate/usr/src/Makefile.master';
my $Makefile_master_orig = $Makefile_master . '.orig';
if (! -f $Makefile_master) {
@@ -92,23 +109,53 @@ if (! -e $Makefile_master_orig) {
doit('cp', '-f', $Makefile_master, $Makefile_master_orig);
}
-# Fix for GNU install:
-# 1. do not strip directories, and do not strip at all
-# 2. replace -f with -t
-# 3. Enable gcc4 mode and use compiler form /usr/bin
-# 4. Set -m32 to ensure 32-bit mode for host compiler (default is 64)
+=item Changes to F<usr/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
+not tolerant here. Also replace option C<-f> with C<-t>.
+
+Enable GCC and GCC4 mode by defining C<__GNUC> and C<__GNUC4>.
+
+Change GCC root to F</usr/>, so the default system compiler is used.
+
+=cut
+
doit('sed', '-r', '-i', '
- /INS\.(file|dir)/ s, -s,,;
- /INS\.file/ s, -f, -t,;
- /^__GNUC *=/ s,.*,__GNUC=,;
- /^__GNUC4 *=/ s,.*,__GNUC4=,;
- /^i386_XARCH *=/ s,.*,i386_XARCH = -m32,;
- /^i386_AS_XARCH *=/ s,.*,i386_AS_XARCH = -xarch=i386,;
- /.*__GNUC4.GCC_ROOT/ s,.*,$(__GNUC4)GCC_ROOT = /usr,;
+ /^INS\.(file|dir)/ s, -s,,;
+ /^INS\.file/ s, -f, -t,;
+ /^__GNUC *=/ s,(.*)=.*,\1=,;
+ /^__GNUC4 *=/ s,(.*)=.*,\1=,;
+ /.*__GNUC4.GCC_ROOT/ s,(.*)=.*,\1 = /usr,;
', $Makefile_master
);
-# Fix usr/src/lib/Makefile.lib
+=item If B<--bootstrap> option is given:
+
+Define C<MCS>, C<CTFCONVERT> and others to be just C</usr/bin/true>.
+This helps to break cyclic dependencies, e. g. to build F<ctfconvert>
+you need F<libctf> and for F<libctf> you need F<ctfconvert>.
+
+=cut
+
+if ($dh{'BOOTSTRAP'}) {
+ doit('sed', '-r', '-i', '
+ /^MCS *=/ s,.*,MCS = /usr/bin/true,;
+ /^CTFCONVERT *=/ s,.*,CTFCONVERT = /usr/bin/true,;
+ /^CTFMERGE *=/ s,.*,CTFMERGE = /usr/bin/true,;
+ /^CTFSTABS *=/ s,.*,CTFSTABS = /usr/bin/true,;
+ ', $Makefile_master
+ );
+}
+
+=item Change to F<usr/src/lib/Makefile.lib>
+
+Set library directories to be F</usr/lib/<multi-arch>>,
+instead of F</usr/lib> (for 32-bit) and F</usr/lib/amd64>
+(for 64-bit). C<dpkg-architecture -qDEB_HOST_MULTIARCH> is involved here.
+
+=cut
+
my $Makefile_lib = 'illumos-gate/usr/src/lib/Makefile.lib';
my $Makefile_lib_orig = $Makefile_lib . '.orig';
# Makefile.lib may not be unpacked, and it is ok
@@ -132,11 +179,24 @@ if ( -e $Makefile_lib) {
);
}
-# Populate illumos-gate/illumos.sh with proper variables:
-# 1. Set default build options and environment
-# 2. Set root directory for illumos-gate
-# 3. Set VERSION = 'source version', e. g. "uts_5.11.0-1+b1"
+=item Create F<illumos-gate/illumos.sh>
+
+Copy F<illumos-gate/usr/src/tools/env/illumos.sh> to F<illumos-gate/illumos.sh>
+and make this changes:
+
+Adjust C<CODEMGR_WS> to be C<current_dir/illumos-gate>.
+
+Set C<VERSION> to be C<source_version> by parsing F<debian/chnagelog>.
+For example it can be C<uts_5.11.0-15>.
+Set C<NIGHTLY_OPTIONS> as C<-FCDp>.
+
+Set C<LD_ALTEXEC=/usr/bin/ld-gnu-to-sun> to call L<sunld(1)>
+instead of GNU L<ld(1)>. Default system GCC is build to use GNU L<ld(1)>,
+but L<sunld(1)> is required to build most illumos components.
+See L<ld-gnu-to-sun(1)>.
+
+=cut
my $illumos_sh = 'illumos-gate/usr/src/tools/env/illumos.sh';
if (! -f $illumos_sh) {
error("Could not find `$illumos_sh'. Is it accidently excluded via -X option?");
@@ -161,8 +221,25 @@ export LD_ALTEXEC=/usr/bin/ld-gnu-to-sun
' >> illumos-gate/illumos.sh
));
+
+=item Create F<illumos-gate/bldenv.sh>
+
+Just make a symlink form F<illumos-gate/usr/src/tools/scripts/bldenv.sh>
+to F<illumos-gate/bldenv.sh>.
+
+=cut
+
doit('ln', '-s', '-f', 'usr/src/tools/scripts/bldenv.sh', 'illumos-gate/bldenv.sh');
+=back
+
+=head1 NOTES
+
+To clean package (via C<./debian/rules clean>) you should just remove F<illumos-gate> directory:
+
+ rm -rf illumos-gate
+
+
=head1 SEE ALSO
L<debhelper(7)>, L<dh_illumos_make(1)>.