|
|
8f2b80 |
#############################################################################
|
|
|
8f2b80 |
# $Id: Makefile.PL.rpm,v 1.1.2.1 2007/01/10 18:01:48 richm%stanfordalumni.org Exp $
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
# The contents of this file are subject to the Mozilla Public License
|
|
|
8f2b80 |
# Version 1.1 (the "License"); you may not use this file except in
|
|
|
8f2b80 |
# compliance with the License. You may obtain a copy of the License at
|
|
|
8f2b80 |
# http://www.mozilla.org/MPL/
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
# Software distributed under the License is distributed on an "AS IS"
|
|
|
8f2b80 |
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
8f2b80 |
# License for the specific language governing rights and limitations
|
|
|
8f2b80 |
# under the License.
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
# The Original Code is PerLDAP. The Initial Developer of the Original
|
|
|
8f2b80 |
# Code is Netscape Communications Corp. and Clayton Donley. Portions
|
|
|
8f2b80 |
# created by Netscape are Copyright (C) Netscape Communications
|
|
|
8f2b80 |
# Corp., portions created by Clayton Donley are Copyright (C) Clayton
|
|
|
8f2b80 |
# Donley, portions created by Leif Hedstrom are Copyright (C) Leif
|
|
|
8f2b80 |
# Hedstrom. All Rights Reserved.
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
# Contributor(s):
|
|
|
8f2b80 |
# * Leif Hedstrom <leif@perldap.org>
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
# DESCRIPTION
|
|
|
8f2b80 |
# The Makefile "source".
|
|
|
8f2b80 |
# This has been heavily modified to simply use pkg-config
|
|
|
8f2b80 |
# to get the components necessary to build.
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
#############################################################################
|
|
|
8f2b80 |
|
|
|
8f2b80 |
require 5.005;
|
|
|
8f2b80 |
|
|
|
8f2b80 |
use ExtUtils::MakeMaker;
|
|
|
8f2b80 |
use ExtUtils::Liblist;
|
|
|
8f2b80 |
use Config;
|
|
|
8f2b80 |
use Carp;
|
|
|
8f2b80 |
|
|
|
8f2b80 |
# name of package to use for pkg-config
|
|
|
8f2b80 |
$ldappkgname = $ENV{"LDAPPKGNAME"} || "mozldap6";
|
|
|
8f2b80 |
my ($DEFINES, $cflags, $libs);
|
|
|
8f2b80 |
if (lc($ldappkgname) eq 'openldap') {
|
|
|
8f2b80 |
$cflags = `pkg-config --cflags nss`;
|
|
|
8f2b80 |
chomp($cflags);
|
|
|
8f2b80 |
$libs = `pkg-config --libs nss`;
|
|
|
8f2b80 |
chomp($libs);
|
|
|
8f2b80 |
$libs = "-lldap -llber $libs";
|
|
|
8f2b80 |
$DEFINES = "-DUSE_OPENLDAP -DUSE_SSL -DPRLDAP";
|
|
|
8f2b80 |
} else {
|
|
|
8f2b80 |
$cflags = `pkg-config --cflags $ldappkgname`;
|
|
|
8f2b80 |
chomp($cflags);
|
|
|
8f2b80 |
$libs = `pkg-config --libs $ldappkgname`;
|
|
|
8f2b80 |
chomp($libs);
|
|
|
8f2b80 |
$DEFINES = "-DUSE_SSL -DPRLDAP";
|
|
|
8f2b80 |
}
|
|
|
8f2b80 |
print "\nPerLDAP - Perl 5 Module for LDAP\n";
|
|
|
8f2b80 |
print "================================\n";
|
|
|
8f2b80 |
print "Using CFLAGS = $cflags\n";
|
|
|
8f2b80 |
print "================================\n";
|
|
|
8f2b80 |
print "Using LIBS = $libs\n";
|
|
|
8f2b80 |
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
# Ok, let's do it!
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
print "\n######### before WriteMakefile #############\n";
|
|
|
8f2b80 |
WriteMakefile(
|
|
|
8f2b80 |
'ABSTRACT' => 'Perl methods for LDAP C API calls',
|
|
|
8f2b80 |
'AUTHOR' => 'Leif Hedstrom <leif@ogre.com>',
|
|
|
8f2b80 |
'NAME' => 'Mozilla::LDAP::API',
|
|
|
8f2b80 |
'DISTNAME' => 'PerLDAP',
|
|
|
8f2b80 |
|
|
|
8f2b80 |
'VERSION_FROM' => 'API.pm',
|
|
|
8f2b80 |
'INC' => $cflags,
|
|
|
8f2b80 |
'LIBS' => [$libs],
|
|
|
8f2b80 |
'MYEXTLIB' => $my_extlib,
|
|
|
8f2b80 |
'DEFINE' => $DEFINES,
|
|
|
8f2b80 |
'XSOPT' => "-nolinenumbers",
|
|
|
8f2b80 |
@extras
|
|
|
8f2b80 |
);
|
|
|
8f2b80 |
|
|
|
8f2b80 |
print "\n######### after WriteMakefile #############\n";
|
|
|
8f2b80 |
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
# Generate a "make HTML" target
|
|
|
8f2b80 |
#
|
|
|
8f2b80 |
sub MY::postamble
|
|
|
8f2b80 |
{
|
|
|
8f2b80 |
'
|
|
|
8f2b80 |
.SUFFIXES: .pm .html
|
|
|
8f2b80 |
.PHONY: html
|
|
|
8f2b80 |
|
|
|
8f2b80 |
.pm.html:
|
|
|
8f2b80 |
pod2html --netscape $< > $@
|
|
|
8f2b80 |
|
|
|
8f2b80 |
html: Entry.html Conn.html Utils.html API.html LDIF.html $(FIRST_MAKEFILE)
|
|
|
8f2b80 |
@rm -f pod2html-itemcache pod2html-dircache
|
|
|
8f2b80 |
'
|
|
|
8f2b80 |
}
|