]> TLD Linux GIT Repositories - packages/rpm.git/blob - rpm.spec
- PLD merge
[packages/rpm.git] / rpm.spec
1 #
2 # TODO:
3 # - when adopting, use 4.5 ticket for checklist: https://bugs.launchpad.net/pld-linux/+bug/262985
4 #
5 # Conditional build:
6 %bcond_without  apidocs         # don't generate documentation with doxygen
7 %bcond_without  python3         # don't build python bindings
8 %bcond_without  plugins         # build plugins
9 %bcond_without  recommends_tags # build without Recommends tag (bootstrapping)
10 %bcond_with     imaevm          # build with IMA/EVM support (requires libimaevm from ima-evm-utils)
11
12 %define         db_ver          5.3.28.0
13 %define         popt_ver        1.15
14 %define         sover           9.1.2
15
16 %if "%{_rpmversion}" >= "4.12" && "%{_rpmversion}" < "5"
17 %define with_recommends_tags    1
18 %endif
19
20 Summary:        RPM Package Manager
21 Summary(de.UTF-8):      RPM Packet-Manager
22 Summary(es.UTF-8):      Gestor de paquetes RPM
23 Summary(pl.UTF-8):      Aplikacja do zarządzania pakietami RPM
24 Summary(pt_BR.UTF-8):   Gerenciador de pacotes RPM
25 Summary(ru.UTF-8):      Менеджер пакетов от RPM
26 Summary(uk.UTF-8):      Менеджер пакетів від RPM
27 Name:           rpm
28 Version:        4.16.1.2
29 Release:        6
30 Epoch:          1
31 License:        GPL v2 / LGPL v2.1
32 Group:          Base
33 Source0:        http://ftp.rpm.org/releases/rpm-4.16.x/%{name}-%{version}.tar.bz2
34 # Source0-md5:  0d10f63a0a4c9517cf3808a601378399
35 Source1:        https://ftp.tld-linux.org/TLD/TLD-Linux.asc
36 # Source1-md5:  5b5caff8c570489ad5bf950734546c24
37 Source2:        macros.local
38 Source3:        macros.lang
39 Source4:        %{name}.sysconfig
40 Source5:        %{name}.groups
41 Source6:        %{name}-groups-po.awk
42 Source7:        %{name}-install-tree
43 Source9:        %{name}-user_group.sh
44 # http://svn.pld-linux.org/banner.sh/
45 Source10:       banner.sh
46 Source11:       %{name}.noautoprov
47 Source12:       %{name}.noautoprovfiles
48 Source13:       %{name}.noautoreq
49 Source14:       %{name}.noautoreqfiles
50 Source15:       perl.prov
51 Patch0:         %{name}-man_pl.patch
52 Patch1:         %{name}-popt-aliases.patch
53 Patch2:         %{name}-perl-macros.patch
54 Patch3:         %{name}-perl-req-perlfile.patch
55 Patch4:         %{name}-scripts-closefds.patch
56 Patch6:         %{name}-perl_req-INC_dirs.patch
57 Patch7:         %{name}-debuginfo.patch
58 Patch8:         %{name}-libtool-deps.patch
59 Patch9:         %{name}-builddir-readlink.patch
60 Patch10:        %{name}-changelog_order_check_nonfatal.patch
61 Patch11:        %{name}-postun-nofail.patch
62 Patch12:        %{name}-clean-docdir.patch
63 Patch13:        %{name}-perl-magic.patch
64 Patch14:        %{name}-ignore-missing-macro-files.patch
65 Patch15:        x32.patch
66 Patch16:        rpm5-db-compat.patch
67 Patch17:        python-internal-build.patch
68 Patch18:        missing-macros.patch
69 Patch19:        pkgconfig.patch
70 Patch20:        uname-deps.patch
71 Patch21:        aarch64.patch
72 Patch22:        ix86-platforms.patch
73 Patch23:        shortcircuited-deps.patch
74 Patch24:        cpuinfo-deps.patch
75 Patch25:        rpmio-read-proc-files.patch
76 Patch26:        allow-at-in-ver-rel.patch
77 Patch27:        no-exeonly-for-elf-reqprov.patch
78 Patch28:        default-patch-flags.patch
79 Patch29:        %{name}-noarch_py_prov.patch
80 Patch30:        missing-ghost-terminate-build.patch
81 Patch31:        missing-doc-terminate-build.patch
82 Patch32:        noexpand.patch
83 Patch33:        sqlite-db-backend.patch
84 Patch34:        skip-symlinks.patch
85 Patch35:        pl-po.patch
86 Patch36:        build-locale.patch
87 Patch100:       build-id-links.patch
88 URL:            https://rpm.org/
89 BuildRequires:  acl-devel
90 BuildRequires:  db-devel >= %{db_ver}
91 BuildRequires:  autoconf >= 2.63
92 BuildRequires:  automake >= 1.4
93 BuildRequires:  bzip2-devel >= 1.0.2-17
94 BuildRequires:  elfutils-devel >= 0.108
95 BuildRequires:  gettext-tools >= 0.19.2
96 BuildRequires:  libarchive-devel
97 BuildRequires:  libcap-devel
98 BuildRequires:  libmagic-devel
99 BuildRequires:  libgcrypt-devel
100 %if %{with plugins}
101 BuildRequires:  audit-libs-devel
102 BuildRequires:  dbus-devel
103 %{?with_imaevm:BuildRequires:   libimaevm-devel >= 1.0}
104 BuildRequires:  libselinux-devel >= 2.1.0
105 %endif
106 # needed only for AM_PROG_CXX used for CXX substitution in rpm.macros
107 BuildRequires:  libstdc++-devel
108 BuildRequires:  libtool >= 1:1.4.2-9
109 BuildRequires:  patch >= 2.2
110 BuildRequires:  pkgconfig(lua) >= 5.1
111 BuildRequires:  popt-devel >= %{popt_ver}
112 BuildRequires:  python3-modules
113 %if %{with python3}
114 BuildRequires:  python3-devel
115 BuildRequires:  rpm-pythonprov
116 BuildRequires:  rpmbuild(macros) >= 1.750
117 %endif
118 BuildRequires:  sqlite3-devel >= 3.22.0
119 BuildRequires:  tcl
120 BuildRequires:  xz-devel
121 BuildRequires:  zlib-devel
122 BuildRequires:  zstd-devel
123 %if %{with apidocs}
124 BuildRequires:  doxygen
125 BuildRequires:  ghostscript
126 BuildRequires:  graphviz
127 BuildRequires:  tetex-pdftex
128 %endif
129 Requires(posttrans):    coreutils
130 Requires:       %{name}-base = %{epoch}:%{version}-%{release}
131 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
132 Requires:       rpm-tld-macros >= 1.744
133 Requires:       FHS >= 3.0-2
134 Requires:       libgcrypt
135 Requires:       popt >= %{popt_ver}
136 %if %{with recommends_tags}
137 Recommends:     rpm-plugin-audit
138 Recommends:     rpm-plugin-prioreset
139 Recommends:     rpm-plugin-syslog
140 %endif
141 Obsoletes:      rpm-utils-perl
142 Obsoletes:      rpm-utils-static
143 Conflicts:      glibc < 2.2.92
144 # db4.6 poldek needed
145 Conflicts:      poldek < 0.21-0.20070703.00.3
146 # segfaults with lzma 0.42.2
147 Conflicts:      lzma-libs < 4.999.3
148 Conflicts:      util-vserver < 0.30.216-1.pre3034.7
149 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
150
151 %define         _binary_payload         w9.gzdio
152
153 # don't require very fresh rpm.macros to build
154 %define         find_lang sh ./scripts/find-lang.sh $RPM_BUILD_ROOT
155 %define         ix86    i386 i486 i586 i686 athlon geode pentium3 pentium4
156 %define         ppc     ppc ppc7400 ppc7450
157 %define         x8664   amd64 ia32e x86_64
158
159 %define         _rpmlibdir /usr/lib/rpm
160
161 %description
162 RPM is a powerful package manager, which can be used to build,
163 install, query, verify, update, and uninstall individual software
164 packages. A package consists of an archive of files, and package
165 information, including name, version, and description.
166
167 %description -l de.UTF-8
168 RPM ist ein kräftiger Packet-Manager, der verwendet sein kann zur
169 Installation, Anfrage, Verifizierung, Aktualisierung und
170 Uninstallation individueller Softwarepakete. Ein Paket besteht aus
171 einem Archiv Dateien und Paketinformation, inklusive Name, Version und
172 Beschreibung.
173
174 %description -l es.UTF-8
175 RPM es un poderoso administrador de paquetes, que puede ser usado para
176 construir, instalar, pesquisar, verificar, actualizar y desinstalar
177 paquetes individuales de software. Un paquete consiste en un
178 almacenaje de archivos, y información sobre el paquete, incluyendo
179 nombre, versión y descripción.
180
181 %description -l pl.UTF-8
182 RPM jest doskonałym programem zarządzającym pakietami. Umożliwia on
183 przebudowanie, instalację czy weryfikację dowolnego pakietu.
184 Informacje dotyczące każdego pakietu, takie jak jego opis, lista
185 plików wchodzących w skład pakietu, zależności od innych pakietów, są
186 przechowywane w bazie danych i można je uzyskać za pomocą opcji
187 odpytywania programu rpm.
188
189 %description -l pt_BR.UTF-8
190 RPM é um poderoso gerenciador de pacotes, que pode ser usado para
191 construir, instalar, pesquisar, verificar, atualizar e desinstalar
192 pacotes individuais de software. Um pacote consiste de um conjunto de
193 arquivos e informações adicionais, incluindo nome, versão e descrição
194 do pacote, permissões dos arquivos, etc.
195
196 %description -l ru.UTF-8
197 RPM - это мощный менеджер пакетов, который может быть использован для
198 создания, инсталляции, запросов (query), проверки, обновления и
199 удаления программных пакетов. Пакет состоит из файлового архива и
200 служебной информации, включающей название, версию, описание и другие
201 данные о пакете.
202
203 %description -l uk.UTF-8
204 RPM - це потужний менеджер пакетів, що може бути використаний для
205 створення, інсталяції, запитів (query), перевірки, поновлення та
206 видалення програмних пакетів. Пакет складається з файлового архіву та
207 службової інформації, що містить назву, версію, опис та іншу
208 інформацію про пакет.
209
210 %package base
211 Summary:        RPM base package - scripts used by rpm packages themselves
212 Summary(pl.UTF-8):      Podstawowy pakiet RPM - skrypty używane przez same pakiety rpm
213 Group:          Base
214 Requires:       filesystem
215 Obsoletes:      rpm-scripts
216 Obsoletes:      vserver-rpm
217
218 %description base
219 The RPM base package contains scripts used by rpm packages themselves.
220 These include:
221 - scripts for adding/removing groups and users needed for rpm
222   packages,
223 - banner.sh to display %%banner messages from rpm scriptlets.
224
225 %description base -l pl.UTF-8
226 Pakiet podstawowy RPM zwiera skrypty używane przez same pakiety rpm.
227 Zawiera on:
228 - skrypty dodające/usuwające grupy i użytkowników dla pakietów rpm,
229 - banner.sh do pokazywania komunikatów %%banner dla skryptletów rpm.
230
231 %package lib
232 Summary:        RPMs library
233 Summary(pl.UTF-8):      Biblioteki RPM-a
234 Group:          Libraries
235 Requires:       db >= %{db_ver}
236 Requires:       libmagic >= 1.15-2
237 Requires:       popt >= %{popt_ver}
238 Obsoletes:      rpm-libs
239 # avoid SEGV caused by mixed db versions
240 Conflicts:      poldek < 0.18.1-16
241
242 %description lib
243 RPMs library.
244
245 %description lib -l pl.UTF-8
246 Biblioteki RPM-a.
247
248 %package devel
249 Summary:        Header files for rpm libraries
250 Summary(de.UTF-8):      Header-Dateien für rpm Libraries
251 Summary(es.UTF-8):      Archivos de inclusión y bibliotecas para programas de manipulación de paquetes rpm
252 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek rpm
253 Summary(pt_BR.UTF-8):   Arquivos de inclusão e bibliotecas para programas de manipulação de pacotes RPM
254 Summary(ru.UTF-8):      Хедеры и библиотеки для программ, работающих с rpm-пакетами
255 Summary(uk.UTF-8):      Хедери та бібліотеки для програм, що працюють з пакетами rpm
256 Group:          Development/Libraries
257 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
258 Requires:       bzip2-devel
259 Requires:       db-devel >= %{db_ver}
260 Requires:       elfutils-devel
261 Requires:       libmagic-devel
262 Requires:       libgcrypt-devel
263 %if %{with selinux}
264 Requires:       libselinux-devel
265 Requires:       libsemanage-devel
266 Requires:       libsepol-devel
267 %endif
268 Requires:       popt-devel >= %{popt_ver}
269 Requires:       zlib-devel
270
271 %description devel
272 The RPM packaging system includes C libraries that make it easy to
273 manipulate RPM packages and databases. They are intended to ease the
274 creation of graphical package managers and other tools that need
275 intimate knowledge of RPM packages. This package contains header files
276 for these libraries.
277
278 %description devel -l de.UTF-8
279 Der RPM-Packensystem enthält eine C-Library, die macht es einfach
280 RPM-Pakete und Dateibanken zu manipulieren. Er eignet sich für
281 Vereinfachung des Schaffens grafischer Paket-Manager und anderer
282 Werkzeuge, die intime Kenntnis von RPM-Paketen brauchen.
283
284 %description devel -l es.UTF-8
285 El sistema de empaquetado RPM incluye una biblioteca C que vuelve
286 fácil la manipulación de paquetes y bases de datos RPM. Su objetivo es
287 facilitar la creación de administradores gráficos de paquetes y otras
288 herramientas que necesiten un conocimiento profundo de paquetes RPM.
289
290 %description devel -l pl.UTF-8
291 System RPM zawiera biblioteki C, które ułatwiają manipulowanie
292 pakietami RPM oraz bazami danych. W zamiarze ma to uprościć tworzenie
293 graficznych programów zarządzających pakietami oraz innych narzędzi,
294 które wymagają szczegółowej wiedzy na temat pakietów RPM. Ten pakiet
295 zawiera pliki nagłówkowe wspomnianych bibliotek.
296
297 %description devel -l pt_BR.UTF-8
298 O sistema de empacotamento RPM inclui uma biblioteca C que torna fácil
299 a manipulação de pacotes e bases de dados RPM. Seu objetivo é
300 facilitar a criação de gerenciadores gráficos de pacotes e outras
301 ferramentas que precisem de conhecimento profundo de pacotes RPM.
302
303 %description devel -l ru.UTF-8
304 Система управления пакетами RPM содержит библиотеку C, которая
305 упрощает манипуляцию пакетами RPM и соответствующими базами данных.
306 Эта библиотека предназначена для облегчения создания графических
307 пакетных менеджеров и других утилит, которым необходимо работать с
308 пакетами RPM.
309
310 %description devel -l uk.UTF-8
311 Система керування пакетами RPM містить бібліотеку C, котра спрощує
312 роботу з пакетами RPM та відповідними базами даних. Ця бібліотека
313 призначена для полегшення створення графічних пакетних менеджерів та
314 інших утиліт, що працюють з пакетами RPM.
315
316 %package utils
317 Summary:        Additional utilities for managing RPM packages and database
318 Summary(de.UTF-8):      Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken
319 Summary(pl.UTF-8):      Dodatkowe narzędzia do zarządzania bazą RPM-a i pakietami
320 Group:          Applications/File
321 Requires:       %{name} = %{epoch}:%{version}-%{release}
322 Requires:       popt >= %{popt_ver}
323 %if %{with recommends_tags}
324 Recommends:     bzip2
325 Recommends:     gzip
326 %endif
327 Conflicts:      filesystem-debuginfo < 3.0-16
328
329 %description utils
330 Additional utilities for managing RPM packages and database.
331
332 %description utils -l de.UTF-8
333 Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken.
334
335 %description utils -l pl.UTF-8
336 Dodatkowe narzędzia do zarządzania bazą RPM-a i pakietami.
337
338 %package build
339 Summary:        Scripts for building binary RPM packages
340 Summary(de.UTF-8):      Scripts fürs Bauen binärer RPM-Pakete
341 Summary(pl.UTF-8):      Skrypty pomocnicze do budowania binarnych RPM-ów
342 Summary(pt_BR.UTF-8):   Scripts e programas executáveis usados para construir pacotes
343 Summary(ru.UTF-8):      Скрипты и утилиты, необходимые для сборки пакетов
344 Summary(uk.UTF-8):      Скрипти та утиліти, необхідні для побудови пакетів
345 Group:          Applications/File
346 Requires(pretrans):     coreutils
347 Requires(pretrans):     findutils
348 Requires:       %{name}-utils = %{epoch}:%{version}-%{release}
349 Requires:       rpm-tld-macros-build >= 1.744
350 Requires:       /bin/id
351 Requires:       awk
352 Requires:       bzip2
353 Requires:       chrpath >= 0.10-4
354 Requires:       cpio
355 Requires:       diffutils
356 Requires:       elfutils
357 Requires:       file >= 4.17
358 Requires:       fileutils
359 Requires:       findutils
360 %ifarch athlon
361 Requires:       gcc >= 3.0.3
362 %else
363 Requires:       gcc
364 %endif
365 Requires:       glibc-devel
366 Requires:       grep
367 Requires:       gzip
368 Requires:       make
369 Requires:       patch
370 Requires:       sed >= 4.0
371 Requires:       sh-utils
372 Requires:       tar >= 1:1.22
373 Requires:       textutils
374 Requires:       which
375 Requires:       xz
376 Provides:       rpmbuild(noauto) = 3
377 %ifarch %{x8664}
378 Conflicts:      automake < 1:1.7.9-2
379 Conflicts:      libtool < 2:1.5-13
380 %endif
381
382 %description build
383 Scripts for building binary RPM packages.
384
385 %description build -l de.UTF-8
386 Scripts fürs Bauen binärer RPM-Pakete.
387
388 %description build -l pl.UTF-8
389 Skrypty pomocnicze do budowania binarnych RPM-ów.
390
391 %description build -l pt_BR.UTF-8
392 Este pacote contém scripts e programas executáveis que são usados para
393 construir pacotes usando o RPM.
394
395 %description build -l ru.UTF-8
396 Различные вспомогательные скрипты и исполняемые программы, которые
397 используются для сборки RPM'ов.
398
399 %description build -l uk.UTF-8
400 Різноманітні допоміжні скрипти та утиліти, які використовуються для
401 побудови RPM'ів.
402
403 %package perlprov
404 Summary:        Additional utilities for checking Perl provides/requires in RPM packages
405 Summary(de.UTF-8):      Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen
406 Summary(pl.UTF-8):      Dodatkowe narzędzia do sprawdzenia zależności skryptów Perla w pakietach RPM
407 Group:          Applications/File
408 Requires:       %{name} = %{epoch}:%{version}-%{release}
409 Requires:       perl-Encode
410 Requires:       perl-devel
411 Requires:       perl-modules
412
413 %description perlprov
414 Additional utilities for checking Perl provides/requires in RPM
415 packages.
416
417 %description perlprov -l de.UTF-8
418 Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen.
419
420 %description perlprov -l pl.UTF-8
421 Dodatkowe narzędzia do sprawdzenia zależności skryptów Perla w
422 pakietach RPM.
423
424 %package pythonprov
425 Summary:        Python macros, which simplifies creation of RPM packages with Python software
426 Summary(pl.UTF-8):      Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w Pythonie
427 Group:          Applications/File
428 Requires:       %{name} = %{epoch}:%{version}-%{release}
429 Requires:       python3
430 Requires:       python3-modules
431 Requires:       python3-setuptools
432
433 %description pythonprov
434 Python macros, which simplifies creation of RPM packages with Python
435 software.
436
437 %description pythonprov -l pl.UTF-8
438 Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w
439 Pythonie.
440
441 %package -n python3-rpm
442 Summary:        Python 3 interface to RPM library
443 Summary(pl.UTF-8):      Interfejs Pythona 3 do biblioteki RPM-a
444 Summary(pt_BR.UTF-8):   Módulo Python 3 para aplicativos que manipulam pacotes RPM
445 Group:          Development/Languages/Python
446 Requires:       %{name} = %{epoch}:%{version}-%{release}
447 Requires:       python3
448 Obsoletes:      python-rpm < 1:4.16.0
449 Obsoletes:      rpm-python
450
451 %description -n python3-rpm
452 The python3-rpm package contains a module which permits applications
453 written in the Python 3 programming language to use the interface
454 supplied by RPM (RPM Package Manager) libraries.
455
456 This package should be installed if you want to develop Python 3
457 programs that will manipulate RPM packages and databases.
458
459 %description -n python3-rpm -l pl.UTF-8
460 Pakiet python3-rpm zawiera moduł, który pozwala aplikacjom napisanym w
461 Pythonie 3 na używanie interfejsu dostarczanego przez biblioteki
462 RPM-a.
463
464 Pakiet ten powinien zostać zainstalowany, jeśli chcesz pisać w
465 Pythonie 3 programy manipulujące pakietami i bazami danych rpm.
466
467 %description -n python3-rpm -l pt_BR.UTF-8
468 O pacote python3-rpm contém um módulo que permite que aplicações
469 escritas em Python 3 utilizem a interface fornecida pelas bibliotecas
470 RPM (RPM Package Manager).
471
472 Esse pacote deve ser instalado se você quiser desenvolver programas em
473 Python 3 para manipular pacotes e bancos de dados RPM.
474
475 %package plugin-audit
476 Summary:        Plugin for logging audit events on package operations
477 Group:          Base
478 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
479
480 %description plugin-audit
481 Plugin for libaudit support
482
483 %package plugin-syslog
484 Summary:        Plugin for syslog functionality
485 Group:          Base
486 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
487
488 %description plugin-syslog
489 This plugin exports RPM actions to the system log.
490
491 %package plugin-ima
492 Summary:        Plugin for IMA file signatures
493 Group:          Base
494 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
495
496 %description plugin-ima
497 This plugin adds support for enforcing and verifying IMA file
498 signatures in an rpm.
499
500 %package plugin-prioreset
501 Summary:        Plugin for resetting scriptlet priorities for SysV init
502 Group:          Base
503 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
504
505 %description plugin-prioreset
506 This plugin is useful on legacy SysV init systems if you run rpm
507 transactions with nice/ionice priorities.
508
509 %package plugin-selinux
510 Summary:        Plugin for SELinux functionality
511 Group:          Base
512 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
513 Requires:       libselinux >= 2.1.0
514
515 %description plugin-selinux
516 Plugin for SELinux functionality.
517
518 %package sign
519 Summary:        Package signing support
520 Group:          Base
521 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
522
523 %description sign
524 This package contains support for digitally signing RPM packages.
525
526 %package apidocs
527 Summary:        RPM API documentation and guides
528 Summary(pl.UTF-8):      Documentacja API RPM-a i przewodniki
529 Group:          Documentation
530 BuildArch:      noarch
531
532 %description apidocs
533 Documentation for RPM API and guides in HTML format generated from rpm
534 sources by doxygen.
535
536 %description apidocs -l pl.UTF-8
537 Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
538 źrodeł RPM-a przez doxygen.
539
540 %prep
541 %setup -q -n %{name}-%{version}%{?subver}
542 %patch0 -p1
543 %patch1 -p1
544 %patch2 -p1
545 %patch3 -p1
546 %patch4 -p1
547 %patch6 -p0
548 %patch7 -p1
549 %patch8 -p1
550 %patch9 -p1
551 %patch10 -p1
552 %patch11 -p1
553 %patch12 -p1
554 %patch13 -p1
555 %patch14 -p1
556 %patch15 -p1
557 %patch16 -p1
558 %patch17 -p1
559 %patch18 -p1
560 %patch19 -p1
561 %patch20 -p1
562 %patch21 -p1
563 %patch22 -p1
564 %patch23 -p1
565 %patch24 -p1
566 %patch25 -p1
567 %patch26 -p1
568 %patch27 -p1
569 %patch28 -p1
570 %patch29 -p1
571 %patch30 -p1
572 %patch31 -p1
573 %patch32 -p1
574 %patch33 -p1
575 %patch34 -p1
576 %patch35 -p1
577 %patch36 -p1
578 %patch100 -p1
579
580 %{__rm} po/*.gmo
581
582 install %{SOURCE15} scripts/perl.prov.in
583
584 %{__mv} -f scripts/perl.req{,.in}
585
586 # generate Group translations to *.po
587 awk -f %{SOURCE6} %{SOURCE5}
588
589 %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' scripts/pythondistdeps.py
590
591 %build
592 %{__libtoolize}
593 %{__aclocal}
594 %{__autoheader}
595 %{__autoconf}
596 %{__automake}
597
598 # rpm checks for CPU type at runtime, but it looks better
599 sed -i \
600         -e 's|@host@|%{_target_cpu}-%{_target_vendor}-%{_target_os}|' \
601         -e 's|@host_cpu@|%{_target_cpu}|' \
602         -e 's|@host_os@|%{_target_os}|' \
603         macros.in
604
605 %configure \
606         WITH_PERL_VERSION=no \
607         __GST_INSPECT=%{_bindir}/gst-inspect-1.0 \
608         __GPG=%{_bindir}/gpg \
609 %if %{with python3}
610         PYTHON=python3 \
611         --enable-python \
612 %endif
613         --disable-inhibit-plugin \
614         --disable-silent-rules \
615         --enable-shared \
616         --enable-bdb \
617         --enable-bdb-ro \
618         --enable-ndb \
619         --enable-sqlite \
620         --enable-zstd \
621         --with-lua \
622         %{?with_imaevm:--with-imaevm} \
623         --with-cap \
624         --with-acl \
625         --with-audit \
626         --with-archive \
627         --with-selinux=%{!?with_plugins:no}%{?with_plugins:yes} \
628         %{!?with_plugins:--disable-plugins} \
629         --with-vendor=tld
630
631 %{__make}
632
633 %{__make} -C po update-gmo
634
635 %if %{with python3}
636 cd python
637 %py3_build
638 %endif
639
640 %install
641 rm -rf $RPM_BUILD_ROOT
642 install -d $RPM_BUILD_ROOT{/bin,/%{_lib},/etc/sysconfig,%{_sysconfdir}/{rpm,pki/rpm-gpg}} \
643         $RPM_BUILD_ROOT{/var/lib/{banner,rpm},/usr/lib/.build-id}
644
645 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/TLD-Linux.asc
646
647 %{__make} install \
648         pkgconfigdir=%{_pkgconfigdir} \
649         DESTDIR=$RPM_BUILD_ROOT
650
651 # cleanup
652 %ifnarch %{ix86} %{x8664} x32
653 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/athlon-linux/macros
654 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/geode-linux/macros
655 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/i386-linux/macros
656 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/i486-linux/macros
657 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/i586-linux/macros
658 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/i686-linux/macros
659 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/pentium3-linux/macros
660 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/pentium4-linux/macros
661 %endif
662
663 %ifnarch %{x8664} x32
664 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/amd64-linux/macros
665 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ia32e-linux/macros
666 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/x32-linux/macros
667 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/x86_64-linux/macros
668 %endif
669
670 %ifnarch %{ppc}
671 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/m68k-linux/macros
672 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ppc32dy4-linux/macros
673 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ppc64*-linux/macros
674 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ppc8260-linux/macros
675 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ppc8560-linux/macros
676 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ppc-linux/macros
677 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ppc*series-linux/macros
678 %endif
679
680 %ifnarch aarch64
681 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/aarch64-linux/macros
682 %endif
683
684 %ifnarch %{arm}
685 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/arm*-linux/macros
686 %endif
687
688 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/alpha*-linux/macros
689 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ia64-linux/macros
690 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/mips*-linux/macros
691 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/riscv64-linux/macros
692 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/s390*-linux/macros
693 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/sh*-linux/macros
694 rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/sparc*-linux/macros
695
696 cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/platform
697 %ifarch x32
698 %{_target_cpu}-%{_target_vendor}-linux-gnux32
699 %else
700 %{_target_cpu}-%{_target_vendor}-linux
701 %endif
702 EOF
703
704 %{__rm} $RPM_BUILD_ROOT%{_rpmlibdir}/find-lang.sh
705
706 install -d $RPM_BUILD_ROOT%{_rpmlibdir}/tld
707
708 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_rpmlibdir}/install-build-tree
709 cp -p %{SOURCE9} $RPM_BUILD_ROOT%{_rpmlibdir}/user_group.sh
710 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rpm
711
712 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_bindir}/banner.sh
713
714 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros
715 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.lang
716 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprov
717 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprovfiles
718 cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreq
719 cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreqfiles
720
721 # move rpm to /bin
722 %{__mv} $RPM_BUILD_ROOT%{_bindir}/rpm $RPM_BUILD_ROOT/bin
723 ln -sf /bin/rpm $RPM_BUILD_ROOT%{_bindir}/rpmquery
724 ln -sf /bin/rpm $RPM_BUILD_ROOT%{_bindir}/rpmverify
725
726 # move essential libs to /lib (libs that /bin/rpm links to)
727 for a in librpm.so librpmbuild.so librpmio.so librpmsign.so; do
728         mv -f $RPM_BUILD_ROOT%{_libdir}/${a}.* $RPM_BUILD_ROOT/%{_lib}
729         ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/${a}.*.*.*) $RPM_BUILD_ROOT%{_libdir}/${a}
730 done
731
732 # init an empty database for %ghost'ing for all supported backends
733 for be in sqlite bdb ndb; do
734         ./rpmdb \
735                 --macros=$RPM_BUILD_ROOT%{_rpmlibdir}/macros \
736                 --rcfile=$RPM_BUILD_ROOT%{_rpmlibdir}/rpmrc \
737                 --dbpath=${PWD}/${be} \
738                 --define "_db_backend ${be}" \
739                 --initdb
740         cp -va ${be}/. $RPM_BUILD_ROOT/var/lib/rpm/
741 done
742
743 %if %{with python3}
744 # Remove anything that rpm make install might put there
745 %{__rm} -rf $RPM_BUILD_ROOT%{py3_sitedir}
746 cd python
747 %py3_install
748 cd ..
749 %endif
750
751 %{__rm} $RPM_BUILD_ROOT%{_libdir}/rpm-plugins/*.la
752
753 # wrong location, not used anyway
754 %{__rm} $RPM_BUILD_ROOT%{_rpmlibdir}/rpm.{daily,log}
755
756 %find_lang %{name}
757
758 %clean
759 rm -rf $RPM_BUILD_ROOT
760
761 %posttrans
762 if [ -e /var/lib/rpm/Packages ]; then
763         if [ ! -e /var/lib/rpm.rpmbackup-%{version}-%{release} ] && \
764                         /bin/cp -a /var/lib/rpm /var/lib/rpm.rpmbackup-%{version}-%{release}; then
765                 echo
766                 echo "Backup of the rpm database has been created in /var/lib/rpm.rpmbackup-%{version}-%{release}"
767                 echo
768         fi
769         echo
770         echo 'If poldek aborts after migration with rpmdb error, this is expected behaviour,'
771         echo 'you should ignore it and restart poldek'
772         echo
773         %{__rm} -rf /var/lib/rpm/log >/dev/null 2>/dev/null || :
774         %{__rm} -rf /var/lib/rpm/tmp >/dev/null 2>/dev/null || :
775         # Unlock database for rebuild, safe since this is posttrans
776         %{__rm} -f /var/lib/rpm/.rpm.lock >/dev/null 2>/dev/null || :
777         if ! /usr/bin/rpmdb --rebuilddb; then
778                 echo
779                 echo "rpm database conversion failed!"
780                 echo "You have to run '/usr/bin/rpmdb --rebuilddb' manually"
781                 echo
782                 exit 1
783         fi
784 fi
785
786 %post   lib -p /sbin/ldconfig
787 %postun lib -p /sbin/ldconfig
788
789 %pretrans build
790 find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
791
792 %files -f %{name}.lang
793 %defattr(644,root,root,755)
794 %doc ChangeLog CREDITS README
795
796 %dir /etc/pki/rpm-gpg
797 /etc/pki/rpm-gpg/TLD-Linux.asc
798
799 %attr(755,root,root) /bin/rpm
800 %attr(755,root,root) %{_bindir}/rpmdb
801 %attr(755,root,root) %{_bindir}/rpmkeys
802 %attr(755,root,root) %{_bindir}/rpmquery
803 %attr(755,root,root) %{_bindir}/rpmverify
804
805 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpm/macros
806 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpm/macros.lang
807 # this is ok to be replaced
808 %config %verify(not md5 mtime size) %{_sysconfdir}/rpm/platform
809
810 %{_mandir}/man8/rpm.8*
811 %{_mandir}/man8/rpmdb.8*
812 %{_mandir}/man8/rpmkeys.8*
813 %{_mandir}/man8/rpm-misc.8*
814 %{?with_plugins:%{_mandir}/man8/rpm-plugins.8*}
815 %lang(fr) %{_mandir}/fr/man8/rpm.8*
816 %lang(ja) %{_mandir}/ja/man8/rpm.8*
817 %lang(ko) %{_mandir}/ko/man8/rpm.8*
818 %lang(pl) %{_mandir}/pl/man8/rpm.8*
819 %lang(ru) %{_mandir}/ru/man8/rpm.8*
820 %lang(sk) %{_mandir}/sk/man8/rpm.8*
821
822 %dir /var/lib/rpm
823 %ghost %config(missingok,noreplace) /var/lib/rpm/*
824 %ghost /var/lib/rpm/.*.lock
825
826 %{_rpmlibdir}/rpmpopt*
827 %{_rpmlibdir}/rpmrc
828 %{_rpmlibdir}/macros
829 %dir %{_rpmlibdir}/macros.d
830 %dir %{_rpmlibdir}/platform
831 %{_rpmlibdir}/platform/noarch-*
832 %ifarch %{ix86} %{x8664} x32
833 %{_rpmlibdir}/platform/athlon*
834 %{_rpmlibdir}/platform/geode*
835 %{_rpmlibdir}/platform/i?86*
836 %{_rpmlibdir}/platform/pentium*
837 %endif
838 %ifarch %{x8664} x32
839 %{_rpmlibdir}/platform/amd64*
840 %{_rpmlibdir}/platform/ia32e*
841 %{_rpmlibdir}/platform/x86_64*
842 %{_rpmlibdir}/platform/x32*
843 %endif
844 %ifarch alpha
845 %{_rpmlibdir}/platform/alpha*
846 %endif
847 %ifarch aarch64
848 %{_rpmlibdir}/platform/aarch64*
849 %endif
850 %ifarch %{arm}
851 %{_rpmlibdir}/platform/arm*
852 %endif
853 %ifarch ia64
854 %{_rpmlibdir}/platform/ia64*
855 %endif
856 %ifarch mips mipsel mips64 mips64el
857 %{_rpmlibdir}/platform/mips*
858 %endif
859 %ifarch %{ppc}
860 %{_rpmlibdir}/platform/ppc*
861 %endif
862 %ifarch sparc sparc64
863 %{_rpmlibdir}/platform/sparc*
864 %endif
865
866 %dir %{_rpmlibdir}/tld
867
868 %attr(755,root,root) %{_rpmlibdir}/rpmdb_dump
869 %attr(755,root,root) %{_rpmlibdir}/rpmdb_load
870
871 # valgrind suppression file for rpm
872 %{_rpmlibdir}/rpm.supp
873
874 %dir /usr/lib/.build-id
875
876 %files base
877 %defattr(644,root,root,755)
878 %dir %{_sysconfdir}/rpm
879 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rpm
880 %dir %{_rpmlibdir}
881 %attr(755,root,root) %{_bindir}/banner.sh
882 %attr(755,root,root) %{_rpmlibdir}/user_group.sh
883 %dir /var/lib/banner
884
885 %files lib
886 %defattr(644,root,root,755)
887 %attr(755,root,root) /%{_lib}/librpm.so.9
888 %attr(755,root,root) /%{_lib}/librpm.so.%{sover}
889 %attr(755,root,root) /%{_lib}/librpmbuild.so.9
890 %attr(755,root,root) /%{_lib}/librpmbuild.so.%{sover}
891 %attr(755,root,root) /%{_lib}/librpmio.so.9
892 %attr(755,root,root) /%{_lib}/librpmio.so.%{sover}
893 %attr(755,root,root) /%{_lib}/librpmsign.so.9
894 %attr(755,root,root) /%{_lib}/librpmsign.so.%{sover}
895 %{?with_plugins:%dir %{_libdir}/rpm-plugins}
896
897 %files devel
898 %defattr(644,root,root,755)
899 %attr(755,root,root) %{_libdir}/librpm.so
900 %attr(755,root,root) %{_libdir}/librpmbuild.so
901 %attr(755,root,root) %{_libdir}/librpmio.so
902 %attr(755,root,root) %{_libdir}/librpmsign.so
903 %{_libdir}/librpm*.la
904 %{_includedir}/rpm
905 %{_pkgconfigdir}/*.pc
906
907 %files utils
908 %defattr(644,root,root,755)
909 %attr(755,root,root) %{_bindir}/rpm2archive
910 %attr(755,root,root) %{_bindir}/rpm2cpio
911 %attr(755,root,root) %{_bindir}/rpmgraph
912 %attr(755,root,root) %{_rpmlibdir}/rpm2cpio.sh
913 %attr(755,root,root) %{_rpmlibdir}/find-debuginfo.sh
914 %attr(755,root,root) %{_rpmlibdir}/tgpg
915 %attr(755,root,root) %{_rpmlibdir}/debugedit
916 %attr(755,root,root) %{_rpmlibdir}/rpmdeps
917 %{_mandir}/man8/rpm2archive.8*
918 %{_mandir}/man8/rpm2cpio.8*
919 %{_mandir}/man8/rpmdeps.8*
920 %{_mandir}/man8/rpmgraph.8*
921 %lang(ja) %{_mandir}/ja/man8/rpm2cpio.8*
922 %lang(ko) %{_mandir}/ko/man8/rpm2cpio.8*
923 %lang(pl) %{_mandir}/pl/man8/rpm2cpio.8*
924 %lang(ru) %{_mandir}/ru/man8/rpm2cpio.8*
925 %lang(pl) %{_mandir}/pl/man8/rpmdeps.8*
926 %lang(ja) %{_mandir}/ja/man8/rpmgraph.8*
927 %lang(pl) %{_mandir}/pl/man8/rpmgraph.8*
928
929 %files build
930 %defattr(644,root,root,755)
931 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpm/noauto*
932 %attr(755,root,root) %{_rpmlibdir}/brp-*
933 %attr(755,root,root) %{_rpmlibdir}/check-files
934 %attr(755,root,root) %{_rpmlibdir}/install-build-tree
935 %attr(755,root,root) %{_rpmlibdir}/elfdeps
936 %attr(755,root,root) %{_rpmlibdir}/libtooldeps.sh
937 # needs hacked pkg-config to return anything
938 %attr(755,root,root) %{_rpmlibdir}/pkgconfigdeps.sh
939 %attr(755,root,root) %{_rpmlibdir}/mkinstalldirs
940
941 %attr(755,root,root) %{_rpmlibdir}/fontconfig.prov
942 # must be here for "Requires: rpm-*prov" to work
943 #%{_rpmlibdir}/macros.d/cmake
944 #%{_rpmlibdir}/macros.d/gstreamer
945 #%{_rpmlibdir}/macros.d/libtool
946 #%{_rpmlibdir}/macros.d/perl
947 #%{_rpmlibdir}/macros.d/pkgconfig
948 #%{_rpmlibdir}/macros.d/python
949 #%{_rpmlibdir}/macros.d/selinux
950 #%{_rpmlibdir}/macros.d/tcl
951 #%{_rpmlibdir}/macros.rpmbuild
952
953 %attr(755,root,root) %{_rpmlibdir}/check-buildroot
954 %attr(755,root,root) %{_rpmlibdir}/check-prereqs
955 %attr(755,root,root) %{_rpmlibdir}/check-rpaths
956 %attr(755,root,root) %{_rpmlibdir}/check-rpaths-worker
957 %attr(755,root,root) %{_rpmlibdir}/find-provides
958 %attr(755,root,root) %{_rpmlibdir}/find-requires
959 %attr(755,root,root) %{_rpmlibdir}/ocamldeps.sh
960 %attr(755,root,root) %{_rpmlibdir}/script.req
961 %attr(755,root,root) %{_rpmlibdir}/sepdebugcrcfix
962
963 %dir %{_rpmlibdir}/fileattrs
964 %{_rpmlibdir}/fileattrs/debuginfo.attr
965 %{_rpmlibdir}/fileattrs/desktop.attr
966 %{_rpmlibdir}/fileattrs/elf.attr
967 %{_rpmlibdir}/fileattrs/font.attr
968 %{_rpmlibdir}/fileattrs/libtool.attr
969 %{_rpmlibdir}/fileattrs/metainfo.attr
970 %{_rpmlibdir}/fileattrs/ocaml.attr
971 %{_rpmlibdir}/fileattrs/perl.attr
972 %{_rpmlibdir}/fileattrs/perllib.attr
973 %{_rpmlibdir}/fileattrs/pkgconfig.attr
974 %{_rpmlibdir}/fileattrs/python.attr
975 %{_rpmlibdir}/fileattrs/pythondist.attr
976 %{_rpmlibdir}/fileattrs/script.attr
977
978 %attr(755,root,root) %{_bindir}/gendiff
979 %attr(755,root,root) %{_bindir}/rpmbuild
980 %attr(755,root,root) %{_bindir}/rpmspec
981
982 %{_mandir}/man1/gendiff.1*
983 %lang(pl) %{_mandir}/pl/man1/gendiff.1*
984 %{_mandir}/man8/rpmbuild.8*
985 %lang(ja) %{_mandir}/ja/man8/rpmbuild.8*
986 %lang(pl) %{_mandir}/pl/man8/rpmbuild.8*
987 %{_mandir}/man8/rpmspec.8*
988
989 %files perlprov
990 %defattr(644,root,root,755)
991 %attr(755,root,root) %{_rpmlibdir}/perl.*
992
993 %files pythonprov
994 %defattr(644,root,root,755)
995 %attr(755,root,root) %{_rpmlibdir}/pythondistdeps.py
996
997 %if %{with python3}
998 %files -n python3-rpm
999 %defattr(644,root,root,755)
1000 %dir %{py3_sitedir}/rpm
1001 %attr(755,root,root) %{py3_sitedir}/rpm/*.so
1002 %{py3_sitedir}/rpm/*.py
1003 %{py3_sitedir}/rpm-%{version}-py*.egg-info
1004 %{py3_sitedir}/rpm/__pycache__
1005 %endif
1006
1007 %if %{with plugins}
1008 %files plugin-audit
1009 %defattr(644,root,root,755)
1010 %attr(755,root,root) %{_libdir}/rpm-plugins/audit.so
1011 %{_mandir}/man8/rpm-plugin-audit.8*
1012
1013 %files plugin-syslog
1014 %defattr(644,root,root,755)
1015 %attr(755,root,root) %{_libdir}/rpm-plugins/syslog.so
1016 %{_mandir}/man8/rpm-plugin-syslog.8*
1017
1018 %files plugin-ima
1019 %defattr(644,root,root,755)
1020 %attr(755,root,root) %{_libdir}/rpm-plugins/ima.so
1021 %{_mandir}/man8/rpm-plugin-ima.8*
1022
1023 %files plugin-prioreset
1024 %defattr(644,root,root,755)
1025 %attr(755,root,root) %{_libdir}/rpm-plugins/prioreset.so
1026 %{_mandir}/man8/rpm-plugin-prioreset.8*
1027
1028 %files plugin-selinux
1029 %defattr(644,root,root,755)
1030 %attr(755,root,root) %{_libdir}/rpm-plugins/selinux.so
1031 %{_mandir}/man8/rpm-plugin-selinux.8*
1032 %endif
1033
1034 %files sign
1035 %defattr(644,root,root,755)
1036 %attr(755,root,root) %{_bindir}/rpmsign
1037 %{_mandir}/man8/rpmsign.8*
1038
1039 %if %{with apidocs}
1040 %files apidocs
1041 %defattr(644,root,root,755)
1042 %doc doc/librpm/html/*
1043 %endif