summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Call RPM_CONFIGDIR just that consistentlyPanu Matilainen2023-03-301-2/+2
| | | | | | For whatever historical reasons RPMCONFIGDIR was used in automake whereas the environment variable is RPM_CONFIGDIR. Just call it that everywhere.
* Add --generate-subpackages to find_lang.shFlorian Festi2023-01-171-0/+40
| | | | | | | using the new dynamic spec feature. It creates one sub package by language. Resolves: #1276
* brp-remove-la-files: use -0 to work on macOSSean Molenaar2022-12-301-2/+2
|
* Avoid unnecessary variables for cmake target data, part 3Panu Matilainen2022-11-281-7/+5
| | | | These don't really add any value over just passing them to install()
* Remove autotools buildPanu Matilainen2022-10-211-44/+0
| | | | | | | | | | There are some missing bits and pieces still to be done for cmake build, but that is so much easier if you don't have to worry about keeping compatibility with the system you're about to remove that it doesn't make sense to drag this on any further. The sooner this is over, the sooner it is over and we can start making use of cmake's advantages instead of just trying to bend over backwards to maintain compatibility with the autotools build.
* Fix a race condition in brp-stripShreenidhi Shedi2022-09-131-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | brp-strip script runs strip command on deliverables paralley and if deliverables are hard linked inside buildroot, it will create contention. One good example for such package is git. https://github.com/vmware/photon/blob/master/SPECS/git/git.spec ``` Sample output: $ rpm -ql git | grep libexec | xargs ls -li 668153 -rwxr-xr-x 137 root root 3401056 Aug 2 08:30 /usr/libexec/git-core/git 668153 -rwxr-xr-x 137 root root 3401056 Aug 2 08:30 /usr/libexec/git-core/git-add 787238 -rwxr-xr-x 1 root root 47770 Aug 2 08:30 /usr/libexec/git-core/git-add--interactive 668153 -rwxr-xr-x 137 root root 3401056 Aug 2 08:30 /usr/libexec/git-core/git-am ``` To overcome this, we run strip twice once for all files with no hardlinks, this is a parallel job, meaning multiple binaries will be stripped in parallel. And once for files with hardlinks, in this case we disable parallel processing and strip binaries in sequential order. RH bug link: https://bugzilla.redhat.com/show_bug.cgi?id=1959049 Co-authored-by: Dweep Advani <dadvani@vmware.com> Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
* rpm2cpio.sh: only read needed bytes of file magicFlorian Festi2022-08-101-1/+1
| | | | | As we look at the first 4 bytes anyway there is no reason to read more. Reading more also hits a bug in bash on aarch64 (rhbz#2115206).
* rpm2cpio.sh: Improve error messageFlorian Festi2022-07-131-1/+1
| | | | | | for unknown payload compression format. At this point it is unlikely this isn't an RPM file as we detected the headers but much more likely the package is using a newer compression format.
* rpm2cpio.sh: Deal with null byte in lzma magicFlorian Festi2022-07-131-6/+6
| | | | | | | | | As the shell can't deal with null bytes only read two bytes and check for proper match. This way we can match for the null byte even if it is not part of the string. This also silents the warning from the shell that there is a null byte being ignored in the magic string for lzma.
* rpm2cpio.sh: strip null bytes with trFlorian Festi2022-07-131-2/+2
| | | | to avoid warnings
* rpm2cpio.sh: Don't drop newlines from header sizesFlorian Festi2022-07-131-1/+5
| | | | | | | | | This script converts binary header sizes to decimal numbers. Shell is not that well suited for this task as it drops newlines at the end of command substitutions. Add a . character at the end and strip it right after that to avoid this problem. Resolves: rhbz#1983015
* rpm2cpio.sh: Check for header magicFlorian Festi2022-07-131-0/+6
| | | | | This make is much less likely to mistake a file as an RPM and will catch errors in header size calculation.
* Exclude *.src.rpm from check-buildrootFlorian Festi2022-07-111-0/+1
| | | | | | | | With the SRPMs now containing the expanded spec file they are bound to have the build root included in the header. Turns out some people package SRPMs to rebuild them locally e.g. against the local kernel. Resolves: rhbz#2104150
* Add an experimental CMake build systemPanu Matilainen2022-06-281-0/+22
| | | | | | | | | | | | | | | | | This is an incomplete release-early version, NOT intended or suitable for production use. It is intended to replace the autotools based buildsystem in rpm 4.20, until then it'll be developed alongside it. This causes some extra complications of course, but then we avoid a huge flag-day, and that matters more. To those wondering why cmake and not ${myfavorite}: the community around us effectively made that choice for us. We've made a lot of noise about bootstrap dependencies. When libsolv, dnf and all the related stack is powered by cmake build, it'd be just foolish to go with anything else. This way people working on the rpm stack have only one build system to learn, there's peer support available nearby and bootstrap dependencies are reduced, not increased. It also doesn't hurt that cmake is actually and actively maintained.
* Prevent readelf internet access during rpaths checking (RhBug:2079600)Panu Matilainen2022-06-221-1/+1
| | | | | | | | | Recent binutils can do debug section lookups over the internet, but this is something we never want during rpmbuild (everything else aside, we're just building the thing so there wont be anything on the net anyhow). Disable the lookups by setting DEBUGINFOD_URLS to empty rather than using the specific option as this is compatible with any old version of readelf.
* check-buildroot script: use export to set LANGPavel Valena2022-05-021-1/+2
| | | | for find as well this ensures correct file processing.
* check-buildroot script: Double-Quote the variablesPavel Valena2022-05-021-1/+1
| | | | to expand the command correctly (SC2086).
* check-buildroot: Redirect xargs stderr to $tmpPavel Valena2022-05-021-1/+1
| | | | | allows failing on various errors as well (and ensures proper handling of the output in case it changes again).
* check-buildroot script: use if-then-elsePavel Valena2022-05-021-2/+2
| | | | | instead of && and ||. Enhances readability and avoids unnecessary errors in case ||: would be omitted.
* check-buildroot: harden $tmp creationPavel Valena2022-05-021-2/+4
| | | | | | Add quotes and check for path writability. Also process evaluate $tmp as part of trap, not expanding the the variable into string.
* Fix check-buildroot missing matches with grep >= 3.5Panu Matilainen2022-04-041-1/+1
| | | | | | | | | | | Since 3.5, grep emits the diagnostic "binary file matches" message to stderr which causes the result file to be empty and build continuing despite an obvious error being present. We're not interested in the match itself, only whether there are files with matches. Grep has a standard option for this (-l), use it. Fixes: #1968
* Fix stupid thinko in commit d0ad515494d1170d36f548e6b8e03038767764b0Panu Matilainen2022-03-031-1/+1
| | | | `find` options all have just one dash. Regression of a regression, sigh.
* Add a rpm_macro() provides generatorDan Čermák2022-01-252-0/+37
| | | | | | This commit adds a very simple provides generator for rpm macros as suggested on the Fedora packaging mailing list: https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/DUFER7QAFYIBYDANJQQ37FBNL5YISZQ2/
* Fix brp-compress regression from f3f763e54dbbcced146b2f9e826a2530ac003a8bPanu Matilainen2022-01-141-2/+2
| | | | | | | | | | Since that commit builds would fail with RPM build errors: Installed (but unpackaged) file(s) found: /.gz Use a similar find -print0 construct as the other loop above.
* remove-la-files: Use file to check for libtool filesTimm Bäder2021-11-171-1/+3
| | | | | Try to minimize accidentally removed .la files that aren't libtool .la files.
* Revert "Don't brp-strip .ko files"Michal Domonkos2021-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original commit might have seemed like an easy remedy for third-party modules affected by commit 0ab151a (such as rhbz#1967291), but it also prevents the modules built from the kernel tree (which employ a different signing strategy, see below) from being stripped off of debug and symbol data, so it's not the correct solution after all. Simply put, *.ko files *are* ELF files, so there's no good reason to skip them. Third-party modules should instead adopt the same hack as the in-tree ones, i.e. overriding the %__spec_post_install macro so that the signing occurs as a last step, after any kind of stripping has taken place. Example from kernel.spec: %define __modsign_install_post \ # Do the signing here [...] %define __spec_install_post \ # eu-strip(1) gets called here %{?__debug_package:%{__debug_install_post}}\ %{__arch_install_post}\ # ... or strip(1) gets called here %{__os_install_post}\ %{__remove_unwanted_dbginfo_install_post}\ %{__modsign_install_post} It's still a hack, but it's better than avoiding the strip altogether. This reverts commit cfdb8300f6e3aed0abc41406a3c4737eb1192067.
* Fix broken output of check-rpaths-workerJonathan Wakely2021-11-101-2/+3
| | | | | The `$lower` variable is always empty, see https://bugzilla.redhat.com/show_bug.cgi?id=2019804 This also changes the badness 32 message to say "a rpath" or "a runpath" which isn't perfect, but is certainly better than "an runpath".
* Update OCaml requires/provides to ignore cmxsOlaf Hering2021-11-101-1/+5
| | | | | | | | | | | | | | OCaml cmxs files are static libraries, which can be loaded at runtime via the Dynlink module. They apparently do not provide any useful runtime dependency information to be stored into the packages Provides/Requires list. Therefore just skip them. Adjust attr, remove extension and ELF magic Adjust ocamldeps, do nothing with cmxs files. Fixes: a6fe37c39b39acbcbd014dd1e6d5653ff84254a1 Signed-off-by: Olaf Hering <olaf@aepfle.de>
* Make brp-strip-comment-note multi processFlorian Festi2021-10-141-3/+2
| | | | | | Run at least the file classification in parallel Resolves: #1230
* Don't strip ELF files with "no machine"Florian Festi2021-09-281-1/+1
| | | | | | | | as strip fails on them (if they are Guile object files). This adds another layer of protection as *.go files are already filtered out. Resolves: #1765
* Don't strip *.go filesFlorian Festi2021-09-281-1/+1
| | | | | | | | as those may be Guile object files. Those are ELF files but cannot be stripped. This may also exclude other files (like Golang sources) but that should not be an issue. Resolves: #1765
* Fix indentation in brp-compressMarek Kulik2021-09-141-27/+27
|
* Fix handling filenames with spaces in brp-compressMarek Kulik2021-09-141-15/+15
|
* Don't brp-strip .ko filesMichal Domonkos2021-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise SecureBoot signatures may be stripped too. We used to exclude shared libraries from this strip as they were supposed to be covered by another brp script (brp-strip-shared), however it turned out the latter was never really used, so we removed the exclusion in commit 0ab151ab138fd4fb6d3176fd0270d9cc6f4623f3. As it turns out, that was a little too ambitious, since we may now inadvertently strip SecureBoot signatures from kernel modules too, provided that they're made during the build, prior to the invocation of brp-strip. Note that this regression currently does *not* affect the following two cases on Fedora/RHEL systems with redhat-rpm-config installed: - in-tree kernel modules; these are built from kernel.spec which already contains a hack ensuring that module signing only happens *after* any stripping (see %__modsign_install_post in kernel.spec) - out-of-tree kernel modules built with debuginfo enabled; this is because brp-strip is only called when %debug_package is set to %{nil} Any other combinations may be affected, depending on the macros and .spec files used, so let's fix this by effectively "reverting" said commit for .ko files only. Fixes: rhbz#1967291
* Add quoting to literal curly bracketsMichal Domonkos2021-06-281-2/+2
| | | | | | | | | | These curly brackets are already treated as literals by the shell, so let's make that explicit for clarity, and silence a ShellCheck warning at the same time. More info: https://github.com/koalaman/shellcheck/wiki/SC1083 Found by ShellCheck.
* Allow /usr/libexec/* rpathsCharalampos Stratakis2021-06-221-0/+2
| | | | | | | An RPATH or RUNPATH pointing to directories owned by a package in /usr/libexec/* is a valid case and should be allowed by the check-rpath script. Related: #1719
* check-rpaths: Look for RPATH and RUNPATH in one goFlorian Festi2021-06-221-5/+5
| | | | Calculate $lower from the actual match
* Don't break readelf output at 80 charactersFlorian Festi2021-06-221-1/+1
| | | | | | by adding -W Related: #1713
* Run rpath check in parallelFlorian Festi2021-06-221-1/+3
| | | | | | using RPM_BUILD_NCPUS Related: #1713
* Use external debuginfo toolingPanu Matilainen2021-06-212-689/+1
| | | | | | | | | | | | | | There's been an increasing interest in the wider community to use the debuginfo tooling outside rpm context, and deep ELF format internals are not rpm's core business anyhow, the reasons for it being here are entirely historical. So without further ado, remove the debuginfo tooling from rpm and rely on the external debugedit project from now on. Update INSTALL to document the new dependency, and add conditionals to relevant debuginfo build tests. The lower-level debugedit and sepdebugcrcfix tools are tested in the external project, no need to duplicate that here.
* Add brp-remove-la-files scriptTimm Bäder2021-06-112-0/+10
| | | | | | | .la files are libtool files and should generally not be installed. Tons of spec files contain a 'find' command to remove them. Add a helper script that automatically removes all .la files from the build root and let projects that need them opt out of this instead.
* Kick out libtool dependency generatorPanu Matilainen2021-06-102-44/+2
| | | | | | | People mostly only care about removing any .la files present in their packages, I've yet to see a single use of a desired/used libtool() dependency during its 14 year existence in rpm. There are enough provides in the world without creating unused ones just because.
* Drop unused and unmaintained gcj compilation build root policyPanu Matilainen2021-05-272-43/+2
| | | | | | | | GCC dropped the entire java works from GCC 7 in 2017 [*] so in recent times this has been doing exactly nothing at all because gcj doesn't even exist. Bye bye. [*] https://gcc.gnu.org/gcc-7/changes.html
* Remove ancient, unused and unmaintained scripts from repoPanu Matilainen2021-05-272-2011/+0
| | | | | These have never been included in tarballs even, so chances are people are not going to miss them too much.
* Remove ancient unused and unmaintained php dependency generatorsPanu Matilainen2021-05-273-66/+0
|
* Remove remaining Python helpers and scripts from the repoPanu Matilainen2021-05-274-602/+6
| | | | | | | These are far better maintained by the Python community, in a repository of their own: https://github.com/rpm-software-management/python-rpm-packaging/
* find-lang.sh: Support long languages names for QTFlorian Festi2021-04-271-7/+7
| | | | | | | | | Most language abbreviations are just two characters but some are longer. Allow an arbiraty number of character instead of exactly two in the names of .qm files (QT translations). This brings the handling of .qm files in line with all other file types. Resolves: #1642
* Revert strict buildroot content checks for nowPanu Matilainen2021-04-081-1/+1
| | | | | | | | | | | | Turns out people are using %check in various "unexpected" ways, some of which are also tied to our long-standing %exclude semantics. We need need better %check which doesn't rely on or allow messing with actual buildroot contents, but there's simply too much plate for a too short a time-frame to try and do that. Revert to old buggy buildroot checking to give time to come up with better solutions to the %check issues. This reverts c1ca2e35025698328edcefa8dedee866d2ea0596 and 1110c280639b66c89da19a0f831af28845591997.
* scripts/pythondistdeps: Fix for Python 3.10Tomas Orsava2021-03-151-1/+9
| | | | | | self.name in PathDistribution is a property in Python 3.10+ and thus we can't redefine it as an instance variable. Instead we explicitly define it as a property, which works on all supported Python versions.
* Also check DT_RUNPATH when looking for rpath issuesSiddhesh Poyarekar2021-01-291-16/+22
| | | | | | | | | | | DT_RPATH has been deprecated in favour of DT_RUNPATH for some time now and both have similar functionality. RUNPATH is less infectious, i.e. it does not affect search paths for dependency resolution of dependencies, but that only limits the issues insecure paths may cause and does not eliminate them. It is therefore necessary to check both RPATH and RUNPATH for the same issues.