]> git.pld-linux.org Git - packages/createrepo_c.git/blob - createrepo_c.spec
3a1a104dcacdc0ff886e91bcf017bf913aa4f664
[packages/createrepo_c.git] / createrepo_c.spec
1 # TODO:
2 # - drpm support?
3 #
4 # Conditional build:
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_with     rpm5    # build with rpm5, tests may fail (rpm.org vs rpm5 compat problems?)
7 %bcond_without  tests   # make tests
8
9 Summary:        Creates a common metadata repository
10 Summary(pl.UTF-8):      Tworzenie wspólnego repozytorium metadanych
11 Name:           createrepo_c
12 Version:        0.10.0
13 Release:        7
14 License:        GPL v2+
15 Group:          Applications/System
16 #Source0Download: https://github.com/rpm-software-management/createrepo_c/releases
17 Source0:        https://github.com/rpm-software-management/createrepo_c/archive/%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5:  2e14b3e5d289875b894000ab1e54f1ec
19 Patch0:         %{name}-rpm5.patch
20 Patch1:         %{name}-python.patch
21 Patch2:         %{name}-include.patch
22 Patch3:         %{name}-bashcompdir.patch
23 URL:            https://github.com/rpm-software-management/createrepo_c
24 BuildRequires:  bzip2-devel
25 BuildRequires:  check-devel
26 BuildRequires:  cmake >= 2.6
27 BuildRequires:  curl-devel
28 BuildRequires:  doxygen
29 #BuildRequires: drpm-devel
30 BuildRequires:  expat-devel
31 BuildRequires:  glib2-devel >= 1:2.22.0
32 BuildRequires:  libmagic-devel
33 BuildRequires:  libxml2-devel >= 2
34 BuildRequires:  openssl-devel
35 BuildRequires:  python-devel >= 2
36 %{?with_tests:BuildRequires:    python-nose}
37 %if %{with python3}
38 BuildRequires:  python3-devel >= 1:3.2
39 %{?with_tests:BuildRequires:    python3-nose}
40 %endif
41 BuildRequires:  rpm-devel
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.673
44 BuildRequires:  sphinx-pdg-2
45 BuildRequires:  sqlite3-devel >= 3
46 BuildRequires:  xz-devel
47 BuildRequires:  zlib-devel
48 Requires:       %{name}-libs = %{version}-%{release}
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 C implementation of Createrepo. This utility will generate a common
53 metadata repository from a directory of RPM packages.
54
55 %description -l pl.UTF-8
56 Implementacja w C programu Createrepo. To narzędzie generuje wspólne
57 repozytorium metadanych z katalogu pakietów RPM.
58
59 %package libs
60 Summary:        Library for repodata manipulation
61 Summary(pl.UTF-8):      Biblioteka do operacji na danych repozytorium
62 Group:          Libraries
63 Requires:       glib2 >= 1:2.22.0
64
65 %description libs
66 This package contains the createrepo_c library for applications to
67 easy manipulate with a repodata.
68
69 %description libs -l pl.UTF-8
70 Ten pakiet zawiera bibliotekę createrepo_c, pozwalającą aplikacjom na
71 łatwe operowanie na danych repozytorium (repodata).
72
73 %package devel
74 Summary:        Header files for createrepo_c library
75 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki createrepo_c
76 Group:          Development/Libraries
77 Requires:       %{name}-libs = %{version}-%{release}
78 Requires:       bzip2-devel
79 Requires:       curl-devel
80 Requires:       expat-devel
81 Requires:       glib2-devel >= 1:2.22.0
82 Requires:       libmagic-devel
83 Requires:       libxml2-devel >= 2
84 Requires:       rpm-devel
85 Requires:       sqlite3-devel >= 3
86 Requires:       xz-devel
87 Requires:       zlib-devel
88
89 %description devel
90 This package contains the createrepo_c C header files. These
91 development files are for easy manipulation with a repodata.
92
93 %description devel -l pl.UTF-8
94 Ten pakiet zawiera pliki nagłówkowe C biblioteki createrepo_c. Mają na
95 celu łatwe operowanie na danych repozytorium (repodata).
96
97 %package apidocs
98 Summary:        API documentation for createrepo_c library
99 Summary(pl.UTF-8):      Dokumentacja API biblioteki createrepo_c
100 Group:          Documentation
101
102 %description apidocs
103 API documentation for createrepo_c library.
104
105 %description apidocs -l pl.UTF-8
106 Dokumentacja API biblioteki createrepo_c.
107
108 %package -n python-createrepo_c
109 Summary:        Python 2 bindings for the createrepo_c library
110 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki createrepo_c
111 Group:          Development/Languages/Python
112 Requires:       %{name}-libs = %{version}-%{release}
113
114 %description -n python-createrepo_c
115 Python 2 bindings for the createrepo_c library.
116
117 %description -n python-createrepo_c -l pl.UTF-8
118 Wiązania Pythona 2 do biblioteki createrepo_c.
119
120 %package -n python3-createrepo_c
121 Summary:        Python 3 bindings for the createrepo_c library
122 Summary(pl.UTF-8):      Wiązania Pythona 3 do biblioteki createrepo_c
123 Group:          Development/Languages/Python
124 Requires:       %{name}-libs = %{version}-%{release}
125
126 %description -n python3-createrepo_c
127 Python 3 bindings for the createrepo_c library.
128
129 %description -n python3-createrepo_c -l pl.UTF-8
130 Wiązania Pythona 3 do biblioteki createrepo_c.
131
132 %package -n bash-completion-createrepo_c
133 Summary:        Bash completion for createrepo_c commands
134 Summary(pl.UTF-8):      Bashowe uzupełnianie dla poleceń createrepo_c
135 Group:          Applications/Shells
136 Requires:       %{name} = %{version}-%{release}
137 Requires:       bash-completion >= 2.0
138
139 %description -n bash-completion-createrepo_c
140 Bash completion for createrepo_c commands (createrepo_c, mergerepo_c,
141 modifyrepo_c).
142
143 %description -n bash-completion-createrepo_c -l pl.UTF-8
144 Bashowe uzupełnianie dla poleceń createrepo_c (createrepo_c,
145 mergerepo_c, modifyrepo_c).
146
147 %prep
148 %setup -q
149 %{?with_rpm5:%patch0 -p1}
150 %patch1 -p1
151 %patch2 -p1
152 %patch3 -p1
153
154 %build
155 install -d build %{?with_python3:build-py3}
156
157 cd build
158 CFLAGS="%{rpmcflags} -D_GNU_SOURCE=1"
159 %cmake .. \
160         -DBASHCOMP_DIR=%{bash_compdir}
161
162 %{__make}
163 %{__make} doc
164
165 %if %{with tests}
166 %{__make} tests
167 %{__make} test \
168         ARGS="-V"
169 %endif
170 cd ..
171
172 %if %{with python3}
173 cd build-py3
174 %cmake .. \
175         -DBASHCOMP_DIR=%{bash_compdir} \
176         -DPYTHON_DESIRED=3
177
178 %{__make}
179
180 %if %{with tests}
181 %{__make} tests
182 %{__make} test \
183         ARGS="-V"
184 %endif
185 cd ..
186 %endif
187
188 %install
189 rm -rf $RPM_BUILD_ROOT
190
191 %if %{with python3}
192 %{__make} -C build-py3 install \
193         DESTDIR=$RPM_BUILD_ROOT
194 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/createrepo_c
195 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/createrepo_c
196 %endif
197
198 %{__make} -C build install \
199         DESTDIR=$RPM_BUILD_ROOT
200
201 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/createrepo_c
202 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/createrepo_c
203 %py_postclean
204
205 %clean
206 rm -rf $RPM_BUILD_ROOT
207
208 %post   libs -p /sbin/ldconfig
209 %postun libs -p /sbin/ldconfig
210
211 %files
212 %defattr(644,root,root,755)
213 %attr(755,root,root) %{_bindir}/createrepo_c
214 %attr(755,root,root) %{_bindir}/mergerepo_c
215 %attr(755,root,root) %{_bindir}/modifyrepo_c
216 %attr(755,root,root) %{_bindir}/sqliterepo_c
217 %{_mandir}/man8/createrepo_c.8*
218 %{_mandir}/man8/mergerepo_c.8*
219 %{_mandir}/man8/modifyrepo_c.8*
220 %{_mandir}/man8/sqliterepo_c.8*
221
222 %files libs
223 %defattr(644,root,root,755)
224 %doc AUTHORS README.md
225 %attr(755,root,root) %{_libdir}/libcreaterepo_c.so.*.*.*
226 %attr(755,root,root) %ghost %{_libdir}/libcreaterepo_c.so.0
227
228 %files devel
229 %defattr(644,root,root,755)
230 %attr(755,root,root) %{_libdir}/libcreaterepo_c.so
231 %{_pkgconfigdir}/createrepo_c.pc
232 %{_includedir}/createrepo_c
233
234 %files apidocs
235 %defattr(644,root,root,755)
236 %doc build/doc/html
237
238 %files -n python-createrepo_c
239 %defattr(644,root,root,755)
240 %dir %{py_sitedir}/createrepo_c
241 %attr(755,root,root) %{py_sitedir}/createrepo_c/_createrepo_c.so
242 %{py_sitedir}/createrepo_c/__init__.py[co]
243
244 %if %{with python3}
245 %files -n python3-createrepo_c
246 %defattr(644,root,root,755)
247 %dir %{py3_sitedir}/createrepo_c
248 %attr(755,root,root) %{py3_sitedir}/createrepo_c/_createrepo_c.so
249 %{py3_sitedir}/createrepo_c/__init__.py
250 %{py3_sitedir}/createrepo_c/__pycache__
251 %endif
252
253 %files -n bash-completion-createrepo_c
254 %defattr(644,root,root,755)
255 %{bash_compdir}/createrepo_c
256 %{bash_compdir}/mergerepo_c
257 %{bash_compdir}/modifyrepo_c
258 %{bash_compdir}/sqliterepo_c
This page took 0.05377 seconds and 2 git commands to generate.