From bb9a1a8ffab8678eff328ce46e7d4f71afc2f07d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Apr 2015 20:33:17 +0000 Subject: [PATCH 01/57] Initial setup of the repo --- .gitignore | 0 sources | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/sources b/sources new file mode 100644 index 0000000..e69de29 From c57ae944ba83ee6983d89f993237e1f2a6c0b353 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 29 Apr 2015 14:40:24 -0600 Subject: [PATCH 02/57] epel only package --- .gitignore | 0 dead.package | 1 + sources | 0 3 files changed, 1 insertion(+) delete mode 100644 .gitignore create mode 100644 dead.package delete mode 100644 sources diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..bb1f637 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +epel only package diff --git a/sources b/sources deleted file mode 100644 index e69de29..0000000 From 710aef5c006d4982fe510e1ddaf837a9232256f3 Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: Fri, 19 Jul 2019 12:26:55 -0400 Subject: [PATCH 03/57] "Adding package.cfg file" --- package.cfg | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 package.cfg diff --git a/package.cfg b/package.cfg new file mode 100644 index 0000000..66ea79d --- /dev/null +++ b/package.cfg @@ -0,0 +1,2 @@ +[koji] +targets = epel8 epel8-playground \ No newline at end of file From 1ebe3692b2846bf156ba5842c6cd8ab025341c3c Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Fri, 19 Jul 2019 12:50:30 -0400 Subject: [PATCH 04/57] Make an initial macro set for 8. --- GPL | 339 +++++++++++++++++++++++++++++++++++++++ dead.package | 1 - epel-rpm-macros.spec | 111 +++++++++++++ macros.epel-rpm-macros | 18 +++ macros.zzz-epel-override | 3 + rpmlint.cf | 1 + sources | 0 7 files changed, 472 insertions(+), 1 deletion(-) create mode 100644 GPL delete mode 100644 dead.package create mode 100644 epel-rpm-macros.spec create mode 100644 macros.epel-rpm-macros create mode 100644 macros.zzz-epel-override create mode 100644 rpmlint.cf create mode 100644 sources diff --git a/GPL b/GPL new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/GPL @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/dead.package b/dead.package deleted file mode 100644 index bb1f637..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -epel only package diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec new file mode 100644 index 0000000..2c6f76b --- /dev/null +++ b/epel-rpm-macros.spec @@ -0,0 +1,111 @@ +Name: epel-rpm-macros +Version: 8 +Release: 1 +Summary: Extra Packages for Enterprise Linux RPM macros + +Group: System Environment/Base +License: GPLv2 + +# This is a EPEL maintained package which is specific to +# our distribution. Thus the source is only available from +# within this srpm. +URL: http://download.fedoraproject.org/pub/epel +Source0: macros.epel-rpm-macros +Source1: macros.zzz-epel-override +Source9: GPL + +BuildArch: noarch +Requires: redhat-release >= %{version} +# For python buildroot macros +Requires: python-srpm-macros +# Since the RHEL python-devel package doesn't require them, bring them in here +# python3-rpm-macros is brought in by python3X-devel +Requires: python-rpm-macros +Requires: python2-rpm-macros + +%description +This package contains the Extra Packages for Enterprise Linux (EPEL) RPM +macros for building EPEL packages. + +%prep +%setup -cT +install -pm 644 %{SOURCE9} . + +%install +#GPG Key +# Can't depend upon %%rpmmacrodir yet, since we're providing it +install -Dpm 644 %{SOURCE0} \ + %buildroot/usr/lib/rpm/macros.d/macros.epel-rpm-macros + +install -Dpm 644 %{SOURCE1} \ + %buildroot/etc/rpm/macros.zzz-epel-override + +%files +%license GPL +/usr/lib/rpm/macros.d/macros.epel-rpm-macros +/etc/rpm/macros.zzz-epel-override + + +%changelog +* Wed Jun 5 2019 Stephen Smoogen - 8-1 +- Make an initial macro set for 8. + +* Fri Jun 15 2018 Jason L Tibbitts III - 7-19 +- Add %%set_build_flags macro. + +* Mon May 14 2018 Jason L Tibbitts III - 7-18 +- Add various %%build_* macros from Fedora. + +* Fri Apr 20 2018 Jason L Tibbitts III - 7-17 +- Add %%_rpmmacrodir from Fedora. + +* Fri Apr 20 2018 Jason L Tibbitts III - 7-16 +- Add %%_metainfodir macro. + +* Thu Feb 15 2018 Jason L Tibbitts III - 7-15 +- Add %%vimfiles_root (bug #1545901) + +* Mon Jan 29 2018 Igor Gnatenko - 7-14 +- Backport ldconfig macros + +* Thu Dec 15 2016 Jason L Tibbitts III - 7-13 +- Backport vpath macros. + +* Fri Dec 9 2016 Orion Poplawski 7-12 +- Fix override macro file name + +* Tue Dec 6 2016 Orion Poplawski 7-11 +- Override %%_pkgdocdir (bug #1392354) + +* Fri Sep 16 2016 Jason L Tibbitts III - 7-10 +- Add overrides file (seems that it must be in /etc/rpm) and override + %%nodejs_arches. + +* Thu Aug 11 2016 Jason L Tibbitts III - 7-9 +- Add %%bash_completion_dir. + +* Wed Mar 30 2016 Jason L Tibbitts III - 7-8 +- Use simpler definition of %%epel. + +* Thu Feb 18 2016 Jason L Tibbitts III - 7-7 +- Add mono macros requested in rhbz 1295117. + +* Mon Jan 25 2016 Orion Poplawski 7-6 +- Bring in python macros via the python-rpm-macros packages +- Use %%setup so fedpkg local works + +* Mon Jan 4 2016 Orion Poplawski 7-5 +- Fix python_provide macro for EPEL7 python3 package names + +* Thu Oct 8 2015 Thomas Spura - 7-4 +- Fix python_provide macro to use epoch and obsolete previous python- package + +* Tue Aug 18 2015 Orion Poplawski 7-3 +- Fix py2_install macro +- Cleanup spec + +* Sat Aug 01 2015 Kevin Fenzi 7-2 +- Add python macros. Fixes bug #1241655 + +* Wed Apr 29 2015 Kevin Fenzi 7-1 +- Initial version for epel. diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros new file mode 100644 index 0000000..aee816a --- /dev/null +++ b/macros.epel-rpm-macros @@ -0,0 +1,18 @@ +# epel macros + +%epel 8 + +# Mono macros requested in rhbz 1295117 +%mono_arches %{ix86} x86_64 sparc sparcv9 ia64 %{arm} alpha s390x ppc ppc64 ppc64le +%_monodir %{_prefix}/lib/mono +%_monogacdir %{_monodir}/gac + +# A directory for rpm macros +%rpmmacrodir /usr/lib/rpm/macros.d + +# Upstream RPM has this in Fedora, obsoleting the one above. +%_rpmmacrodir /usr/lib/rpm/macros.d + +# Bash completions; not in bash to not intefere with install ordering +%bash_completion_dir /usr/share/bash-completion/completions/ + diff --git a/macros.zzz-epel-override b/macros.zzz-epel-override new file mode 100644 index 0000000..3f184c3 --- /dev/null +++ b/macros.zzz-epel-override @@ -0,0 +1,3 @@ +# This file is used _only_ to override macros which exist in RHEL. +# It should be used very sparingly. + diff --git a/rpmlint.cf b/rpmlint.cf new file mode 100644 index 0000000..557f414 --- /dev/null +++ b/rpmlint.cf @@ -0,0 +1 @@ +addFilter("no-%build-section") diff --git a/sources b/sources new file mode 100644 index 0000000..e69de29 From 77c53c7dc64e8b0bf823f4f25698e11d9b31517b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 30 Sep 2019 14:44:50 +0200 Subject: [PATCH 05/57] Define %python2 and %python3 See https://pagure.io/packaging-committee/issue/907 Redefine %__pythonX to change the behavior of %pythonX, %pythonX_version, etc. Use %pythonX in spec. --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 2c6f76b..c7b4f42 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 1 +Release: 2 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -47,6 +47,9 @@ install -Dpm 644 %{SOURCE1} \ %changelog +* Mon Sep 30 2019 Miro Hrončok - 8-2 +- Define %%python2 and %%python3 + * Wed Jun 5 2019 Stephen Smoogen - 8-1 - Make an initial macro set for 8. diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index aee816a..745946c 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -16,3 +16,6 @@ # Bash completions; not in bash to not intefere with install ordering %bash_completion_dir /usr/share/bash-completion/completions/ +# Use the non-underscored Python macros to refer to Python in spec, etc. +%python2 %__python2 +%python3 %__python3 From c32cf91d2ec7fa4022bccd0dafd369473d0250c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 21 Oct 2019 18:13:22 +0200 Subject: [PATCH 06/57] Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 instead of /usr/libexec/platform-python --- epel-rpm-macros.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index c7b4f42..e8563fa 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 2 +Release: 3 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -19,9 +19,10 @@ Requires: redhat-release >= %{version} # For python buildroot macros Requires: python-srpm-macros # Since the RHEL python-devel package doesn't require them, bring them in here -# python3-rpm-macros is brought in by python3X-devel Requires: python-rpm-macros Requires: python2-rpm-macros +# Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 instead of /usr/libexec/platform-python +Requires: (python-modular-rpm-macros if python3-devel) %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -47,6 +48,9 @@ install -Dpm 644 %{SOURCE1} \ %changelog +* Mon Oct 21 2019 Miro Hrončok - 8-3 +- Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 instead of /usr/libexec/platform-python + * Mon Sep 30 2019 Miro Hrončok - 8-2 - Define %%python2 and %%python3 From 4bf0de73c5aba16740bc02fc836a70de87e7c718 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 30 Oct 2019 17:22:18 -0600 Subject: [PATCH 07/57] Add gpgverify macro and script --- epel-rpm-macros.spec | 10 +++- gpgverify | 116 +++++++++++++++++++++++++++++++++++++++++ macros.epel-rpm-macros | 3 ++ 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100755 gpgverify diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index e8563fa..fd3301c 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 3 +Release: 4 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -12,6 +12,7 @@ License: GPLv2 URL: http://download.fedoraproject.org/pub/epel Source0: macros.epel-rpm-macros Source1: macros.zzz-epel-override +Source2: gpgverify Source9: GPL BuildArch: noarch @@ -41,13 +42,20 @@ install -Dpm 644 %{SOURCE0} \ install -Dpm 644 %{SOURCE1} \ %buildroot/etc/rpm/macros.zzz-epel-override +install -Dpm 755 %{SOURCE2} \ + %{buildroot}%{_rpmconfigdir}/gpgverify + %files %license GPL /usr/lib/rpm/macros.d/macros.epel-rpm-macros /etc/rpm/macros.zzz-epel-override +%{_rpmconfigdir}/gpgverify %changelog +* Wed Oct 30 2019 Orion Poplawski - 8-4 +- Add gpgverify macro and script + * Mon Oct 21 2019 Miro Hrončok - 8-3 - Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 instead of /usr/libexec/platform-python diff --git a/gpgverify b/gpgverify new file mode 100755 index 0000000..1673549 --- /dev/null +++ b/gpgverify @@ -0,0 +1,116 @@ +#!/bin/bash + +# Copyright 2018 B. Persson, Bjorn@Rombobeorn.se +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +function print_help { + cat <<'EOF' +Usage: gpgverify --keyring= --signature= --data= + +gpgverify is a wrapper around gpgv designed for easy and safe scripting. It +verifies a file against a detached OpenPGP signature and a keyring. The keyring +shall contain all the keys that are trusted to certify the authenticity of the +file, and must not contain any untrusted keys. + +The differences, compared to invoking gpgv directly, are that gpgverify accepts +the keyring in either ASCII-armored or unarmored form, and that it will not +accidentally use a default keyring in addition to the specified one. + +Parameters: + --keyring= keyring with all the trusted keys and no others + --signature= detached signature to verify + --data= file to verify against the signature +EOF +} + + +fatal_error() { + message="$1" # an error message + status=$2 # a number to use as the exit code + echo "gpgverify: $message" >&2 + exit $status +} + + +require_parameter() { + term="$1" # a term for a required parameter + value="$2" # Complain and terminate if this value is empty. + if test -z "${value}" ; then + fatal_error "No ${term} was provided." 2 + fi +} + + +check_status() { + action="$1" # a string that describes the action that was attempted + status=$2 # the exit code of the command + if test $status -ne 0 ; then + fatal_error "$action failed." $status + fi +} + + +# Parse the command line. +keyring= +signature= +data= +for parameter in "$@" ; do + case "${parameter}" in + (--help) + print_help + exit + ;; + (--keyring=*) + keyring="${parameter#*=}" + ;; + (--signature=*) + signature="${parameter#*=}" + ;; + (--data=*) + data="${parameter#*=}" + ;; + (*) + fatal_error "Unknown parameter: \"${parameter}\"" 2 + ;; + esac +done +require_parameter 'keyring' "${keyring}" +require_parameter 'signature' "${signature}" +require_parameter 'data file' "${data}" + +# Make a temporary working directory. +workdir="$(mktemp --directory)" +check_status 'Making a temporary directory' $? +workring="${workdir}/keyring.gpg" + +# Decode any ASCII armor on the keyring. This is harmless if the keyring isn't +# ASCII-armored. +gpg2 --homedir="${workdir}" --yes --output="${workring}" --dearmor "${keyring}" +check_status 'Decoding the keyring' $? + +# Verify the signature using the decoded keyring. +gpgv2 --homedir="${workdir}" --keyring="${workring}" "${signature}" "${data}" +check_status 'Signature verification' $? + +# (--homedir isn't actually necessary. --dearmor processes only the input file, +# and if --keyring is used and contains a slash, then gpgv2 uses only that +# keyring. Thus neither command will look for a default keyring, but --homedir +# makes extra double sure that no default keyring will be touched in case +# another version of GPG works differently.) + +# Clean up. (This is not done in case of an error that may need inspection.) +rm --recursive --force ${workdir} diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 745946c..7aea262 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -19,3 +19,6 @@ # Use the non-underscored Python macros to refer to Python in spec, etc. %python2 %__python2 %python3 %__python3 + +# gpgverify verifies signed sources. There is documentation in the script. +%gpgverify %{_rpmconfigdir}/gpgverify From 76a0765e0ef0b8029315c8d9747eceda19e43b39 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 13 Nov 2019 14:47:14 -0800 Subject: [PATCH 08/57] bump release because 8-4 was built in playground Signed-off-by: Kevin Fenzi --- epel-rpm-macros.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index fd3301c..b23583e 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 4 +Release: 5 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -53,6 +53,9 @@ install -Dpm 755 %{SOURCE2} \ %changelog +* Wed Nov 13 2019 Kevin Fenzi - 8-5 +- Bump release, because 8-4 was built in epel8-playground + * Wed Oct 30 2019 Orion Poplawski - 8-4 - Add gpgverify macro and script From 170a25dd506f5b1f25b514320991250c473d2d22 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 13 Nov 2019 14:51:28 -0800 Subject: [PATCH 09/57] This package should NOT build for both epel8 and epel8-playground. Signed-off-by: Kevin Fenzi --- package.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.cfg b/package.cfg index 66ea79d..b728443 100644 --- a/package.cfg +++ b/package.cfg @@ -1,2 +1,2 @@ [koji] -targets = epel8 epel8-playground \ No newline at end of file +targets = epel8 From 0a2c9ff3ae987f63e5cbd04ba6252a6a8f350b86 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Wed, 20 Nov 2019 13:51:48 -0800 Subject: [PATCH 10/57] Enable auto python requires generation --- epel-rpm-macros.spec | 10 +++++++++- pythondist.attr | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 pythondist.attr diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index b23583e..c9011fa 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 5 +Release: 6 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -13,6 +13,7 @@ URL: http://download.fedoraproject.org/pub/epel Source0: macros.epel-rpm-macros Source1: macros.zzz-epel-override Source2: gpgverify +Source3: pythondist.attr Source9: GPL BuildArch: noarch @@ -45,14 +46,21 @@ install -Dpm 644 %{SOURCE1} \ install -Dpm 755 %{SOURCE2} \ %{buildroot}%{_rpmconfigdir}/gpgverify +install -Dpm 644 %{SOURCE3} \ + %{buildroot}%{_fileattrsdir}/pythondist.attr + %files %license GPL /usr/lib/rpm/macros.d/macros.epel-rpm-macros /etc/rpm/macros.zzz-epel-override %{_rpmconfigdir}/gpgverify +%{_fileattrsdir}/pythondist.attr %changelog +* Wed Nov 20 2019 Troy Dawson - 8-6 +- Enable python requires generator + * Wed Nov 13 2019 Kevin Fenzi - 8-5 - Bump release, because 8-4 was built in epel8-playground diff --git a/pythondist.attr b/pythondist.attr new file mode 100644 index 0000000..2bf737a --- /dev/null +++ b/pythondist.attr @@ -0,0 +1,3 @@ +%__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides +%__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires +%__pythondist_path ^/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ From 55df88613e99f4a547c6f979541e2d16362c87f9 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Thu, 21 Nov 2019 11:44:32 -0800 Subject: [PATCH 11/57] Bump release to be in sync with playground build. --- epel-rpm-macros.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index c9011fa..2e2b506 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 6 +Release: 8 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -58,6 +58,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Thu Nov 21 2019 Troy Dawson - 8-8 +- Bump release to be in sync with playground build. + * Wed Nov 20 2019 Troy Dawson - 8-6 - Enable python requires generator From 7d7c796f7b0e86f9a58164fc36f3d5515e58ed2b Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Fri, 3 Apr 2020 12:17:50 -0700 Subject: [PATCH 12/57] Add %qt5_qtwebengine_arches to macros --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 2e2b506..50c2438 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 8 +Release: 9 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -58,6 +58,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Fri Apr 03 2020 Troy Dawson - 8-9 +- Add %qt5_qtwebengine_arches to macros + * Thu Nov 21 2019 Troy Dawson - 8-8 - Bump release to be in sync with playground build. diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 7aea262..7d3b5fa 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -22,3 +22,7 @@ # gpgverify verifies signed sources. There is documentation in the script. %gpgverify %{_rpmconfigdir}/gpgverify + +# qt5 macro removed from RHEL8 but needed to ensure qtwebengine, and +# it's dependencies build on supported arches. +%qt5_qtwebengine_arches %{ix86} x86_64 %{arm} aarch64 mips mipsel mips64el From db76dd30b60d03ab6bb4cd12cdfa938dbe45c8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 14 Apr 2020 14:46:34 +0200 Subject: [PATCH 13/57] Define %python, but make it work only if %__python is redefined --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 50c2438..b5e9190 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 9 +Release: 10 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -58,6 +58,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Tue Apr 14 2020 Miro Hrončok - 8-10 +- Define %%python, but make it work only if %%__python is redefined + * Fri Apr 03 2020 Troy Dawson - 8-9 - Add %qt5_qtwebengine_arches to macros diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 7d3b5fa..ac5376f 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -20,6 +20,16 @@ %python2 %__python2 %python3 %__python3 +# Users can use %%python only if they redefined %%__python (e.g. to %%__python3) +%python() %{lua:\ + __python = rpm.expand("%__python")\ + if __python == "/usr/bin/python" then\ + rpm.expand("%{error:Cannot use %%python if %%__python wasn't redefined to something other than /usr/bin/python.}")\ + else\ + print(__python)\ + end\ +} + # gpgverify verifies signed sources. There is documentation in the script. %gpgverify %{_rpmconfigdir}/gpgverify From 64bc4a72f66452112c30865653990a9bca3d4826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 14 Apr 2020 14:46:42 +0200 Subject: [PATCH 14/57] Add the %pycached macro Usage: %files ... %pycached %{python3_sitelib}/foo.py This will list: /usr/lib/python3.8/site-packages/foo.py /usr/lib/python3.8/site-packages/__pycache__/foo.cpython-38{,.opt-?}.pyc Assuming the Python 3 version is 3.8. The bytecode files are globbed, their presence is not checked. This will fail: %pycached %{python3_sitelib}/foo error: %pycached can only be used with paths explicitly ending with .py And so will any of this: %pycached %{python3_sitelib}/* %pycached %{python3_sitelib}/foo.* %pycached %{python3_sitelib}/foo.p? %pycached %{python3_sitelib}/foo.?y %pycached %{python3_sitelib}/foo.?? But this will work: %pycached %{python3_sitelib}/foo*.py And it will generate the following globs: /usr/lib/python3.8/site-packages/foo*.py /usr/lib/python3.8/site-packages/__pycache__/foo*.cpython-38{,.opt-?}.pyc When used with paths that include Python 3 version, it globs with the version: %pycached /opt/python3.10/foo.py Generates: /opt/python3.10/foo.py /opt/python3.10/__pycache__/foo.cpython-310{,.opt-?}.pyc While paths without version have less strict globs: %pycached /custom/foo.py /custom/foo.py /custom/__pycache__/foo.cpython-3*{,.opt-?}.pyc This will generate a warning in RPM build: warning: File listed twice: /custom/__pycache__/foo.cpython-38.opt-1.pyc However it ensures the optimized bytecode is there. --- epel-rpm-macros.spec | 1 + macros.epel-rpm-macros | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index b5e9190..0ce65e9 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -60,6 +60,7 @@ install -Dpm 644 %{SOURCE3} \ %changelog * Tue Apr 14 2020 Miro Hrončok - 8-10 - Define %%python, but make it work only if %%__python is redefined +- Add the %%pycached macro * Fri Apr 03 2020 Troy Dawson - 8-9 - Add %qt5_qtwebengine_arches to macros diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index ac5376f..e7edbba 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -30,6 +30,21 @@ end\ } +# This only supports Python 3.5+ and will never work with Python 2. +# Hence, it has no Python version in the name. +%pycached() %{lua: + path = rpm.expand("%{?1}") + if (string.sub(path, "-3") ~= ".py") then + rpm.expand("%{error:%%pycached can only be used with paths explicitly ending with .py}") + else + print(path) + pyminor = path:match("/python3.(%d+)/") or "*" + dirname = path:match("(.*/)") + modulename = path:match(".*/([^/]+).py") + print("\\n" .. dirname .. "__pycache__/" .. modulename .. ".cpython-3" .. pyminor .. "{,.opt-?}.pyc") + end +} + # gpgverify verifies signed sources. There is documentation in the script. %gpgverify %{_rpmconfigdir}/gpgverify From 93fbfe9fd3f4597fbcc596e45e181cf51f69ccfa Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Thu, 30 Apr 2020 12:33:42 -0700 Subject: [PATCH 15/57] Install python36-rpm-macros or python38-rpm-macros correctly --- epel-rpm-macros.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 0ce65e9..60eaf6b 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 10 +Release: 11 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -23,8 +23,10 @@ Requires: python-srpm-macros # Since the RHEL python-devel package doesn't require them, bring them in here Requires: python-rpm-macros Requires: python2-rpm-macros -# Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 instead of /usr/libexec/platform-python -Requires: (python-modular-rpm-macros if python3-devel) +# Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 or python3.8 +# instead of /usr/libexec/platform-python +Requires: (python36-rpm-macros if python36-devel) +Requires: (python38-rpm-macros if python38-devel) %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -58,6 +60,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Thu Apr 30 2020 Troy Dawson - 8-11 +- Install python36-rpm-macros or python38-rpm-macros correctly + * Tue Apr 14 2020 Miro Hrončok - 8-10 - Define %%python, but make it work only if %%__python is redefined - Add the %%pycached macro From 054c9b6b80635033a7afd3b828762fb7f162a297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 8 Jun 2020 00:12:12 +0200 Subject: [PATCH 16/57] Backport %py_shebang_fix, %pytest, %py_provides --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 60eaf6b..8efc14d 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 11 +Release: 12 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -60,6 +60,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Sun Jun 07 2020 Miro Hrončok - 8-12 +- Backport %%py_shebang_fix, %%pytest, %%py_provides + * Thu Apr 30 2020 Troy Dawson - 8-11 - Install python36-rpm-macros or python38-rpm-macros correctly diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index e7edbba..770dc05 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -20,6 +20,11 @@ %python2 %__python2 %python3 %__python3 +# Simplified version backported from Fedora +%py_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python} %{py_shbang_opts}"} +%py2_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python2} %{py2_shbang_opts}"} +%py3_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python3} %{py3_shbang_opts}"} + # Users can use %%python only if they redefined %%__python (e.g. to %%__python3) %python() %{lua:\ __python = rpm.expand("%__python")\ @@ -45,6 +50,32 @@ end } +# This is intended for Python 3 only, hence also no Python version in the name. +%__pytest /usr/bin/pytest-3 +%pytest %{expand:\\\ + CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ + PATH="%{buildroot}%{_bindir}:$PATH"\\\ + PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\ + PYTHONDONTWRITEBYTECODE=1\\\ + %__pytest} + +%py_provides() %{lua: + local name = rpm.expand('%1') + if name == '%1' then + rpm.expand('%{error:%%py_provides requires at least 1 argument, the name to provide}') + end + local evr = rpm.expand('%2') + if evr == '%2' then + evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}') + end + print('Provides: ' .. name .. ' = ' .. evr .. '\\n') + -- NB: dash needs to be escaped! + if name:match('^python3%-') then + replaced = name:gsub('^python3%-', 'python-') + print('Provides: ' .. replaced .. ' = ' .. evr .. '\\n') + end +} + # gpgverify verifies signed sources. There is documentation in the script. %gpgverify %{_rpmconfigdir}/gpgverify From 07f430f86097a0e248d1304509befac3298fa094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 15 Jun 2020 12:16:08 +0200 Subject: [PATCH 17/57] Allow to combine %pycached with other macros (e.g. %exclude or %ghost) Previous implementation allowed for only one argument to be passed to the %pycached macro, which made it impossible to combine it with other macros. Current implementation allows to pass other macros as arguments to %pycached. Example: %pycached %exclude /path/to/foo.py For macro expansion limitations, the opposite order is not possible. That is to be documented in the guidelines: https://pagure.io/packaging-committee/pull-request/986 Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1838992 Co-authored-by: Marcel Plch --- epel-rpm-macros.spec | 1 + macros.epel-rpm-macros | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 8efc14d..f02234e 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -62,6 +62,7 @@ install -Dpm 644 %{SOURCE3} \ %changelog * Sun Jun 07 2020 Miro Hrončok - 8-12 - Backport %%py_shebang_fix, %%pytest, %%py_provides +- Allow to combine %%pycached with other macros (e.g. %%exclude or %%ghost) (#1838992) * Thu Apr 30 2020 Troy Dawson - 8-11 - Install python36-rpm-macros or python38-rpm-macros correctly diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 770dc05..3aa950c 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -38,7 +38,7 @@ # This only supports Python 3.5+ and will never work with Python 2. # Hence, it has no Python version in the name. %pycached() %{lua: - path = rpm.expand("%{?1}") + path = rpm.expand("%{?*}") if (string.sub(path, "-3") ~= ".py") then rpm.expand("%{error:%%pycached can only be used with paths explicitly ending with .py}") else From 307b3330c011d723855096ae4c80d715abad481c Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Fri, 19 Jun 2020 15:39:43 -0700 Subject: [PATCH 18/57] Use Suggests for python36-rpm-macros --- epel-rpm-macros.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index f02234e..4a0b518 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 12 +Release: 13 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -25,8 +25,8 @@ Requires: python-rpm-macros Requires: python2-rpm-macros # Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 or python3.8 # instead of /usr/libexec/platform-python -Requires: (python36-rpm-macros if python36-devel) -Requires: (python38-rpm-macros if python38-devel) +Requires: (python-modular-rpm-macros if python3-devel) +Suggests: python36-rpm-macros %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -60,6 +60,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Fri Jun 19 2020 Troy Dawson - 8-13 +- Use Suggests for python36-rpm-macros + * Sun Jun 07 2020 Miro Hrončok - 8-12 - Backport %%py_shebang_fix, %%pytest, %%py_provides - Allow to combine %%pycached with other macros (e.g. %%exclude or %%ghost) (#1838992) From ec3dee4d053b649457d44009e7a7bfebfe8ae4dd Mon Sep 17 00:00:00 2001 From: Artur Iwicki Date: Sun, 28 Jun 2020 14:01:31 +0200 Subject: [PATCH 19/57] Add a Requires on fpc-srpm-macros --- epel-rpm-macros.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 4a0b518..49f9efe 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 13 +Release: 14 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -18,6 +18,8 @@ Source9: GPL BuildArch: noarch Requires: redhat-release >= %{version} +# For FPC buildroot macros +Requires: fpc-srpm-macros # For python buildroot macros Requires: python-srpm-macros # Since the RHEL python-devel package doesn't require them, bring them in here @@ -60,6 +62,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Sun Jun 28 2020 Artur Iwicki - 8-14 +- Add a Requires for fpc-srpm-macros + * Fri Jun 19 2020 Troy Dawson - 8-13 - Use Suggests for python36-rpm-macros From 3d7bea8322f8a7c5bd1b01ec16180c5b036a65a7 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 29 Jul 2020 16:16:10 -0400 Subject: [PATCH 20/57] Backport support for out-of-source builds controlled by __cmake_in_source_build macro (#1861329) - Backport cmake_build and cmake_install macros - Backport ctest macro --- cmake-build | 17 +++++++++++ cmake-configure | 13 ++++++++ cmake-install | 17 +++++++++++ epel-rpm-macros.spec | 28 +++++++++++++++++- macros.zzz-epel-override-cmake | 54 ++++++++++++++++++++++++++++++++++ 5 files changed, 128 insertions(+), 1 deletion(-) create mode 100755 cmake-build create mode 100755 cmake-configure create mode 100755 cmake-install create mode 100644 macros.zzz-epel-override-cmake diff --git a/cmake-build b/cmake-build new file mode 100755 index 0000000..4a9962f --- /dev/null +++ b/cmake-build @@ -0,0 +1,17 @@ +#!/bin/bash +# Shell wrapper for supporting compiling with different backends for CMake < 3.13 + +# Collect arguments +__cmake_builddir="$1" +__build_flags="${@:2}" + +if [ -f "${__cmake_builddir}/Makefile" ]; then + /usr/bin/make -C "${__cmake_builddir}" V=1 VERBOSE=1 ${__build_flags} + exit $? +elif [ -f "${__cmake_builddir}/build.ninja" ]; then + /usr/bin/ninja -C "${__cmake_builddir}" -v ${__build_flags} + exit $? +else + echo "Unknown build format, exiting!" + exit 99 +fi diff --git a/cmake-configure b/cmake-configure new file mode 100755 index 0000000..adbc2ea --- /dev/null +++ b/cmake-configure @@ -0,0 +1,13 @@ +#!/bin/bash +# Shell wrapper for supporting out-of-source builds with CMake < 3.13 + +# Collect arguments +__cmake="$1" +__cmake_srcdir="$2" +__cmake_builddir="$3" +__cmake_flags="${@:4}" + +# Do the build +mkdir -p "${__cmake_builddir}" +"${__cmake}" ${__cmake_flags} "${__cmake_srcdir}" "${__cmake_builddir}" +exit $? diff --git a/cmake-install b/cmake-install new file mode 100755 index 0000000..f3cbcb8 --- /dev/null +++ b/cmake-install @@ -0,0 +1,17 @@ +#!/bin/bash +# Shell wrapper for supporting installing with different backends for CMake < 3.13 + +# Collect arguments +__cmake_builddir="$1" +__cmake_destdir="$2" + +if [ -f "${__cmake_builddir}/Makefile" ]; then + /usr/bin/make -C "${__cmake_builddir}" install DESTDIR="${__cmake_destdir}" + exit $? +elif [ -f "${__cmake_builddir}/build.ninja" ]; then + DESTDIR="${__cmake_destdir}" /usr/bin/ninja -C "${__cmake_builddir}" install -v + exit $? +else + echo "Unknown build format, exiting!" + exit 99 +fi diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 49f9efe..34b360f 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 14 +Release: 15 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -16,6 +16,14 @@ Source2: gpgverify Source3: pythondist.attr Source9: GPL +# CMake macro backport for until RHEL 8 updates to CMake 3.17+ +# Cf. https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds +# Cf. https://bugzilla.redhat.com/show_bug.cgi?id=1858941 +Source21: cmake-configure +Source22: cmake-build +Source23: cmake-install +Source24: macros.zzz-epel-override-cmake + BuildArch: noarch Requires: redhat-release >= %{version} # For FPC buildroot macros @@ -53,15 +61,33 @@ install -Dpm 755 %{SOURCE2} \ install -Dpm 644 %{SOURCE3} \ %{buildroot}%{_fileattrsdir}/pythondist.attr +# Install CMake stuff +install -Dpm 755 %{SOURCE21} \ + %{buildroot}%{_rpmconfigdir}/cmake-configure +install -Dpm 755 %{SOURCE22} \ + %{buildroot}%{_rpmconfigdir}/cmake-build +install -Dpm 755 %{SOURCE23} \ + %{buildroot}%{_rpmconfigdir}/cmake-install +install -Dpm 755 %{SOURCE24} \ + %{buildroot}/etc/rpm/macros.zzz-epel-override-cmake + + %files %license GPL /usr/lib/rpm/macros.d/macros.epel-rpm-macros /etc/rpm/macros.zzz-epel-override %{_rpmconfigdir}/gpgverify %{_fileattrsdir}/pythondist.attr +%{_rpmconfigdir}/cmake-* +/etc/rpm/macros.zzz-epel-override-cmake %changelog +* Wed Jul 29 2020 Neal Gompa - 8-15 +- Backport support for out-of-source builds controlled by __cmake_in_source_build macro (#1861329) +- Backport cmake_build and cmake_install macros +- Backport ctest macro + * Sun Jun 28 2020 Artur Iwicki - 8-14 - Add a Requires for fpc-srpm-macros diff --git a/macros.zzz-epel-override-cmake b/macros.zzz-epel-override-cmake new file mode 100644 index 0000000..f53660e --- /dev/null +++ b/macros.zzz-epel-override-cmake @@ -0,0 +1,54 @@ +# +# EPEL override macros for cmake +# +%_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON +%__ctest /usr/bin/ctest +%__cmake_in_source_build 1 +%__cmake_builddir %{!?__cmake_in_source_build:%{_vpath_builddir}}%{?__cmake_in_source_build:.} +%__cmake_configure %{_rpmconfigdir}/cmake-configure %{__cmake} %{_vpath_srcdir} %{__cmake_builddir} + +# - Set default compile flags +# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables +# and default to -O3 -DNDEBUG. Strip the -O3 so we can override with *FLAGS +# - Turn on verbose makefiles so we can see and verify compile flags +# - Set default install prefixes and library install directories +# - Turn on shared libraries by default +%cmake \ +%if 0%{?set_build_flags:1} \ + %set_build_flags \ +%else \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS ; \ + FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS ; \ + %{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} \ +%endif \ + %{!?__cmake_in_source_build:%__cmake_configure}%{?__cmake_in_source_build:%__cmake} \\\ + -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ + -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ + -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ +%if "%{?_lib}" == "lib64" \ + %{?_cmake_lib_suffix64} \\\ +%endif \ + %{?_cmake_shared_libs} + +%cmake_build \ + %{_rpmconfigdir}/cmake-build "%{__cmake_builddir}" %{?_smp_mflags} + +%cmake_install \ + %{_rpmconfigdir}/cmake-install "%{__cmake_builddir}" "%{buildroot}" + +%ctest(:-:) \ + cd "%{__cmake_builddir}" \ + %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %{**} \ + cd - + +%cmake3_build %cmake_build +%cmake3_install %cmake_install +%ctest3 %ctest From e93d8e2f0d0b056349a22d5bef8a93116d469516 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 30 Jul 2020 21:56:45 -0400 Subject: [PATCH 21/57] Use legacy behavior for cmake-configure --- cmake-build | 2 +- cmake-configure | 12 ++++++++---- cmake-install | 2 +- epel-rpm-macros.spec | 5 ++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cmake-build b/cmake-build index 4a9962f..138ff5f 100755 --- a/cmake-build +++ b/cmake-build @@ -2,7 +2,7 @@ # Shell wrapper for supporting compiling with different backends for CMake < 3.13 # Collect arguments -__cmake_builddir="$1" +__cmake_builddir="$(realpath $1)" __build_flags="${@:2}" if [ -f "${__cmake_builddir}/Makefile" ]; then diff --git a/cmake-configure b/cmake-configure index adbc2ea..da0bace 100755 --- a/cmake-configure +++ b/cmake-configure @@ -3,11 +3,15 @@ # Collect arguments __cmake="$1" -__cmake_srcdir="$2" -__cmake_builddir="$3" +__cmake_srcdir="$(realpath $2)" +__cmake_builddir="$(realpath $3)" __cmake_flags="${@:4}" +__cmake_retval=0 # Do the build mkdir -p "${__cmake_builddir}" -"${__cmake}" ${__cmake_flags} "${__cmake_srcdir}" "${__cmake_builddir}" -exit $? +pushd "${__cmake_builddir}" +"${__cmake}" ${__cmake_flags} "${__cmake_srcdir}" +__cmake_retval=$? +popd +exit ${__cmake_retval} diff --git a/cmake-install b/cmake-install index f3cbcb8..104b035 100755 --- a/cmake-install +++ b/cmake-install @@ -2,7 +2,7 @@ # Shell wrapper for supporting installing with different backends for CMake < 3.13 # Collect arguments -__cmake_builddir="$1" +__cmake_builddir="$(realpath $1)" __cmake_destdir="$2" if [ -f "${__cmake_builddir}/Makefile" ]; then diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 34b360f..c92a301 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 15 +Release: 16 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -83,6 +83,9 @@ install -Dpm 755 %{SOURCE24} \ %changelog +* Thu Jul 30 2020 Neal Gompa - 8-16 +- Use legacy behavior for cmake-configure + * Wed Jul 29 2020 Neal Gompa - 8-15 - Backport support for out-of-source builds controlled by __cmake_in_source_build macro (#1861329) - Backport cmake_build and cmake_install macros From fc1c4ad75b600525d6b25bc98e35f2b1c279f533 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Thu, 24 Sep 2020 17:10:44 +0000 Subject: [PATCH 22/57] remove package.cfg per new epel-playground policy --- package.cfg | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 package.cfg diff --git a/package.cfg b/package.cfg deleted file mode 100644 index b728443..0000000 --- a/package.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[koji] -targets = epel8 From d08dbfe8a08aec01f7ccaeff5be9ca868ad601d3 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Tue, 8 Sep 2020 14:29:08 -0700 Subject: [PATCH 23/57] Add a Requires for lua-srpm-macros Signed-off-by: Michel Alexandre Salim --- epel-rpm-macros.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index c92a301..c3e2871 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 16 +Release: 17 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -28,6 +28,8 @@ BuildArch: noarch Requires: redhat-release >= %{version} # For FPC buildroot macros Requires: fpc-srpm-macros +# For Lua SRPM macros +Requires: lua-srpm-macros # For python buildroot macros Requires: python-srpm-macros # Since the RHEL python-devel package doesn't require them, bring them in here @@ -83,6 +85,9 @@ install -Dpm 755 %{SOURCE24} \ %changelog +* Tue Sep 8 2020 Michel Alexandre Salim - 8-17 +- Add a Requires for lua-srpm-macros + * Thu Jul 30 2020 Neal Gompa - 8-16 - Use legacy behavior for cmake-configure From f73450ae93a39190bdcb02c4984f6af2475f827e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 25 Sep 2020 14:51:31 +0200 Subject: [PATCH 24/57] Add %python3_platform_triplet and %python3_ext_suffix Also add %python_platform_triplet and %python_ext_suffix. https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names --- epel-rpm-macros.spec | 6 +++++- macros.epel-rpm-macros | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index c3e2871..ff1f1c2 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 17 +Release: 18 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -85,6 +85,10 @@ install -Dpm 755 %{SOURCE24} \ %changelog +* Fri Sep 25 2020 Miro Hrončok - 8-18 +- Add %%python3_platform_triplet and %%python3_ext_suffix +- https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names + * Tue Sep 8 2020 Michel Alexandre Salim - 8-17 - Add a Requires for lua-srpm-macros diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 3aa950c..078906b 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -25,6 +25,12 @@ %py2_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python2} %{py2_shbang_opts}"} %py3_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python3} %{py3_shbang_opts}"} +# https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names +%python_platform_triplet %(%{__python} -Esc "import sysconfig; print(sysconfig.get_config_var('MULTIARCH'))") +%python_ext_suffix %(%{__python} -Esc "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") +%python3_platform_triplet %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('MULTIARCH'))") +%python3_ext_suffix %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") + # Users can use %%python only if they redefined %%__python (e.g. to %%__python3) %python() %{lua:\ __python = rpm.expand("%__python")\ From 2962b79e1a755ce418608a4932387900e807fa6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 22 Dec 2020 10:50:28 +0100 Subject: [PATCH 25/57] Define %python_disable_dependency_generator This was missed in 0a2c9ff3ae987f63e5cbd04ba6252a6a8f350b86 See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/K4K4VANVFWKOXXK2GRB3QBC2IF5GJLE2/ --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index ff1f1c2..26d8625 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 18 +Release: 19 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -85,6 +85,9 @@ install -Dpm 755 %{SOURCE24} \ %changelog +* Tue Dec 22 2020 Miro Hrončok - 8-19 +- Define %%python_disable_dependency_generator + * Fri Sep 25 2020 Miro Hrončok - 8-18 - Add %%python3_platform_triplet and %%python3_ext_suffix - https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 078906b..012e8c6 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -82,6 +82,10 @@ end } +%python_disable_dependency_generator() \ +%undefine __pythondist_requires \ +%{nil} + # gpgverify verifies signed sources. There is documentation in the script. %gpgverify %{_rpmconfigdir}/gpgverify From 03f860c6a342727a997f4794058d033911bfdf78 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Mon, 30 Nov 2020 19:20:05 -0500 Subject: [PATCH 26/57] Backport %gpgverify API simplification Allow EPEL packages to use the simpler %gpgverify API which is available in Fedora. This incorporates the changes made to redhat-rpm-config in the following commits: 3490049 (Simplify the API of %gpgverify, 2019-07-25) 4d93255 (Fix the simple API of %gpgverify, 2019-11-01) --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 26d8625..3861867 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 19 +Release: 20 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -85,6 +85,9 @@ install -Dpm 755 %{SOURCE24} \ %changelog +* Sat May 01 2021 Todd Zullinger - 8-20 +- Backport %%gpgverify API simplification + * Tue Dec 22 2020 Miro Hrončok - 8-19 - Define %%python_disable_dependency_generator diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 012e8c6..dfe4f40 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -87,7 +87,22 @@ %{nil} # gpgverify verifies signed sources. There is documentation in the script. -%gpgverify %{_rpmconfigdir}/gpgverify +%gpgverify(k:s:d:) %{lua: +local script = rpm.expand("%{_rpmconfigdir}/gpgverify ") +local keyring = rpm.expand("%{-k*}") +local signature = rpm.expand("%{-s*}") +local data = rpm.expand("%{-d*}") +print(script) +if keyring ~= "" then + print(rpm.expand("--keyring='%{SOURCE" .. keyring .. "}' ")) +end +if signature ~= "" then + print(rpm.expand("--signature='%{SOURCE" .. signature .. "}' ")) +end +if data ~= "" then + print(rpm.expand("--data='%{SOURCE" .. data .. "}' ")) +end +} # qt5 macro removed from RHEL8 but needed to ensure qtwebengine, and # it's dependencies build on supported arches. From 41f19b80193e3511a350414e5952562afb432adf Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Mon, 30 Nov 2020 19:26:57 -0500 Subject: [PATCH 27/57] Remove exec perms from /etc/rpm/macros.zzz-epel-override-cmake When building, rpm warns and removes the unnecessary exec perms: *** WARNING: ./etc/rpm/macros.zzz-epel-override-cmake is executable but has empty or no shebang, removing executable bit Update the install command to avoid the warning. --- epel-rpm-macros.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 3861867..d20e366 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -70,7 +70,7 @@ install -Dpm 755 %{SOURCE22} \ %{buildroot}%{_rpmconfigdir}/cmake-build install -Dpm 755 %{SOURCE23} \ %{buildroot}%{_rpmconfigdir}/cmake-install -install -Dpm 755 %{SOURCE24} \ +install -Dpm 644 %{SOURCE24} \ %{buildroot}/etc/rpm/macros.zzz-epel-override-cmake @@ -87,6 +87,7 @@ install -Dpm 755 %{SOURCE24} \ %changelog * Sat May 01 2021 Todd Zullinger - 8-20 - Backport %%gpgverify API simplification +- Remove exec perms from /etc/rpm/macros.zzz-epel-override-cmake * Tue Dec 22 2020 Miro Hrončok - 8-19 - Define %%python_disable_dependency_generator From 3524d18e09c66faef59d773b10f86c16f867926f Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Mon, 30 Nov 2020 19:52:28 -0500 Subject: [PATCH 28/57] Add .gitignore Ignore .rpm files, build logs, and the prepared build and mock results directories. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca67ff4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/*.rpm +/.build-*.log +/epel-rpm-macros-*/ +/results_epel-rpm-macros/ From 3cb4370ece3c99e4b607457b51359f1bf0168195 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Mon, 30 Nov 2020 19:56:03 -0500 Subject: [PATCH 29/57] Silence rpmlint warnings about non-issues Rename rpmlint.cf to epel-rpm-macros.rpmlintrc so `fedpkg lint` will read it. Escape a stray '%' in %changelog. --- epel-rpm-macros.rpmlintrc | 5 +++++ epel-rpm-macros.spec | 3 ++- rpmlint.cf | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 epel-rpm-macros.rpmlintrc delete mode 100644 rpmlint.cf diff --git a/epel-rpm-macros.rpmlintrc b/epel-rpm-macros.rpmlintrc new file mode 100644 index 0000000..98d093f --- /dev/null +++ b/epel-rpm-macros.rpmlintrc @@ -0,0 +1,5 @@ +addFilter("epel-rpm-macros\.src: W: strange-permission cmake-(build|configure|install) 755") +addFilter("epel-rpm-macros\.src: W: strange-permission gpgverify 755") +addFilter("no-%build-section") +addFilter("no-documentation") +addFilter("only-non-binary-in-usr-lib") diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index d20e366..685641a 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -88,6 +88,7 @@ install -Dpm 644 %{SOURCE24} \ * Sat May 01 2021 Todd Zullinger - 8-20 - Backport %%gpgverify API simplification - Remove exec perms from /etc/rpm/macros.zzz-epel-override-cmake +- Silence rpmlint warnings about non-issues * Tue Dec 22 2020 Miro Hrončok - 8-19 - Define %%python_disable_dependency_generator @@ -125,7 +126,7 @@ install -Dpm 644 %{SOURCE24} \ - Add the %%pycached macro * Fri Apr 03 2020 Troy Dawson - 8-9 -- Add %qt5_qtwebengine_arches to macros +- Add %%qt5_qtwebengine_arches to macros * Thu Nov 21 2019 Troy Dawson - 8-8 - Bump release to be in sync with playground build. diff --git a/rpmlint.cf b/rpmlint.cf deleted file mode 100644 index 557f414..0000000 --- a/rpmlint.cf +++ /dev/null @@ -1 +0,0 @@ -addFilter("no-%build-section") From 81296b67df15b7383fbe5ea28974854ae2d44c50 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 19 May 2021 17:40:35 -0400 Subject: [PATCH 30/57] Drop custom CMake macros, RHEL 8.4 includes them now (cf. rhbz#1858983) Starting with Red Hat Enterprise Linux 8.4, CMake was rebased to v3.18 and the CMake macros were synced from Fedora to RHEL. This obviates the need for our version, so let's drop them. Reference: https://bugzilla.redhat.com/1816874 Reference: https://bugzilla.redhat.com/1858983 --- cmake-build | 17 ----------- cmake-configure | 17 ----------- cmake-install | 17 ----------- epel-rpm-macros.spec | 25 +++------------- macros.zzz-epel-override-cmake | 54 ---------------------------------- 5 files changed, 4 insertions(+), 126 deletions(-) delete mode 100755 cmake-build delete mode 100755 cmake-configure delete mode 100755 cmake-install delete mode 100644 macros.zzz-epel-override-cmake diff --git a/cmake-build b/cmake-build deleted file mode 100755 index 138ff5f..0000000 --- a/cmake-build +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Shell wrapper for supporting compiling with different backends for CMake < 3.13 - -# Collect arguments -__cmake_builddir="$(realpath $1)" -__build_flags="${@:2}" - -if [ -f "${__cmake_builddir}/Makefile" ]; then - /usr/bin/make -C "${__cmake_builddir}" V=1 VERBOSE=1 ${__build_flags} - exit $? -elif [ -f "${__cmake_builddir}/build.ninja" ]; then - /usr/bin/ninja -C "${__cmake_builddir}" -v ${__build_flags} - exit $? -else - echo "Unknown build format, exiting!" - exit 99 -fi diff --git a/cmake-configure b/cmake-configure deleted file mode 100755 index da0bace..0000000 --- a/cmake-configure +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Shell wrapper for supporting out-of-source builds with CMake < 3.13 - -# Collect arguments -__cmake="$1" -__cmake_srcdir="$(realpath $2)" -__cmake_builddir="$(realpath $3)" -__cmake_flags="${@:4}" -__cmake_retval=0 - -# Do the build -mkdir -p "${__cmake_builddir}" -pushd "${__cmake_builddir}" -"${__cmake}" ${__cmake_flags} "${__cmake_srcdir}" -__cmake_retval=$? -popd -exit ${__cmake_retval} diff --git a/cmake-install b/cmake-install deleted file mode 100755 index 104b035..0000000 --- a/cmake-install +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Shell wrapper for supporting installing with different backends for CMake < 3.13 - -# Collect arguments -__cmake_builddir="$(realpath $1)" -__cmake_destdir="$2" - -if [ -f "${__cmake_builddir}/Makefile" ]; then - /usr/bin/make -C "${__cmake_builddir}" install DESTDIR="${__cmake_destdir}" - exit $? -elif [ -f "${__cmake_builddir}/build.ninja" ]; then - DESTDIR="${__cmake_destdir}" /usr/bin/ninja -C "${__cmake_builddir}" install -v - exit $? -else - echo "Unknown build format, exiting!" - exit 99 -fi diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 685641a..310c479 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 20 +Release: 21 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -16,14 +16,6 @@ Source2: gpgverify Source3: pythondist.attr Source9: GPL -# CMake macro backport for until RHEL 8 updates to CMake 3.17+ -# Cf. https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds -# Cf. https://bugzilla.redhat.com/show_bug.cgi?id=1858941 -Source21: cmake-configure -Source22: cmake-build -Source23: cmake-install -Source24: macros.zzz-epel-override-cmake - BuildArch: noarch Requires: redhat-release >= %{version} # For FPC buildroot macros @@ -63,16 +55,6 @@ install -Dpm 755 %{SOURCE2} \ install -Dpm 644 %{SOURCE3} \ %{buildroot}%{_fileattrsdir}/pythondist.attr -# Install CMake stuff -install -Dpm 755 %{SOURCE21} \ - %{buildroot}%{_rpmconfigdir}/cmake-configure -install -Dpm 755 %{SOURCE22} \ - %{buildroot}%{_rpmconfigdir}/cmake-build -install -Dpm 755 %{SOURCE23} \ - %{buildroot}%{_rpmconfigdir}/cmake-install -install -Dpm 644 %{SOURCE24} \ - %{buildroot}/etc/rpm/macros.zzz-epel-override-cmake - %files %license GPL @@ -80,11 +62,12 @@ install -Dpm 644 %{SOURCE24} \ /etc/rpm/macros.zzz-epel-override %{_rpmconfigdir}/gpgverify %{_fileattrsdir}/pythondist.attr -%{_rpmconfigdir}/cmake-* -/etc/rpm/macros.zzz-epel-override-cmake %changelog +* Wed May 19 2021 Neal Gompa - 8-21 +- Drop custom CMake macros, RHEL 8.4 includes them now (cf. rhbz#1858983) + * Sat May 01 2021 Todd Zullinger - 8-20 - Backport %%gpgverify API simplification - Remove exec perms from /etc/rpm/macros.zzz-epel-override-cmake diff --git a/macros.zzz-epel-override-cmake b/macros.zzz-epel-override-cmake deleted file mode 100644 index f53660e..0000000 --- a/macros.zzz-epel-override-cmake +++ /dev/null @@ -1,54 +0,0 @@ -# -# EPEL override macros for cmake -# -%_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON -%__ctest /usr/bin/ctest -%__cmake_in_source_build 1 -%__cmake_builddir %{!?__cmake_in_source_build:%{_vpath_builddir}}%{?__cmake_in_source_build:.} -%__cmake_configure %{_rpmconfigdir}/cmake-configure %{__cmake} %{_vpath_srcdir} %{__cmake_builddir} - -# - Set default compile flags -# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables -# and default to -O3 -DNDEBUG. Strip the -O3 so we can override with *FLAGS -# - Turn on verbose makefiles so we can see and verify compile flags -# - Set default install prefixes and library install directories -# - Turn on shared libraries by default -%cmake \ -%if 0%{?set_build_flags:1} \ - %set_build_flags \ -%else \ - CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ - CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ - FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS ; \ - FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS ; \ - %{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} \ -%endif \ - %{!?__cmake_in_source_build:%__cmake_configure}%{?__cmake_in_source_build:%__cmake} \\\ - -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ - -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ - -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ - -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\ - -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ - -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ -%if "%{?_lib}" == "lib64" \ - %{?_cmake_lib_suffix64} \\\ -%endif \ - %{?_cmake_shared_libs} - -%cmake_build \ - %{_rpmconfigdir}/cmake-build "%{__cmake_builddir}" %{?_smp_mflags} - -%cmake_install \ - %{_rpmconfigdir}/cmake-install "%{__cmake_builddir}" "%{buildroot}" - -%ctest(:-:) \ - cd "%{__cmake_builddir}" \ - %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %{**} \ - cd - - -%cmake3_build %cmake_build -%cmake3_install %cmake_install -%ctest3 %ctest From 05b5b0ae2c852bbd9f0047bdfa5bb4250a8974fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 14 Jul 2021 18:49:40 +0200 Subject: [PATCH 31/57] Introduce %py3_check_import With $PATH and $PYTHONPATH set to the %buildroot, the macro tries to import the given Python 3 module(s). Useful as a smoke test in %check when ruining tests is not feasible. Accepts spaces or commas as separators. Backport of https://src.fedoraproject.org/rpms/python-rpm-macros/c/c2305ea3 --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 310c479..41b73bb 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 21 +Release: 22 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -65,6 +65,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Wed Jul 14 2021 Miro Hrončok - 8-22 +- Introduce %%py3_check_import + * Wed May 19 2021 Neal Gompa - 8-21 - Drop custom CMake macros, RHEL 8.4 includes them now (cf. rhbz#1858983) diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index dfe4f40..c693891 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -82,6 +82,35 @@ end } +# With $PATH and $PYTHONPATH set to the %%buildroot, +# try to import the given Python module(s). +# Useful as a smoke test in %%check when running tests is not feasible. +# Use spaces or commas as separators. +%py_check_import() %{expand:\\\ + (cd %{_topdir} &&\\\ + PATH="%{buildroot}%{_bindir}:$PATH"\\\ + PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python_sitearch}:%{buildroot}%{python_sitelib}}"\\\ + PYTHONDONTWRITEBYTECODE=1\\\ + %{__python} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" + ) +} +%py2_check_import() %{expand:\\\ + (cd %{_topdir} &&\\\ + PATH="%{buildroot}%{_bindir}:$PATH"\\\ + PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python2_sitearch}:%{buildroot}%{python2_sitelib}}"\\\ + PYTHONDONTWRITEBYTECODE=1\\\ + %{__python2} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" + ) +} +%py3_check_import() %{expand:\\\ + (cd %{_topdir} &&\\\ + PATH="%{buildroot}%{_bindir}:$PATH"\\\ + PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\ + PYTHONDONTWRITEBYTECODE=1\\\ + %{__python3} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" + ) +} + %python_disable_dependency_generator() \ %undefine __pythondist_requires \ %{nil} From f44829e9fcd7b2d960677bdbb9e5d7a3bc2078a0 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Wed, 21 Jul 2021 15:18:49 -0700 Subject: [PATCH 32/57] Add macros.build-constraints Signed-off-by: Michel Alexandre Salim --- epel-rpm-macros.spec | 13 ++++++++++++- macros.build-constraints | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 macros.build-constraints diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 41b73bb..007962b 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 22 +Release: 23 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -15,6 +15,8 @@ Source1: macros.zzz-epel-override Source2: gpgverify Source3: pythondist.attr Source9: GPL +# misc macros +Source150: macros.build-constraints BuildArch: noarch Requires: redhat-release >= %{version} @@ -55,6 +57,10 @@ install -Dpm 755 %{SOURCE2} \ install -Dpm 644 %{SOURCE3} \ %{buildroot}%{_fileattrsdir}/pythondist.attr +# misc macros +install -Dpm 644 %{SOURCE150} \ + %{buildroot}/usr/lib/rpm/macros.d/macros.build-constraints + %files %license GPL @@ -62,9 +68,14 @@ install -Dpm 644 %{SOURCE3} \ /etc/rpm/macros.zzz-epel-override %{_rpmconfigdir}/gpgverify %{_fileattrsdir}/pythondist.attr +# misc macros +/usr/lib/rpm/macros.d/macros.build-constraints %changelog +* Sat Jul 24 2021 Michel Alexandre Salim - 8-23 +- Add macros.build-constraints + * Wed Jul 14 2021 Miro Hrončok - 8-22 - Introduce %%py3_check_import diff --git a/macros.build-constraints b/macros.build-constraints new file mode 100644 index 0000000..1343cd8 --- /dev/null +++ b/macros.build-constraints @@ -0,0 +1,10 @@ +# Macros to constrain resource use during the build process + +# m: memory limit in MBs per core; default is 1024 +%limit_build(m:) \ + _mem_per_process="%{-m:%{-m*}}%{!-m:1024}" \ + _max_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo) \ + _max_jobs="$(($_max_mem / ($_mem_per_process * 1024)))" \ + _cur_max_jobs="%{_smp_build_ncpus}" \ + test "${_cur_max_jobs}" -gt "${_max_jobs}" && _cur_max_jobs="${_max_jobs}" && echo "Warning: Reducing build parallelism to -j${_max_jobs} because of memory limits" \ + %global _smp_build_ncpus "${_cur_max_jobs}" From 4e27a744cad179c99697d9292fb14fb9698dcb9c Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Mon, 2 Aug 2021 09:31:55 -0700 Subject: [PATCH 33/57] Refactor to use standard macros, not hard-coded paths Signed-off-by: Michel Alexandre Salim --- epel-rpm-macros.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 007962b..80c6781 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -44,12 +44,11 @@ install -pm 644 %{SOURCE9} . %install #GPG Key -# Can't depend upon %%rpmmacrodir yet, since we're providing it install -Dpm 644 %{SOURCE0} \ - %buildroot/usr/lib/rpm/macros.d/macros.epel-rpm-macros + %{buildroot}%{_rpmmacrodir}/macros.epel-rpm-macros install -Dpm 644 %{SOURCE1} \ - %buildroot/etc/rpm/macros.zzz-epel-override + %{buildroot}%{_sysconfdir}/rpm/macros.zzz-epel-override install -Dpm 755 %{SOURCE2} \ %{buildroot}%{_rpmconfigdir}/gpgverify @@ -59,22 +58,23 @@ install -Dpm 644 %{SOURCE3} \ # misc macros install -Dpm 644 %{SOURCE150} \ - %{buildroot}/usr/lib/rpm/macros.d/macros.build-constraints + %{buildroot}%{_rpmmacrodir}/macros.build-constraints %files %license GPL -/usr/lib/rpm/macros.d/macros.epel-rpm-macros -/etc/rpm/macros.zzz-epel-override +%{_rpmmacrodir}/macros.epel-rpm-macros +%{_sysconfdir}/rpm/macros.zzz-epel-override %{_rpmconfigdir}/gpgverify %{_fileattrsdir}/pythondist.attr # misc macros -/usr/lib/rpm/macros.d/macros.build-constraints +%{_rpmmacrodir}/macros.build-constraints %changelog -* Sat Jul 24 2021 Michel Alexandre Salim - 8-23 +* Mon Aug 2 2021 Michel Alexandre Salim - 8-23 - Add macros.build-constraints +- Refactor to use standard macros, not hard-coded paths * Wed Jul 14 2021 Miro Hrončok - 8-22 - Introduce %%py3_check_import From deb0434a277a002c151a7ca850b9baadf452e9ec Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Wed, 1 Sep 2021 11:22:33 -0700 Subject: [PATCH 34/57] Fix macros.build-constraints' %limit_build number of CPUs will never be set to less than 1 this now outputs build flag overrides to be used with %make_build etc. add documentation Signed-off-by: Michel Alexandre Salim --- epel-rpm-macros.spec | 8 ++++++- macros.build-constraints | 48 +++++++++++++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 80c6781..f7cb5b3 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 23 +Release: 24 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -72,6 +72,12 @@ install -Dpm 644 %{SOURCE150} \ %changelog +* Wed Sep 1 2021 Michel Alexandre Salim - 8-24 +- Fix macros.build-constraints' %%limit_build + - number of CPUs will never be set to less than 1 + - this now outputs build flag overrides to be used with %%make_build etc. + - add documentation + * Mon Aug 2 2021 Michel Alexandre Salim - 8-23 - Add macros.build-constraints - Refactor to use standard macros, not hard-coded paths diff --git a/macros.build-constraints b/macros.build-constraints index 1343cd8..db99418 100644 --- a/macros.build-constraints +++ b/macros.build-constraints @@ -1,10 +1,42 @@ # Macros to constrain resource use during the build process -# m: memory limit in MBs per core; default is 1024 -%limit_build(m:) \ - _mem_per_process="%{-m:%{-m*}}%{!-m:1024}" \ - _max_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo) \ - _max_jobs="$(($_max_mem / ($_mem_per_process * 1024)))" \ - _cur_max_jobs="%{_smp_build_ncpus}" \ - test "${_cur_max_jobs}" -gt "${_max_jobs}" && _cur_max_jobs="${_max_jobs}" && echo "Warning: Reducing build parallelism to -j${_max_jobs} because of memory limits" \ - %global _smp_build_ncpus "${_cur_max_jobs}" +# outputs build flag overrides to be used in conjunction with +# %%make_build, %%cmake_build etc. +# +# if no override is needed, this macro outputs nothing +# +# - m memory limit in MBs per core; default is 1024 +# +# Usage: +# e.g. %make_build %{limit_build -m 2048} +# => /usr/bin/make -O -j16 V=1 VERBOSE=1 +# %make_build %{limit_build -m 40960} +# => /usr/bin/make -O -j16 V=1 VERBOSE=1 -j1 +# +%limit_build(m:) %{lua: + local mem_per_process=rpm.expand("%{-m*}") + if mem_per_process == "" then + mem_per_process = 1024 + else + mem_per_process = tonumber(mem_per_process) + end + local mem_total = 0 + for line in io.lines('/proc/meminfo') do + if line:sub(1, 9) == "MemTotal:" then + local tokens = {} + for token in line:gmatch("%w+") do + tokens[#tokens + 1] = token + end + mem_total = tonumber(tokens[2]) + break + end + end + local max_jobs = mem_total // (mem_per_process * 1024) + if max_jobs < 1 then + max_jobs = 1 + end + cur_max_jobs=tonumber(rpm.expand("%{_smp_build_ncpus}")) + if cur_max_jobs > max_jobs then + print("-j" .. max_jobs) + end +} From ec361e3258bfa482b8c6baf4c551420b8ebee03e Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 09:41:08 -0700 Subject: [PATCH 35/57] - Update release to 9 - lua-srpm-macros and python-srpm-macros already pulled in by redhat-rpm-macros - python2-rpm-macros - not in RHEL9 - python-rpm-macros and python3-rpm-macros pulled n by python-devel/python3-devel - fpc-srpm-macros - buildroot only, set to recommends for now Signed-off-by: Troy Dawson --- epel-rpm-macros.spec | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index f7cb5b3..a9a3209 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros -Version: 8 -Release: 24 +Version: 9 +Release: 1 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -21,18 +21,7 @@ Source150: macros.build-constraints BuildArch: noarch Requires: redhat-release >= %{version} # For FPC buildroot macros -Requires: fpc-srpm-macros -# For Lua SRPM macros -Requires: lua-srpm-macros -# For python buildroot macros -Requires: python-srpm-macros -# Since the RHEL python-devel package doesn't require them, bring them in here -Requires: python-rpm-macros -Requires: python2-rpm-macros -# Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 or python3.8 -# instead of /usr/libexec/platform-python -Requires: (python-modular-rpm-macros if python3-devel) -Suggests: python36-rpm-macros +Recommends: fpc-srpm-macros %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -72,6 +61,9 @@ install -Dpm 644 %{SOURCE150} \ %changelog +* Mon Oct 25 2021 Troy Dawson - 9-1 +- Make an initial macro set for 9 + * Wed Sep 1 2021 Michel Alexandre Salim - 8-24 - Fix macros.build-constraints' %%limit_build - number of CPUs will never be set to less than 1 From ccc4dda6d56f5a52d8a76888b8c3e42005d9f2fe Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 09:46:09 -0700 Subject: [PATCH 36/57] pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros https://bugzilla.redhat.com/show_bug.cgi?id=2001034 Signed-off-by: Troy Dawson --- epel-rpm-macros.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index a9a3209..ef659ee 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -22,6 +22,9 @@ BuildArch: noarch Requires: redhat-release >= %{version} # For FPC buildroot macros Recommends: fpc-srpm-macros +# pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros +# https://bugzilla.redhat.com/show_bug.cgi?id=2001034 +Requires: pyproject-rpm-macros if python3-rpm-macros %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM From 8122e8fd36d2bd42c895a09e95362e539235763f Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 10:57:38 -0700 Subject: [PATCH 37/57] remove macros already in rhel9 Signed-off-by: Troy Dawson --- macros.epel-rpm-macros | 134 +---------------------------------------- 1 file changed, 1 insertion(+), 133 deletions(-) diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index c693891..01fefc7 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -1,138 +1,6 @@ # epel macros -%epel 8 - -# Mono macros requested in rhbz 1295117 -%mono_arches %{ix86} x86_64 sparc sparcv9 ia64 %{arm} alpha s390x ppc ppc64 ppc64le -%_monodir %{_prefix}/lib/mono -%_monogacdir %{_monodir}/gac - -# A directory for rpm macros -%rpmmacrodir /usr/lib/rpm/macros.d - -# Upstream RPM has this in Fedora, obsoleting the one above. -%_rpmmacrodir /usr/lib/rpm/macros.d +%epel 9 # Bash completions; not in bash to not intefere with install ordering %bash_completion_dir /usr/share/bash-completion/completions/ - -# Use the non-underscored Python macros to refer to Python in spec, etc. -%python2 %__python2 -%python3 %__python3 - -# Simplified version backported from Fedora -%py_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python} %{py_shbang_opts}"} -%py2_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python2} %{py2_shbang_opts}"} -%py3_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python3} %{py3_shbang_opts}"} - -# https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names -%python_platform_triplet %(%{__python} -Esc "import sysconfig; print(sysconfig.get_config_var('MULTIARCH'))") -%python_ext_suffix %(%{__python} -Esc "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") -%python3_platform_triplet %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('MULTIARCH'))") -%python3_ext_suffix %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") - -# Users can use %%python only if they redefined %%__python (e.g. to %%__python3) -%python() %{lua:\ - __python = rpm.expand("%__python")\ - if __python == "/usr/bin/python" then\ - rpm.expand("%{error:Cannot use %%python if %%__python wasn't redefined to something other than /usr/bin/python.}")\ - else\ - print(__python)\ - end\ -} - -# This only supports Python 3.5+ and will never work with Python 2. -# Hence, it has no Python version in the name. -%pycached() %{lua: - path = rpm.expand("%{?*}") - if (string.sub(path, "-3") ~= ".py") then - rpm.expand("%{error:%%pycached can only be used with paths explicitly ending with .py}") - else - print(path) - pyminor = path:match("/python3.(%d+)/") or "*" - dirname = path:match("(.*/)") - modulename = path:match(".*/([^/]+).py") - print("\\n" .. dirname .. "__pycache__/" .. modulename .. ".cpython-3" .. pyminor .. "{,.opt-?}.pyc") - end -} - -# This is intended for Python 3 only, hence also no Python version in the name. -%__pytest /usr/bin/pytest-3 -%pytest %{expand:\\\ - CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ - PATH="%{buildroot}%{_bindir}:$PATH"\\\ - PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\ - PYTHONDONTWRITEBYTECODE=1\\\ - %__pytest} - -%py_provides() %{lua: - local name = rpm.expand('%1') - if name == '%1' then - rpm.expand('%{error:%%py_provides requires at least 1 argument, the name to provide}') - end - local evr = rpm.expand('%2') - if evr == '%2' then - evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}') - end - print('Provides: ' .. name .. ' = ' .. evr .. '\\n') - -- NB: dash needs to be escaped! - if name:match('^python3%-') then - replaced = name:gsub('^python3%-', 'python-') - print('Provides: ' .. replaced .. ' = ' .. evr .. '\\n') - end -} - -# With $PATH and $PYTHONPATH set to the %%buildroot, -# try to import the given Python module(s). -# Useful as a smoke test in %%check when running tests is not feasible. -# Use spaces or commas as separators. -%py_check_import() %{expand:\\\ - (cd %{_topdir} &&\\\ - PATH="%{buildroot}%{_bindir}:$PATH"\\\ - PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python_sitearch}:%{buildroot}%{python_sitelib}}"\\\ - PYTHONDONTWRITEBYTECODE=1\\\ - %{__python} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" - ) -} -%py2_check_import() %{expand:\\\ - (cd %{_topdir} &&\\\ - PATH="%{buildroot}%{_bindir}:$PATH"\\\ - PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python2_sitearch}:%{buildroot}%{python2_sitelib}}"\\\ - PYTHONDONTWRITEBYTECODE=1\\\ - %{__python2} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" - ) -} -%py3_check_import() %{expand:\\\ - (cd %{_topdir} &&\\\ - PATH="%{buildroot}%{_bindir}:$PATH"\\\ - PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\ - PYTHONDONTWRITEBYTECODE=1\\\ - %{__python3} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" - ) -} - -%python_disable_dependency_generator() \ -%undefine __pythondist_requires \ -%{nil} - -# gpgverify verifies signed sources. There is documentation in the script. -%gpgverify(k:s:d:) %{lua: -local script = rpm.expand("%{_rpmconfigdir}/gpgverify ") -local keyring = rpm.expand("%{-k*}") -local signature = rpm.expand("%{-s*}") -local data = rpm.expand("%{-d*}") -print(script) -if keyring ~= "" then - print(rpm.expand("--keyring='%{SOURCE" .. keyring .. "}' ")) -end -if signature ~= "" then - print(rpm.expand("--signature='%{SOURCE" .. signature .. "}' ")) -end -if data ~= "" then - print(rpm.expand("--data='%{SOURCE" .. data .. "}' ")) -end -} - -# qt5 macro removed from RHEL8 but needed to ensure qtwebengine, and -# it's dependencies build on supported arches. -%qt5_qtwebengine_arches %{ix86} x86_64 %{arm} aarch64 mips mipsel mips64el From 8ee9fd160ee1a910701c6a83e25feeaf323fdc2a Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 11:06:31 -0700 Subject: [PATCH 38/57] pythondist.attr provided by python3-rpm-generators Signed-off-by: Troy Dawson --- epel-rpm-macros.spec | 4 ---- pythondist.attr | 3 --- 2 files changed, 7 deletions(-) delete mode 100644 pythondist.attr diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index ef659ee..f46c4c9 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -45,9 +45,6 @@ install -Dpm 644 %{SOURCE1} \ install -Dpm 755 %{SOURCE2} \ %{buildroot}%{_rpmconfigdir}/gpgverify -install -Dpm 644 %{SOURCE3} \ - %{buildroot}%{_fileattrsdir}/pythondist.attr - # misc macros install -Dpm 644 %{SOURCE150} \ %{buildroot}%{_rpmmacrodir}/macros.build-constraints @@ -58,7 +55,6 @@ install -Dpm 644 %{SOURCE150} \ %{_rpmmacrodir}/macros.epel-rpm-macros %{_sysconfdir}/rpm/macros.zzz-epel-override %{_rpmconfigdir}/gpgverify -%{_fileattrsdir}/pythondist.attr # misc macros %{_rpmmacrodir}/macros.build-constraints diff --git a/pythondist.attr b/pythondist.attr deleted file mode 100644 index 2bf737a..0000000 --- a/pythondist.attr +++ /dev/null @@ -1,3 +0,0 @@ -%__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides -%__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires -%__pythondist_path ^/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ From 7353e5ae80405e44060046823ec31c4440d19ec9 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 11:10:55 -0700 Subject: [PATCH 39/57] gpgverify provided by redhat-rpm-config Signed-off-by: Troy Dawson --- gpgverify | 116 ------------------------------------------------------ 1 file changed, 116 deletions(-) delete mode 100755 gpgverify diff --git a/gpgverify b/gpgverify deleted file mode 100755 index 1673549..0000000 --- a/gpgverify +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -# Copyright 2018 B. Persson, Bjorn@Rombobeorn.se -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -function print_help { - cat <<'EOF' -Usage: gpgverify --keyring= --signature= --data= - -gpgverify is a wrapper around gpgv designed for easy and safe scripting. It -verifies a file against a detached OpenPGP signature and a keyring. The keyring -shall contain all the keys that are trusted to certify the authenticity of the -file, and must not contain any untrusted keys. - -The differences, compared to invoking gpgv directly, are that gpgverify accepts -the keyring in either ASCII-armored or unarmored form, and that it will not -accidentally use a default keyring in addition to the specified one. - -Parameters: - --keyring= keyring with all the trusted keys and no others - --signature= detached signature to verify - --data= file to verify against the signature -EOF -} - - -fatal_error() { - message="$1" # an error message - status=$2 # a number to use as the exit code - echo "gpgverify: $message" >&2 - exit $status -} - - -require_parameter() { - term="$1" # a term for a required parameter - value="$2" # Complain and terminate if this value is empty. - if test -z "${value}" ; then - fatal_error "No ${term} was provided." 2 - fi -} - - -check_status() { - action="$1" # a string that describes the action that was attempted - status=$2 # the exit code of the command - if test $status -ne 0 ; then - fatal_error "$action failed." $status - fi -} - - -# Parse the command line. -keyring= -signature= -data= -for parameter in "$@" ; do - case "${parameter}" in - (--help) - print_help - exit - ;; - (--keyring=*) - keyring="${parameter#*=}" - ;; - (--signature=*) - signature="${parameter#*=}" - ;; - (--data=*) - data="${parameter#*=}" - ;; - (*) - fatal_error "Unknown parameter: \"${parameter}\"" 2 - ;; - esac -done -require_parameter 'keyring' "${keyring}" -require_parameter 'signature' "${signature}" -require_parameter 'data file' "${data}" - -# Make a temporary working directory. -workdir="$(mktemp --directory)" -check_status 'Making a temporary directory' $? -workring="${workdir}/keyring.gpg" - -# Decode any ASCII armor on the keyring. This is harmless if the keyring isn't -# ASCII-armored. -gpg2 --homedir="${workdir}" --yes --output="${workring}" --dearmor "${keyring}" -check_status 'Decoding the keyring' $? - -# Verify the signature using the decoded keyring. -gpgv2 --homedir="${workdir}" --keyring="${workring}" "${signature}" "${data}" -check_status 'Signature verification' $? - -# (--homedir isn't actually necessary. --dearmor processes only the input file, -# and if --keyring is used and contains a slash, then gpgv2 uses only that -# keyring. Thus neither command will look for a default keyring, but --homedir -# makes extra double sure that no default keyring will be touched in case -# another version of GPG works differently.) - -# Clean up. (This is not done in case of an error that may need inspection.) -rm --recursive --force ${workdir} From 34c5276fa00058dff40f44d7efb56b3e842f7434 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 11:14:01 -0700 Subject: [PATCH 40/57] macros.build-constraints provided by redhat-rpm-config Signed-off-by: Troy Dawson --- epel-rpm-macros.spec | 14 -------------- macros.build-constraints | 42 ---------------------------------------- 2 files changed, 56 deletions(-) delete mode 100644 macros.build-constraints diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index f46c4c9..ec5f75e 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -12,11 +12,7 @@ License: GPLv2 URL: http://download.fedoraproject.org/pub/epel Source0: macros.epel-rpm-macros Source1: macros.zzz-epel-override -Source2: gpgverify -Source3: pythondist.attr Source9: GPL -# misc macros -Source150: macros.build-constraints BuildArch: noarch Requires: redhat-release >= %{version} @@ -42,21 +38,11 @@ install -Dpm 644 %{SOURCE0} \ install -Dpm 644 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/rpm/macros.zzz-epel-override -install -Dpm 755 %{SOURCE2} \ - %{buildroot}%{_rpmconfigdir}/gpgverify - -# misc macros -install -Dpm 644 %{SOURCE150} \ - %{buildroot}%{_rpmmacrodir}/macros.build-constraints - %files %license GPL %{_rpmmacrodir}/macros.epel-rpm-macros %{_sysconfdir}/rpm/macros.zzz-epel-override -%{_rpmconfigdir}/gpgverify -# misc macros -%{_rpmmacrodir}/macros.build-constraints %changelog diff --git a/macros.build-constraints b/macros.build-constraints deleted file mode 100644 index db99418..0000000 --- a/macros.build-constraints +++ /dev/null @@ -1,42 +0,0 @@ -# Macros to constrain resource use during the build process - -# outputs build flag overrides to be used in conjunction with -# %%make_build, %%cmake_build etc. -# -# if no override is needed, this macro outputs nothing -# -# - m memory limit in MBs per core; default is 1024 -# -# Usage: -# e.g. %make_build %{limit_build -m 2048} -# => /usr/bin/make -O -j16 V=1 VERBOSE=1 -# %make_build %{limit_build -m 40960} -# => /usr/bin/make -O -j16 V=1 VERBOSE=1 -j1 -# -%limit_build(m:) %{lua: - local mem_per_process=rpm.expand("%{-m*}") - if mem_per_process == "" then - mem_per_process = 1024 - else - mem_per_process = tonumber(mem_per_process) - end - local mem_total = 0 - for line in io.lines('/proc/meminfo') do - if line:sub(1, 9) == "MemTotal:" then - local tokens = {} - for token in line:gmatch("%w+") do - tokens[#tokens + 1] = token - end - mem_total = tonumber(tokens[2]) - break - end - end - local max_jobs = mem_total // (mem_per_process * 1024) - if max_jobs < 1 then - max_jobs = 1 - end - cur_max_jobs=tonumber(rpm.expand("%{_smp_build_ncpus}")) - if cur_max_jobs > max_jobs then - print("-j" .. max_jobs) - end -} From 5ac77a6aae0a77f07d60ac5764094bce5e8f5af3 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 11:19:57 -0700 Subject: [PATCH 41/57] epel-rpm-macros.rpmlintrc not used Signed-off-by: Troy Dawson --- epel-rpm-macros.rpmlintrc | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 epel-rpm-macros.rpmlintrc diff --git a/epel-rpm-macros.rpmlintrc b/epel-rpm-macros.rpmlintrc deleted file mode 100644 index 98d093f..0000000 --- a/epel-rpm-macros.rpmlintrc +++ /dev/null @@ -1,5 +0,0 @@ -addFilter("epel-rpm-macros\.src: W: strange-permission cmake-(build|configure|install) 755") -addFilter("epel-rpm-macros\.src: W: strange-permission gpgverify 755") -addFilter("no-%build-section") -addFilter("no-documentation") -addFilter("only-non-binary-in-usr-lib") From e714c8c15a2ecb34358ed7a63fff625f290174a8 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 11:44:18 -0700 Subject: [PATCH 42/57] Cleanup spec, prepare for new macros --- epel-rpm-macros.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index ec5f75e..edd3550 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -12,11 +12,14 @@ License: GPLv2 URL: http://download.fedoraproject.org/pub/epel Source0: macros.epel-rpm-macros Source1: macros.zzz-epel-override -Source9: GPL +Source2: GPL +#Add source for misc macros below here + BuildArch: noarch Requires: redhat-release >= %{version} # For FPC buildroot macros +# Currently Recommends; Change to Requires when it is in EPEL Recommends: fpc-srpm-macros # pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros # https://bugzilla.redhat.com/show_bug.cgi?id=2001034 @@ -28,16 +31,18 @@ macros for building EPEL packages. %prep %setup -cT -install -pm 644 %{SOURCE9} . +install -pm 644 %{SOURCE2} . %install -#GPG Key +#epel rpm macros install -Dpm 644 %{SOURCE0} \ %{buildroot}%{_rpmmacrodir}/macros.epel-rpm-macros install -Dpm 644 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/rpm/macros.zzz-epel-override +#Add misc macros below here + %files %license GPL From 1e810d816414b7ca8653c6260fe36a0387a9c5d9 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Fri, 5 Nov 2021 13:40:48 -0700 Subject: [PATCH 43/57] Add %dist to Release:, Fix pyproject-rpm-macros typo --- epel-rpm-macros.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index edd3550..3ea43e4 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 1 +Release: 2%{dist} Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -23,7 +23,7 @@ Requires: redhat-release >= %{version} Recommends: fpc-srpm-macros # pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros # https://bugzilla.redhat.com/show_bug.cgi?id=2001034 -Requires: pyproject-rpm-macros if python3-rpm-macros +Requires: (pyproject-rpm-macros if python3-rpm-macros) %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -51,6 +51,10 @@ install -Dpm 644 %{SOURCE1} \ %changelog +* Mon Oct 25 2021 Troy Dawson - 9-2 +- Add %dist to Release: +- Fix pyproject-rpm-macros typo + * Mon Oct 25 2021 Troy Dawson - 9-1 - Make an initial macro set for 9 From 3dd1c45c3a9c50d955e64e9ffe64d07255df5c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 9 Nov 2021 15:36:29 +0100 Subject: [PATCH 44/57] Minor packaging nitpicks - remove long-discouraged Group tag - use HTTPS URL - align all Requires to column 16 - escape the %dist macro in the 9-2 changelog entry --- epel-rpm-macros.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 3ea43e4..46688fd 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -3,13 +3,12 @@ Version: 9 Release: 2%{dist} Summary: Extra Packages for Enterprise Linux RPM macros -Group: System Environment/Base License: GPLv2 # This is a EPEL maintained package which is specific to # our distribution. Thus the source is only available from # within this srpm. -URL: http://download.fedoraproject.org/pub/epel +URL: https://download.fedoraproject.org/pub/epel Source0: macros.epel-rpm-macros Source1: macros.zzz-epel-override Source2: GPL @@ -23,7 +22,7 @@ Requires: redhat-release >= %{version} Recommends: fpc-srpm-macros # pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros # https://bugzilla.redhat.com/show_bug.cgi?id=2001034 -Requires: (pyproject-rpm-macros if python3-rpm-macros) +Requires: (pyproject-rpm-macros if python3-rpm-macros) %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -52,7 +51,7 @@ install -Dpm 644 %{SOURCE1} \ %changelog * Mon Oct 25 2021 Troy Dawson - 9-2 -- Add %dist to Release: +- Add %%dist to Release: - Fix pyproject-rpm-macros typo * Mon Oct 25 2021 Troy Dawson - 9-1 From 61359cc134b829c2536305988fb22b93bd76ff92 Mon Sep 17 00:00:00 2001 From: Carl George Date: Thu, 2 Dec 2021 09:21:29 -0600 Subject: [PATCH 45/57] Rebuild for EPEL9 --- epel-rpm-macros.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 46688fd..45b0118 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 2%{dist} +Release: 3%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -50,6 +50,9 @@ install -Dpm 644 %{SOURCE1} \ %changelog +* Thu Dec 02 2021 Carl George - 9-3 +- Rebuild for EPEL9 + * Mon Oct 25 2021 Troy Dawson - 9-2 - Add %%dist to Release: - Fix pyproject-rpm-macros typo From db0166460a94b0b75b77029c5b2f083a311e3006 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 17 May 2022 18:16:23 -0500 Subject: [PATCH 46/57] Add `Requires: ansible-srpm-macros` --- epel-rpm-macros.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 45b0118..b379763 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 3%{dist} +Release: 4%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -23,6 +23,7 @@ Recommends: fpc-srpm-macros # pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros # https://bugzilla.redhat.com/show_bug.cgi?id=2001034 Requires: (pyproject-rpm-macros if python3-rpm-macros) +Requires: ansible-srpm-macros %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -50,6 +51,9 @@ install -Dpm 644 %{SOURCE1} \ %changelog +* Tue May 17 2022 Maxwell G - 9-4 +- Add `Requires: ansible-srpm-macros` + * Thu Dec 02 2021 Carl George - 9-3 - Rebuild for EPEL9 From e19afa3b2ec51c469e92f2b4159c971558994fb5 Mon Sep 17 00:00:00 2001 From: Carl George Date: Thu, 26 May 2022 23:35:11 -0500 Subject: [PATCH 47/57] Backport java_arches macro from Fedora Fedora java packages now make use of a java_arches macro to only build on specific arches. Backport this to EPEL to allow those packages to be built in EPEL without modification. https://fedoraproject.org/wiki/Changes/Drop_i686_JDKs --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index b379763..30022d1 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 4%{dist} +Release: 5%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -51,6 +51,9 @@ install -Dpm 644 %{SOURCE1} \ %changelog +* Fri May 27 2022 Carl George - 9-5 +- Backport java_arches macro from Fedora + * Tue May 17 2022 Maxwell G - 9-4 - Add `Requires: ansible-srpm-macros` diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 01fefc7..23ee6a6 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -4,3 +4,6 @@ # Bash completions; not in bash to not intefere with install ordering %bash_completion_dir /usr/share/bash-completion/completions/ + +# Arches that OpenJDK and dependent packages run on +%java_arches aarch64 ppc64le s390x x86_64 From c212ede694540e26330a25c00825425eba7f9773 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 1 Sep 2022 18:10:54 -0500 Subject: [PATCH 48/57] Backport macros.shell-completions from Fedora --- epel-rpm-macros.spec | 11 +++++++++-- macros.shell-completions | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 macros.shell-completions diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 30022d1..d415d32 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 5%{dist} +Release: 6%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -13,6 +13,8 @@ Source0: macros.epel-rpm-macros Source1: macros.zzz-epel-override Source2: GPL #Add source for misc macros below here +# https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/macros.shell-completions +Source3: macros.shell-completions BuildArch: noarch @@ -42,15 +44,20 @@ install -Dpm 644 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/rpm/macros.zzz-epel-override #Add misc macros below here - +install -Dpm 644 %{SOURCE3} \ + %{buildroot}%{_rpmmacrodir}/macros.shell-completions %files %license GPL %{_rpmmacrodir}/macros.epel-rpm-macros %{_sysconfdir}/rpm/macros.zzz-epel-override +%{_rpmmacrodir}/macros.shell-completions %changelog +* Thu Sep 01 2022 Maxwell G - 9-6 +- Backport macros.shell-completions from Fedora + * Fri May 27 2022 Carl George - 9-5 - Backport java_arches macro from Fedora diff --git a/macros.shell-completions b/macros.shell-completions new file mode 100644 index 0000000..8e505d7 --- /dev/null +++ b/macros.shell-completions @@ -0,0 +1,3 @@ +%bash_completions_dir %{_datadir}/bash-completion/completions +%zsh_completions_dir %{_datadir}/zsh/site-functions +%fish_completions_dir %{_datadir}/fish/vendor_completions.d From ee11dd5032353996377a47212cbdbc7af3ec04da Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sat, 3 Sep 2022 19:53:52 -0500 Subject: [PATCH 49/57] Add go-srpm-macros-epel to the buildroot --- epel-rpm-macros.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index d415d32..9b91a8d 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 6%{dist} +Release: 7%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -26,6 +26,11 @@ Recommends: fpc-srpm-macros # https://bugzilla.redhat.com/show_bug.cgi?id=2001034 Requires: (pyproject-rpm-macros if python3-rpm-macros) Requires: ansible-srpm-macros +# Provides backports from Fedora's go-rpm-macros and fixes critical +# bugs in RHEL's go-rpm-macros. +# Just like in Fedora, only the minimal -srpm-macros are needed in the buildroot. +# The rest of the macros are pulled in dynamically. +Requires: go-srpm-macros-epel %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -55,6 +60,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Fri Sep 02 2022 Maxwell G - 9-7 +- Add go-srpm-macros-epel to the buildroot + * Thu Sep 01 2022 Maxwell G - 9-6 - Backport macros.shell-completions from Fedora From 0657f9b47c3dea8f55756e74fd2fbfb60c5a0fdb Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Mon, 23 Jan 2023 15:32:04 +0100 Subject: [PATCH 50/57] Add perl-generators-epel to the buildroot --- epel-rpm-macros.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 9b91a8d..59d36d1 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 7%{dist} +Release: 8%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -31,6 +31,9 @@ Requires: ansible-srpm-macros # Just like in Fedora, only the minimal -srpm-macros are needed in the buildroot. # The rest of the macros are pulled in dynamically. Requires: go-srpm-macros-epel +# Provides backport from Fedora's perl-generators related to proposal +# https://fedoraproject.org/wiki/Changes/Perl_replace_MODULE_COMPAT_by_generator +Requires: perl-generators-epel %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -60,6 +63,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Mon Jan 23 2023 Jitka Plesnikova - 9-8 +- Add perl-generators-epel to the buildroot + * Fri Sep 02 2022 Maxwell G - 9-7 - Add go-srpm-macros-epel to the buildroot From 41c3ca379c3d4e9d15c5b7098a5a444da450d41a Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Tue, 24 Jan 2023 10:14:30 +0100 Subject: [PATCH 51/57] Add boolean operator to perl-generators-epel --- epel-rpm-macros.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 59d36d1..5be13e8 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -33,7 +33,7 @@ Requires: ansible-srpm-macros Requires: go-srpm-macros-epel # Provides backport from Fedora's perl-generators related to proposal # https://fedoraproject.org/wiki/Changes/Perl_replace_MODULE_COMPAT_by_generator -Requires: perl-generators-epel +Requires: (perl-generators-epel if perl-generators) %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM From a0d0fa2bf373163d3ad19be2177759180f4901e6 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 10 Feb 2023 14:27:52 -0600 Subject: [PATCH 52/57] Add rpmautospec to the buildroot to mirror Fedora --- epel-rpm-macros.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 5be13e8..d455dad 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 8%{dist} +Release: 9%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -34,6 +34,8 @@ Requires: go-srpm-macros-epel # Provides backport from Fedora's perl-generators related to proposal # https://fedoraproject.org/wiki/Changes/Perl_replace_MODULE_COMPAT_by_generator Requires: (perl-generators-epel if perl-generators) +# Add rpmautospec to the buildroot to mirror Fedora +Requires: rpmautospec-rpm-macros %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -63,6 +65,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Fri Feb 10 2023 Maxwell G - 9-9 +- Add rpmautospec to the buildroot to mirror Fedora + * Mon Jan 23 2023 Jitka Plesnikova - 9-8 - Add perl-generators-epel to the buildroot From fd96ff6194f32cdca55e3b90cfcb121d3c219b54 Mon Sep 17 00:00:00 2001 From: Artur Frenszek-Iwicki Date: Sun, 5 Mar 2023 11:43:43 +0000 Subject: [PATCH 53/57] Add a Requires on fpc-srpm-macros --- epel-rpm-macros.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index d455dad..a2c47c9 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 9%{dist} +Release: 11%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -20,8 +20,7 @@ Source3: macros.shell-completions BuildArch: noarch Requires: redhat-release >= %{version} # For FPC buildroot macros -# Currently Recommends; Change to Requires when it is in EPEL -Recommends: fpc-srpm-macros +Requires: fpc-srpm-macros # pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros # https://bugzilla.redhat.com/show_bug.cgi?id=2001034 Requires: (pyproject-rpm-macros if python3-rpm-macros) @@ -65,6 +64,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Sun Mar 05 2023 Artur Frenszek-Iwicki - 9-11 +- Add fpc-srpm-macros to the buildroot + * Fri Feb 10 2023 Maxwell G - 9-9 - Add rpmautospec to the buildroot to mirror Fedora From 22656b4be335f5234f0026e6bdf4a0ee1f7bb652 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 24 Feb 2023 20:34:09 -0600 Subject: [PATCH 54/57] Add rust-srpm-macros-epel to the buildroot Depends-on: https://src.fedoraproject.org/rpms/rust-packaging/pull-request/6 --- epel-rpm-macros.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index a2c47c9..0a095b9 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -30,6 +30,8 @@ Requires: ansible-srpm-macros # Just like in Fedora, only the minimal -srpm-macros are needed in the buildroot. # The rest of the macros are pulled in dynamically. Requires: go-srpm-macros-epel +# Provides backports from Fedora's rust-srpm-macros +Requires: rust-srpm-macros-epel # Provides backport from Fedora's perl-generators related to proposal # https://fedoraproject.org/wiki/Changes/Perl_replace_MODULE_COMPAT_by_generator Requires: (perl-generators-epel if perl-generators) @@ -67,6 +69,9 @@ install -Dpm 644 %{SOURCE3} \ * Sun Mar 05 2023 Artur Frenszek-Iwicki - 9-11 - Add fpc-srpm-macros to the buildroot +* Sat Feb 25 2023 Maxwell G - 9-10 +- Add rust-srpm-macros-epel to the buildroot + * Fri Feb 10 2023 Maxwell G - 9-9 - Add rpmautospec to the buildroot to mirror Fedora From 83096c1f1539aeb6ee60a3d1c78724083c0e11ac Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 10 May 2023 09:03:06 -0500 Subject: [PATCH 55/57] Rebuild for RHEL 9.2 --- epel-rpm-macros.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 0a095b9..35d55ff 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 11%{dist} +Release: 12%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -66,6 +66,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Wed May 10 2023 Maxwell G - 9-12 +- Rebuild for RHEL 9.2 + * Sun Mar 05 2023 Artur Frenszek-Iwicki - 9-11 - Add fpc-srpm-macros to the buildroot From 1b116421bf641c23cdce64b371e9fecca65f1bc7 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Fri, 6 Oct 2023 02:40:46 +0200 Subject: [PATCH 56/57] Add qt6-srpm-macros to the buildroot. Fixes rhbz#2220860. --- epel-rpm-macros.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 35d55ff..2f68657 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 9 -Release: 12%{dist} +Release: 13%{dist} Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -37,6 +37,7 @@ Requires: rust-srpm-macros-epel Requires: (perl-generators-epel if perl-generators) # Add rpmautospec to the buildroot to mirror Fedora Requires: rpmautospec-rpm-macros +Requires: qt6-srpm-macros %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM @@ -66,6 +67,9 @@ install -Dpm 644 %{SOURCE3} \ %changelog +* Thu Oct 05 2023 Mattias Ellert - 9-13 +- Add qt6-srpm-macros to the buildroot. Fixes rhbz#2220860. + * Wed May 10 2023 Maxwell G - 9-12 - Rebuild for RHEL 9.2 From 746c959580d13bb2d03d65ef13302920ec59c3b8 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Mon, 30 Oct 2023 18:37:44 +0300 Subject: [PATCH 57/57] Remove unnecessary files --- sources | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 sources diff --git a/sources b/sources deleted file mode 100644 index e69de29..0000000