!1 package init

Merge pull request !1 from jeff200902/master
This commit is contained in:
openeuler-ci-bot 2020-06-20 15:12:23 +08:00 committed by Gitee
commit 4eb2130d36
4 changed files with 165 additions and 0 deletions

97
Makefile.PL.rpm Normal file
View File

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

64
perl-Mozilla-LDAP.spec Normal file
View File

@ -0,0 +1,64 @@
Name: perl-Mozilla-LDAP
Version: 1.5.3
Release: 28
Summary: Wraps OpenLDAP C SDK as LDAP Perl module
License: GPLv2+ and LGPLv2+ and MPLv1.1
URL: https://www-archive.mozilla.org/directory/faq/perldap-faq
Source0: https://ftp.mozilla.org/pub/mozilla.org/directory/perldap/releases/%{version}/src/perl-mozldap-%{version}.tar.gz
Source1: https://ftp.mozilla.org/pub/mozilla.org/directory/perldap/releases/1.5/src/Makefile.PL.rpm
Requires: perl-interpreter >= 2:5.8.0
BuildRequires: gcc perl-interpreter >= 2:5.8.0 perl-devel perl-generators
BuildRequires: perl(ExtUtils::MakeMaker) nspr-devel nss-devel openldap-devel >= 2.4.22
%description
Wraps OpenLDAP C SDK as LDAP Perl module.
%prep
%autosetup -n perl-mozldap-%{version} -p1 -S git
cat << \EOF > perl-Mozilla-LDAP-prov
#!/bin/sh
%{__perl_provides} $* |\
sed -e '/perl(Mozilla::LDAP::Entry)$/d'
EOF
%define __perl_provides %{_builddir}/perl-mozldap-%{version}/perl-Mozilla-LDAP-prov
chmod +x %{__perl_provides}
cat << \EOF > perl-Mozilla-LDAP-req
%{__perl_requires} $* |\
sed -e '/perl(Mozilla::LDAP::Entry)/d'
EOF
%define __perl_requires %{_builddir}/perl-mozldap-%{version}/perl-Mozilla-LDAP-req
chmod +x %{__perl_requires}
%build
LDAPPKGNAME=openldap CFLAGS="$RPM_OPT_FLAGS" perl %{SOURCE1} PREFIX=$RPM_BUILD_ROOT%{_prefix} INSTALLDIRS=vendor < /dev/null
make OPTIMIZE="$RPM_OPT_FLAGS" CFLAGS="$RPM_OPT_FLAGS"
make test
%install
eval `perl '-V:installarchlib'`
%makeinstall
rm -f `find $RPM_BUILD_ROOT -type f -name perllocal.pod -o -name .packlist`
find $RPM_BUILD_ROOT -name API.so -exec chmod 755 {} \;
if [ -x /usr/lib/rpm/brp-compress ] ; then
/usr/lib/rpm/brp-compress
fi
find $RPM_BUILD_ROOT%{_prefix} -type f -print | \
sed "s@^$RPM_BUILD_ROOT@@g" > perl-Mozilla-LDAP-%{version}-%{release}-filelist
if [ "$(cat perl-Mozilla-LDAP-%{version}-%{release}-filelist)X" = "X" ] ; then
echo "ERROR: EMPTY FILE LIST"
exit 1
fi
%files -f perl-Mozilla-LDAP-%{version}-%{release}-filelist
%doc CREDITS ChangeLog README MPL-1.1.txt
%exclude %{_datadir}/perl5/
%exclude %{_libdir}/perl5/vendor_perl/auto/Mozilla/LDAP/API/API.bs
%changelog
* Sat Apr 18 2020 Jeffery.Gao <gaojianxing@huawei.com> - 1.5.3-28
- Package init

4
perl-Mozilla-LDAP.yaml Normal file
View File

@ -0,0 +1,4 @@
version-control: NA
src_repo: NA
tag_prefix: NA
seperator: NA

BIN
perl-mozldap-1.5.3.tar.gz Normal file

Binary file not shown.