Import of oldpackages/perl

Signed-off-by: Marcel Denia <naoir@gmx.net>
This commit is contained in:
Marcel Denia 2014-07-04 05:18:57 +02:00
parent 931f161e27
commit 6420bbd712
17 changed files with 10826 additions and 0 deletions

203
lang/perl/Makefile Normal file
View File

@ -0,0 +1,203 @@
#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=perl
PKG_VERSION:=5.10.0
PKG_RELEASE:=7
PKG_MD5SUM:=d2c39b002ebfd2c3c5dba589365c5a71
PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \
ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_LICENSE:=GPLv1 ARTISTIC
PKG_LICENSE_FILES:=Copying Artisitc README
PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
ifneq ($(CONFIG_USE_EGLIBC),)
EXTRA_LIBS:=bsd
EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
endif
define Package/perl/Default
SUBMENU:=Perl
SECTION:=lang
CATEGORY:=Languages
TITLE:=The Perl intepreter
URL:=http://www.perl.com/
DEPENDS:=+USE_EGLIBC:libbsd
endef
define Package/microperl
$(call Package/perl/Default)
TITLE+=(minimal version)
endef
define Package/microperl/description
A perl package without operating-specific functions such as readdir.
endef
define Build/Template
$(STAMP_CONFIGURED)-$(1): $(STAMP_PREPARED)
-$(MAKE) -C $(PKG_BUILD_DIR) clean
$(call Build/$(1)/Configure)
touch $$@
$(STAMP_BUILT)-$(1): $(STAMP_CONFIGURED)-$(1)
$(call Build/$(1)/Compile)
touch $$@
$(STAMP_BUILT): $(STAMP_BUILT)-$(1)
endef
define Build/microperl/Configure
endef
define Build/microperl/Compile
$(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.micro \
CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)"
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/microperl $(PKG_INSTALL_DIR)/usr/bin/
endef
define Package/microperl/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/microperl $(1)/usr/bin/
endef
include perlmod.mk
define Package/perl
$(call Package/perl/Default)
endef
define Package/perl/description
Perl is a stable, cross platform programming language.
It is used for mission critical projects in the public and private sectors
and is widely used to program web applications of all needs.
endef
define Build/perl/Configure
@echo
@echo "===> Stage 1: Configure host perl"
@echo
mkdir -p $(PKG_BUILD_DIR)/host-perl
(cd $(PKG_BUILD_DIR)/host-perl && sh ../Configure -der -Dmksymlinks -Uusedl -Dotherlibdirs=$(PERL_LIB))
@echo
@echo "===> Stage 2: Build host perl binary with static extensions"
@echo
$(MAKE) -C $(PKG_BUILD_DIR)/host-perl
@echo
@echo "===> Stage 3: Configure target perl"
@echo
-$(MAKE) -C $(PKG_BUILD_DIR) clean
sed \
-e 's!%%CC%%!$(TARGET_CC)!g' \
-e 's!%%CFLAGS%%!$(TARGET_CFLAGS) -DUSE_CROSS_COMPILE $(TARGET_CPPFLAGS)!g' \
-e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
-e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
-e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
-e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
-e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \
-e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \
-e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \
-e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
> $(PKG_BUILD_DIR)/config.sh
(cd $(PKG_BUILD_DIR) && ./Configure -S)
endef
define Build/perl/Compile
@echo
@echo "===> Stage 4: Build target miniperl binary"
@echo
install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
-rm -f $(PKG_BUILD_DIR)/miniperl
$(MAKE) -C $(PKG_BUILD_DIR) miniperl
mkdir -p $(PKG_BUILD_DIR)/target-bin
install -m 0755 $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/target-bin/
@echo
@echo "===> Stage 5: Build target perl binary"
@echo
-rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl
install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/
touch $(PKG_BUILD_DIR)/miniperl
$(MAKE) -C $(PKG_BUILD_DIR) perl
install -m 0755 $(PKG_BUILD_DIR)/perl $(PKG_BUILD_DIR)/target-bin/
@echo
@echo "===> Stage 6: Build target extensions and utils"
@echo
-rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl
install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/
ln -sf miniperl $(PKG_BUILD_DIR)/perl
touch $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl
$(MAKE) -C $(PKG_BUILD_DIR)
@echo
@echo "===> Stage 7: Install Perl into staging dir"
@echo
-rm -f $(PKG_BUILD_DIR)/perl
$(INSTALL_BIN) $(PKG_BUILD_DIR)/host-perl/perl $(PKG_BUILD_DIR)/
(cd $(PKG_BUILD_DIR) && ./perl installperl --destdir=$(STAGING_DIR))
@echo
@echo "===> Stage 8: Install Perl into a temporary root"
@echo
-rm -f $(PKG_BUILD_DIR)/perl
$(INSTALL_BIN) $(PKG_BUILD_DIR)/target-bin/perl $(PKG_BUILD_DIR)
-rm -rf $(PKG_INSTALL_DIR)
mkdir -p $(PKG_INSTALL_DIR)
(cd $(PKG_BUILD_DIR) && host-perl/miniperl installperl --destdir=$(PKG_INSTALL_DIR))
endef
define Package/perl/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
endef
ifneq ($(CONFIG_PACKAGE_microperl),)
define Build/microperl
$(call Build/Template,microperl)
endef
endif
$(eval $(Build/microperl))
ifneq ($(CONFIG_PACKAGE_perl),)
define Build/perl
$(call Build/Template,perl)
endef
endif
$(eval $(Build/perl))
define Build/Configure
endef
define Build/Compile
endef
$(eval $(call RequireCommand,rsync, \
$(PKG_NAME) requires rsync installed on the host-system. \
))
$(eval $(call BuildPackage,microperl))
$(eval $(call BuildPackage,perl))
-include perlbase.mk

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
#!/bin/sh
#
# Generate perl module package dependencies
#
# Copyright (C) 2007 Peter Colberg <peter@petercolberg.org>
# Licensed under the terms of the GNU General Public License.
#
if [ $# -lt 3 ]; then
echo >&2 "Usage: $(basename $0) STAGING-DIR PERL-BUILD-DIR [FILES...] [DIRECTORIES...]"
exit 1
fi
STAGING_DIR="$1"
PERL_BIN="$STAGING_DIR/usr/bin/perl"
PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10"
INC_DIR="$(dirname $0)"
shift
"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$@" <<'PERL_SCRIPT'
use strict;
use warnings;
use Module::ScanDeps;
use File::Find;
use Cwd;
our $sitelib = "/usr/lib/perl5/5.10";
sub scandeps {
my $builddir = Cwd::abs_path(shift);
my @scanpaths = @_;
my ($curdir, @pkgdirs, $dir, @deps, %depends, $file);
our ($pkg, %bundles, $path, @files);
@pkgdirs = glob($builddir . "/*/ipkg");
$curdir = getcwd();
@INC = ();
for $dir (@pkgdirs) {
chdir($dir) or die "$dir: $!";
for $pkg (glob("*")) {
chdir($dir . "/" . $pkg . $sitelib) or next;
push @INC, getcwd();
sub wanted {
return unless (-f $_);
s/^\.\///;
$bundles{$_} = $pkg;
}
find({ wanted => \&wanted, no_chdir => 1 }, ".");
}
}
chdir($curdir) or die "$curdir: $!\n";
for $path (@scanpaths) {
sub scan_wanted {
return unless (-f $_ and /\.(pl|pm)$/);
push @files, $_;
}
if (-f $path) {
push @files, $path;
}
elsif (-d $path) {
find({ wanted => \&scan_wanted, no_chdir => 1 }, $path);
}
}
@deps = keys %{scan_deps(files => \@files, recurse => 0)};
for $file (grep { not exists $bundles{$_} } @deps) {
warn "could not resolve dependency: $file\n";
}
%depends = map { $bundles{$_}, 1 } grep { exists $bundles{$_} } @deps;
if (%depends) {
print join(' ', 'perl', sort keys %depends), "\n";
}
}
if (@ARGV > 1) {
scandeps(@ARGV);
}
PERL_SCRIPT

View File

@ -0,0 +1,176 @@
#!/bin/sh
#
# Generate perl base modules package definitions
#
# Copyright (C) 2007 Peter Colberg <peter@petercolberg.org>
# Licensed under the terms of the GNU General Public License.
#
if [ $# -lt 1 ]; then
echo >&2 "Usage: $(basename $0) STAGING-DIR [OUTFILE]"
exit 1
fi
STAGING_DIR="$1"
PERL_BIN="$STAGING_DIR/usr/bin/perl"
PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10"
INC_DIR="$(dirname $0)"
shift
"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$PERL_LIB" "$@" <<'PERL_SCRIPT'
use strict;
use warnings;
use Module::ScanDeps;
use File::Find;
use File::Basename;
our $skipfiles = 'CORE vmsish.pm auto/sdbm';
our %defmodules = (
'essential' => 'lib.pm vars.pm strict.pm warnings.pm warnings Carp Carp.pm Exporter Exporter.pm locale.pm subs.pm overload.pm constant.pm',
'getoptpl' => 'getopt.pl getopts.pl',
'utf8' => 'utf8_heavy.pl',
'Getopt' => 'newgetopt.pl',
'open' => 'open2.pl open3.pl',
'Config' => 'Config_heavy.pl',
'bytes' => 'bytes_heavy.pl',
);
our %defdepends = (
'DB_File' => 'libdb1-compat',
'GDBM_File' => 'libgdbm',
);
our $prefix = 'perlbase-';
sub template ($) {
$_ = $_[0];
return <<TEMPLATE;
define Package/$$_{package}
SECTION:=lang
CATEGORY:=Languages
URL:=http://www.cpan.org/
TITLE:=$$_{module} perl module
DEPENDS:=$$_{depends}
endef
define Package/$$_{package}/install
\$(call perlmod/Install,\$(1),$$_{files},$$_{exclude})
endef
\$(eval \$(call BuildPackage,$$_{package}))
TEMPLATE
}
sub scandeps ($) {
my $sitedir = shift;
my @result;
my ($mod, $file, @deps, $dep, %depends, $parent, $pkg);
our (%files, %modules);
my (%packages, %excludes);
for $mod (keys %defmodules) {
($pkg = $prefix . $mod) =~ tr/A-Z_/a-z-/;
$modules{$pkg} = $mod;
for $file (split / /, $defmodules{$mod}) {
$files{$file} = $pkg;
}
}
for $file ('pod', 'Pod', split(/ /, $skipfiles)) {
$files{$file} = undef;
}
sub wanted {
s/^\.\///;
return if (/^(\.|auto)$/ or exists $files{$_});
if (/\.pod$/) {
$files{$_} = undef;
}
elsif (exists $files{dirname($_)}) {
$files{$_} = $files{dirname($_)};
}
elsif (m!^(?:auto/)?([^./]+)(?:\.(?:pl|pm)|/|$)!) {
(my $pkg = $prefix . $1) =~ tr/A-Z_/a-z-/;
$modules{$pkg} = $1;
$files{$_} = $pkg;
}
else {
$files{$_} = undef;
}
}
chdir($sitedir);
find({ wanted => \&wanted, no_chdir => 1}, '.');
for $pkg (keys %modules) {
$packages{$pkg} = [];
$excludes{$pkg} = [];
$depends{$pkg} = {};
}
for $file (keys %files) {
$mod = $files{$file};
$parent = $files{dirname($file)};
if (defined ($mod)) {
if (defined ($parent) and not ($parent eq $mod)) {
push @{$packages{$mod}}, $file;
push @{$excludes{$parent}}, $file;
}
elsif (not defined ($parent)) {
push @{$packages{$mod}}, $file;
}
}
elsif (defined ($parent)) {
push @{$excludes{$parent}}, $file;
}
}
for $mod (keys %defdepends) {
($pkg = $prefix . $mod) =~ tr/A-Z_/a-z-/;
for $dep (split / /, $defdepends{$mod}) {
${$depends{$pkg}}{$dep} = 1;
}
}
@INC = ('.');
for $file (grep { -f $_ and defined $files{$_} } keys %files) {
@deps = keys %{scan_deps(files => [ $file ], recurse => 0)};
$pkg = $files{$file};
for $dep (grep { not defined $files{$_} } @deps) {
warn "$file: could not resolve dependency: $dep\n";
}
for $dep (grep { defined $files{$_} } @deps) {
next if ($files{$dep} eq $pkg);
${$depends{$pkg}}{$files{$dep}} = 1;
}
}
for $pkg (sort keys %packages) {
push @result, template({
package => $pkg,
module => $modules{$pkg},
depends => join(' ', 'perl', sort keys %{$depends{$pkg}}),
files => join(' ', sort @{$packages{$pkg}}),
exclude => join(' ', sort @{$excludes{$pkg}}),
});
}
return join('', @result);
}
if (@ARGV > 1) {
open FILE, ">$ARGV[1]" or die "$ARGV[1]: $!\n";
print FILE scandeps($ARGV[0]);
close FILE;
}
else {
print scandeps($ARGV[0] or '.');
}
PERL_SCRIPT

View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# Attempt to strip comments and pod docs from perl modules
#
[ "$#" -gt 0 ] || set .
echo "---> Stripping modules in: $@" >&2
find "$@" -name \*.pm -or -name \*.pl -or -name \*.pod | while read fn; do
echo " $fn" >&2
sed -i -e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d; /^=\(head\|pod\|item\|over\|back\)/,$d; /^#$/d; /^#[^!"'"'"']/d' "$fn"
done

View File

@ -0,0 +1,49 @@
--- /dev/null
+++ b/generate_uudmap
@@ -0,0 +1,7 @@
+#!/bin/bash
+echo \{
+for i in {0..31}; do echo -n ' 0,'; done
+echo
+for i in {0..63}; do echo -n " $i,"; done
+echo
+echo \}
--- a/Makefile.micro
+++ b/Makefile.micro
@@ -173,13 +173,8 @@ uperlapi$(_O): $(HE) perlapi.c perlapi.h
uxsutils$(_O): $(HE) xsutils.c
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) xsutils.c
-uudmap.h: generate_uudmap$(_X)
- $(RUN) ./generate_uudmap$(_X) >uudmap.h
-
-generate_uudmap$(_O): generate_uudmap.c
- $(CC) $(CCFLAGS) -o $@ $(CFLAGS) generate_uudmap.c
-
-generate_uudmap$(_X): generate_uudmap$(_O)
- $(LD) -o generate_uudmap $(LDFLAGS) generate_uudmap$(_O) $(LIBS)
+uudmap.h:
+ chmod a+x generate_uudmap
+ $(RUN) ./generate_uudmap >uudmap.h
# That's it, folks!
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -478,11 +478,13 @@ opmini\$(OBJ_EXT): opmini.c
globals\$(OBJ_EXT): uudmap.h
-uudmap.h: generate_uudmap\$(EXE_EXT)
- \$(RUN) ./generate_uudmap\$(EXE_EXT) >uudmap.h
+uudmap.h: generate_uudmap
+ chmod a+x generate_uudmap
+ \$(RUN) ./generate_uudmap >uudmap.h
-generate_uudmap\$(EXE_EXT): generate_uudmap\$(OBJ_EXT)
- \$(CC) -o generate_uudmap \$(LDFLAGS) generate_uudmap\$(OBJ_EXT) \$(libs)
+generate_uudmap:
+ cp ../generate_uudmap .
+ touch generate_uudmap
!GROK!THIS!
$spitshell >>Makefile <<'!NO!SUBS!'

View File

@ -0,0 +1,22 @@
--- a/config_h.SH
+++ b/config_h.SH
@@ -53,6 +53,19 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
#ifndef _config_h_
#define _config_h_
+#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
+# include <endian.h>
+# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
+# if (__BYTE_ORDER == __LITTLE_ENDIAN)
+# define __LITTLE_ENDIAN__
+# elif (__BYTE_ORDER == __BIG_ENDIAN)
+# define __BIG_ENDIAN__
+# else
+# error Unknown endianness
+# endif
+# endif
+#endif
+
/* LOC_SED:
* This symbol holds the complete pathname to the sed program.
*/

View File

@ -0,0 +1,27 @@
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -133,6 +133,24 @@ case "$optimize" in
;;
esac
+# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
+# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us
+# where to look. We don't want gcc's own libraries, however, so we
+# filter those out.
+# This could be conditional on Unbuntu, but other distributions may
+# follow suit, and this scheme seems to work even on rather old gcc's.
+# This unconditionally uses gcc because even if the user is using another
+# compiler, we still need to find the math library and friends, and I don't
+# know how other compilers will cope with that situation.
+# Still, as an escape hatch, allow Configure command line overrides to
+# plibpth to bypass this check.
+case "$plibpth" in
+'') plibpth=`gcc -print-search-dirs | grep libraries |
+ cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'`
+ plibpth="$plibpth" # Collapse all entries on one line
+ ;;
+esac
+
# Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com>
# for this test.
cat >try.c <<'EOM'

