rpm-build/scripts/Makefile.am
Mikhail Gordeev d2bb16eaa5 brp: Add brp-dupe-bin script
Some packages in Sisyphus install files both under %_prefix and outside
it in subdirectories of /, e. g. in both /bin and /usr/bin, or in /sbin
and /usr/sbin. Those packages must be installable into both unmerged and
merged-usr hierarchies and still work correctly. Most of the packages
can be adapted for use on both hierarchies, if they are rebuilt with
rpm-build with this brp module, with no spec changes required.

This brp module ensures that files under %buildroot/bin and %buildroot/usr/bin
are a copy of each other. If one of them is a symbolic link to another,
it is replaced by a copy of its target. If different files of the same
type are found inside the buildroot, it fails the build.
Likewise for %buildroot/sbin.

This approach has the following advantages:
- The resulting package can be installed on a split-usr hierarchy. We
  cannot use hard links, since our RPM can not auto-replace them while
  installing in an environment where hard link targets are to be on
  different storage sources (aka "split-usr").
- Most of packages in the repo should be installed in both hierarchies
  as is or after rebuild.

The single worst disadvantage is disk space requirements: we store 2
copies in the cpio of product rpms and 2 copies while installed on an
unmerged-usr hierarchy. We hope that this is not too bad: the copied
files themselves are not that big, the cpio in a package file is
compressed, and the eventual upgrade of filesystem < 3 is much less
likely to hit disk space limits.

As for files in /lib*, it is unlikely for packages in the repository to
depend on their particular location, so there is no need to put links or
copies both outside %_prefix and in %_prefix; all the packages with
file conflicts exclusive to merged-usr setups are fixed already.

This module can be safely disabled or removed when we eventually drop
support for unmerged-usr hierarchies.

Link: https://altlinux.org/Usrmerge
2024-03-11 17:00:00 +03:00

101 lines
4.0 KiB
Makefile

# Makefile for rpm scripts.
AUTOMAKE_OPTIONS = 1.4 foreign
EXTRA_DIST = \
posttrans-filetriggers 0ldconfig.filetrigger \
debuginfo.req debuginfo.req.files debuginfo.prov debuginfo.prov.files \
functions .provides.sh \
find-debuginfo-files process-debuginfo process-lto \
find-scriptlet-requires brp-sign-kmodules \
brp-adjust_libraries brp-alt \
brp-check_contents brp-cleanup brp-compress brp-debuginfo \
brp-dupe-bin \
brp-fix-perms brp-fixup brp-strip-lto \
brp-verify_elf brp-verify-info \
brp-verify-unit \
compress_files \
cpp.req cpp.req.files \
find-lang \
rpmb-find-package \
fixup-binconfig fixup-pkgconfig fixup-libtool fixup-libraries \
fixup-desktop fixup-desktop.awk \
files.req files.req.files 0common-files.req.list \
is_elf_so_executable \
ldd lib.req lib.req.files lib.prov lib.prov.files shlib.req.awk \
pam.req pam.req.files pam.prov pam.prov.files \
percolate \
pkgconfig.req pkgconfiglib.req pkgconfig.req.files \
provided_symbols \
rpmlib.req rpmlib.req.files \
rpm2cpio.sh \
shebang.req shebang.req.files \
shell.req shell.req.files shell.prov shell.prov.files \
static.req static.req.files \
symlinks.req symlinks.req.files \
systemd-services.req systemd-services.req.files \
tmpdir.sh \
install strip \
verify-elf
installprefix = $(DESTDIR)
all:
configdir = ${prefix}/lib/rpm
libexecdir = ${prefix}/libexec
config_DATA = 0common-files.req.list # .provides.sh
config_SCRIPTS = \
debuginfo.req debuginfo.req.files debuginfo.prov debuginfo.prov.files \
find-debuginfo-files process-debuginfo process-lto \
find-scriptlet-requires \
brp-alt \
compress_files \
cpp.req cpp.req.files \
find-lang \
rpmb-find-package \
fixup-binconfig fixup-pkgconfig fixup-libtool fixup-libraries \
fixup-gnuconfig fixup-desktop fixup-desktop.awk \
files.req files.req.files \
is_elf_so_executable \
ldd lib.req lib.req.files lib.prov lib.prov.files shlib.req.awk \
pam.req pam.req.files pam.prov pam.prov.files \
pkgconfig.req pkgconfiglib.req pkgconfig.req.files \
percolate \
provided_symbols \
rpmlib.req rpmlib.req.files \
rpm2cpio.sh \
shebang.req shebang.req.files \
shell.req shell.req.files shell.prov shell.prov.files \
static.req static.req.files \
symlinks.req symlinks.req.files \
systemd-services.req systemd-services.req.files \
tmpdir.sh \
verify-elf \
rpmb-functions \
# 0ldconfig.filetrigger posttrans-filetriggers
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(configdir)/brp.d
$(mkinstalldirs) $(DESTDIR)$(libexecdir)/rpm-build
$(INSTALL) -m755 brp-cleanup $(DESTDIR)$(configdir)/brp.d/008-cleanup.brp
$(INSTALL) -m755 brp-fix-perms $(DESTDIR)$(configdir)/brp.d/016-fix-perms.brp
$(INSTALL) -m755 brp-fixup $(DESTDIR)$(configdir)/brp.d/024-fixup.brp
$(INSTALL) -m755 brp-check_contents $(DESTDIR)$(configdir)/brp.d/028-check_contents.brp
$(INSTALL) -m755 brp-compress $(DESTDIR)$(configdir)/brp.d/032-compress.brp
$(INSTALL) -m755 brp-verify-info $(DESTDIR)$(configdir)/brp.d/040-verify-info.brp
$(INSTALL) -m755 brp-verify-unit $(DESTDIR)$(configdir)/brp.d/044-verify-unit.brp
$(INSTALL) -m755 brp-adjust_libraries $(DESTDIR)$(configdir)/brp.d/048-adjust_libraries.brp
$(INSTALL) -m755 brp-debuginfo $(DESTDIR)$(configdir)/brp.d/056-debuginfo.brp
$(INSTALL) -m755 brp-sign-kmodules $(DESTDIR)$(configdir)/brp.d/057-brp-sign-kmodules.brp
$(INSTALL) -m755 brp-strip-lto $(DESTDIR)$(configdir)/brp.d/061-brp-strip-lto.brp
$(INSTALL) -m755 brp-dupe-bin $(DESTDIR)$(configdir)/brp.d/089-brp-dupe-bin.brp
$(INSTALL) -m755 process-debuginfo $(DESTDIR)$(configdir)/process-debuginfo
$(INSTALL) -m755 process-lto $(DESTDIR)$(configdir)/process-lto
$(INSTALL) -m755 brp-verify_elf $(DESTDIR)$(configdir)/brp.d/064-verify_elf.brp
$(INSTALL) -m755 install $(DESTDIR)$(libexecdir)/rpm-build/install
$(INSTALL) -m755 strip $(DESTDIR)$(libexecdir)/rpm-build/strip
@LN_S@ pkgconfig.req $(DESTDIR)$(configdir)/pkgconfig.prov
@LN_S@ pkgconfig.req.files $(DESTDIR)$(configdir)/pkgconfig.prov.files
@LN_S@ pkgconfig.req.files $(DESTDIR)$(configdir)/pkgconfiglib.req.files