Commit Graph

30 Commits

Author SHA1 Message Date
Arseny Maslennikov
9b8a832c84 configure: drop the id -u hack
Even if we come across an environment where `id -u` is not supported,
the required patch would be around 7 lines long centered around

    printf("%d\n", geteuid());

, maybe PRIu32 instead of "%d" or however it is spelled.
2024-06-03 17:00:00 +03:00
Arseny Maslennikov
c01ddd8a9b configure, macros: reflect default PATH for scripts
Put /bin after /usr/bin. This should have been done just as filesystem 3
was live, to be honest.

Reported-by: Nikolay A. Fetisov <naf@altlinux.org>
Link: https://bugzilla.altlinux.org/50527
Link: https://altlinux.org/Usrmerge
2024-06-03 17:00:00 +03:00
Arseny Maslennikov
c9564687ff rpmb-functions.in: expand @RPMCONFIGDIR@
This will be useful in a subsequent change.
2024-03-11 17:00:00 +03:00
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
Arseny Maslennikov
76fa8b1172 Rename find-package to solve misconflict with rpm
It is not that easy to ship find-package as part of rpm-build.
We have to drop find-package from the filelist of rpm as well. For this
change to enter Sisyphus, both rpm-build and rpm have to be changed and
rebuilt in their own base build chroots.

If rpm-build is built to include find-package first, rpm is
uninstallable in the base chroot due to a misconflict, so it cannot be
rebuilt.
If rpm is built to exclude find-package first, it disappears from the
base chroot altogether, making rpm-build break, so no
package can be built as well.
2024-03-04 20:36:26 +03:00
Arseny Maslennikov
119d2f57f6 Introduce 044-verify-unit.brp
It is intended to check the sanity of systemd units installed in the
buildroot. As of today, it errors out on executable unit files and units
passing nobody as User=, Group= or in SupplementaryGroups=.
2024-01-11 17:00:00 +03:00
93297e9c33 s/egrep/grep -E/ 2022-04-26 08:00:00 +00:00
8c5c47a2a1 Remove remaining vestiges of python bindings
Build of python bindings was turned off by commit 4.0.4-alt100.97~5 made
about 5 years ago, not it's time to remove the remaining unused bits.
2021-09-08 08:00:00 +00:00
715065e999 brp: Add brp-strip-lto script
Strip LTO sections and symbols from objects and archives (static
libraries). %brp_strip_none macro is respected.

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2021-08-24 00:52:22 +03:00
5ef5c8ff4a Use file4 instead of file
This will allow upgrading system file to v5, leaving rpmbuild using
stable file v4.
2021-08-12 13:23:31 +03:00
3a74c95016 Remove internal debugedit
Do not build internal debugedit and its tests. Debugedit is now external
package.
2021-04-29 22:39:57 +03:00
bb6b349cb4 Move brp-bytecompile_python and brp-hardlink_pyo_pyc to rpm-build-python
If there are .py files to bytecompile, then rpm-build-python has to be
installed, so move these scripts to rpm-build-python where they belong.
2021-04-29 12:00:00 +00:00
Panu Matilainen
e3bd69c7df Add a built-in macro for fetching number of CPUs, affinity aware and all
There's an increasing number of placing wanting to know the number of
CPU's for parallel processing, and increasingly these things are running
in containers and such where the total host CPU count is not meaningful.

Merged-by: Vitaly Chikunov <vt@altlinux.org>
2020-12-08 22:47:59 +03:00
14e97e6b25 tests: Add debugedit tests
Copy reduced tests/Makefile.am from RPM upstream and make tests work.
2020-11-10 06:43:20 +03:00
08c5331f48 debugedit: Build newly imported debugedit 2020-11-09 23:07:25 +03:00
8b68c147ee brp-sign-kmodules: Sign kernel modules after kernel build
Try to work similar to `CONFIG_MODULE_SIG_ALL=y'.
2020-11-06 15:16:45 +03:00
5cc014bed6 Process debuginfo in parallel
- Split processing of single binary into separate script.
- Call it from xargs -P.
2020-07-05 01:06:16 +03:00
0954baaf05 Remove AM_INTL_SUBDIR
This macro is no longer exported by gettext.
2020-01-03 19:33:48 +00:00
Anton V. Boyarshinov
54a2ca259c Auto-requies on binaries used in systemd .service files added 2019-12-26 14:09:03 +00:00
90d5486688 Check for cookie_io_functions_t provided by stdio.h
Do not check for libio.h, it's not included anyway.
Check for cookie_io_functions_t and conditionalize
on HAVE_COOKIE_IO_FUNCTIONS_T instead.
2019-11-24 11:58:18 +00:00
Alexey Tourbin
72ad101add 4.0.4-alt113
- Implemented limited support for large files: a 2GB+ file can now be packaged,
  but the total size of uncompressed cpio payload is capped at 4 GB.
- Automatically downgrade LZMA compression levels 7-9 -> 6 on small payloads.
2018-06-26 13:03:42 +03:00
Alexey Tourbin
d410a87e93 configure.ac: enabled large-file support
This turns out to be a bit easier than I thought yesterday.  When mmap
fails in lib/fsm.c, it falls back to file descriptor IO.  So by simply
enabling AC_SYS_LARGEFILE, I'm already able to package a 3G file, which
can be written like this:

perl -e 'seek STDOUT,3<<30,0 and print 1 or die' >out
2018-06-26 12:42:44 +03:00
Gleb Fotengauer-Malinovskiy
e9dcdf727e Introduce mips{,n32,64}{,el}, riscv64, and s390x architectures 2018-05-29 13:13:20 +03:00
96a5445b98 Drop bzdio support
There is no use in supporting bzip2 compressed payloads in rpmbuild nowadays.
2017-11-20 01:42:20 +00:00
7a81369647 Introduce brp-check_contents
Add a brp interface for checking contents of files in buildroot.
The initial revision of brp-check_contents scripts checks
for suspicious path names like /var/lib/run, complementing
the change introduced in sisyphus_check-0.8.43-alt1.
2017-10-25 03:16:59 +00:00
Gleb Fotengauer-Malinovskiy
3691deca51 Rename macros and rpmrc to buildmacros and rpmbuildrc
This change is needed only for rpm-4.13+rpmbuild-4.0.4 bootstrap.
Files in rpm-4.13 can and should be compatible with rpmbuild-4.0.4 and
vice versa.
2016-12-08 19:23:33 +03:00
8c1f9d589b Move "is this ELF shared object an executable" check to a separate script
* configure.ac (AC_OUTPUT): Add scripts/fixup-libraries.
* rpm-4_0.spec (%files build): Add %_rpmlibdir/is_elf_so_executable.
* scripts/is_elf_so_executable: New file.
* scripts/Makefile.am (EXTRA_DIST, config_SCRIPTS): Add it.
* scripts/fixup-libraries: Rename to scripts/fixup-libraries.in,
use is_elf_so_executable.
2016-12-07 11:30:42 +00:00
Ivan Zakharyaschev
0f969acf44 percolate: register it in Makefile etc. 2016-04-05 22:57:42 +03:00
1ccc182f71 build: rewrite without using nested functions
gcc generates trampolines for pointers to nested functions.
This implies executable stack - the thing we want to avoid.
2015-01-28 17:04:30 +00:00
880573c77f configure.in: rename to configure.ac 2013-10-28 00:35:31 +00:00