Logoj0ke.net Open Build Service > Projects > server:php:applications > php5-pear-xml_serializer > Changes
Sign Up | Log In

Changes of Revision 3

[-] Added php5-pear-xml_serializer.spec
x
 
1
@@ -0,0 +1,107 @@
2
+#
3
+# spec file for package php5-pearl-xml_serializer
4
+#
5
+# This file and all modifications and additions to the pristine
6
+# package are under the same license as the package itself.
7
+#
8
+
9
+
10
+# norootforbuild
11
+
12
+
13
+Name:               php5-pear-xml_serializer
14
+Version:            0.18.0
15
+Release:            0
16
+Summary:            Swiss-army knife for reading and writing XML files. Creates XML files from data structures and vice versa
17
+License:            PHP License
18
+Group:              Development/Libraries/PHP
19
+Url:                http://pear.php.net/package/XML_Serializer
20
+Source0:            http://download.pear.php.net/package/XML_Serializer-%version.tgz
21
+BuildArch:          noarch
22
+PreReq:             php5-pear
23
+BuildRequires:      php5-pear
24
+BuildRoot:          %{_tmppath}/%{name}-%{version}-build
25
+%define             peardir %(pear config-get php_dir 2> /dev/null)
26
+%define             xmldir  %{_var}/lib/pear
27
+
28
+%description
29
+XML_Serializer serializes complex data structures like arrays or object as XML
30
+documents.  
31
+
32
+This class helps you generating any XML document you require without the need 
33
+for DOM.  
34
+
35
+Furthermore this package can be used as a replacement to serialize() and 
36
+unserialize() as it comes with a matching XML_Unserializer that is able to 
37
+create PHP data structures (like arrays and objects) from XML documents, if 
38
+type hints are available.  
39
+
40
+If you use the XML_Unserializer on standard XML files, it will try to guess 
41
+how it has to be unserialized. In most cases it does exactly what you expect 
42
+it to do.  Try reading a RSS file with XML_Unserializer and you have the whole 
43
+RSS file in a structured array or even a collection of objects, 
44
+similar to XML_RSS.
45
+
46
+Since version 0.8.0 the package is able to treat XML documents similar to the
47
+simplexml extension of PHP 5.
48
+
49
+Author:
50
+-------
51
+    Stephan Schmidt
52
+
53
+
54
+%prep
55
+%setup -c -T
56
+pear -v -c pearrc \
57
+        -d php_dir=%{peardir} \
58
+        -d doc_dir=%_defaultdocdir/%name \
59
+        -d bin_dir=%{_bindir} \
60
+        -d data_dir=%{peardir}/data \
61
+        -d test_dir=%{peardir}/tests \
62
+        -d ext_dir=%{_libdir} \
63
+        -s
64
+
65
+%build
66
+
67
+
68
+%install
69
+pear -c pearrc install --offline --nodeps --packagingroot %buildroot %{SOURCE0}
70
+%__rm -rf %buildroot/%peardir/.{filemap,lock,registry,channels,depdb,depdblock}
71
+
72
+# Install XML package description
73
+%__mkdir_p %buildroot%{xmldir}
74
+%__tar -xzf %{SOURCE0} package.xml
75
+%__cp package.xml %buildroot%xmldir/XML_Serializer.xml
76
+
77
+# fix todo: move it to defaultdocdir
78
+mkdir -p %buildroot%_defaultdocdir/%name
79
+mv %buildroot%peardir/data/XML_Serializer/doc/todo.txt %buildroot%_defaultdocdir/%name/
80
+rm -rf %buildroot%peardir/data
81
+# fix defaultdocdir
82
+mv %buildroot%_defaultdocdir/%name/XML_Serializer/* %buildroot%_defaultdocdir/%name/
83
+rm -rf %buildroot%_defaultdocdir/%name/XML_Serializer
84
+
85
+%clean
86
+%__rm -rf %{buildroot}
87
+
88
+
89
+%post
90
+pear install --nodeps --soft --force --register-only %{xmldir}/XML_Serializer.xml
91
+
92
+
93
+%postun
94
+if [ "$1" -eq "0" ]; then
95
+    pear uninstall --nodeps --ignore-errors --register-only pear.php.net/XML_Serializer
96
+fi
97
+
98
+
99
+%files
100
+%defattr(-, root, root)
101
+%doc %_defaultdocdir/%name
102
+%dir %peardir/XML
103
+%peardir/XML/Serializer.php
104
+%peardir/XML/Unserializer.php
105
+%xmldir/XML_Serializer.xml
106
+
107
+
108
+%changelog
109