]> git.pld-linux.org Git - packages/libpst.git/blob - libpst.spec
fc47dcfae50ba30b418418f3ee0f8a485ff65895
[packages/libpst.git] / libpst.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # CPython 2.x module
4 %bcond_without  python3         # CPython 3.x module
5 %bcond_without  static_libs     # don't build static libraries
6 #
7 Summary:        Library for reading .pst files
8 Summary(pl.UTF-8):      Biblioteka do czytania plików .pst
9 Name:           libpst
10 Version:        0.6.76
11 Release:        3
12 License:        GPL v2+
13 Group:          Libraries
14 Source0:        https://www.five-ten-sg.com/libpst/packages/%{name}-%{version}.tar.gz
15 # Source0-md5:  e821b94e8d7790ee314059f751182ebf
16 Patch0:         python3.10.patch
17 URL:            https://www.five-ten-sg.com/libpst/
18 BuildRequires:  ImageMagick
19 BuildRequires:  autoconf >= 2.60
20 BuildRequires:  automake
21 BuildRequires:  gd-devel
22 BuildRequires:  libgsf-devel
23 BuildRequires:  libstdc++-devel
24 BuildRequires:  libtool >= 2:1.5
25 BuildRequires:  pkgconfig
26 %if %{with python2}
27 BuildRequires:  boost-python-devel
28 BuildRequires:  python-devel >= 2
29 BuildRequires:  python-modules >= 2
30 %endif
31 %if %{with python3}
32 BuildRequires:  boost-python3-devel
33 BuildRequires:  python3-devel >= 1:3.2
34 BuildRequires:  python3-modules >= 1:3.2
35 %endif
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  zlib-devel
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 Library for reading PST (MS Outlook Personal Folders) files.
42
43 %description -l pl.UTF-8
44 Biblioteka do czytania plików .pst.
45
46 %package devel
47 Summary:        Header files for libpst library
48 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libpst
49 Group:          Development/Libraries
50 Requires:       %{name} = %{version}-%{release}
51
52 %description devel
53 Header files for libpst library.
54
55 %description devel -l pl.UTF-8
56 Pliki nagłówkowe biblioteki libpst.
57
58 %package static
59 Summary:        Static libpst library
60 Summary(pl.UTF-8):      Statyczna biblioteka libpst
61 Group:          Development/Libraries
62 Requires:       %{name}-devel = %{version}-%{release}
63
64 %description static
65 Static libpst library.
66
67 %description static -l pl.UTF-8
68 Statyczna biblioteka libpst.
69
70 %package tools
71 Summary:        Utilities for converting Microsoft Outlook .pst files
72 Summary(pl.UTF-8):      Narzędzia do konwertowania plików .pst Microsoft Outlooka
73 Group:          Applications
74 Requires:       %{name} = %{version}-%{release}
75 Requires:       ImageMagick
76 Obsoletes:      readpst
77
78 %description tools
79 Utilities for converting Microsoft Outlook .pst files.
80
81 %description tools -l pl.UTF-8
82 Narzędzia do konwertowania plików .pst Microsoft Outlooka.
83
84 %package -n python-libpst
85 Summary:        libpst Python 2 bindings
86 Summary(pl.UTF-8):      Wiązania libpst dla Pythona 2
87 Group:          Development/Languages/Python
88
89 %description -n python-libpst
90 libpst Python 2 bindings.
91
92 %description -n python-libpst -l pl.UTF-8
93 Wiązania libpst dla Pythona 2.
94
95 %package -n python3-libpst
96 Summary:        libpst Python 3 bindings
97 Summary(pl.UTF-8):      Wiązania libpst dla Pythona 3
98 Group:          Development/Languages/Python
99
100 %description -n python3-libpst
101 libpst Python 3 bindings.
102
103 %description -n python3-libpst -l pl.UTF-8
104 Wiązania libpst dla Pythona 3.
105
106 %prep
107 %setup -q
108 %patch0 -p1
109
110 %build
111 %{__libtoolize}
112 %{__aclocal} -I m4
113 %{__autoconf}
114 %{__autoheader}
115 %{__automake}
116 %configure \
117         %{!?with_static_libs:--disable-static} \
118         --enable-dii \
119         --enable-libpst-shared \
120         %{!?with_python3:--disable-python}
121
122 %{__make}
123
124 %if %{with python2}
125 install -d build-py2
126 ./libtool --mode=compile %{__cxx} %{rpmcxxflags} %{rpmcppflags} -I. -Isrc -I%{py_incdir} -o build-py2/python-libpst.lo -c python/python-libpst.cpp
127 ./libtool --mode=link %{__cxx} -shared -module -avoid-version -rpath %{py_sitedir} %{rpmldflags} %{rpmcxxflags} -o build-py2/_libpst.la build-py2/python-libpst.lo src/libpst.la -lboost_python%(echo %{py_ver} | tr -d .)
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 %{__make} install \
134         DESTDIR=$RPM_BUILD_ROOT
135
136 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_libpst.la
137 %if %{with static_libs}
138 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_libpst.a
139 %endif
140
141 %if %{with python2}
142 install -d $RPM_BUILD_ROOT%{py_sitedir}
143 ./libtool --mode=install install build-py2/_libpst.la $RPM_BUILD_ROOT%{py_sitedir}
144 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_libpst.la
145 %endif
146
147 # packaged as %doc (split into base and -devel)
148 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
149
150 %clean
151 rm -rf $RPM_BUILD_ROOT
152
153 %post   -p /sbin/ldconfig
154 %postun -p /sbin/ldconfig
155
156 %files
157 %defattr(644,root,root,755)
158 %doc AUTHORS ChangeLog NEWS README TODO
159 %attr(755,root,root) %{_libdir}/libpst.so.*.*.*
160 %attr(755,root,root) %ghost %{_libdir}/libpst.so.4
161
162 %files devel
163 %defattr(644,root,root,755)
164 %doc html/*.html html/devel
165 %attr(755,root,root) %{_libdir}/libpst.so
166 %{_libdir}/libpst.la
167 %{_includedir}/libpst-4
168 %{_pkgconfigdir}/libpst.pc
169
170 %if %{with static_libs}
171 %files static
172 %defattr(644,root,root,755)
173 %{_libdir}/libpst.a
174 %endif
175
176 %files tools
177 %defattr(644,root,root,755)
178 %attr(755,root,root) %{_bindir}/lspst
179 %attr(755,root,root) %{_bindir}/nick2ldif
180 %attr(755,root,root) %{_bindir}/pst2dii
181 %attr(755,root,root) %{_bindir}/pst2ldif
182 %attr(755,root,root) %{_bindir}/readpst
183 %{_mandir}/man1/lspst.1*
184 %{_mandir}/man1/pst2dii.1*
185 %{_mandir}/man1/pst2ldif.1*
186 %{_mandir}/man1/readpst.1*
187 %{_mandir}/man5/outlook.pst.5*
188
189 %if %{with python2}
190 %files -n python-libpst
191 %defattr(644,root,root,755)
192 %attr(755,root,root) %{py_sitedir}/_libpst.so
193 %endif
194
195 %if %{with python3}
196 %files -n python3-libpst
197 %defattr(644,root,root,755)
198 %attr(755,root,root) %{py3_sitedir}/_libpst.so
199 %endif
This page took 0.138172 seconds and 2 git commands to generate.