From 1124387625c3e24a4e8a100d2db83dec502bfa13 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 25 Feb 2014 16:04:24 +0100 Subject: [PATCH 1/3] pidl: Install pidl files corrently. Globbing is a really bad idea in installtion system. One of them is if you use patch -b to create a backup, you will end up installing the backup file too! BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Andreas Schneider Reviewed-by: Kai Blin (cherry picked from commit cee11cfa4544425099268cd32393169afb4bb107) --- pidl/lib/wscript_build | 31 ++++++++++++++++++++++++++++++- pidl/wscript | 3 --- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/pidl/lib/wscript_build b/pidl/lib/wscript_build index eb5f1e0..9bddf3f 100644 --- a/pidl/lib/wscript_build +++ b/pidl/lib/wscript_build @@ -1,4 +1,33 @@ #!/usr/bin/env python # install the pidl modules -bld.INSTALL_WILDCARD('${DATAROOTDIR}/perl5', '**/*.pm', flat=False) +bld.INSTALL_FILES('${DATAROOTDIR}/perl5', + ''' + Parse/Pidl.pm + Parse/Pidl/Samba4.pm + Parse/Pidl/CUtil.pm + Parse/Pidl/Expr.pm + Parse/Pidl/Wireshark/Conformance.pm + Parse/Pidl/Wireshark/NDR.pm + Parse/Pidl/ODL.pm + Parse/Pidl/Dump.pm + Parse/Pidl/Util.pm + Parse/Pidl/Samba4/Header.pm + Parse/Pidl/Samba4/COM/Header.pm + Parse/Pidl/Samba4/COM/Proxy.pm + Parse/Pidl/Samba4/COM/Stub.pm + Parse/Pidl/Samba4/TDR.pm + Parse/Pidl/Samba4/NDR/Server.pm + Parse/Pidl/Samba4/NDR/Client.pm + Parse/Pidl/Samba4/NDR/Parser.pm + Parse/Pidl/Samba4/Python.pm + Parse/Pidl/Samba4/Template.pm + Parse/Pidl/IDL.pm + Parse/Pidl/Typelist.pm + Parse/Pidl/Samba3/ClientNDR.pm + Parse/Pidl/Samba3/ServerNDR.pm + Parse/Pidl/Compat.pm + Parse/Pidl/NDR.pm + Parse/Yapp/Driver.pm + ''', + flat=False) diff --git a/pidl/wscript b/pidl/wscript index 7a25734..05d9982 100644 --- a/pidl/wscript +++ b/pidl/wscript @@ -26,9 +26,6 @@ def build(bld): if not bld.CONFIG_SET('HAVE_PERL_MAKEMAKER'): return - pidl_src = ['pidl'] - pidl_src.extend(bld.path.ant_glob('lib/**/*.pm').split()) - pidl_manpages = { 'pidl': 'man1/pidl.${PERLMAN1EXT}', 'lib/Parse/Pidl/NDR.pm': 'man3/Parse::Pidl::NDR.${PERLMAN3EXT}', -- 1.8.5.2 From b929788024a2d051f0ef5d94b566346147151062 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 25 Feb 2014 17:16:37 +0100 Subject: [PATCH 2/3] waf: Add option to specify perl vendor dir. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Andreas Schneider Reviewed-by: Kai Blin Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Feb 27 11:48:54 CET 2014 on sn-devel-104 (cherry picked from commit 9b200555fec2e33da9521db388d1839375aa8d83) --- buildtools/wafadmin/Tools/perl.py | 7 +++++++ pidl/lib/wscript_build | 2 +- pidl/wscript | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/buildtools/wafadmin/Tools/perl.py b/buildtools/wafadmin/Tools/perl.py index a6787a8..90be8d8 100644 --- a/buildtools/wafadmin/Tools/perl.py +++ b/buildtools/wafadmin/Tools/perl.py @@ -103,7 +103,14 @@ def check_perl_ext_devel(conf): else: conf.env.ARCHDIR_PERL = read_out('print $Config{sitearch}')[0] + conf.env.VENDORDIR_PERL = Options.options.perlvendordir + def set_options(opt): opt.add_option("--with-perl-binary", type="string", dest="perlbinary", help = 'Specify alternate perl binary', default=None) opt.add_option("--with-perl-archdir", type="string", dest="perlarchdir", help = 'Specify directory where to install arch specific files', default=None) + opt.add_option("--with-perl-vendordir", + type="string", + dest="perlvendordir", + help="Specify directory where to install perl vendor files", + default='${DATAROOTDIR}/perl5/vendor_perl') diff --git a/pidl/lib/wscript_build b/pidl/lib/wscript_build index 9bddf3f..29632d4 100644 --- a/pidl/lib/wscript_build +++ b/pidl/lib/wscript_build @@ -1,7 +1,7 @@ #!/usr/bin/env python # install the pidl modules -bld.INSTALL_FILES('${DATAROOTDIR}/perl5', +bld.INSTALL_FILES(bld.env.VENDORDIR_PERL, ''' Parse/Pidl.pm Parse/Pidl/Samba4.pm diff --git a/pidl/wscript b/pidl/wscript index 05d9982..77abb01 100644 --- a/pidl/wscript +++ b/pidl/wscript @@ -8,6 +8,8 @@ def set_options(opt): def configure(conf): conf.check_tool('perl') + conf.check_perl_ext_devel() + # we need a recent version of MakeMaker to get the right man page names if conf.CHECK_PERL_MANPAGE(): conf.env.PERLMAN1EXT = conf.CHECK_PERL_MANPAGE(section='1') -- 1.8.5.2 From bbf583db46d258e9f406b4f4c3d73fe94bf3bfab Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 27 Feb 2014 13:14:56 +0100 Subject: [PATCH 3/3] pidl: Make perl(Parse:Yapp:Driver) installation optional. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Andreas Schneider Reviewed-by: Jelmer Vernooij Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Feb 27 18:47:03 CET 2014 on sn-devel-104 (cherry picked from commit f0030c619bcf22dbe9eed54b2c0dc9c61f564838) --- pidl/lib/wscript_build | 6 +++++- pidl/wscript | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pidl/lib/wscript_build b/pidl/lib/wscript_build index 29632d4..09d26eb 100644 --- a/pidl/lib/wscript_build +++ b/pidl/lib/wscript_build @@ -28,6 +28,10 @@ bld.INSTALL_FILES(bld.env.VENDORDIR_PERL, Parse/Pidl/Samba3/ServerNDR.pm Parse/Pidl/Compat.pm Parse/Pidl/NDR.pm - Parse/Yapp/Driver.pm ''', flat=False) + +if not bld.CONFIG_SET('USING_SYSTEM_PARSE_YAPP_DRIVER'): + bld.INSTALL_FILES(bld.env.VENDORDIR_PERL, + 'Parse/Yapp/Driver.pm', + flat=False) diff --git a/pidl/wscript b/pidl/wscript index 77abb01..c7b72c4 100644 --- a/pidl/wscript +++ b/pidl/wscript @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os, sys, Logs +import os, sys, Logs, Options from samba_utils import MODE_755 def set_options(opt): @@ -20,6 +20,9 @@ def configure(conf): conf.find_program('yapp', var='YAPP') conf.find_program('pod2man', var='POD2MAN') + # Check for perl(Parse::Yapp::Driver) + check_system_perl_module(conf, "Parse::Yapp::Driver", 1.05) + def build(bld): bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=MODE_755) @@ -82,3 +85,23 @@ try this to avoid this message: $ touch ../pidl/lib/Parse/Pidl/IDL.pm ../pidl/lib/Parse/Pidl/Expr.pm ''') +def check_system_perl_module(conf, module, version=None): + bundle_name = module.replace('::', '_') + module_check = module + found = False + + # Create module string with version + if version: + module_check = module + ' ' + str(version) + + # Check if we have to bundle it. + if conf.LIB_MUST_BE_BUNDLED(bundle_name.lower()): + return False + + # Check for system perl module + if not conf.check_perl_module(module_check): + return False + + conf.define('USING_SYSTEM_%s' % bundle_name.upper(), 1) + + return True -- 1.8.5.2