Author: glen                         Date: Wed Feb 16 18:48:49 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- apache version independance
- use _sysconfdir macro
- update descriptions for url and dot issue
- fix path to sql scripts emited in post script

---- Files affected:
SPECS:
   horde.spec (1.60 -> 1.61) 

---- Diffs:

================================================================
Index: SPECS/horde.spec
diff -u SPECS/horde.spec:1.60 SPECS/horde.spec:1.61
--- SPECS/horde.spec:1.60       Sun Feb 13 23:46:52 2005
+++ SPECS/horde.spec    Wed Feb 16 19:48:44 2005
@@ -9,7 +9,7 @@
 Summary(pt_BR):        Componentes comuns do Horde usados por todos os módulos
 Name:          horde
 Version:       3.0.3
-Release:       2
+Release:       2.5
 License:       LGPL
 Vendor:                The Horde Project
 Group:         Development/Languages/PHP
@@ -18,10 +18,12 @@
 Source1:       %{name}.conf
 Patch0:                %{name}-path.patch
 URL:           http://www.horde.org/
+BuildRequires: rpmbuild(macros) >= 1.177
 BuildRequires: rpm-php-pearprov >= 4.0.2-98
 PreReq:                apache-mod_dir >= 1.3.22
-Requires(post):        grep
-Requires:      apache >= 1.3.22
+Requires(triggerpostun):       grep
+Requires(triggerpostun):       sed >= 4.0
+Requires:      apache >= 1.3.33-2
 Requires:      php >= 4.1.0
 Requires:      php-gettext >= 4.1.0
 Requires:      php-imap >= 4.1.0
@@ -54,6 +56,10 @@
 Requires:      php-domxml
 %endif
 
+%define                _apache1dir     /etc/apache
+%define                _apache2dir     /etc/httpd
+%define                _sysconfdir     /etc/horde.org
+
 %description
 The Horde Framework provides a common structure and interface for
 Horde modules (such as IMP, a web-based mail program). This RPM is
@@ -61,7 +67,7 @@
 
 The Horde Project writes web applications in PHP and releases them
 under the GNU Public License. For more information (including help
-with Horde and its modules) please visit http://www.horde.org/ .
+with Horde and its modules) please visit <http://www.horde.org/>.
 
 %description -l pl
 Szkielet Horde dostarcza wspólną strukturę oraz interfejs dla modułów
@@ -70,7 +76,7 @@
 
 Projekt Horde tworzy aplikacje w PHP i dostarcza je na licencji GNU
 Public License. Jeżeli chcesz się dowiedzieć czegoś więcej (także help
-do IMP-a) zajrzyj na stronę http://www.horde.org/ .
+do IMP-a) zajrzyj na stronę <http://www.horde.org/>.
 
 %description -l pt_BR
 Este pacote provę uma interface e estrutura comuns para os módulos
@@ -80,7 +86,7 @@
 O Projeto Horde é constituído por diversos aplicativos web escritos em
 PHP, todos liberados sob a GPL. Para mais informaçőes (incluindo ajuda
 com relaçăo ao Horde e seus módulos), por favor visite
-http://www.horde.org/ .
+<http://www.horde.org/>.
 
 %prep
 %setup -q
@@ -88,9 +94,9 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{apachedir},%{confdir}/horde} \
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/horde \
        $RPM_BUILD_ROOT%{hordedir}/{admin,js,lib,locale,services} \
-       $RPM_BUILD_ROOT%{hordedir}/{templates,themes,util}
+       $RPM_BUILD_ROOT%{hordedir}/{templates,themes,util} \
 
 cp -pR scripts docs
 cp -pR *.php                   $RPM_BUILD_ROOT%{hordedir}
@@ -102,72 +108,96 @@
        cp -p $i/.htaccess      $RPM_BUILD_ROOT%{hordedir}/$i
 done
 
