Import of pkgsrc-2015Q2
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# $NetBSD: Makefile,v 1.75 2014/10/09 14:06:50 wiz Exp $
|
||||
#
|
||||
# $NetBSD: Makefile,v 1.79 2015/06/17 11:59:58 wiz Exp $
|
||||
|
||||
PKGNAME= url2pkg-2.20
|
||||
PKGNAME= url2pkg-2.23
|
||||
CATEGORIES= pkgtools
|
||||
|
||||
MAINTAINER= pkgsrc-users@NetBSD.org
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! @PERL@
|
||||
# $NetBSD: url2pkg.pl,v 1.26 2014/08/01 15:44:13 schmonz Exp $
|
||||
# $NetBSD: url2pkg.pl,v 1.29 2015/06/17 11:59:58 wiz Exp $
|
||||
#
|
||||
|
||||
# Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||
@@ -120,6 +120,7 @@ my ($distname, $abs_wrkdir, $abs_wrksrc);
|
||||
my (@wrksrc_files, @wrksrc_dirs);
|
||||
my (@depends, @build_depends, @includes, @build_vars, @extra_vars, @todo);
|
||||
my ($pkgname);
|
||||
my ($dist_subdir);
|
||||
|
||||
#
|
||||
# And now to the real magic_* subroutines.
|
||||
@@ -246,6 +247,7 @@ sub generate_initial_package($) {
|
||||
my ($url) = @_;
|
||||
my ($found, $master_site);
|
||||
my ($master_sites, $distfile, $homepage, $dist_sufx, $category);
|
||||
my ($gh_project, $gh_tag, $gh_release);
|
||||
|
||||
$found = false;
|
||||
open(SITES, "<", "../../mk/fetch/sites.mk") or die;
|
||||
@@ -301,6 +303,41 @@ sub generate_initial_package($) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
if ($url =~ qr"^https?://github\.com/") {
|
||||
if ($url =~ qr"^https?://github\.com/(.*)/(.*)/archive/(.*)(\.tar\.gz|\.zip)$") {
|
||||
$master_sites = "\${MASTER_SITE_GITHUB:=$1/}";
|
||||
$homepage = "\${MASTER_SITE_GITHUB:=$1/$2/}";
|
||||
$gh_project = $2;
|
||||
$gh_tag = $3;
|
||||
if (index($gh_tag, $gh_project) == -1 ) {
|
||||
$pkgname = '${GITHUB_PROJECT}-${DISTNAME}';
|
||||
$dist_subdir = '${GITHUB_PROJECT}';
|
||||
}
|
||||
$distfile = "$3$4";
|
||||
$found = true;
|
||||
} elsif ($url =~ qr"^https?://github\.com/(.*)/(.*)/releases/download/(.*)/(.*)(\.tar\.gz|\.zip)$") {
|
||||
$master_sites = "\${MASTER_SITE_GITHUB:=$1/}";
|
||||
$homepage = "\${MASTER_SITE_GITHUB:=$1/$2/}";
|
||||
if (index($4, $2) == -1) {
|
||||
$gh_project = $2;
|
||||
$dist_subdir = '${GITHUB_PROJECT}';
|
||||
}
|
||||
if ($3 eq $4) {
|
||||
$gh_release = '${DISTNAME}';
|
||||
} else {
|
||||
$gh_release = $3;
|
||||
}
|
||||
$distfile = "$4$5";
|
||||
$found = true;
|
||||
} else {
|
||||
die("$0: ERROR: Invalid GitHub URL: ${url}\n");
|
||||
}
|
||||
} else {
|
||||
$gh_project = ""; $gh_release = ""; $dist_subdir = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
if ($url =~ qr"^(.*/)(.*)$") {
|
||||
($master_sites, $distfile) = ($1, $2);
|
||||
@@ -328,11 +365,20 @@ sub generate_initial_package($) {
|
||||
print MF ("# \$Net" . "BSD\$\n");
|
||||
print MF ("\n");
|
||||
print_section(*MF, [
|
||||
(($gh_project ne "")
|
||||
? ["GITHUB_PROJECT", $gh_project]
|
||||
: ()),
|
||||
["DISTNAME", $distname],
|
||||
["CATEGORIES", $category],
|
||||
["MASTER_SITES", $master_sites],
|
||||
(($gh_release ne "")
|
||||
? ["GITHUB_RELEASE", $gh_release]
|
||||
: ()),
|
||||
(($dist_sufx ne ".tar.gz" && $dist_sufx ne ".gem")
|
||||
? ["EXTRACT_SUFX", $dist_sufx]
|
||||
: ()),
|
||||
(($dist_subdir ne "")
|
||||
? ["DIST_SUBDIR", $dist_subdir]
|
||||
: ())
|
||||
]);
|
||||
print_section(*MF, [
|
||||
@@ -377,6 +423,7 @@ sub adjust_package_from_extracted_distfiles()
|
||||
given ($f) {
|
||||
next when qr"^\.";
|
||||
next when 'pax_global_header';
|
||||
next when 'package.xml';
|
||||
next when qr".*\.gemspec";
|
||||
default { push(@files, $f) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user