1643
lang/perl/perlbase.mk Normal file

File diff suppressed because it is too large Load Diff

53
lang/perl/perlmod.mk Normal file
View File

@ -0,0 +1,53 @@
# This makefile simplifies perl module builds.
#
# Build environment
PERL_CMD := $(STAGING_DIR)/usr/bin/perl
PERL_LIB := $(STAGING_DIR)/usr/lib/perl5/5.10
# Module install prefix
PERL_SITELIB := /usr/lib/perl5/5.10
define perlmod/Configure
(cd $(PKG_BUILD_DIR); \
PERL5LIB=$(PERL_LIB) \
PERL_MM_USE_DEFAULT=1 \
$(2) \
$(PERL_CMD) Makefile.PL \
$(1) \
PERL_LIB=$(PERL_LIB) \
PERL_ARCHLIB=$(PERL_LIB) \
INSTALLSITELIB=$(PERL_SITELIB) \
INSTALLSITEARCH=$(PERL_SITELIB) \
DESTDIR=$(PKG_INSTALL_DIR) \
);
endef
define perlmod/Compile
PERL5LIB=$(PERL_LIB) \
$(2) \
$(MAKE) -C $(PKG_BUILD_DIR) \
$(1) \
install
endef
define perlmod/Install
$(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB)
(cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \
rsync --relative -rlHp --itemize-changes \
--exclude=\*.pod \
--exclude=.packlist \
$(addprefix --exclude=/,$(strip $(3))) \
--prune-empty-dirs \
$(strip $(2)) $(strip $(1))$(PERL_SITELIB))
chmod -R u+w $(strip $(1))$(PERL_SITELIB)
@echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
xargs -r sed -i \
-e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d' \
-e '/^=\(head\|pod\|item\|over\|back\)/,$$$$d' \
-e '/^#$$$$/d' \
-e '/^#[^!"'"'"']/d'
endef