[Pkg-openldap-devel] DEBIAN / UBUNTU OPENLDAP WILL NOT BUILD FROM SOURCE

GI Joe medic333333 at gmail.com
Mon May 23 18:59:07 UTC 2016


... and also OF NOTE... source excerpt from dpkg-buildpackage...

my @debian_rules = ('debian/rules');
my @rootcommand = ();
my $signcommand;
my ($admindir, $usepause, $noclean,
    $cleansource, $since, $maint,
    $changedby, $desc, $parallel);
my $checkbuilddep = 1;
my $signkey = defined $ENV{DEB_SIGN_KEYID} ? $ENV{DEB_SIGN_KEYID} : undef;
my $signforce = 0;
my $signreleased = 1;
my $signsource = 1;
my $signchanges = 1;
my $buildtarget = 'build';
my $binarytarget = 'binary';
my $targetarch = my $targetgnusystem = '';
my @build_profiles = ();
my $call_target = '';
my $call_target_as_root = 0;
my (@checkbuilddep_opts, @changes_opts, @source_opts);

use constant BUILD_DEFAULT    => 1;
use constant BUILD_SOURCE     => 2;
use constant BUILD_ARCH_DEP   => 4;
use constant BUILD_ARCH_INDEP => 8;
use constant BUILD_BINARY     => BUILD_ARCH_DEP | BUILD_ARCH_INDEP;
use constant BUILD_ALL        => BUILD_BINARY | BUILD_SOURCE;
my $include = BUILD_ALL | BUILD_DEFAULT;

sub build_normal() { return ($include & BUILD_ALL) == BUILD_ALL; }
sub build_sourceonly() { return $include == BUILD_SOURCE; }
sub build_binaryonly() { return !($include & BUILD_SOURCE); }
sub build_binaryindep() { return ($include == BUILD_ARCH_INDEP); }
sub build_opt() {
    return (($include == BUILD_BINARY) ? '-b' :
            (($include == BUILD_ARCH_DEP) ? '-B' :
             (($include == BUILD_ARCH_INDEP) ? '-A' :
              (($include == BUILD_SOURCE) ? '-S' :
               internerr("build_opt called with include=$include")))));
}

...
.
.
.
...

if ($call_target) {
    if ($call_target_as_root or
        $call_target =~ /^(clean|binary(|-arch|-indep))$/)
    {
        withecho(@rootcommand, @debian_rules, $call_target);
    } else {
        withecho(@debian_rules, $call_target);
    }
    exit 0;
}

unless ($noclean) {
    withecho(@rootcommand, @debian_rules, 'clean');
}
unless (build_binaryonly) {
    warning(_g('building a source package without cleaning up as you asked;
' .
               'it might contain undesired files')) if $noclean;
    chdir('..') or syserr('chdir ..');
    withecho('dpkg-source', @source_opts, '-b', $dir);
    chdir($dir) or syserr("chdir $dir");
}

if ($buildtarget ne 'build' and scalar(@debian_rules) == 1) {
    # Verify that build-{arch,indep} are supported. If not, fallback to
build.
    # This is a temporary measure to not break too many packages on a flag
day.
    my $pid = spawn(exec => [ 'make', '-f', @debian_rules, '-qn',
$buildtarget ],
                    from_file => '/dev/null', to_file => '/dev/null',
                    error_to_file => '/dev/null');
    my $cmdline = "make -f @debian_rules -qn $buildtarget";
    wait_child($pid, nocheck => 1, cmdline => $cmdline);
    my $exitcode = WEXITSTATUS($?);
    subprocerr($cmdline) unless WIFEXITED($?);
    if ($exitcode == 2) {
        warning(_g("%s must be updated to support the 'build-arch' and " .
                   "'build-indep' targets (at least '%s' seems to be " .
                   'missing)'), "@debian_rules", $buildtarget);
        $buildtarget = 'build';
    }
}


On Mon, May 23, 2016 at 1:18 PM, GI Joe <medic333333 at gmail.com> wrote:

