]>
Commit | Line | Data |
---|---|---|
1e67d643 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
382d2064 | 5 | %define php_name php%{?php_suffix} |
fba179d7 | 6 | %define modname translit |
99d98d5e ER |
7 | Summary: %{modname} - transliterates non-latin character sets to latin |
8 | Summary(pl.UTF-8): %{modname} - translitacja alfabetów niełacińskich do łacińskiego | |
382d2064 | 9 | Name: %{php_name}-pecl-%{modname} |
3a9bf2c3 ER |
10 | Version: 0.6.2 |
11 | Release: 1 | |
0b399c4b AG |
12 | License: PHP |
13 | Group: Development/Languages/PHP | |
3a9bf2c3 ER |
14 | Source0: https://github.com/derickr/pecl-translit/archive/RELEASE_0_6_2.tar.gz |
15 | # Source0-md5: 599a00bb624d1ebc8440698aa89585dc | |
16 | URL: https://github.com/derickr/pecl-translit | |
6aaad9c6 | 17 | BuildRequires: %{php_name}-devel >= 3:5.0.4 |
f3dfaad1 | 18 | BuildRequires: libtool |
bde1698e | 19 | BuildRequires: rpmbuild(macros) >= 1.650 |
1e67d643 ER |
20 | %if %{with tests} |
21 | BuildRequires: %{php_name}-cli | |
22 | BuildRequires: %{php_name}-iconv | |
23 | %endif | |
f03978c1 | 24 | %{?requires_php_extension} |
382d2064 | 25 | Requires: %{php_name}-iconv |
3831f6a4 | 26 | Provides: php(%{modname}) = %{version} |
6aaad9c6 | 27 | Obsoletes: php-pecl-translit < 0.6.1-8 |
0b399c4b AG |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
0b399c4b AG |
30 | %description |
31 | This extension allows you to transliterate text in non-latin | |
32 | characters (such as Chinese, Cyrillic, Greek etc) to latin characters. | |
33 | Besides the transliteration the extension also contains filters to | |
34 | upper- and lowercase latin, cyrillic and greek, and perform special | |
35 | forms of transliteration such as converting ligatures such as the | |
76d977d1 JB |
36 | Norwegian "ae" ligature to separate "ae" characters and normalizing |
37 | punctuation and spacing. | |
0b399c4b | 38 | |
39336f6a JR |
39 | %description -l pl.UTF-8 |
40 | To rozszerzenie umożliwia transliterację tekstu ze znaków | |
41 | niełacińskich (takich jak chińskie, cyrilica, greckie) na znaki | |
42 | łacińskie. Oprócz transliteracji rozszerzenie zawiera także filtry na | |
43 | wielkie i małe litery łacińskie, cyrylicę i greckie oraz wykonuje | |
76d977d1 JB |
44 | specjalne formy transliteracji, takie jak konwersja ligatur takich jak |
45 | norweska ligatura "ae" na oddzielne znaki "ae" oraz normalizacja | |
39336f6a | 46 | znaków przestankowych i odstępów. |
76d977d1 | 47 | |
0b399c4b | 48 | %prep |
99d98d5e | 49 | %setup -qc |
3a9bf2c3 | 50 | mv pecl-translit-*/* . |
0b399c4b AG |
51 | |
52 | %build | |
0b399c4b AG |
53 | phpize |
54 | %configure | |
55 | %{__make} | |
56 | ||
1e67d643 ER |
57 | %if %{with tests} |
58 | # simple module load test | |
59 | %{__php} -n -q \ | |
60 | -d extension_dir=modules \ | |
61 | -d extension=%{php_extensiondir}/iconv.so \ | |
62 | -d extension=%{modname}.so \ | |
63 | -m > modules.log | |
64 | grep %{modname} modules.log | |
65 | ||
66 | cat <<'EOF' > run-tests.sh | |
67 | #!/bin/sh | |
68 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
69 | exec %{__make} test \ | |
70 | PHP_EXECUTABLE=%{__php} \ | |
71 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="iconv" \ | |
72 | RUN_TESTS_SETTINGS="-q $*" | |
73 | EOF | |
74 | chmod +x run-tests.sh | |
75 | ||
76 | ./run-tests.sh | |
77 | %endif | |
78 | ||
0b399c4b AG |
79 | %install |
80 | rm -rf $RPM_BUILD_ROOT | |
2623f792 | 81 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} |
0b399c4b | 82 | |
99d98d5e ER |
83 | install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir} |
84 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini | |
85 | ; Enable %{modname} extension module | |
86 | extension=%{modname}.so | |
f03978c1 | 87 | EOF |
0b399c4b AG |
88 | |
89 | %clean | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %post | |
2623f792 | 93 | %php_webserver_restart |
0b399c4b | 94 | |
f03978c1 ER |
95 | %postun |
96 | if [ "$1" = 0 ]; then | |
2623f792 | 97 | %php_webserver_restart |
0b399c4b AG |
98 | fi |
99 | ||
100 | %files | |
101 | %defattr(644,root,root,755) | |
99d98d5e ER |
102 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini |
103 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |