[Centos] php-snmp

Thu Sep 9 01:09:53 UTC 2004
John Newbigin <jn at it.swin.edu.au>

This is the patch that I apply to the php spec file.  As you can see, 
there is some support commented out.  The RH72 spec I think originally 
contained the --with config settings which I copied from there.  Perhaps 
RH9 would be a good place to look for EL3.

--- /tmp/jnewbigin/centosification/SPECS/php.spec       Tue Oct  1 
00:51:29 2002
+++ php/php-mod.spec    Tue Jul 20 13:59:21 2004
@@ -398,6 +398,9 @@
  %if %{oracle}
         --with-oci8=shared \
  %endif
+       --with-snmp=shared,%{_prefix} \
+       --with-snmp=shared \
+       --enable-ucd-snmp-hack \
         --with-pgsql=shared,%{_prefix} \
         --with-unixODBC=shared,%{_prefix} \
         $@
@@ -649,21 +652,21 @@

 
################################################################################
  # snmp 
#########################################################################
-#
-#%files snmp
-#      %defattr(-,root,root)
-#      %{_libdir}/php4/snmp.so
-#
-#
-#%post snmp
-#      %{__perl} -pi -e "s|^;extension=snmp.so|extension=snmp.so|" 
%{_sysconfdir}/php.ini
-#      %{__perl} -pi -e "s|^;extension=php_snmp.dll|extension=snmp.so|" 
%{_sysconfdir}/php.ini
-#
-#
-#%preun snmp
-#      if [ $1 = 0 -a -f %{_sysconfdir}/php.ini ] ; then
-#        %{__perl} -pi -e "s|^extension=snmp.so|;extension=snmp.so|" 
%{_sysconfdir}/php.ini
-#      fi
+
+%files snmp
+       %defattr(-,root,root)
+       %{_libdir}/php4/snmp.so
+
+
+%post snmp
+       %{__perl} -pi -e "s|^;extension=snmp.so|extension=snmp.so|" 
%{_sysconfdir}/php.ini
+       %{__perl} -pi -e "s|^;extension=php_snmp.dll|extension=snmp.so|" 
%{_sysconfdir}/php.ini
+
+
+%preun snmp
+       if [ $1 = 0 -a -f %{_sysconfdir}/php.ini ] ; then
+         %{__perl} -pi -e "s|^extension=snmp.so|;extension=snmp.so|" 
%{_sysconfdir}/php.ini
+       fi


 
################################################################################

Dan wrote:

> I took a look at the spec file and there was nothing about snmp
> commented out. So did a search for a spec file for EL3 and found one
> which had the snmp module set to build. Looked it over and copied what
> sections refer to snmp. When I add the line:
> %file snmp -f files.snmp
> I get the error-> Could not open %file
> /usr/src/redhat/BUILD/php-4.3.2/files.snmp: No such file or directory
> If I remove this line, I get an error about an upackaged file that is
> called snmp.o
> Reading up I found that if you receive the second error you need to add
> the  %file line for the file that is missing and that is what I did in
> the first place. I have never built my own rpm before so I am new to
> this. Any help would be appreciated.
> 
> Here is a link to the spec file http://traffic.wonderwave.net/php.spec
> 
> 
> Dan
> 
> On Tue, 2004-09-07 at 09:50, Dag Wieers wrote:
> 
>>On Tue, 7 Sep 2004, John Newbigin wrote:
>>
>>
>>>I have build php-snmp & php-oci8 for CentOS-2 but I assume you are
> 
> referring
> 
>>>to CentOS-3.1
>>>
>>>The CentOS-2 version is available under centos-2/extras/i386/ on the
> 
> centos
> 
>>>mirror.
>>
>>If you can send me the SPEC files, I can look into providing these for
>>el2.1 and el3 (i386, x86_64)
>>
>>Kind regards,
>>--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
>>[Any errors in spelling, tact or fact are transmission errors]
> 
> 
> _______________________________________________
> CentOS mailing list
> CentOS at caosity.org
> http://www.caosity.org/mailman/listinfo/centos
> 
> 
> 


-- 
John Newbigin - Computer Systems Officer
School of Information Technology
Swinburne University of Technology
Melbourne, Australia
http://www.it.swin.edu.au/staff/jnewbigin