> OF NOTE... Note the sequencing in "dh" shown in its sourcecode excerpt
> below...
>
>
> ----------------------------------------------------------------------------
>
>> ---->>>[dh binary --with autoreconf
>> --builddirectory=/.../openldap-2.4.42+dfsg/debian/build
>> --parallel]
>>
>> Same thing.  dh executes to install target on "binary."  Builddirectory is
>> resolved in debian/rules as the same thing at line 34...
>>      builddir        := $(CURDIR)/debian/build
>>
>
> Not the same, trivially demonstrated:
>
> dh binary
>
> executes ./configure in the current directory, creating ./config.log.
>
> dh binary --builddirectory=$(pwd)/debian/build
>
> cd's into debian/build and executes ../../configure, creating
> debian/build/config.log.
>
> --------------------------------------------------------------------------------
>
> FROM DH SOURCE CODE:
>
> }];
> $sequences{'build-indep'} = [@bd];
> $sequences{'build-arch'} = [@bd];
> if (! compat(8)) {
>         # From v9, sequences take standard rules targets into account.
>         $sequences{build} = [@bd_minimal, rules("build-arch"),
> rules("build-indep")];
>         $sequences{'install-indep'} = [rules("build-indep"), @i];
>         $sequences{'install-arch'} = [rules("build-arch"), @i];
>         $sequences{'install'} = [rules("build"), rules("install-arch"),
> rules("install-indep")];
>         $sequences{'binary-indep'} = [rules("install-indep"), @b];
>         $sequences{'binary-arch'} = [rules("install-arch"), @ba, @b];
>         $sequences{binary} = [rules("install"), rules("binary-arch"),
> rules("binary-indep")];
> }
> else {
>         $sequences{build} = [@bd];
>         $sequences{'install'} = [@{$sequences{build}}, @i];
>         $sequences{'install-indep'} = [@{$sequences{'build-indep'}}, @i];
>         $sequences{'install-arch'} = [@{$sequences{'build-arch'}}, @i];
>         $sequences{binary} = [@{$sequences{install}}, @ba, @b];
>         $sequences{'binary-indep'} = [@{$sequences{'install-indep'}}, @b];
>         $sequences{'binary-arch'} = [@{$sequences{'install-arch'}}, @ba,
> @b];
> }
>
> sub rules {
>         return "debian/rules ".join(" ", @_);
> }
>
>
> On Sun, May 22, 2016 at 10:23 PM, GI Joe <medic333333 at gmail.com> wrote:
>
>> Something of note:  On your last comment about VERSION_OPTION.
>>
>> VERSION_OPTION is defined in top.mk.  However, in the libraries tree
>> straight from umich.edu...  they don't include the Debian build top.mk.
>>
>> Hence, I think that's the main issue with the {VARS} in the Debian
>> tradition.
>>
>> On Sun, May 22, 2016 at 10:19 PM, GI Joe <medic333333 at gmail.com> wrote:
>>
>>> :)
>>>
>>> Noted your above and will let you know how it comes out or if I find
>>> anything else.
>>>
>>>
>>>
>>> On Sun, May 22, 2016 at 10:11 PM, Ryan Tandy <ryan at nardis.ca> wrote:
>>>
>>>> On Sun, May 22, 2016 at 09:14:16PM -0500, GI Joe wrote:
>>>>
>>>>> ---->>>[OK. Why? Is this to work around the contrib modules
>>>>> (specifically
>>>>> smbk5pwd) being set up to build with gnutls, while you're building with
>>>>> openssl?]
>>>>>
>>>>> Just testing...  as I was saying... it appears that the problems
>>>>> originate
>>>>> around all of that gssapi/samba stuff inserted circa 2009.   IMHO, It
>>>>> should still be able to compile, test, install properly no matter what
>>>>> libraries are finally linked.  (Try Redhat/Centos)
>>>>>
>>>>
>>>> It does, for the components that are integrated in the autoconf build
>>>> system, but the contrib modules are driven just by simple Makefiles, so do
>>>> need some tweaking to ensure the proper flags are set.
>>>>
>>>> ---->>>[(I was expecting a 'dch --local', or some other edit to
>>>>> debian/changelog, at this point, to distinguish your package from the
>>>>> archive version...)]
>>>>>
>>>>> Not yet.  Don't need to since I'm doing this as prep work before
>>>>> rolling
>>>>> out a 'final edition'.  Gotta be able to install and run it, first.
>>>>> THEN
>>>>> build debs.
>>>>>
>>>>
>>>> OK.
>>>>
>>>> ---->>>[dh binary --with autoreconf
>>>>> --builddirectory=/.../openldap-2.4.42+dfsg/debian/build
>>>>> --parallel]
>>>>>
>>>>> Same thing.  dh executes to install target on "binary."
>>>>> Builddirectory is
>>>>> resolved in debian/rules as the same thing at line 34...
>>>>>      builddir        := $(CURDIR)/debian/build
>>>>>
>>>>
>>>> Not the same, trivially demonstrated:
>>>>
>>>> dh binary
>>>>
>>>> executes ./configure in the current directory, creating ./config.log.
>>>>
>>>> dh binary --builddirectory=$(pwd)/debian/build
>>>>
>>>> cd's into debian/build and executes ../../configure, creating
>>>> debian/build/config.log.
>>>>
>>>> And that does matter, as evidenced by your earlier quotes of things
>>>> failing to find debian/build/libtool.
>>>>
>>>> Autoreconf usually unnecessary too when working with a virgin source
>>>>> tree
>>>>> or after a clean.
>>>>>
>>>>
>>>> Yes, if we were building unmodified upstream sources: but in this case,
>>>> you're missing out on changes made to configure.in by any Debian
>>>> patches, of which there are several. Notably, some of the patches change or
>>>> add other functionality _and_ change the build system to make it all work;
>>>> so if you still have those packages included but you're not doing
>>>> autoreconf, then yes, it's quite likely to break.
>>>>
>>>> ---->>>[ Missing '--with autoreconf' might explain why you find yourself
>>>>> having to edit configure.in, while missing --builddirectory would
>>>>> explain
>>>>> the error about missing libtool I remarked on earlier. ]
>>>>>
>>>>> Not.  The vars were undefined in [context].  (Yes, I realize that's
>>>>> kinda
>>>>> vague... but, I went thru that hours ago)   See below.
>>>>> ....
>>>>>
>>>>> fakeroot dpkg-buildpackage comes after I know this thing is going to
>>>>> install and execute and pass a couple hundred tests.
>>>>>
>>>>
>>>> For faster iterations during development:
>>>>
>>>> export DEB_BUILD_OPTIONS=nocheck
>>>>
>>>> ---->>> 'dpkg-buildpackage -us -uc -b' does succeed for me, though,
>>>>> with no
>>>>> changes at all to the package. So maybe try using that instead?]
>>>>>
>>>>> Try running an ldapsearch -ZZ resulting in TLS 1.2 from Debian/GnuTLS
>>>>> to
>>>>> about 2000 other openldap servers running on Redhat or CentOS and
>>>>> you'll
>>>>> understand pretty quick.  Try adding a few more overlays and backends,
>>>>> too.
>>>>>
>>>>
>>>> I don't understand how this is related to the dpkg-buildpackage
>>>> suggestion, sorry.
>>>>
>>>> I said "with no changes to the package" because that's how I'm testing
>>>> it. I'd make sure you're calling the right commands to build the source
>>>> unmodified first, then change GnuTLS to OpenSSL. I wouldn't expect further
>>>> changes to be necessary.
>>>>
>>>> (BELOW:  After my changes)
>>>>>
>>>>> build/top.mk:VERSION_OPTION = @VERSION_OPTION@
>>>>>      <<<<-------------------------------
>>>>>
>>>>
>>>> Looks like the VERSION_OPTION stuff is related to
>>>> debian/patches/libldap-symbol-versions, which touches... configure.in.
>>>> So yes, I'd expect to run into breakage with that patch applied but not
>>>> running autoreconf.
>>>>
>>>> And your GSSAPI_LIBS problem probably has two parts... the first is
>>>> also autoreconf-related (since the gssapi patch also modifies the build
>>>> system), and the second is fixed by running dpkg-buildpackage instead of
>>>> debian/rules directly, which _shouldn't_ be necessary, but apparently is
>>>> with the current xenial package. Next time I touch the Ubuntu package I'll
>>>> look into that and try to fix it.
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-openldap-devel/attachments/20160523/063cfc6e/attachment-0001.html>


More information about the Pkg-openldap-devel mailing list