]>
Commit | Line | Data |
---|---|---|
489bd56d ER |
1 | # TODO |
2 | # - python bindings fail in both cython and swig mode: | |
3 | # $ python -c "import plist" # cython | |
4 | # Traceback (most recent call last): | |
5 | # File "<string>", line 1, in <module> | |
6 | # ImportError: dynamic module does not define init function (initplist) | |
7 | # $ python -c "import plist" # swig | |
8 | # Traceback (most recent call last): | |
9 | # File "<string>", line 1, in <module> | |
10 | # File "/usr/lib64/python2.7/site-packages/plist/__init__.py", line 3, in <module> | |
11 | # File "/usr/lib64/python2.7/site-packages/plist/plist.py", line 26, in <module> | |
12 | # File "/usr/lib64/python2.7/site-packages/plist/plist.py", line 22, in swig_import_helper | |
13 | # ImportError: dynamic module does not define init function (init_plist) | |
486cfdf5 ER |
14 | # |
15 | # Conditional build: | |
0580d94b | 16 | %bcond_with swig # build with Swig |
486cfdf5 ER |
17 | %bcond_without cython # build with Cython |
18 | ||
7980613e MB |
19 | Summary: Library for manipulating Apple Property Lists |
20 | Summary(pl.UTF-8): Biblioteka do manipulowania Apple Property Lists | |
21 | Name: libplist | |
489bd56d | 22 | Version: 1.10 |
c958846a | 23 | Release: 2 |
7980613e MB |
24 | License: LGPL v2+ |
25 | Group: Libraries | |
489bd56d | 26 | # Source0Download: http://www.libimobiledevice.org/ |
a0267948 | 27 | Source0: http://www.libimobiledevice.org/downloads/%{name}-%{version}.tar.bz2 |
489bd56d | 28 | # Source0-md5: fe642d0c8602d70c408994555c330dd1 |
4987ce66 | 29 | URL: http://www.libimobiledevice.org/ |
a649e5ba | 30 | BuildRequires: cmake >= 2.8.2-2 |
7980613e | 31 | BuildRequires: glib2-devel >= 1:2.14.1 |
af989959 | 32 | BuildRequires: libstdc++-devel |
7980613e MB |
33 | BuildRequires: libxml2-devel >= 1:2.6.30 |
34 | BuildRequires: pkgconfig | |
486cfdf5 | 35 | %{?with_cython:BuildRequires: python-Cython} |
7980613e | 36 | BuildRequires: python-devel |
af989959 | 37 | BuildRequires: python-modules |
38 | BuildRequires: rpm-pythonprov | |
486cfdf5 ER |
39 | BuildRequires: rpmbuild(macros) >= 1.600 |
40 | %{?with_swig:BuildRequires: swig-python} | |
7980613e MB |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
42 | ||
43 | %description | |
44 | Library for manipulating Apple Property Lists in binary and XML | |
45 | format. | |
46 | ||
47 | %description -l pl.UTF-8 | |
48 | Biblioteka do manipulowania Apple Property Lists w formacie binarnym i | |
49 | XML. | |
50 | ||
51 | %package devel | |
52 | Summary: Header files for libplist library | |
53 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libplist | |
54 | Group: Development/Libraries | |
55 | Requires: %{name} = %{version}-%{release} | |
56 | Requires: glib2-devel >= 1:2.14.1 | |
57 | Requires: libxml2-devel >= 1:2.6.30 | |
58 | ||
59 | %description devel | |
60 | Header files for libplist library. | |
61 | ||
62 | %description devel -l pl.UTF-8 | |
63 | Pliki nagłówkowe biblioteki libplist. | |
64 | ||
65 | %package -n python-plist | |
66 | Summary: libplist Python bindings | |
67 | Summary(pl.UTF-8): Wiązania libplist dla Pythona | |
68 | Group: Development/Languages/Python | |
8d2cbeb9 | 69 | Requires: %{name} = %{version}-%{release} |
7980613e MB |
70 | |
71 | %description -n python-plist | |
72 | libplist Python bindings. | |
73 | ||
74 | %description -n python-plist -l pl.UTF-8 | |
75 | Wiązania libplist dla Pythona. | |
76 | ||
77 | %prep | |
78 | %setup -q | |
79 | ||
489bd56d ER |
80 | touch cython/*.py[xh] |
81 | ||
7980613e MB |
82 | %build |
83 | install -d build | |
84 | cd build | |
85 | %cmake \ | |
486cfdf5 ER |
86 | -DENABLE_SWIG=%{!?with_swig:NO}%{?with_swig:YES} \ |
87 | -DENABLE_CYTHON=%{!?with_cython:NO}%{?with_cython:YES} \ | |
7980613e MB |
88 | ../ |
89 | ||
90 | %{__make} | |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %{__make} -C build install \ | |
96 | DESTDIR=$RPM_BUILD_ROOT | |
97 | ||
98 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
99 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
100 | %py_postclean | |
101 | ||
486cfdf5 ER |
102 | # cmake sucks, fix perms |
103 | %if %{with cython} | |
104 | chmod a+x $RPM_BUILD_ROOT%{py_sitedir}/plist.so | |
d92842ba | 105 | cp -p cython/plist.pxd $RPM_BUILD_ROOT%{py_sitedir} |
486cfdf5 ER |
106 | %endif |
107 | %if %{with swig} | |
108 | chmod a+x $RPM_BUILD_ROOT%{py_sitedir}/plist/_plist.so | |
109 | %endif | |
110 | ||
7980613e MB |
111 | %clean |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %post -p /sbin/ldconfig | |
115 | %postun -p /sbin/ldconfig | |
116 | ||
117 | %files | |
118 | %defattr(644,root,root,755) | |
8d2cbeb9 | 119 | %doc AUTHORS NEWS README |
489bd56d | 120 | %attr(755,root,root) %{_bindir}/plistutil* |
7980613e MB |
121 | %attr(755,root,root) %{_libdir}/libplist++.so.*.*.* |
122 | %attr(755,root,root) %ghost %{_libdir}/libplist++.so.1 | |
123 | %attr(755,root,root) %{_libdir}/libplist.so.*.*.* | |
124 | %attr(755,root,root) %ghost %{_libdir}/libplist.so.1 | |
125 | ||
126 | %files devel | |
127 | %defattr(644,root,root,755) | |
128 | %attr(755,root,root) %{_libdir}/libplist++.so | |
129 | %attr(755,root,root) %{_libdir}/libplist.so | |
130 | %{_includedir}/plist | |
131 | %{_pkgconfigdir}/libplist++.pc | |
132 | %{_pkgconfigdir}/libplist.pc | |
133 | ||
486cfdf5 | 134 | %if %{with cython} || %{with swig} |
7980613e MB |
135 | %files -n python-plist |
136 | %defattr(644,root,root,755) | |
489bd56d | 137 | |
486cfdf5 ER |
138 | %if %{with cython} |
139 | %attr(755,root,root) %{py_sitedir}/plist.so | |
45f3789e | 140 | %{py_sitedir}/plist.pxd |
486cfdf5 | 141 | %endif |
489bd56d | 142 | |
486cfdf5 | 143 | %if %{with swig} |
7980613e MB |
144 | %dir %{py_sitedir}/plist |
145 | %attr(755,root,root) %{py_sitedir}/plist/_plist.so | |
146 | %{py_sitedir}/plist/*.py[co] | |
486cfdf5 | 147 | %endif |
489bd56d | 148 | |
486cfdf5 | 149 | %endif |