summaryrefslogtreecommitdiffstats
path: root/php-lukasreschke-id3parser.spec
blob: f5c6d97686e3160cec95c6a020b19e5c1ac12bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# remirepo/fedora spec file for php-lukasreschke-id3parser
#
# Copyright (c) 2016-2017 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global gh_commit    62f4de76d4eaa9ea13c66dacc1f22977dace6638
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner     LukasReschke
%global gh_project   ID3Parser
%global pk_owner     lukasreschke
%global pk_project   id3parser

Name:           php-%{pk_owner}-%{pk_project}
Version:        0.0.3
Release:        1%{?dist}
Summary:        ID3 parser library

Group:          Development/Libraries
# https://github.com/LukasReschke/ID3Parser/issues/1
License:        GPL+
URL:            https://github.com/%{gh_owner}/%{gh_project}
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

BuildRequires:  php(language) >= 5.4
BuildRequires:  %{_bindir}/phpab
BuildRequires:  %{_bindir}/php

# From composer.json, "require": {
#        "php": ">=5.4"
Requires:       php(language) >= 5.4
# From phpcompatifo report for 0.0.1
Requires:       php-date
Requires:       php-iconv
Requires:       php-pcre
Requires:       php-xml
Requires:       php-zlib

Provides:       php-composer(%{pk_owner}/%{pk_project}) = %{version}


%description
This is a pure ID3 parser based upon getID3.
It supports the following ID3 versions inside MP3 files:

* ID3v1 (v1.0 & v1.1)
* ID3v2 (v2.2, v2.3 & v2.4)

Autoloader: %{_datadir}/php/%{gh_project}/autoload.php


%prep
%setup -q -n %{gh_project}-%{gh_commit}


%build
: Generate autoloader
%{_bindir}/phpab --output src/autoload.php src


%install
rm -rf     %{buildroot}
mkdir -p   %{buildroot}%{_datadir}/php
cp -pr src %{buildroot}%{_datadir}/php/%{gh_project}


%check
: Check our autoloader
%{_bindir}/php -r '
  require "%{buildroot}%{_datadir}/php/%{gh_project}/autoload.php";
  $analyzer = new \ID3Parser\ID3Parser();
'


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md composer.json
%{_datadir}/php/%{gh_project}


%changelog
* Fri Sep 23 2016 Remi Collet <remi@fedoraproject.org> - 0.0.3-1
- update to 0.0.3

* Wed Sep  7 2016 Remi Collet <remi@fedoraproject.org> - 0.0.2-1
- update to 0.0.2 (no change)
- add upstream LICENSE file

* Tue May 31 2016 Remi Collet <remi@fedoraproject.org> - 0.0.1-1
- initial package