-cp -pR config/*.php.dist       $RPM_BUILD_ROOT%{confdir}/horde
-cp -p  config/.htaccess                $RPM_BUILD_ROOT%{confdir}/horde
-cp -p  config/*.xml            $RPM_BUILD_ROOT%{confdir}/horde
+cp -pR config/*.php.dist       $RPM_BUILD_ROOT%{_sysconfdir}/horde
+cp -p  config/.htaccess                $RPM_BUILD_ROOT%{_sysconfdir}/horde
+cp -p  config/*.xml            $RPM_BUILD_ROOT%{_sysconfdir}/horde
 
-install        %{SOURCE1}              $RPM_BUILD_ROOT%{apachedir}
-ln -fs %{confdir}/%{name}      $RPM_BUILD_ROOT%{hordedir}/config
+install        %{SOURCE1}              
$RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+ln -fs %{_sysconfdir}/%{name}  $RPM_BUILD_ROOT%{hordedir}/config
 
 # Described in documentation as dangerous file...
 rm $RPM_BUILD_ROOT%{hordedir}/test.php
 
 # bit unclean..
-cd $RPM_BUILD_ROOT%{confdir}/horde
+cd $RPM_BUILD_ROOT%{_sysconfdir}/horde
 for i in *.dist; do cp $i `basename $i .dist`; done
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" 
/etc/httpd/httpd.conf; then
-       echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
-       if [ -f /var/lock/subsys/httpd ]; then
-               /usr/sbin/apachectl restart 1>&2
+# apache1
+if [ -d %{_apache1dir}/conf.d ]; then
+       ln -sf %{_sysconfdir}/apache.conf %{_apache1dir}/conf.d/99_%{name}.conf
+       if [ -f /var/lock/subsys/apache ]; then
+               /etc/rc.d/init.d/apache restart 1>&2
        fi
-elif [ -d /etc/httpd/httpd.conf ]; then
-       ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
+fi
+# apache2
+if [ -d %{_apache2dir}/httpd.conf ]; then
+       ln -sf %{_sysconfdir}/apache.conf 
%{_apache2dir}/httpd.conf/99_%{name}.conf
        if [ -f /var/lock/subsys/httpd ]; then
-               /usr/sbin/apachectl restart 1>&2
+               /etc/rc.d/init.d/httpd restart 1>&2
        fi
 fi
 
-cat <<_EOF2_
+%banner %{name} -e <<EOF
 IMPORTANT:
-If you are installing for the first time, you must now
+If you are installing for the first time, You must now
 create the Horde database tables. Look into directory
-/usr/share/doc/%{name}-%{version}/scripts/db
+/usr/share/doc/%{name}-%{version}/scripts/sql
 to find out how to do this for your database.
-_EOF2_
+EOF
 
 %preun
 if [ "$1" = "0" ]; then
-       umask 027
-       if [ -d /etc/httpd/httpd.conf ]; then
-           rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-       else
-               grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
-                       /etc/httpd/httpd.conf.tmp
-               mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
+       # apache1
+       if [ -d %{_apache1dir}/conf.d ]; then
+               rm -f %{_apache1dir}/conf.d/99_%{name}.conf
+               if [ -f /var/lock/subsys/apache ]; then
+                       /etc/rc.d/init.d/apache restart 1>&2
+               fi
        fi
-       if [ -f /var/lock/subsys/httpd ]; then
-           /usr/sbin/apachectl restart 1>&2
+       # apache2
+       if [ -d %{_apache2dir}/httpd.conf ]; then
+               rm -f %{_apache2dir}/httpd.conf/99_%{name}.conf
+               if [ -f /var/lock/subsys/httpd ]; then
+                       /etc/rc.d/init.d/httpd restart 1>&2
+               fi
        fi
 fi
 
 %triggerpostun -- horde <= 2.2.7-2
 for i in horde.php html.php lang.php mime_drivers.php mime_mapping.php 
motd.php prefs.php registry.php; do
        if [ -f /home/services/httpd/html/horde/config/$i.rpmsave ]; then
-               cp -f %{confdir}/%{name}/$i %{confdir}/%{name}/$i.rpmnew
-               mv -f /home/services/httpd/html/horde/config/$i.rpmsave 
%{confdir}/%{name}/$i
+               cp -f %{_sysconfdir}/%{name}/$i %{_sysconfdir}/%{name}/$i.rpmnew
+               mv -f /home/services/httpd/html/horde/config/$i.rpmsave 
%{_sysconfdir}/%{name}/$i
        fi
 done
- 
+
+%triggerpostun -- horde <= 3.0.3-2
+set -x
+# apache1 confdir
+if [ -f /etc/apache/apache.conf ] && grep -q '^Include conf\.d' 
/etc/apache/apache.conf; then
+       sed -i -e '
+               /^Include.*mod_horde\.conf/d
+       ' /etc/apache/apache.conf
+else
+       # they're still using old apache.conf
+       sed -i -e '
+               s,^Include.*mod_horde\.conf,Include 
%{_sysconfdir}/conf.d/*_mod_horde.conf,
+       ' /etc/apache/apache.conf
+fi
+
+if [ -f /var/lock/subsys/apache ]; then
+       /etc/rc.d/init.d/apache restart 1>&2
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc README 
docs/{HACKING,CONTRIBUTING,CODING_STANDARDS,CHANGES,INSTALL,scripts}
 %dir %{hordedir}
-%dir %{confdir}
+%dir %{_sysconfdir}
 %{hordedir}/*.php
 %{hordedir}/admin
 %{hordedir}/config
@@ -178,12 +208,12 @@
 %{hordedir}/templates
 %{hordedir}/themes
 %{hordedir}/util
-%attr(640,root,http) %config(noreplace) %{apachedir}/horde.conf
-%attr(770,root,http) %dir %{confdir}/horde
-%attr(640,root,http) %{confdir}/horde/*.dist
-%attr(660,root,http) %config(noreplace) %{confdir}/horde/*.php
-%attr(640,root,http) %config(noreplace) %{confdir}/horde/.htaccess
-%attr(660,root,http) %config(noreplace) %{confdir}/horde/*.xml
+%attr(640,root,http) %config(noreplace) %{_sysconfdir}/apache.conf
+%attr(770,root,http) %dir %{_sysconfdir}/horde
+%attr(640,root,http) %{_sysconfdir}/horde/*.dist
+%attr(660,root,http) %config(noreplace) %{_sysconfdir}/horde/*.php
+%attr(640,root,http) %config(noreplace) %{_sysconfdir}/horde/.htaccess
+%attr(660,root,http) %config(noreplace) %{_sysconfdir}/horde/*.xml
 
 %define date   %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -191,6 +221,12 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.61  2005/02/16 18:48:44  glen
+- apache version independance
+- use _sysconfdir macro
+- update descriptions for url and dot issue
+- fix path to sql scripts emited in post script
+
 Revision 1.60  2005/02/13 22:46:52  matipl
 - repair check php ver for requires XML (php-dom for 5 or php-domxml for 4)
 - STBR
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/horde.spec?r1=1.60&r2=1.61&f=u


_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to