dev-php/spdx-licenses: Add 1.0.0 version
authorGuillaume Seren <guillaumeseren@gmail.com>
Thu, 24 Nov 2016 07:33:47 +0000 (08:33 +0100)
committerMichael Orlitzky <mjo@gentoo.org>
Sun, 18 Dec 2016 23:17:01 +0000 (18:17 -0500)
This is needed for composer-1.2.2, bug 439206.

Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
dev-php/spdx-licenses/Manifest [new file with mode: 0644]
dev-php/spdx-licenses/files/autoload.php [new file with mode: 0644]
dev-php/spdx-licenses/files/spdx-licenses-change-res-path.patch [new file with mode: 0644]
dev-php/spdx-licenses/metadata.xml [new file with mode: 0644]
dev-php/spdx-licenses/spdx-licenses-1.0.0.ebuild [new file with mode: 0644]

diff --git a/dev-php/spdx-licenses/Manifest b/dev-php/spdx-licenses/Manifest
new file mode 100644 (file)
index 0000000..5df1ea2
--- /dev/null
@@ -0,0 +1 @@
+DIST spdx-licenses-1.0.0.tar.gz 8244 SHA256 c292e3bfaa75b0e9b87b7426576a17390ca2f6df37ba002bd1d8561d0ffa4518 SHA512 1ef19555f252c5e03fe3b0376442f47bd50d894effa04bca58e7644e18fcc2a905239086d1aaf31277ce5928a7f9743e123c767e197c0fa063c015ad14851a14 WHIRLPOOL 6f69389f2fe5d55a729b10552cb2c54e8e6473fc5a9d9ace453de76f8bf6f89ae41135feeb89b833d025f8e4b25136730b4006ce0078eaceb236c5d1af52b7d2
diff --git a/dev-php/spdx-licenses/files/autoload.php b/dev-php/spdx-licenses/files/autoload.php
new file mode 100644 (file)
index 0000000..6ebf96e
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+/* Autoloader for composer/ca-bundle and its dependencies */
+
+if (!class_exists('Fedora\\Autoloader\\Autoload', false)) {
+    require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
+}
+
+\Fedora\Autoloader\Autoload::addPsr4('Composer\\Spdx\\', __DIR__);
diff --git a/dev-php/spdx-licenses/files/spdx-licenses-change-res-path.patch b/dev-php/spdx-licenses/files/spdx-licenses-change-res-path.patch
new file mode 100644 (file)
index 0000000..284cddd
--- /dev/null
@@ -0,0 +1,22 @@
+# Fix the path of res/
+
+--- ./src/SpdxLicenses.php        2015-07-15 19:38:14.000000000 +0200
++++ ./src/SpdxLicenses.php        2016-11-13 19:24:17.659442468 +0100
+@@ -170,7 +170,7 @@
+     private function loadLicenses()
+     {
+         if (null === $this->licenses) {
+-            $jsonFile = file_get_contents(__DIR__ . '/../res/spdx-licenses.json');
++            $jsonFile = file_get_contents(__DIR__ . '/res/spdx-licenses.json');
+             $this->licenses = json_decode($jsonFile, true);
+         }
+     }
+@@ -178,7 +178,7 @@
+     private function loadExceptions()
+     {
+         if (null === $this->exceptions) {
+-            $jsonFile = file_get_contents(__DIR__ . '/../res/spdx-exceptions.json');
++            $jsonFile = file_get_contents(__DIR__ . '/res/spdx-exceptions.json');
+             $this->exceptions = json_decode($jsonFile, true);
+         }
+     }
diff --git a/dev-php/spdx-licenses/metadata.xml b/dev-php/spdx-licenses/metadata.xml
new file mode 100644 (file)
index 0000000..36e603d
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>guillaumeseren@gmail.com</email>
+    <name>Guillaume Seren</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+  <longdescription>
+       Tools for working with the SPDX license list and validating licenses. 
+  </longdescription>
+</pkgmetadata>
diff --git a/dev-php/spdx-licenses/spdx-licenses-1.0.0.ebuild b/dev-php/spdx-licenses/spdx-licenses-1.0.0.ebuild
new file mode 100644 (file)
index 0000000..da59be8
--- /dev/null
@@ -0,0 +1,27 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+DESCRIPTION="Tools for working with the SPDX license list and validating licenses"
+HOMEPAGE="https://github.com/composer/spdx-licenses"
+SRC_URI="https://github.com/composer/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+       dev-lang/php:*
+       dev-php/fedora-autoloader"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-change-res-path.patch"
+)
+
+src_install() {
+       insinto "/usr/share/php/Composer/Spdx"
+       doins -r src/. res "${FILESDIR}"/autoload.php
+       dodoc README.md
+}