]> git.pld-linux.org Git - projects/template-specs.git/blob - php-pear.spec
- update pear
[projects/template-specs.git] / php-pear.spec
1 #
2 # NOTE
3 # - You should use pear instead of this template to create new specs:
4 #   $ pear download PEAR_PackageFileManager2
5 #   $ pear make-rpm-spec PEAR_PackageFileManager2-1.0.1.tgz
6 #   Wrote RPM spec file php-pear-PEAR_PackageFileManager2.spec
7 #
8 #   This file exists just for a reference when updating existing packages
9 #
10 %include        /usr/lib/rpm/macros.php
11 %define         _class          class
12 %define         _subclass       subclass
13 %define         _status         stable
14 %define         _pearname       %{_class}_%{_subclass}
15 Summary:        %{_pearname} -
16 Summary(pl.UTF-8):      %{_pearname} -
17 Name:           php-pear-%{_pearname}
18 Version:        0.2.0
19 Release:        1
20 License:        PHP 2.02
21 Group:          Development/Languages/PHP
22 Source0:        http://pear.php.net/get/%{_pearname}-%{version}.tgz
23 URL:            http://pear.php.net/package/Class_Subclass/
24 BuildRequires:  php-packagexml2cl
25 BuildRequires:  php-pear-PEAR
26 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
27 BuildRequires:  rpmbuild(macros) >= 1.593
28 Requires:       php-pear
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 # exclude optional dependencies
33 %define         _noautoreq      pear(XML/Beautifier/.*)
34
35 # included in tests
36 %define         _noautoreq pear(HTML_TestListener.php) pear(TestUnit.php)
37
38 %description
39 ...
40
41 In PEAR status of this package is: %{_status}.
42
43 %description -l pl.UTF-8
44 ...
45
46 Ta klasa ma w PEAR status: %{_status}.
47
48 %package tests
49 Summary:        Tests for PEAR::%{_pearname}
50 Summary(pl.UTF-8):      Testy dla PEAR::%{_pearname}
51 Group:          Development/Languages/PHP
52 Requires:       %{name} = %{version}-%{release}
53 AutoProv:       no
54 AutoReq:        no
55
56 %description tests
57 Tests for PEAR::%{_pearname}.
58
59 %description tests -l pl.UTF-8
60 Testy dla PEAR::%{_pearname}.
61
62 %prep
63 %pear_package_setup
64
65 # optional ext not reported properly. do it manually
66 echo '%{name} can optionally use PHP extension "mhash"' >> install.log
67
68 ## docs fixups
69
70 # pear/docs -> docs
71 install -d docs/%{_pearname}
72 mv ./%{php_pear_dir}/%{_class}/doc/* docs/%{_pearname}
73
74 # pear/docs -> docs
75 install -d docs/%{_pearname}
76 mv ./%{php_pear_dir}/docs/%{_pearname}/* docs/%{_pearname}
77
78 # pear/data/docs -> docs
79 install -d docs/%{_pearname}
80 mv ./%{php_pear_dir}/data/%{_pearname}/docs/* docs/%{_pearname}
81
82 # tests fixups
83 # class/test -> tests
84 install -d ./%{php_pear_dir}/tests/%{_pearname}
85 mv ./%{php_pear_dir}/{%{_class}/test/*,tests/%{_pearname}}
86
87 # pear/tests/pearname/tests -> pear/tests/pearname
88 mv ./%{php_pear_dir}/tests/%{_pearname}/{tests/*,}
89 rmdir ./%{php_pear_dir}/tests/%{_pearname}/tests
90
91 # docs/tests -> tests
92 install -d ./%{php_pear_dir}/tests/%{_pearname}
93 mv docs/%{_pearname}/tests/* ./%{php_pear_dir}/tests/%{_pearname}
94
95 # tests -> tests/%{_pearname}
96 install -d ./%{php_pear_dir}/tests/%{_pearname}
97 mv ./%{php_pear_dir}/tests/{*,%{_pearname}}
98
99 # examples fixups
100 mv ./%{php_pear_dir}/examples .
101 mv ./%{php_pear_dir}/%{_class}/examples .
102 mv docs/%{_pearname}/examples .
103 mv docs/%{_pearname}/docs/examples .
104
105 %build
106 packagexml2cl package.xml > ChangeLog
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 install -d $RPM_BUILD_ROOT%{php_pear_dir}
111 install -d $RPM_BUILD_ROOT{%{php_pear_dir},%{_examplesdir}/%{name}-%{version}}
112 %pear_package_install
113
114 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_pear_dir}}
115 install -p ./%{_bindir}/* $RPM_BUILD_ROOT%{_bindir}
116
117 install -d $RPM_BUILD_ROOT{%{php_pear_dir},%{_bindir},%{_examplesdir}/%{name}-%{version}}
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
119 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124 %post -p <lua>
125 %pear_package_print_optionalpackages
126
127 %files
128 %defattr(644,root,root,755)
129 %doc ChangeLog install.log optional-packages.txt
130 %doc docs/%{_pearname}/docs/*
131 %attr(755,root,root) %{_bindir}/*
132 %{php_pear_dir}/.registry/*.reg
133 %{php_pear_dir}/.registry/.channel.*/*.reg
134 %{php_pear_dir}/%{_class}/*.php
135
136 %{php_pear_dir}/data/%{_pearname}
137
138 %{_examplesdir}/%{name}-%{version}
139
140 %files tests
141 %defattr(644,root,root,755)
142 %{php_pear_dir}/tests/%{_pearname}
This page took 0.072 seconds and 4 git commands to generate.