summaryrefslogtreecommitdiffstats
path: root/php-natxet-cssmin.spec
blob: 805ac32c78bfc088994547b9a74f2c706d2f51f6 (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
103
104
105
106
107
108
109
110
# remirepo spec file for php-natxet-cssmin, from:
#
# Fedora spec file for php-natxet-cssmin
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#
%global github_owner    natxet
%global github_name     CssMin
%global github_version  3.0.6
%global github_commit   d5d9f4c3e5cedb1ae96a95a21731f8790e38f1dd
# if set, will be a post-release snapshot build, otherwise a 'normal' build
#global github_date     20141229
%global shortcommit %(c=%{github_commit}; echo ${c:0:7})
%global packagist_owner natxet
%global packagist_name  CssMin

%global lcname  %(echo %{packagist_name} | tr '[:upper:]' '[:lower:]')

# phpci
%global php_min_ver    5.0.0

Name:           php-%{packagist_owner}-%{lcname}
Version:        %{github_version}
Release:        1%{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
Summary:        Configurable CSS parser and minifier

# License text is included in the sole code file
License:        MIT
URL:            https://github.com/%{github_owner}/%{github_name}
# Must use commit-based not tag-based github tarball:
# https://fedoraproject.org/wiki/Packaging:SourceURL#Github
Source0:        https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz

BuildArch:      noarch
BuildRequires:  php-cli
BuildRequires:  php-pcre

Requires:       php(language) >= %{php_min_ver}
Requires:       php-pcre

Provides:       php-composer(%{packagist_owner}/%{packagist_name}) = %{version}

BuildRequires: %{_bindir}/phpab


%description
CssMin is a css parser and minifier. It minifies css by removing
unneeded whitespace characters, comments, empty blocks and empty
declarations. In addition declaration values can get rewritten to
shorter notation if available. The minification is configurable. 


%prep
%setup -qn %{github_name}-%{github_commit}


%build
# From composer.json, "autoload": {
 #        "classmap": ["src/"]
 %{_bindir}/phpab --quiet --nolower --output ./autoload.php ./


%install
mkdir -p %{buildroot}%{_datadir}/php/%{packagist_owner}/%{packagist_name}
cp -pr src/ %{buildroot}%{_datadir}/php/%{packagist_owner}/%{packagist_name}
cp -p autoload.php %{buildroot}%{_datadir}/php/%{packagist_owner}/%{packagist_name}


%check
# Minimal test for our autoloader
php -r '
  require "%{buildroot}%{_datadir}/php/%{packagist_owner}/%{packagist_name}/autoload.php";
  exit(class_exists("CssMin") ? 0 : 1);
'


%files
%doc README composer.json
%{_datadir}/php/%{packagist_owner}


%changelog
* Tue Mar 26 2019 Remi Collet <remi@remirepo.net> - 3.0.6-1
- update to 3.0.6
- add minimal test for our autoloader

* Tue May  3 2016 Remi Collet <remi@fedoraproject.org> - 3.0.4-3
- rebuild

* Mon Apr 25 2016 James Hogarth <james.hogarth@gmail.com> - 3.0.4-1
- new release 3.0.4
- Add simple classmap autoloader

* Thu Oct 15 2015 Remi Collet <remi@fedoraproject.org> - 3.0.4-1
- update to 3.0.4

* Tue Jun 09 2015 Adam Williamson <awilliam@redhat.com> - 3.0.3-1
- new release 3.0.3

* Tue Feb 24 2015 Remi Collet <remi@fedoraproject.org> - 3.0.2-2.20141229git8883d28
- add backport stuff for remi repo

* Mon Feb 23 2015 Adam Williamson <awilliam@redhat.com> - 3.0.2-2.20141229git8883d28
- change layout to match upstream's (with the /src sub-directory)

* Mon Dec 29 2014 Adam Williamson <awilliam@redhat.com> - 3.0.2-1.20141229git8883d28
- initial package