]> git.pld-linux.org Git - packages/php-pecl-idn.git/commitdiff
- conf.d and php api macros
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 14 Sep 2005 13:37:00 +0000 (13:37 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    php-pecl-idn.spec -> 1.6

php-pecl-idn.spec

index bc243b070c178bd2b1f5872b480f65a1b35b1da0..6850c2ecfc76be0d064b0787c3ea43856de1582f 100644 (file)
@@ -1,5 +1,8 @@
 %define                _modname        idn
 %define                _status         beta
+%define                _sysconfdir     /etc/php
+%define                extensionsdir   %(php-config --extension-dir 2>/dev/null)
+
 Summary:       idn - binding to the GNU libidn
 Summary(pl):   idn - wi±zanie do GNU libidn
 Name:          php-pecl-idn
@@ -11,14 +14,13 @@ Source0:    http://pecl.php.net/get/%{_modname}-%{version}.tgz
 # Source0-md5: ef8635ec22348325a76abd2abddca4a1
 URL:           http://pecl.php.net/package/idn/
 BuildRequires: libidn-devel
-BuildRequires: php-devel
-Requires:      php-common
+BuildRequires: php-devel >= 3:5.0.0
+BuildRequires: rpmbuild(macros) >= 1.238
+%{?requires_php_extension}
+Requires:      %{_sysconfdir}/conf.d
 Obsoletes:     php-pear-idn
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _sysconfdir     /etc/php
-%define                extensionsdir   %{_libdir}/php
-
 %description
 Binding to the GNU libidn for using Internationalized Domain Names.
 
@@ -41,22 +43,29 @@ phpize
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{extensionsdir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/conf.d,%{extensionsdir}}
 
 install %{_modname}-%{version}/modules/%{_modname}.so $RPM_BUILD_ROOT%{extensionsdir}
+cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_modname}.ini
+; Enable %{_modname} extension module
+extension=%{_modname}.so
+EOF
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-%{_sbindir}/php-module-install install %{_modname} %{_sysconfdir}/php-cgi.ini
+[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
 
-%preun
-if [ "$1" = "0" ]; then
-       %{_sbindir}/php-module-install remove %{_modname} %{_sysconfdir}/php-cgi.ini
+%postun
+if [ "$1" = 0 ]; then
+       [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
+       [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
 fi
 
 %files
 %defattr(644,root,root,755)
 %doc %{_modname}-%{version}/CREDITS
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{_modname}.ini
 %attr(755,root,root) %{extensionsdir}/%{_modname}.so
This page took 0.09705 seconds and 4 git commands to generate.