Compare commits

...

532 Commits

Author SHA1 Message Date
Jason Tibbitts 1b85ce0ce8 Keep the macro deps in alphabetical order. 2020-02-21 11:54:53 -06:00
Jason Tibbitts 3a4ec69bee Add dependency on fonts-srpm-macros.
The font guidelines overhaul was approved by FPC, so bring the macros
into the buildroot.  https://pagure.io/packaging-committee/issue/935
2020-02-20 16:56:42 -06:00
Jeff Law 9dd5528cf9 - Use eu-elfclassify to only run strip on ELF relocatables
and archive libraries.
2020-02-20 13:40:19 -07:00
Igor Raits edd94328ae
Fixup parallel algorithm for brp-strip-lto
Same as in RPM upstream.

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-02-14 14:26:36 +01:00
Igor Raits b92766d4d9
Fix year in changelog
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-02-14 14:20:25 +01:00
Igor Raits 776d974885
brp-strip-lto: Run strip in parallel
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-02-14 14:12:15 +01:00
Jeff Law 20749d9857
Strip LTO sections/symbols from installed .o/.a files 2020-02-14 13:39:34 +01:00
Tomas Orsava 9ce99265fd brp-python-bytecompile: Prepare for 2 digit minor versions (e.g. 3.10) 2020-02-14 12:35:17 +00:00
Lumir Balhar 312bfbac26 Use `-B` flag for Python when using compileall2 to not write pyc files
The Python compileall2 module in /usr/lib/rpm/redhat/
can be executed by various different Python interpreters.
We don't want to write several different `*.pyc` files
to this location - in most cases, that's not possible,
but somebody might run this as root.
2020-01-27 15:32:07 +00:00
Jeff Law 3e759e70ac Allow conditionally adding -fcommon to CFLAGS by defining %_legacy_common_support
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2020-01-23 14:25:11 +01:00
Florian Weimer fff3459086 Reenable annobin after GCC 10 integration (#1792892)
This reverts commit c18924507d
("Temporarily disable annobin for GCC 10 (#1792892)").
2020-01-20 13:52:38 +01:00
Florian Weimer c18924507d Temporarily disable annobin for GCC 10 (#1792892) 2020-01-20 11:42:04 +01:00
Denys Vlasenko 40a9e696d6 Bump version
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-05 13:56:00 +01:00
Denys Vlasenko 817f533126 kmod.prov: fix and speed it up
For kernel builds, /usr/lib/rpm/kmod.prov is fork+execed by rpmbuild
in "Processing files:" step about 8000 times, single-threaded,
with cumulative run time of ~2 minutes.

Speed up this script, by avoiding additional fork+execing.

Tested to work, observed speedup: almost exactly 2 times faster.

While verifying correctness, noticed that old script was buggy -
it was generating a bogus "Provides:" item - kmod(modules.builtin.modinfo),
because the logic in script was filtering for */*.ko files and
for */modules.builtin* files, and wasn't prepared for
the existence of */modules.builtin.modinfo file.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-05 13:53:31 +01:00
Igor Gnatenko 2721f1c528
Bump version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-03 15:48:35 +01:00
Pavel Raiskup e345575f97 %set_build_flags: define LT_SYS_LIBRARY_PATH
This config is to let libtool recognize that our 64bit variant of
%_libdir is actually on the standard/default library path, so libtool
doesn't think it has to be hard-wired as RPATH.  This is proper solution
for libtool RPATH issues described in:

  https://docs.fedoraproject.org/en-US/packaging-guidelines/#_removing_rpath

The libtool script/macros (new enough, v2.4.6+) honor this variable when
it isn't possible to detect the system-wide default library path.  It is
e.g. able to parse /etc/ld.so.* configuration, but there's no info about
/usr/lib64 on Fedora.

So to not force everybody to do:

   %configure LT_SYS_LIBRARY_PATH=...

... rather set this system-wide.  This is low-risk change since
older libtool scripts don't use this variable, and really no other
tools should.
2019-12-03 15:04:51 +01:00
Nicolas Mailhot f5f6818d6e wordwrap: fix some corner cases
– handle CR in addition to LF
– be smarter in presence of lists
– fix off-by-one mistake when a LF in the processed text falls exactly on the 81st column
2019-12-03 12:02:01 +00:00
Denys Vlasenko ddce306578
Bump version
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:01:10 +01:00
Denys Vlasenko 140ee1de89
brp-mangle-shebangs: do not stat / touch files needlessly
Run "stat" to get mtime, and "touch -d $saved_mtime"
only if we indeed modify file's shebang.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:00:36 +01:00
Denys Vlasenko 618362d6fb
brp-mangle-shebangs: fix unsafe/incorrect command expansion
trim() {
  printf '%s' "$*"
}
...
  read shebang_line < "$f" || :
  orig_shebang=$(trim $(echo "$shebang_line" | grep -Po "#!\K.*" || echo))

The "trimming", i.e. replacement of multiple spaces and removal of leading
and trailing spaces, is achieved because "trim $(cmd)" construct has an
unquoted $(), which is subject to word splitting.

This works, yes. BUT.

It is also subject to glob expansion - any ?s and *s will be attempted
to be expanded as well - definitely NOT what we want!

This change replaces this trick with code which avoids the expansion issue,
and which does not spawn any subprocesses for string manipulations -
this is ~3 times faster (fork+execs are expensive).

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:00:36 +01:00
Denys Vlasenko 63d7e4dc11
brp-mangle-shebangs: speed up finding of "text executables" (scripts)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:00:35 +01:00
Lumir Balhar 6335a7ff4a Fix brp-python-bytecompile with the new features from compileall2
Resolves: rhbz#1595265

The problem this change is intended to solve is with how `real_libdir`
is calculated. Let's assume we want to recursively byte-compile all
`*.py` files in
`/builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8`.
Then, `real_libdir` is this path without `$RPM_BUILD_ROOT` with
the filename at the end which displays in the error message like this:

```
Bytecompiling .py files below /builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8 using /usr/bin/python3.8
*** Error compiling '/builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8/site-packages/greplin/bar.py'...
  File "/usr/lib/python3.8/bar.py", line 1
    import sin from math
               ^
SyntaxError: invalid syntax
```

`/usr/lib/python3.8/bar.py` is obviously wrong.

One of the new features of the `compileall2` module (which will
be available in stdlib in Python 3.9) is that the path byte-compiled to
`*.pyc` files is calculated for each file. This means that by using
`-s` and `-p` we can strip `$RPM_BUILD_ROOT` and prepend `/` for each
file individually which will fix the problem.

```
Bytecompiling .py files below /builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8 using /usr/bin/python3.8
*** Error compiling '/builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8/site-packages/greplin/bar.py'...
  File "/usr/lib/python3.8/site-packages/greplin/bar.py", line 1
    import sin from math
               ^
SyntaxError: invalid syntax
```

This change has an effect only for Python >= 3.4.
2019-12-02 16:39:32 +01:00
Miro Hrončok 4d93255fb3 Fix the simple API of %gpgverify 2019-11-01 08:04:12 +01:00
Jason Tibbitts 2c88f0ec58 Bump release and add changelog entry. 2019-08-22 10:46:36 -05:00
Miro Hrončok 3490049617 Simplify the API of %gpgverify
Instead of:

  %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'

It is now possible to do:

  %gpgverify -k2 -s1 -d0

I haven't yet assumed any defaults not to break backwards compatibility.
2019-07-25 11:20:37 +02:00
Richard W.M. Jones 0b30be56e5 Bump version and rebuild. 2019-07-25 10:13:28 +01:00
David Abdurachmanov 0676a754f0 rpmrc: update optflags for riscv64
Match other architectures by adding missing flags:

    -fasynchronous-unwind-tables -fstack-clash-protection

This is already in Fedora/RISCV for 1+ year.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-07-25 10:12:03 +01:00
Igor Gnatenko 4a1d1dd78f
Fixup python-srpm-macros version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-07-20 18:47:27 +02:00
Lumir Balhar 5437dfca81 Use compileall2 Python module for byte-compilation in brp-python-bytecompile 2019-07-20 08:08:26 +02:00
Miro Hrončok 53617406d9 Move brp-python-bytecompile from rpm, so we can easily adapt it 2019-07-20 08:07:57 +02:00
Nicolas Mailhot faef29eb93 bump release 2019-07-08 23:32:20 +02:00
Nicolas Mailhot b8797dcd02 listfiles: make it robust against all kinds of “interesting” input
– restore protection against empty input
 – handle non-empty inputs, with whitespace, quotes, linebreaks, etc
2019-07-08 23:30:42 +02:00
Nicolas Mailhot 1f7310110e wordwrap: make list indenting smarter, to produce something with enough structure that it can be converted into AppStream metadata 2019-07-08 23:24:08 +02:00
Robert-André Mauchin 1e9cb0e970 Revert "listfiles: fix expansion of listfiles_exclude/listfiles_include"
This reverts commit 9deb0680eb.

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
2019-07-08 17:13:20 +02:00
Nicolas Mailhot 9deb0680eb listfiles: fix expansion of listfiles_exclude/listfiles_include 2019-07-08 01:14:41 +02:00
Florian Festi 6b139317d5 Add changelog entry for previous change 2019-07-01 17:12:12 +02:00
Daniel Mach 38d0d92d5c Switch binary payload compression to Zstandard level 19
Fedora Change: https://fedoraproject.org/w/index.php?title=Changes/Switch_RPMs_to_zstd_compression
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1720729
Fesco ticket: https://pagure.io/fesco/issue/2144
Rel-eng ticket: https://pagure.io/releng/issue/8395
2019-07-01 16:41:12 +02:00
Vít Ondruch 86aae600e6 Enable RPM to set SOURCE_DATE_EPOCH environment variable.
If %source_date_epoch_from_changelog is true, RPM can set the SOURCE_DATE_EPOCH
environment variable to the timestamp of the topmost changelog entry. The
SOURCE_DATE_EPOCH can be in turn used by various projects to override otherwise
dynamically generated timestamps.

E.g. this might help to have stable timestamps in generated
documentation etc.
2019-06-27 08:41:44 +02:00
Igor Gnatenko 6708d7876e
Bump release
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-25 08:14:09 +02:00
Robert-André Mauchin 29b504fa55 Expand listfiles_include and listfiles_exclude in condition
listfiles_include and listfiles_exclude can contain multiline data that should be expanded, otherwise it breaks the if condition on newlines.
2019-06-24 22:47:59 +00:00
Jitka Plesnikova c68c6bd353 Remove perl macro refugees 2019-06-12 12:54:26 +02:00
Panu Matilainen bab65715b2 Provide temporary shelter for rpm 4.15 perl macro refugees
Rpm 4.15 removes various language-specific macros. Python side is
already covered by the versioned python macros but this is not the
case with Perl, macros. Add them here temporarily to avoid breaking
the world, but these really belong to perl-macros or such.
2019-06-10 14:12:21 +03:00
Igor Gnatenko 5878df46c0
Bump release
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-04 08:25:50 +02:00
Nicolas Mailhot 02f4a20583 misc: protect listfiles against empty input, to avoid harmless but annoying messages in build logs 2019-06-04 08:24:14 +02:00
Nicolas Mailhot 8394d3cf12
misc: add a wordwrap helper 2019-06-04 08:23:55 +02:00
Björn Persson 3da0ad5da8 Added gpgverify. 2019-05-30 19:54:13 +02:00
Nicolas Mailhot c6773c14ed misc: listfiles: improve argument passing, simplify it and make it more robust 2019-04-24 17:16:46 +02:00
Nicolas Mailhot 61ec2ef5ba forge: add pagure driver 2019-04-24 16:48:00 +02:00
Nicolas Mailhot 68a8a3b402 misc: writevars: fix code formatting 2019-04-24 16:47:34 +02:00
Miro Hrončok f29acc639b buildflags.md: Fix the packaging guidelines link 2019-01-18 22:38:59 +01:00
Panu Matilainen 20a0e63249 Drop redundant _smp_mflag re-definition, use the one from rpm instead
Once upon a time these did differ (for various bad reasons) but the
version in rpm has been identical to ours for many years, lets shed
some old baggage.
2019-01-15 12:02:22 +02:00
Florian Weimer e80fa1344a Build flags: Add support for extension builders (#1543394) 2018-12-20 11:34:27 +01:00
Panu Matilainen 98ffd5040d Silence the annoying warning from ldconfig brp-script (#1540971) 2018-12-17 16:16:25 +02:00
Nicolas Mailhot 5335ee546b common: add a writevars helper 2018-12-04 17:25:02 +01:00
Nicolas Mailhot 353f8b9faf common: add a setcurrent helper 2018-12-04 17:25:01 +01:00
Nicolas Mailhot 7b6ec4668c forge: fix handling of / in refs as showcased by github.com/dnstap/golang-dnstap 2018-12-04 17:24:34 +01:00
Nicolas Mailhot d6f71146ac forge: keep distprefixes lowercase, even for not primary ones 2018-12-04 17:24:34 +01:00
Miro Hrončok a212174975 Make automagic Python bytecompilation optional
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2
2018-11-15 12:13:14 +01:00
Jason Tibbitts b725d1e38a Bump version/update changelog. 2018-11-08 08:34:28 -06:00
Nicolas Mailhot 455084c511 forge: add more distprefix cleaning (bz1646724) 2018-11-06 17:47:28 +01:00
Igor Gnatenko 65fc49d917
bump version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-10-22 11:09:13 +02:00
Nicolas Mailhot 8ba2a65b5c forge: add back a no-op -q in %forgeautosetup, even though being quiet was always its default behaviour
https://lists.fedoraproject.org/archives/users/81059352675829171399634426908237561548/
2018-10-22 10:10:19 +02:00
Igor Gnatenko 39fa88418c
bump version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-10-20 12:32:45 +02:00
Nicolas Mailhot c70110c677
forge: refactor to allow multiple calls
– permit extraction of multiple archives in a single specfile
   – %forgemeta, %forgesetup, %forgeautosetup: add a “-z <number>” switch to
     select a specific set of rpm variables
     (for example forgeurl<number> and version<number>)
   – %forgemeta, %forgesetup: add a “-a” switch to process all sets in one go
     (makes no sense in forgeautosetup, as you need so select specific patches)
   – %forgemeta: deprecate the “-u” switch, use “-z” it’s better
     (“-u” was awkward and mainly used by the %gometa macro. %gometa will now
      call the lua code directly)
 – %forgesetup: use “-v” for verbose processing, be quiet by default, drop “-q”
   (align with %forgemeta, %forgeautosetup and %autosetup)
 – %forgesetup, %forgeautosetup: only pass flags that make sense to
   %setup/%autosetup; reorder to match what works in el7
 – factor out complex or common lua code in separate lua modules, to allow:
   – code reuse in other macros without cut and pasting
   – direct lua routine invocation from other macros without going through a
     rpm macro
   – rpm syntax errors that point to a line in an actual lua file
 – %forgemeta: refactor the logic to drop as much forge-specific code as
   possible, use a single logic flow with tables of constants
 – %forgemeta: export more computed info in rpm variables, such as the
   %{_builddir} subdirectory an archive was extracted to (lifesaver when
   processing multiple archives)
 – %forgemeta: prepend secondary distprefixes with .S, to make clear they do
    not apply to the main archive
 – %forgemeta: add versionx to secondary distprefixes, if relevant
 – %forgemeta: make tar.bz2 the default archive format

Caveats:
 – forge services implement full-release downloads via tags. However the actual
   syntax of such tags is not standardised. If the macro does not guess the
   correct tag an upstream uses for a specific release, you will need to
   set the tag value explicitly.
 – GitHub lets upstreams move their projects to new URLs, keeping the old URL
   active. It all works transparently *except* the top directory inside
   generated archives always matches the new project name (even when accessed
   by compatibility URLs, and even for releases that antedate the renaming).
   Therefore, if macro processing of a GitHub archive suddenly fails, start by
   checking if upstream didn’t rename itself.

Multicall usage example (with “-a”)
 – to process a specific bloc in one of the macros use “-z <suffix>”
 – suffix 0 and no suffix are synonyms
 – therefore, calling the macros without “-a” or “-z” just works for the
   general use case when you have a single archive to process
 – caveat: forge services implement full-release

%<--
%global forgeurl0        https://gitlab.com/osslugaru/lugaru
Version:                 1.2

%global forgeurl1        https://gitlab.com/osslugaru/lugaru
%global tag1             1.1

%global forgeurl2        https://gitlab.com/osslugaru/lugaru
%global commit2          68488b0a11df90dca703c67e5592b93c6a269957

%global forgeurl3        https://gitlab.com/osslugaru/lugaru
%global branch3          v1.1

%global forgeurl4       https://github.com/google/trillian
%global version4        1.0.8

%global forgeurl5       https://github.com/kubernetes/apiextensions-apiserver
%global version5        1.9.6
%global tag5            kubernetes-%{version5}

%global forgeurl6        https://github.com/jdbranham/grafana-diagram
%global version6         1.3
%global commit6          440689793ab6da82019c5ee43b49438dfef976d5

%global forgeurl7        https://github.com/rethinkdb/rethinkdb-go
%global version7         1.4.2
%global branch7          v1

%global forgeurl8        https://code.googlesource.com/gocloud
%global version8         0.20.0

%global forgeurl9        https://code.googlesource.com/gocloud
%global tag9             v0.27.0

%global forgeurl10      https://code.googlesource.com/google-api-go-client
%global commit10        24928b980e6919be4c72647aacd53ebcbb8c4bab
%global version10       0

%global forgeurl11      https://code.googlesource.com/google-api-go-client
%global branch11        dartman

%global forgeurl12      https://bitbucket.org/nielsenb/pdfocr
%global version12       0.3.0
%global commit12        4f5750d202d33267094621630836f1215a5efa66

%global forgeurl13      https://bitbucket.org/nielsenb/pdfocr
%global version13       0.1.4
%global tag13           v0.1.4
%global commit13        c0359843a3420769940e12019ebd68891a053bd8

%global forgeurl14      https://bitbucket.org/creachadair/shell
%global commit14        3dcd505a7ca5845388111724cc2e094581e92cc6

%global forgeurl15      https://bitbucket.org/kirbyvisp/vdjpuzzle2/
%global branch15        js-edits
%global commit15        36a3850eb4a04c05e0f7e29e7d0c196f373eb672

%forgemeta -ia

Name:           testing
Release:        1%{?dist}
Summary:        A test package

URL:            %{forgeurl}
License:        Public domain

Source0:        %{forgesource0}
Source1:        %{forgesource1}
Source2:        %{forgesource2}
Source3:        %{forgesource3}
Source4:        %{forgesource4}
Source5:        %{forgesource5}
Source6:        %{forgesource6}
Source7:        %{forgesource7}
Source8:        %{forgesource8}
Source9:        %{forgesource9}
Source10:       %{forgesource10}
Source11:       %{forgesource11}
Source12:       %{forgesource12}
Source13:       %{forgesource13}
Source14:       %{forgesource14}
Source15:       %{forgesource15}

%description
A test package

%prep
%forgesetup -a

%build
exit 1

%install

%files
%doc
%<--

Merges: https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/35
2018-10-20 12:26:43 +02:00
Jan Pazdziora e3e0ba6ab7 Add %_swidtagdir for directory for SWID tag files describing the installation.
Signed-off-by: Jan Pazdziora <jpazdziora@redhat.com>
2018-10-11 14:26:10 +02:00
Igor Gnatenko f4ecbd3f4c Merge #34 `switch to distprefix in forge macros, implement branch support, refactor the logic to be simpler to understand and maintain` 2018-10-06 17:15:47 +00:00
Igor Gnatenko e46fe6f663 Merge #33 `remove explicit linebreaks, recent rpm versions insert them by default` 2018-10-06 17:15:25 +00:00
Igor Gnatenko 7e278eadca Merge #32 `simplify gitlab processing thanks to https://gitlab.com/gitlab-org/gitlab-ce/issues/38830` 2018-10-06 17:14:55 +00:00
Miro Hrončok b852a706ad Make ambiguous python shebangs error
See https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
2018-09-10 18:26:02 +02:00
Nicolas Mailhot 2c2e13ee0e switch to distprefix, implement branch support, refactor the logic to be simpler to understand and maintain 2018-08-31 20:03:31 +02:00
Nicolas Mailhot ec13f91007 remove explicit linebreaks, recent rpm versions insert them by default 2018-08-31 12:24:10 +02:00
Nicolas Mailhot 31fa384924 simplify gitlab processing thanks to https://gitlab.com/gitlab-org/gitlab-ce/issues/38830 2018-08-31 11:21:57 +02:00
Kalev Lember 9278251531 Add aarch64 to ldc arches 2018-08-20 22:33:04 +02:00
Igor Gnatenko 357550f7ba
Enable --as-needed by default
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-08-15 07:00:14 +02:00
Jason ティビツ 4d49f071dd Merge #24 `allow overriding the computed date in forge's %{?dist} macro` 2018-07-31 22:11:59 +00:00
Miro Hrončok 973e5c7052 Mangle /bin shebangs to /usr/bin ones (#1581757) 2018-07-19 12:34:53 +02:00
David Hugh Malcolm 521c1a9dd5 buildflags.md: fix typo 2018-07-11 13:43:53 +00:00
Igor Gnatenko ce50624ff0
fix type from previous commit
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-10 16:45:19 +02:00
Igor Gnatenko 85e473f982
Add option to add -Wl,--as-needed into LDFLAGS
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-10 16:41:33 +02:00
Igor Gnatenko 68e4ff270c
rename _strict_symbol_defs_build to _ld_strict_symbol_defs
It says more where to look and what it is supposed to do.

Acked-by: Florian Festi <ffesti@redhat.com>
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-10 16:41:33 +02:00
Kalev Lember 9a15f27f34 Disable non-functional ppc64 support for ldc packages
Sadly, ldc ppc64 support has detoriated so much that it no longer works
with any current llvm version. I'll keep an eye on things and re-enable
it once it's fixed, but right now it's just broken and upstream is
suggesting to disable the support for now.

https://github.com/ldc-developers/ldc/issues/2356
2018-07-09 12:24:57 +02:00
Panu Matilainen a62764b8e8 - Fix kernel ABI related strings (Peter Oros, #26)
- Automatically trim changelog to two years (Zbigniew Jędrzejewski-Szmek, #22)
- Cosmetics cleanups (Zbigniew Jędrzejewski-Szmek, #22)
2018-06-26 13:44:59 +03:00
Panu Matilainen 4d324adc62 Merge #26 `Fix kernel ABI related scripts` 2018-06-26 10:40:37 +00:00
Panu Matilainen aa24434396 Merge #22 `Automatically trim changelog entries after 2 years` 2018-06-26 10:40:16 +00:00
Florian Weimer a5c98437e2 Build flags: Require SSE2 on i686 (#1592212) 2018-06-18 11:48:31 +02:00
Fabio Valentini 30ef72bedf
macros.forge: drop additional dot to match current Guidelines 2018-06-14 18:25:25 +02:00
Petr Oros 4e17da5386 Fix kernel ABI related scripts
find-provides.ksyms and find-requires.ksyms contain macros for
  generate external kernel module symbol dependency table.
  These scripts are broken in fedora for long time.
  Patch fix both and make it useable again.

  -Petr

Signed-off-by: Petr Oros <poros@redhat.com>
2018-06-04 08:44:43 +02:00
Miro Hrončok c7d6417a3b Add a possibility to opt-out form automagic Python bytecompilation
That is, outside of Python specific directories.

More at https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation
2018-05-28 14:26:20 +02:00
Fabio Valentini 22833277e6
supplying %date for %forge macros optional (backwards compatible) 2018-05-26 11:59:04 +02:00
Fabio Valentini 74b8dd05bb do not use modification time of tarball for computing %dist
Using the modification time of the snapshot tarball for computing dist is a bad idea, since it's different on different machines.

For example, the computed date during the `buildSRPMfromSCM` koji task is likely different from the local date when the package was prepared, and so package builds (especially EVRs and changelog entries) are not reproducible.

With this change, the snapshot date is not calculated magically, but the packager has to set "%global date YYYYMMDD" manually. I also adapted the documentation for the macro to reflect that change.

This is related to the following FPC issue: https://pagure.io/packaging-committee/issue/719
2018-05-10 17:11:47 +00:00
Peter Jones f7e8f73ead brp-mangle-shebangs: make it possible to use generated exclusion lists
This patch adds two additional rpm macros, __brp_mangle_shebangs_exclude_file
and __brp_mangle_shebangs_exclude_from_file, to specify files from which
to read the extended regexps used for excluding shebangs and target
files.

Additionally, this adds documentation in the macros file and
--help/--usage/-?/-h to brp-mangle-shebangs, so that it's possible to
actually discover what the intended behavior is without reading the
script itself.

Signed-off-by: Peter Jones <pjones@redhat.com>
2018-05-02 14:38:46 -04:00
Florian Weimer f25f1b7627 Reflect -fasynchronous-unwind-tables GCC default on POWER (#1550914) 2018-05-02 11:55:12 +02:00
Florian Weimer 6b620c91fb Use plain -fcf-protection compiler flag, without -mcet (#1570823) 2018-05-02 11:39:39 +02:00
Peter Jones 60cf200c3c Add Requires: efi-srpm-macros for %{efi}
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-05-01 16:00:40 -04:00
Jason Tibbitts fdbb98bd99 Add %_metainfodir macro.
An intervening commit added a fix to %forgeautosetup, but the specfile
was not updated.  I indicated the fix in the %changelog.
2018-04-20 12:05:38 -05:00
Nicolas Mailhot e1493f294d fix patch application with autosetup (we have autosetup users now!) 2018-03-25 19:24:58 +02:00
Zbigniew Jędrzejewski-Szmek 8c5d5de24a Trim changelog entries older than two years
Inspired by http://gitweb.mageia.org/software/rpm/rpm-setup/tree/macros.in#n22
but changed to two years (3+ releases of Fedora).
2018-03-11 15:15:30 +01:00
Zbigniew Jędrzejewski-Szmek f843bf828a Drop Group tag and period from Summary 2018-03-11 14:52:54 +01:00
Jason Tibbitts b771d1efaf Update forge macros. 2018-03-05 10:22:04 -06:00
Nicolas Mailhot bea8f67f2c add another safety for people that write urls without protocols → quite a lot of indenting changes 2018-03-04 23:40:59 +01:00
Nicolas Mailhot 1073ba2a5a Handle more github quirks 2018-03-04 23:39:29 +01:00
Florian Weimer 8deb29e50a Make -fasynchronous-unwind-tables explicit on aarch64 (#1536431)
This reflects the default built into GCC.
2018-02-28 14:49:24 +01:00
Florian Weimer d5133f9acc Use -funwind-tables on POWER
Ideally, the GCC defaults should change as well, but let's put this into
redhat-rpm-config, too, similarly to -fasynchronous-unwind-tables.
2018-02-28 10:45:12 +01:00
Igor Gnatenko 71d7440127
ldconfig: make %ldconfig_post/%ldconfig_postun parameterized
If %ldconfig is not defined, then "%ldconfig_post/%ldconfig_postun foo"
will expand to " foo" which is breaking packages.

Also now it is possible to move %end into post/postun.

Reported-by: Terje Røsten <terjeros@phys.ntnu.no>
References: https://bugzilla.redhat.com/show_bug.cgi?id=1548331
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-25 07:11:46 +01:00
Florian Weimer 0448c23b73 Document the use of -Wl,z,lazy 2018-02-24 21:46:59 +01:00
Florian Weimer a4ec7ec768 Update release and changelog 2018-02-24 21:38:00 +01:00
Florian Weimer 509d4afbe4 Remove -z now from GCC specs file, now on command line (#1548397) 2018-02-24 21:37:06 +01:00
Florian Weimer 910c8585f3 Update release and changelog 2018-02-24 17:40:55 +01:00
Florian Weimer cd7779aeac First step of moving -z now to the gcc command line (#1548397) 2018-02-24 17:38:12 +01:00
Miro Hrončok 8f59b756ca Don't mangle shebangs with whitespace only changes (#1546993) 2018-02-22 11:12:28 +01:00
Igor Gnatenko 987e94f6ea
Move %end to %ldconfig_scriptlets
If people choose to use %ldconfig_post/%ldconfig_postun, let them to
deal with %end.

Reported-by: Harald Reindl <h.reindl@thelounge.net>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1547838
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-22 07:58:50 +01:00
Igor Gnatenko 17746cb929
macros.ldconfig: %end section immediately
Some people tend to use comments in spec files which adds them into the
scriptlet and we don't want this.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-17 13:51:42 +01:00
Igor Gnatenko 40990bb864
brp-mangle-shebangs: add support for whitespaces in file names
Now it starts requiring bash instead of POSIX-compatible shell, but this
is not a problem since other scripts in here do same.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-15 10:03:34 +01:00
Miro Hrončok fb05a239d2
Allow to opt-out from shebang mangling for specific paths/shebangs
Introduces __brp_mangle_shebangs_exclude_from and __brp_mangle_shebangs_exclude

 * the first allows to explude specific paths from the mangling
 * the second allows to exlude specific shebangs

Both are used with `grep -E`. Similar escaping rules as in [1] apply.

[1] https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering
2018-02-15 08:47:54 +01:00
Igor Gnatenko 6bc9480501
buildflags.md: add missing quote
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-09 17:42:37 +01:00
Nicolas Mailhot f0c0098d58 Add bitbucket.org support to %forgemeta 2018-02-09 10:17:46 +01:00
Nicolas Mailhot c314c8a285 enhance slightly %forgemeta to help investigating when it is called in silent mode from another macro 2018-02-09 10:17:46 +01:00
Nicolas Mailhot c6cdde1b01 fix slight brokenness in %forgesetup error paths 2018-02-09 10:17:46 +01:00
Igor Gnatenko 51f1c66748
brp-mangle-shebangs: Simplify/Fix check for shebang starting with "/"
Reported-by: Jun Aruga <jaruga@redhat.com>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1541057
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-08 10:38:45 +01:00
Igor Gnatenko 8444cee8f3
bump release
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-07 18:24:10 +01:00
Igor Gnatenko 35f7182912
brp-mangle-shebangs: fix mangling absolute paths in /.../env
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-07 18:23:28 +01:00
Igor Gnatenko d2cc76421f
chmod +x brp-ldconfig
Just for consistency.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-07 18:06:01 +01:00
Florian Weimer ddb845537c Fix typo 2018-02-05 14:40:59 +01:00
Florian Weimer fa08f0e5a1 Add RPM macros for compiler/linker flags 2018-02-04 18:00:40 +01:00
Igor Gnatenko 222670e2e7
Use newly available /usr/bin/grep
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-03 18:29:37 +01:00
Peter Robinson 07dea7d44f Use generic tuning for ARMv7 2018-01-31 09:34:18 +00:00
Jason Tibbitts 9ac5353554 Fix bad dependency on grep. 2018-01-30 20:23:24 -06:00
Miro Hrončok 00b0603754 Explicitly require stuff for brp-mangle-shebangs
Except what is in coreutils (already required)
2018-01-30 22:08:52 +01:00
Miro Hrončok 257a3a95c7 Add brp-mangle-shebangs 2018-01-30 13:31:25 +01:00
Igor Gnatenko 1591a6fbf8
Add macros.ldconfig
With https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets
we try to remove ldconfig scriptlets, but it would make every package
look horrible with all those conditionals. So let's just wrap ldconfig
scriptlets into macro so it doesn't look that horrible and error-prone.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-30 08:23:10 +01:00
Igor Gnatenko 7a29d55964
typo: fix day of week
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-29 17:30:29 +01:00
Igor Gnatenko 12ace9bdb9 Create DSO symlinks automatically
If there are unpackaged symlinks, build will fail with unpackaged files.
People can %undefine __brp_ldconfig if they need to and they should make
sure that they call ldconfig themselves.

Right now, script doesn't guide packagers what to do, but it's not
prerequisite.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-29 16:41:52 +01:00
Florian Weimer 8d6c6d0761 Build flags: Disable -z defs again (#1535422) 2018-01-29 15:18:11 +01:00
Florian Weimer 1b296f01fc Build flags: Enable CET on i686, x86_64 (#1538725) 2018-01-29 15:18:11 +01:00
Florian Weimer 6e5a75d61e Build flags: Switch to generic tuning on i686 (#1538693)
This matches what the gcc package already does by default.
2018-01-25 16:22:54 +01:00
Florian Weimer a013956e4f Build flags: Mention -fplugin-arg-annobin-disable 2018-01-23 16:25:52 +01:00
Florian Weimer c873752b33 Build flags: Improve description of -z defs remedies 2018-01-23 11:42:25 +01:00
Florian Weimer 078af19261 Link with -z defs by default (#1535422) 2018-01-22 16:01:54 +01:00
Florian Weimer 75a53b7ea3 Make armhfp flags consistent with GCC defaults 2018-01-22 15:41:54 +01:00
Florian Weimer 72b1044620 Build flags: Consistently use x86_64 (Fedora architecture name) 2018-01-22 15:18:23 +01:00
Florian Weimer e43ce312b7 Make use of -fasynchronous-unwind-tables more explicit (#1536431) 2018-01-22 15:17:14 +01:00
Florian Weimer 5b96b31cac Fix typo in build flags documentation 2018-01-22 14:53:38 +01:00
Florian Weimer faa1ad44f7 Remove --param=ssp-buffer-size=4 from build flags
-fstack-protector-strong does not use frame size heuristics for
deciding which functions to instrument, so changing the parameter has
no effect.
2018-01-22 14:30:12 +01:00
Florian Weimer 0d162176e9 Document build flags 2018-01-22 14:28:15 +01:00
Panu Matilainen 3bf139f646 Document how to disable hardened and annotated build (#1211296) 2018-01-19 12:21:06 +02:00
Panu Matilainen a747e7fb51 Fix the inevitable embarrassing typo in 77, doh 2018-01-17 12:57:53 +02:00
Panu Matilainen c4646d791d Macroize build root policies for consistent disable/override ability
Add a separate macro for each brp we have, using standard naming
convention and conditionalize the usage in %__os_install_post.
Voilà, we have a standard way to disable (and also override) any brp
scripts from specs that need it and a common scheme for new brps
to follow.

Note that this is not supposed to change the existing behavior and
default build root policy invocations at all, any change in those
would be a thinko/typo/copy-paste error in this commit.
2018-01-17 12:29:44 +02:00
Florian Weimer 42f29f31df Add -fstack-clash-protection for supported architectures (#1515865)
Avoid it on architectures which have only generic GCC support (such as
armv7hl).
2018-01-17 10:14:56 +01:00
Florian Weimer 6c35c254c2 Add _GLIBCXX_ASSERTIONS to CFLAGS/CXXFLAGS (#1515858) 2018-01-17 10:14:18 +01:00
Igor Gnatenko 7ab7ab048c Remove Requires: cmake-rpm-macros
It doesn't belong to redhat-rpm-config which is about *srpm* buildtime..

This reverts commit ea5600c887.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-15 23:28:09 +01:00
Jason Tibbitts 7c4cd33085 Add macros.forge.
Add macros to simplify the packaging of forge-hosted projects.
* https://bugzilla.redhat.com/show_bug.cgi?id=1523779
* https://fedoraproject.org/wiki/Forge-hosted_projects_packaging_automation
2018-01-11 17:49:08 -06:00
Sergey Avseyev ebb7ec32a4 Add Requires: nim-srpm-macros for %nim_arches 2018-01-03 12:43:14 +02:00
Igor Gnatenko bbf2e891aa Require annobin only if gcc is installed
Since b5ea4b290b we started to require gcc
(because annobin requires gcc). Since annobin does work only with gcc,
we don't have to install it if user doesn't have it.

Reported-by: Dominick Grift <dac.override@gmail.com>
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-02 12:56:19 +01:00
Björn Esser ea5600c887
Add Requires: cmake-rpm-macros for CMake auto-{provides,requires} (#1498894) 2017-12-21 16:12:02 +01:00
Panu Matilainen b9d5eecd65 Update URL to current location at src.fedoraproject.org 2017-12-08 14:32:21 +02:00
Nick Clifton b5ea4b290b Enable binary annotations in compiler flags 2017-11-22 12:41:44 +01:00
Troy Dawson fb76fd5200 Remove Requires: fedora-rpm-macros
- fedora-rpm-macros only contains a file with just a comment
 - If the package ever gets content we can add it back
2017-10-26 07:00:37 -07:00
Igor Gnatenko 1e879960b4 fix typo in changelog
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-10-03 15:43:01 +02:00
Igor Gnatenko 6d23bc8dc0 bump version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-07-31 14:45:19 +02:00
Igor Gnatenko 00e8557ba2 Move _debuginfo_subpackages and _debugsource_packages from rpm (RHBZ #1476735)
References: https://bugzilla.redhat.com/show_bug.cgi?id=1476735
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-07-31 14:45:08 +02:00
Igor Gnatenko f6596a4ca5 Define _include_gdx_index (RHBZ #1476722)
References: https://bugzilla.redhat.com/show_bug.cgi?id=1476722
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-07-31 14:43:55 +02:00
Robin Lee bc1c35fe61 Make %kernel_module_package actually honor %kmodtool_generate_buildreqs 2017-07-18 14:42:07 +02:00
Igor Gnatenko 2cb318efe9 Add Requires: rust-srpm-macros for %rust_arches
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-07-13 16:52:55 +02:00
Orion Poplawski 38d4bf84e7 Add Requires: openblas-srpm-macros for %openblas_arches 2017-03-15 15:03:00 -06:00
Dan Horák 4914809dca - set zEC12 as minimum architecture level for s390(x) (#1404991) 2017-02-02 12:26:14 +01:00
Jason Tibbitts 905b8bae64 Add macros.vpath from FPC ticket 655
https://fedorahosted.org/fpc/ticket/655
2016-12-15 13:05:41 -06:00
Adam Williamson 6dc72405b3 Revert #1393492 changes, they break far too many builds
Per fweimer: "Sorry, we need to revert the -Werror=implicit-*
bits.  There is no chance we can get this working in any
reasonable time frame, there is simply too much breakage."
2016-12-06 14:45:53 -08:00
Panu Matilainen 4edc01803a Actually bump version too. Sigh, again... 2016-11-30 13:52:35 +02:00
Panu Matilainen beb08c6bba Error on implicit function declaration and -return type for C (#1393492)
Add -Werror=implicit-function-declaration -Werror=implicit-int to
global cflags as per https://fedoraproject.org/wiki/Changes/Fedora26CFlags
2016-11-30 13:51:10 +02:00
Panu Matilainen 3081c4e7d5 Introduce macros for language specific compiler options
Introduce new language specific __global_fooflags for C, C++ and Fortran
This looks mildly strange and suspicious since because the global flags
get pulled in indirectly via %optflags (that doesn't change here but becomes
more obvious).

Depends on previous commit (8fe5b07871)
which was done separately to make the actual change (or lack of thereof)
stand out here.

This is not supposed to change any actual values for current usages,
so if it does it's a bug.

However there's a minor bonus involved for Fortran users who can now get
the correct FFLAGS/FCFLAGS for non-autoconf projects too by using
__global_fflags/fcflags
2016-11-30 13:41:57 +02:00
Panu Matilainen 8fe5b07871 Rename __global_cflags to __global_compiler_flags
Preparing for language specific compiler flag macros, this is
simply:

    perl -pi -e "s:__global_cflags:__global_compiler_flags:g" macros rpmrc

Since this looks like a much bigger change than it actually is, doing
it in a separate step without an associated build.
2016-11-30 13:37:12 +02:00
Panu Matilainen 5815b8dba9 Argh, remember to bump version too 2016-11-29 10:20:53 +02:00
Panu Matilainen c6dadedc03 Drop atom optimization on i686 (#1393492)
Implements the first half of:
https://fedoraproject.org/wiki/Changes/Fedora26CFlags
2016-11-29 10:19:51 +02:00
Dan Horák af1538f1bd - set z10 as minimum architecture level for s390(x) 2016-11-15 11:17:07 +01:00
Panu Matilainen d95e9bc7b6 Fix directory name mismatch in kernel_source macro (#648996)
Patch from  Jacob Keller.
2016-11-11 09:34:23 +02:00
Panu Matilainen cf7406787b Add default compiler flags for various MIPS architectures (#1366735) 2016-11-08 16:42:14 +02:00
Panu Matilainen b1a45b244e -pie is incompatible with static linkage (#1343892, #1287743)
The hardened gcc specs do not handle static linkage, so building
with -static has been broken since commit
d9235d2d90. Adjust the -ld spec
file to avoid -pie when static linkage is used, as suggested
by Florian Weimer.
2016-11-08 15:21:31 +02:00
Panu Matilainen 3234495f75 Drop unwanted + unused brp-* scripts
If java people say brp-java-repack-jars is not needed then it
probably isn't (#1235770). brp-implant-ident-static hasn't been enabled
in 13+ years, I THINK it's safe to say its not critically needed.

Leaving the actual scripts in the repo for now (amusement for
archeologists of future generations, eh?)
2016-11-07 16:14:38 +02:00
Lubomir Rintel 08a5bbb161 Add valgrind_arches macro for BuildRequires of valgrind (#1334599) 2016-11-07 15:50:01 +02:00
Stephen Gallagher 4fdceaa4c5 Add s390x build target for Node.js packages (#1391999) 2016-11-07 15:30:35 +02:00
Kalev Lember e9cc9d94a3 Add ldc_arches macro 2016-10-30 18:08:19 +01:00
Jason Tibbitts 9a4753b3e4 Remove hardcoded limit of 16 CPUs for make -j
There was a hardcoded limit of 16 on the value passed to make -j.  This
has been removed.  See
https://bugzilla.redhat.com/show_bug.cgi?id=1384938
2016-10-17 13:47:22 -05:00
Richard W.M. Jones c602b415e0 Update config.guess, config.sub to the latest versions from upstream.
These support the riscv64 architecture.
2016-10-13 16:28:32 +01:00
Richard W.M. Jones b159548b73 riscv64: Add riscv64 + global_cflags to our rpmrc. 2016-10-13 15:15:31 +01:00
Peter Robinson 47427a213e Enable aarch64 for mono arches 2016-10-12 12:44:52 +01:00
Jason Tibbitts c0b2fd19e0 Add .gitignore file. 2016-10-03 17:03:08 -05:00
Jason Tibbitts 7359cf0b80 And add a more descriptive comment. 2016-10-03 16:06:03 -05:00
Jason Tibbitts d3c4ff3299 Leave the macro undefined instead of defining to 0. 2016-10-03 14:30:19 -05:00
Jason Tibbitts a0145ecd2f Add %_configure_disable_silent_rules
Adds %_configure_disable_silent_rules, defaulting to 0, to optionally
enable the passing of --disable-silent-rules to configure scripts.
2016-10-03 12:55:00 -05:00
Jason Tibbitts 4824deaead Add dependency on qt5-srpm-macros. 2016-09-14 08:44:10 -05:00
Jason Tibbitts a5fc6e4b82 Well that was dumb; depend on the correct package. 2016-08-12 19:00:43 -05:00
Jason Tibbitts 704d7c0546 Add fedora-rpm-macros dep. 2016-08-12 18:42:36 -05:00
Jason Tibbitts 8e03aee432 Merge branch 'master' of ssh://pkgs.fedoraproject.org/rpms/redhat-rpm-config 2016-08-11 17:19:15 -05:00
Petr Písař e5530da0dc Mandatory Perl build-requires added <https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl> 2016-06-24 09:40:22 +02:00
Jason Tibbitts 818514ea62 Fix some trailing whitespace. 2016-04-12 19:45:59 -05:00
Jason Tibbitts 77e91e6469 Add fpc-srpm-macros dep. 2016-04-12 11:08:38 -05:00
Jason Tibbitts be53b9b3c2 Add a file for miscellaneous macros. 2016-04-11 21:41:45 -05:00
Fedora Release Engineering e29e82243c - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-04 22:03:37 +00:00
Dan Hor?k 945c0e15a3 - switch to -mcpu=power8 for ppc64le default compiler flags 2016-02-02 08:41:26 +01:00
Orion Poplawski 1e513b70c5 Escape macros in %changelog 2016-01-13 09:16:46 -07:00
Orion Poplawski fc07b2aa54 Add Requires: python-srpm-macros 2016-01-13 09:06:53 -07:00
Peter Robinson 3b1087c6c7 Add missing ARMv6 optflags 2016-01-08 00:36:58 +00:00
Peter Robinson cba4f80fea nodejs 4+ now supports aarch64 and power64 2015-12-02 17:28:31 +00:00
Jaromir Capik 6ace240a04 Adding STAGE2 bootstrap recipe 2015-11-04 16:43:28 +01:00
Florian Festi ba49b89375 - Add Requires: go-srpm-macros
- Resolves: #1243922
2015-07-17 15:08:03 +02:00
Sandro Mani 5c2b556b6a Use %__libsymlink_path instead of %__libsymlink_exclude_path in libsymlink.attr 2015-07-15 10:39:19 +02:00
Adam Jackson b19da6ace4 Fix cc1 specs mishandling of incremental linking 2015-07-08 13:49:53 -04:00
Dennis Gilmore 5fab7c250f - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-18 22:12:53 +00:00
Dan Horák b3b65bcefd - Mono 4 adds support for ppc64le 2015-06-05 12:37:35 +02:00
Florian Festi a91c848b8a - Support out of source builds for %_configure_gnuconfig_hack (#1191788)
- Fix typo in %kernel_module_package (#1159361)
2015-05-29 16:54:33 +02:00
Florian Festi db967d3586 - Add %py_auto_byte_compile macro controlling Python bytecompilation
(#976651)
2015-05-19 13:28:55 +02:00
Florian Festi cdfb917815 Fix libsymlink.attr for new magic pattern for symlinks (#1207945) 2015-04-29 15:12:24 +02:00
Adam Jackson 5568cb1c38 Fix ld specs mishandling of incremental linking 2015-04-08 09:29:03 -04:00
Till Maas d9235d2d90 Enable hardened_build by default 2015-02-19 18:13:04 +01:00
Dan Horák 3cc8292af7 - Explicitly set -mcpu/-mtune for ppc64p7 and ppc64le to override rpm defaults 2014-12-10 17:53:28 +01:00
Panu Matilainen 226d76f65b - Gnat macros are now in a package of their own (#1133632) 2014-09-22 11:30:22 +03:00
Dan Horák ff30293d77 Revert "Changed ppc64 to power64 macro for mono_archs"
This reverts commit 8928398b2b.
2014-09-19 12:33:05 +02:00
Thierry Vignaud caec3fe92f The attached patch kills a bogus comment in redhat-rpm-config
(it should have been killed along 2cbbbb322e

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-09-16 09:31:34 +03:00
Dennis Gilmore 53fbfd98bd - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 21:10:17 -05:00
Peter Robinson 624175e139 ARMv7 has Ada so add it to GNAT_arches 2014-06-05 22:49:12 +01:00
Brent Baude 8928398b2b Changed ppc64 to power64 macro for mono_archs 2014-05-24 08:11:59 -05:00
Peter Robinson 01bd917b0e aarch64 has Ada so add it to GNAT_arches 2014-05-13 11:24:52 +01:00
Josh Boyer 1767166dd5 Fix kmod.prov to deal with compressed modules (#1096349) 2014-05-12 15:05:02 -04:00
Jens Petersen 121c2fa889 move macros.ghc-srpm to ghc-srpm-macros and require it (#1089102) 2014-05-01 10:10:45 +09:00
Peter Robinson f60ba57637 With gcc 4.9 aarch64 now supports stack-protector 2014-04-29 23:37:34 +01:00
Ville Skyttä 82a41dfa6a Drop brp-* scripts needlessly duplicated with rpm
One possible incompatibility, hopefully non-issue: our brp-strip*
allowed setting strip and objdump to use via args and STRIP and
OBJDUMP env vars whereas the rpm ones allow it through args only
(i.e. %{__strip} and %{__objdump} as far as specfiles are concerned).
2014-04-27 17:09:14 +03:00
Ville Skyttä 20c7e01657 Drop bunch of macro definitions needlessly duplicated with rpm
Specifically, the following are gone from here now: %_prefix,
%_sysconfdir, %_infodir, %_mandir, %_defaultdocdir, %_configure,
%makeinstall, %debug_package, %_use_internal_dependency_generator,
%_missing_doc_files_terminate_build, %_unpackaged_files_terminate_build
2014-04-27 12:02:23 +03:00
Ville Skyttä 24cd400d7c %changelog spelling fixes 2014-04-27 12:02:23 +03:00
Ville Skyttä 20a45694f9 Trim trailing whitespace 2014-04-27 11:58:46 +03:00
Ville Skyttä c73bd80489 Drop .gitignore, there's nothing for git to ignore here any more 2014-04-27 11:34:19 +03:00
Panu Matilainen 147cb4ced1 - Temporarily bring back find-requires and -provides scripts to rrc-side
- Packages that refer to /usr/lib/rpm/redhat/find-requires|provides
  do exist afterall, bring the scripts (but NOT macro overrides for them)
  back until the packages (python3 at least) are fixed.
2014-04-15 16:11:41 +03:00
Panu Matilainen eaf6603313 - Let OCaml handle its own arch macros (#1087794) 2014-04-15 14:36:04 +03:00
Panu Matilainen 5c5a1d10b9 Oops, bogus date in changelog (sigh) 2014-04-15 10:14:32 +03:00
Panu Matilainen dd2a70568b - Move kmod and libsymlink dependency generators here from rpm
- These are specific to Fedora so might as well live here, and
  having them here also avoids having to carry patches in rpm
  for no good reason etc
2014-04-15 10:08:30 +03:00
Panu Matilainen 2cbbbb322e - Drop most of the script-based dependency generation bits
- Use rpmdeps to generate any "normal" dependencies even for the
  kernel module stuff, drop all other unnecessary duplication
  like elf, libtool and pkgconfig deps.
2014-04-10 15:20:54 +03:00
Panu Matilainen 43629272a8 - Allow opting out of config.{guess,sub} replacement hack (#991613) 2014-04-08 13:30:58 +03:00
Panu Matilainen 0f965fc0b3 - Add mono path macros (#1070936) 2014-04-08 13:26:14 +03:00
Panu Matilainen a1cd32b14d Doh, remember to bump the actual version 2014-04-08 12:41:42 +03:00
Panu Matilainen c8cbd244cf - Move the remaining dependency generator stuff to the kmp macro package
- Stop overriding rpm external dependency generator settings by default
- No normal package should ever end up using the old unmaintained
  dependency generator scripts from here, but the kmp system depends
  for now on the way this was previously set up here so letting
  that old cruft live in the non-default package for now.
2014-04-08 12:36:08 +03:00
Panu Matilainen fdc99f0414 Split kernel module scripts and macros to a separate package
- These are not very relevant for Fedora, more so for RHEL and derivates
  where it would be far preferrable to maintain the scripts as separately
  from Fedoras redhat-rpm-config package as they are unmaintained and
  only get out of sync here. Splitting these to a separate package
  is the first step towards that.
- This isn't supposed to affect Fedora packages in any way.
2014-04-07 14:47:28 +03:00
Panu Matilainen 0e6d36bee9 Split kernel module macros to a separate file 2014-04-07 14:38:58 +03:00
Panu Matilainen 188c86566f Be more explicit about the package contents 2014-04-07 14:36:52 +03:00
Panu Matilainen fe3b678a9d - Stop pretending this package is relocatable, its not
- Require rpm >= 4.11 for /usr/lib/rpm/macros.d support etc
- Move our macros out of from /etc, they're not configuration
2014-04-02 17:26:32 +03:00
Panu Matilainen d671d47dd1 - Remember to update lookaside-source status (there aren't any) 2014-04-02 13:21:15 +03:00
Panu Matilainen 060a4721d1 - Make fedora dist-git the upstream of this package and its sources,
all patches dropped as they're no longer relevant
- Add maintainer comments to spec wrt versioning and changes
- Except for Changelog documentation, the resulting binary package
  is identical to previous version (9.1.0-58), ie only maintenance
  practise is changed here, not contents.
2014-04-02 13:12:25 +03:00
Panu Matilainen c8d1a00f2a Merge remote-tracking branch 'localupstream/master' into merge
* localupstream/master: (213 commits)
  Flatten the directory structure in preparation to merge
  ...
2014-04-02 10:50:18 +03:00
Panu Matilainen 4241a31b50 Flatten the directory structure in preparation to merge 2014-04-02 10:42:10 +03:00
Panu Matilainen 64c2b57c0d Remove mostly useless Makefile in merge preparation 2014-04-02 10:41:29 +03:00
Dan Horák c7d4014777 Enable ppc64le otherwise default rpm cflags will be used 2014-04-01 10:57:31 +03:00
Dan Horák bca39317e9 - enable ppc64le otherwise default rpm cflags will be used 2014-03-24 17:27:07 +01:00
Panu Matilainen 6e5c1076ec - config.guess/sub don't need to be group-writable (#1061762) 2014-02-07 11:00:05 +02:00
Kevin Fenzi 6c38f18be2 Update libtool hardening hack and re-enable (#978949) 2014-01-25 10:10:32 +02:00
Dhiru Kholia 33b9cbdc67 Enable "-Werror=format-security" by default (#1043495) 2014-01-25 10:10:32 +02:00
Karsten Hopp e0046a7a16 update config.sub with ppc64p7 support (already in automake) We used to fix this in the selected ppc64p7 packages, but can't do that anymore because the current %configure macro overwrites our changes. 2014-01-25 10:10:32 +02:00
Panu Matilainen 1046b9e79a - update config.guess/sub from upstream for little-endian ppc archs 2014-01-25 10:10:32 +02:00
Kevin Fenzi e606f56f34 Make docdirs unversioned on Fedora 20+ (#986871) 2014-01-25 10:03:26 +02:00
Kevin Fenzi b4b00eca04 Hack around libtool issue for hardened build for now (#978949) 2014-01-25 10:03:26 +02:00
Panu Matilainen 76c839e23e - fix brp-java-repack-jars failing on strange permissions (#905573) 2014-01-25 10:03:26 +02:00
Panu Matilainen d4c5b38371 - switch from -fstack-protector to -fstack-protector-strong (#978763) 2014-01-25 10:03:26 +02:00
Panu Matilainen 5f7da21873 - make cpu limit for building configurable through _smp_ncpus_max macro - forward "port" from rhel-6 (#669638) 2014-01-25 10:03:26 +02:00
T.C. Hollingsworth 31a511cc04 add nodejs_arches macro for ExclusiveArch for Node.js packages 2014-01-25 10:03:26 +02:00
Adam Jackson 4a42acd940 redhat-config-*: Use + to append rather than %rename, to protect against
multiple -specs= ending up in the command line. (#892837)
2014-01-25 10:03:26 +02:00
Panu Matilainen 0466a24ccb - Also set FCFLAGS from %%configure (#914831) 2014-01-25 10:03:26 +02:00
Panu Matilainen 48bdcffed2 - Add optflags stack protector override for AArch64 (#909788) 2014-01-25 10:03:26 +02:00
Panu Matilainen 2a557175eb - Switch back to manual config.guess/sub copies for reproducability - Replace config.guess/sub from %%configure again (#951442) 2014-01-25 10:03:14 +02:00
Panu Matilainen b9eb0a184b - Add -grecord-gcc-switches to global CFLAGS (#951669) 2014-01-25 00:41:21 +02:00
Jens Petersen 09b575178f add ARM to ghc_arches_with_ghci for ghc-7.4.2 ghci support
This change must not be backported to F18 before ghc-7.4.2.
2014-01-25 00:39:47 +02:00
Toshio Kuratomi d22596b0c1 Patch to fix spaces in java jar files
https://bugzilla.redhat.com/show_bug.cgi?id=872737
2014-01-25 00:37:36 +02:00
Toshio Kuratomi 1891cc0aeb Patch to fix spaces in files used in filtering macros
https://bugzilla.redhat.com/show_bug.cgi?id=783932
2014-01-25 00:35:48 +02:00
Ville Skyttä e8199cfec5 Drop (un)setting LANG and DISPLAY in various build stages.
rpm >= 4.8.0 takes care of that itself.
2014-01-25 00:35:48 +02:00
Toshio Kuratomi f41a8a73aa Fix kernel_source macro to match the directory that kernel sources are installed in
https://bugzilla.redhat.com/show_bug.cgi?id=648996
2014-01-25 00:35:48 +02:00
Toshio Kuratomi 2f654df096 Patch _mandir, _infodir, and _defaultocdir to use _prefix
https://bugzilla.redhat.com/show_bug.cgi?id=853216
2014-01-25 00:35:48 +02:00
Toshio Kuratomi be607b55f4 Java jars need the MANIFEST.MF file to be first in the archive
https://bugzilla.redhat.com/show_bug.cgi?id=465664
2014-01-25 00:35:48 +02:00
Toshio Kuratomi f40ecfaa06 Add patch from https://bugzilla.redhat.com/show_bug.cgi?id=783433
to fix spaces in files and directories that are fed to the
brp-python-hardlink script
2014-01-25 00:35:32 +02:00
Panu Matilainen 98d1974f20 - enable minidebuginfo generation (#834073) 2014-01-25 00:14:16 +02:00
Panu Matilainen 3b282b08f2 - revert back to plain -g, -g3 seems to cancel dwz size improvements 2014-01-25 00:13:09 +02:00
Panu Matilainen 1cff11580f - require dwz, enable dwarf compression for debuginfo packages (#833311) 2014-01-25 00:11:43 +02:00
Jens Petersen 0bdcad5349 ghc_arches: add s390 and s390x 2014-01-25 00:09:07 +02:00
Panu Matilainen 2e8b7fa04c - add GNAT arch definitions 2014-01-25 00:07:47 +02:00
Dennis Gilmore 5b8380d52b per ppc team request drop -mminimal-toc on ppc64 2014-01-25 00:05:30 +02:00
Jens Petersen 28c041a114 macros.ghc-srpm: add ghc_arches_with_ghci for fully bootstrapped ghc archs 2014-01-24 23:56:26 +02:00
Dennis Gilmore 36225c3b7c Revert "macros: Globally add --disable-silent-rules to configure"
This reverts commit 8174ec3d10.

remove patch that forces --disable-silent-rules to configure it breaks anything set to not ignore unknown configure options
2014-01-24 23:55:03 +02:00
Jens Petersen 68557142e4 add armv5tel to ghc_arches 2014-01-24 23:51:28 +02:00
Dennis Gilmore 401166077f build armv5tel on armv7l since they are the same abi armv7hl is a incompatable ABI 2014-01-24 23:49:36 +02:00
Jens Petersen 74c45dc8c2 add armv7hl to ghc_arches 2014-01-24 23:47:43 +02:00
Adam Jackson 7b12d83d77 redhat-hardened-cc1: Inject -fPIE, not -fPIC. cf. http://lists.fedoraproject.org/pipermail/devel/2011-September/157365.html 2014-01-24 23:45:40 +02:00
Adam Jackson 5034f24e6a Expose %_hardening_{c,ld}flags independently to make it easier for packages to apply them to selected components 2014-01-24 23:45:05 +02:00
Colin Walters 8174ec3d10 macros: Globally add --disable-silent-rules to configure
Various projects have been adding AM_SILENT_RULES from Automake to
their Makefiles for "developer convenience"; the goal being that they
see warnings more easily.

Now really the right way to do this is to have a make wrapper (or an IDE)
that knows how to filter out warnings, but let's leave that aside for now.

But for debugging builds, we really need the full log data.  Being
able to see exactly how e.g. libtool is being run helps a lot for
debugging link problems as an example.
2014-01-24 23:42:25 +02:00
Adam Jackson 0ae4b38eee redhat-hardened-{cc1,ld}: Move some of the rewrite magic to gcc specs so we don't end up with both -fPIC and -fPIE on the command line 2014-01-24 23:41:09 +02:00
Adam Jackson 51811936c4 redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %_hardened_build 2014-01-24 23:36:04 +02:00
Adam Jackson 4b29a24132 redhat-rpm-config-9.1.0-relro.patch: LDFLAGS, not CFLAGS. 2014-01-24 23:34:16 +02:00
Jon Masters 16f86875d9 redhat-rpm-config: change default arch level target for all ARM v7 to armv7hl
All ARM version 7 systems support a vector hardware floating point unit and
have the ability to run using the hard floating point ABI (aapcs-vfpv3-d16).
This is the only configuration we support as a v7 target, so we force the
use of hard floating point. This prevents e.g. packages being built with
a armv5tel target on an armv7 system without explicit intent.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
2014-01-24 23:30:45 +02:00
Adam Jackson 60aea2849e Add -z relro 2014-01-24 23:24:07 +02:00
Jens Petersen d8bfddbf7e Revert "replace ghc_archs with ghc_excluded_archs"
This reverts commit 8fc99b69b6.
2014-01-24 23:22:42 +02:00
Jens Petersen 71ab2d9056 replace ghc_archs with ghc_excluded_archs 2014-01-24 23:19:09 +02:00
Dennis Gilmore fe1e807f2f add arm hardware floating point macros update the armv7l macros 2014-01-24 23:13:58 +02:00
Dennis Gilmore dc985dd5fc add a -srpm to the arch macros so they dont conflict with the langaugae base arch macros 2014-01-24 23:12:41 +02:00
Dennis Gilmore 9ecf19e1bd add macros defining arches so language stacks can add new arches without adding the arches to every spec file macros are needed at srpm creation time so live here 2014-01-24 23:02:24 +02:00
Panu Matilainen 26a7faf833 - adjust to new pkg-config behavior wrt private dependencies (#596433) 2014-01-24 22:57:27 +02:00
Kevin Fenzi e04bd964a3 Update libtool hardening hack and re-enable (#978949) 2014-01-13 12:45:57 -07:00
Dhiru Kholia d1c22eee30 Enable "-Werror=format-security" by default (#1043495) 2013-12-18 08:41:34 +02:00
Karsten Hopp f808f779df update config.sub with ppc64p7 support (already in automake)
We used to fix this in the selected ppc64p7 packages, but can't do that anymore
because the current %configure macro overwrites our changes.
2013-09-04 21:55:10 +02:00
Panu Matilainen 8f766c5ee4 - oops, accidentally removed source in previous commit 2013-08-16 14:05:48 +03:00
Panu Matilainen 499f65fa2a - update config.guess/sub from upstream for little-endian ppc archs 2013-08-16 13:25:23 +03:00
Petr Písař 8716aaa134 Perl 5.18 rebuild 2013-07-29 08:56:28 +02:00
Tomas Mraz daac6dfeb6 Disable the libtool hack as it is breaking builds 2013-07-25 16:42:52 +02:00
Kevin Fenzi e6fe460e84 Make docdirs unversioned on Fedora 20+ (#986871)
- Hack around libtool issue for hardened build for now (#978949)
2013-07-24 16:20:05 -06:00
Petr Písař 3610794c3e Perl 5.18 rebuild 2013-07-17 21:02:48 +02:00
Panu Matilainen 15fbd4c0c2 - fix brp-java-repack-jars failing on strange permissions (#905573) 2013-07-05 13:29:16 +03:00
Panu Matilainen 8153763b1f - switch from -fstack-protector to -fstack-protector-strong (#978763) 2013-07-04 10:26:49 +03:00
Panu Matilainen 3be8fc4ae6 - make cpu limit for building configurable through _smp_ncpus_max macro
- forward "port" from rhel-6 (#669638)
2013-06-27 10:08:01 +03:00
Panu Matilainen 9781bbafca Fix an old bogus date in changelog 2013-05-29 13:00:57 +03:00
T.C. Hollingsworth 490aabb061 add nodejs_arches macro for ExclusiveArch for Node.js packages 2013-05-29 12:56:32 +03:00
Adam Jackson 6ef9b403ea Less verbose of a comment 2013-05-13 12:30:24 -04:00
Adam Jackson 3cff8f9b97 redhat-config-*: Use + to append rather than %rename, to protect against
multiple -specs= ending up in the command line. (#892837)
2013-05-13 11:19:02 -04:00
Panu Matilainen 234364ec2f - Also set FCFLAGS from %%configure (#914831) 2013-04-23 07:33:30 +03:00
Panu Matilainen 4b27de8d70 - Add optflags stack protector override for AArch64 (#909788) 2013-04-23 07:31:50 +03:00
Panu Matilainen 4481ddfec4 - Doh, add redhat-rpm-config-9.1.0.tar.bz2 back to sources 2013-04-22 14:54:31 +03:00
Panu Matilainen 9c8971c1cd - Switch back to manual config.guess/sub copies for reproducability
- Replace config.guess/sub from %%configure again (#951442)
2013-04-22 14:16:11 +03:00
Panu Matilainen 5ec4cc65c2 - Add -grecord-gcc-switches to global CFLAGS (#951669) 2013-04-22 13:20:19 +03:00
Panu Matilainen ea63b1b6bc - Add virtual system-rpm-config provide 2013-03-25 13:08:11 +02:00
Dennis Gilmore 6ec83fd8c4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 2013-02-14 15:31:02 -06:00
Jens Petersen 1b89fd3a33 add ARM to ghc_arches_with_ghci for ghc-7.4.2 ghci support
This change must not be backported to F18 before ghc-7.4.2.
2012-11-17 21:25:07 +09:00
Toshio Kuratomi 83cfe608da Patch to fix spaces in java jar files
https://bugzilla.redhat.com/show_bug.cgi?id=872737
2012-11-09 13:49:08 -08:00
Toshio Kuratomi c4fd9e0f75 Refresh 0001-Drop-un-setting-LANG-and-DISPLAY-in-various-build-st.patch
(Line offset has canged by a few lines).
2012-11-09 03:44:55 -08:00
Toshio Kuratomi 62a6fd7d9f Patch to fix spaces in files used in filtering macros
https://bugzilla.redhat.com/show_bug.cgi?id=783932
2012-11-09 03:40:39 -08:00
Toshio Kuratomi 5c4ec180bc Drop (un)setting LANG and DISPLAY in build stages, require rpm >= 4.8.0. 2012-10-03 18:19:33 -07:00
Toshio Kuratomi 94c3f755ba Add patch from https://bugzilla.redhat.com/show_bug.cgi?id=783433
to fix spaces in files and directories that are fed to the
  brp-python-hardlink script
- Require zip since java repack jars requires it
  https://bugzilla.redhat.com/show_bug.cgi?id=857479
- Java jars need the MANIFEST.MF file to be first in the archive
  https://bugzilla.redhat.com/show_bug.cgi?id=465664
- Fix kernel_source macro to match the directory that kernel sources are installed in
  https://bugzilla.redhat.com/show_bug.cgi?id=648996
- Patch _mandir, _infodir, and _defaultocdir to use _prefix
  https://bugzilla.redhat.com/show_bug.cgi?id=853216
2012-10-03 17:30:10 -07:00
Toshio Kuratomi 94fba4eae8 Add patch from https://bugzilla.redhat.com/show_bug.cgi?id=783433
to fix spaces in files and directories that are fed to the
  brp-python-hardlink script
2012-10-03 10:17:07 -07:00
Dennis Gilmore 0577043ed3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-21 10:25:12 -05:00
Panu Matilainen e95fc2098b - enable minidebuginfo generation (#834073) 2012-06-27 13:32:42 +03:00
Panu Matilainen 7f5c2c3943 - revert back to plain -g, -g3 seems to cancel dwz size improvements 2012-06-25 17:22:09 +03:00
Panu Matilainen 5316e51652 - require dwz, enable dwarf compression for debuginfo packages (#833311) 2012-06-25 14:42:15 +03:00
Petr Písař 51aea39741 Pull in dependency with macros specific for building Perl source packages 2012-06-06 14:00:11 +02:00
Jens Petersen 6ce33965b9 ghc_arches: add s390 and s390x 2012-03-03 15:31:01 +09:00
Panu Matilainen b2f900ec00 - add GNAT arch definitions 2012-02-22 10:12:42 +02:00
Dennis Gilmore 93950caa5d per ppc team request drop -mminimal-toc on ppc64 2012-01-15 12:24:11 -06:00
Dennis Gilmore 8d1ad74fc7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-13 20:46:15 -06:00
Peter Robinson 3b39f7f26b mktemp was long obsoleted by coreutils 2012-01-11 10:43:24 +00:00
Jens Petersen aa2690b410 macros.ghc-srpm: add ghc_arches_with_ghci for fully bootstrapped ghc archs 2011-12-27 21:40:35 +09:00
Dennis Gilmore df3fa9bf05 remove patch that forces --disable-silent-rules to configure
it breaks anything set to not ignore unknown configure options
2011-11-09 07:27:37 -06:00
Jens Petersen cf4ace9dc3 add armv5tel to ghc_arches 2011-10-18 16:30:42 +09:00
Dennis Gilmore e5475deba5 build armv5tel on armv7l since they are the same abi armv7hl is
a incompatable ABI
2011-09-28 09:45:25 -05:00
Jens Petersen 3e2fed4717 add armv7hl to ghc_arches 2011-09-28 09:57:24 +09:00
Ville Skyttä bb7037453e Fix URL. 2011-09-25 10:53:08 +03:00
Adam Jackson 3e26010b1e redhat-hardened-cc1: Inject -fPIE, not -fPIC.
cf. http://lists.fedoraproject.org/pipermail/devel/2011-September/157365.html
2011-09-22 14:42:22 -04:00
Adam Jackson 688e86b5a8 Expose %_hardening_{c,ld}flags independently to make it easier for
packages to apply them to selected components
2011-09-16 17:06:58 -04:00
Colin Walters 677db6759b Globally disable silent rules 2011-08-10 05:36:25 -04:00
Adam Jackson ca385d9198 redhat-hardened-{cc1,ld}: Move some of the rewrite magic to gcc specs so
we don't end up with both -fPIC and -fPIE on the command line
2011-08-08 10:59:25 -04:00
Adam Jackson da8d7a1e6a redhat-hardened-{cc1,ld}: Move some of the rewrite magic to gcc specs so
we don't end up with both -fPIC and -fPIE on the command line
2011-08-08 10:58:51 -04:00
Adam Jackson 796b80f2f4 redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %_hardened_build 2011-08-01 12:26:41 -04:00
Adam Jackson 8e60e55b8a redhat-rpm-config-9.1.0-relro.patch: LDFLAGS, not CFLAGS. 2011-07-07 13:17:24 -04:00
Jon Masters a51eb50bb4 redhat-rpm-config: change default arch level target for all ARM v7 to armv7hl
All ARM version 7 systems support a vector hardware floating point unit and
have the ability to run using the hard floating point ABI (aapcs-vfpv3-d16).
This is the only configuration we support as a v7 target, so we force the
use of hard floating point. This prevents e.g. packages being built with
a armv5tel target on an armv7 system without explicit intent.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
2011-07-02 04:55:37 -04:00
Adam Jackson 92e4921960 Add -z relro 2011-06-27 12:40:49 -04:00
Jens Petersen 8e0316b094 revert back to ghc_arches at releng's request 2011-06-21 13:05:25 +09:00
Jens Petersen 62baae777d Revert "replace ghc_archs with ghc_excluded_archs"
This reverts commit 8fc99b69b6.
2011-06-21 12:58:44 +09:00
Jens Petersen 60590c6d51 Revert "rename the arch patch in .spec too"
This reverts commit f657756e52.
2011-06-21 12:58:44 +09:00
Jens Petersen f657756e52 rename the arch patch in .spec too 2011-06-18 16:15:24 +09:00
Jens Petersen 8fc99b69b6 replace ghc_archs with ghc_excluded_archs 2011-06-18 16:05:16 +09:00
Dennis Gilmore 127539ef29 add arm hardware floating point macros
update the armv7l macros
2011-06-13 10:49:23 -05:00
Jens Petersen 39a665e921 fix typo of parallel in changelog 2011-06-02 13:27:25 +09:00
Dennis Gilmore 708e5ed256 add a -srpm to the arch macros so they dont conflict with the langaugae
base arch macros
2011-05-30 21:25:00 -05:00
Dennis Gilmore b7a1febf43 include the macros files 2011-05-27 11:40:29 -05:00
Dennis Gilmore 1e51f9b0b7 add macros defining arches so language stacks can add new arches without adding the arches to every spec file
macros are needed at srpm creation time so live here
2011-05-27 11:30:20 -05:00
Fedora Release Engineering f6ccdd625f dist-git conversion 2010-07-29 17:59:00 +00:00
Panu Matilainen 39013eb03a - adjust to new pkg-config behavior wrt private dependencies (#596433) 2010-05-27 12:21:55 +00:00
Panu Matilainen 63747f2774 - avoid unnecessarily running brp-strip-comment-note (#568924) 2010-03-01 09:06:10 +00:00
Panu Matilainen 055d0b77e1 Don't run brp-strip-comment-note when find-debuginfo.sh is run (#568924)
- brp-strip-comment-note is not only unnecessary here but is also
  now messing up things by resetting EI_OSABI to zero (#568921)
- patch from  Roland McGrath
2010-03-01 10:58:17 +02:00
Panu Matilainen cc13fe8402 - unbreak find-requires again, doh (#564527) 2010-02-15 11:49:10 +00:00
Panu Matilainen 635437c7bf Unbreak find-requires (#443015, #564527)
- regression originating from commit 9ed9b4e345
  which was supposed to fix something for on ARM but broke pretty much
  all else
- this should've been in 9.1.0 but somehow gone missing, ugh...
- fix originally from Bill Nottingham
2010-02-15 13:45:45 +02:00
Panu Matilainen f17b98976e - python byte-compilation errors abort the build by default 2010-02-03 11:06:30 +00:00
Panu Matilainen 7cf1ad2dbb Enable strict python bytecompile mode (if rpm supports it)
- with %_python_bytecompile_errors_terminate_build set to non-zero,
  byte-compilation errors will abort the build, this helps catch out
  silly "improt foo" syntax errors early on
- not all .py files are valid python (they can be templates, inteded for
  jython consumption etc), and what's valid can depend on the python
  version (notably 2.x vs 3.x) so allow overriding from spec
2010-02-03 12:52:30 +02:00
Panu Matilainen f49ef8cb4c Lose one more leftover patch (merged in 9.1.0 already) 2010-02-02 10:44:28 +00:00
Panu Matilainen 2e8b67dd78 Dont install ChangeLog into /usr/lib/rpm/redhat directory, doh 2010-02-02 12:02:10 +02:00
Panu Matilainen d53f48cc84 Tarball creation tweaks
- add ChangeLog to tarballs
- make tagging non-interactive
- silence the tarball generation commands
2010-02-02 11:24:04 +02:00
Panu Matilainen c73da1f920 Leave rpm's hkp keyserver configuration alone
- rpm < 4.6 used to try and fetch and import any missing keys from
  keyserver automatically on rpmdb iteration if hkp_keyserver was set, which
  caused hideous slowdowns and huge load on pgp keyservers AND was a
  security hazard as rpm thinks imported == trusted key. This is safe
  enable now as rpm will only ever import keys when explicitly told to do
  so with --import
- this makes pgp import directly from PGP servers work, ie
   'rpm --import 0x<keyid>'
2010-01-26 17:48:44 +02:00
Panu Matilainen 631ba9b6fe Use $(NAME) instead of hardwired name everywhere in makefile 2010-01-26 17:27:54 +02:00
Panu Matilainen a11368f98a Remove config.guess and config.sub
- these used to have RH-specific hacks in them and %configure used to
  copy updated versions to builddir on invocation but neither is done
  now, these are just copies of upstream (libtool / automake) versions
  so there's no point dragging them along
- some packages might expect to find them in /usr/lib/rpm/redhat/ so
  perhaps spec should copy them at build-time from automake/libtool
  to ensure a recent version
2010-01-26 16:09:35 +02:00
Panu Matilainen de76474f35 Remove "upstream reference" spec file
- this makes no sense as the spec needs to be separately maintained
  for distribution versions separately anyway
2010-01-26 15:52:39 +02:00
Panu Matilainen 7ec7e86b74 Set version directly in Makefile (and bump the version) 2010-01-26 15:51:57 +02:00
Panu Matilainen 1d1bd8e3cb Remove ancient and unused brp-redhat script
- this was last used eons ago somewhere in rpm 3.x - 4.[01] era
2010-01-26 15:40:02 +02:00
Panu Matilainen 9d5f7858ba rpm >= 4.6.0 doesn't process macrofiles: from rpmrc anymore, remove
- macrofiles: is silently ignored by recent rpm versions, remove the
  useless setting to avoid possible confusion
2010-01-26 14:43:47 +02:00
Panu Matilainen 2a452bba1e Permit using different python version for brp-python-bytecompile (#521141)
- pass %{__python} macro to brp-python-bytecompile instead of using
  hardwired /usr/bin/python, as suggested by Bowe Strickland
2010-01-26 13:55:54 +02:00
Panu Matilainen bda00a1a70 Use rpm's perl dependency extractors
- rpm's dep extractors have gotten numerous improvements over the years,
  while the ones here haven't seen any updates since 2002
- point the find-* scripts to rpm's scripts, remove the redundant and
  outdated perl.* scripts
2010-01-22 17:09:57 +02:00
Panu Matilainen ca3cae8695 Make peace with newer git 2010-01-22 16:27:43 +02:00
Panu Matilainen c57d60b64e Remove unused CVSROOT variable from Makefile 2010-01-22 16:25:45 +02:00
Panu Matilainen f359c096c2 Remove redundant %find_lang definition
- this was only useful back when we were using our own find-lang.sh
2010-01-22 15:59:04 +02:00
Panu Matilainen 4c01ac82e6 Remove brp-sparc64-linux blast from the past
- kludgery like this might've been necessary back in 2000 to get started
  with multilib setup but it certainly isn't needed now
2010-01-22 15:55:11 +02:00
Panu Matilainen 56ed371d31 Remove redundant and deprecated %_initrddir definition (#455279)
- this has been provided by rpm since forever, no need to carry it here
2010-01-22 15:47:15 +02:00
Panu Matilainen 850eda59f8 Disable autotools dependency tracking in %configure (#496522)
- autotools dependency tracking isn't generally useful in rpm builds;
  disabling it results in cleaner build logs and possibly slight build speedups
- patch from Ville Skyttä
2010-01-22 15:43:38 +02:00
Panu Matilainen c9d2ffe123 Don't set --target in %configure (#458648)
- --target is only ever useful for handful of compiler toolchain packages
  and cross-compiler packages are better off setting it themselves if
  necessary, rpm messing here only gets in the way
- patch originally from Stepan Kasal
2010-01-22 15:39:38 +02:00
Panu Matilainen f2e3413ddb Enable overriding the default ./configure path of %configure (#489942)
- syncs up with rpm upstream setup
- FFLAGS has a Fedora-specific override forcing us to carry this %configure
  copy, need to fix rpm to permit more fine-grained overrides...
2010-01-22 15:37:33 +02:00
Panu Matilainen b5b2aedbc1 Add filtering framework for external dependency generator (#516240)
- patch from Chris Weyl
2010-01-22 15:30:02 +02:00
Panu Matilainen 82f9946bc0 Speed up static archive stripping processing (#517101)
- only bother processing files named *.a instead of everything in buildroot
- patch from Adam Jackson
2010-01-22 15:26:58 +02:00
Panu Matilainen e56e816f47 Enable use of XZ compression for binary rpm payloads
- as per https://fedoraproject.org/wiki/Features/XZRpmPayloads
  - lowish compression preset level to keep deltarpm rebuild time tolerable
  - source rpms dont really benefit from XZ compression as the contents are
    typically tarballs which are already compressed
- patch from Bill Nottingham
2010-01-22 15:26:19 +02:00
Panu Matilainen 159a65fb61 Ensure empty buildroot for %install
- remove any existing buildroot contents and safely create a new one
- patch originally from OpenSUSE / Michael Schroeder, adopted to Fedora
  by Tom "spot" Callaway
2010-01-22 15:24:29 +02:00
Panu Matilainen f9c0aca4ae Make i686 the default x86 architecture, optimize for Atom CPU
- as per http://fedoraproject.org/wiki/Features/F12X86Support
- patch from Bill Nottingham
2010-01-22 15:23:31 +02:00
Panu Matilainen e2a80f379c Change default hashing algorithm in file digests to SHA-256 (#485826)
- as per https://fedoraproject.org/wiki/Features/StrongerHashes
- patch from  Miloslav Trmač
2010-01-22 15:22:42 +02:00
Panu Matilainen 5c981d5072 Fedora 11 default buildflags
- as per http://fedoraproject.org/wiki/Features/ArchitectureSupport
  - set 32 bit intel build arch to i586 on compatible hardware
  - set 32 bit sparc build arch to sparcv9 on compatible hardware
- add missing armv7l arch
- set the default build arch to match fedora arm build target
2010-01-22 15:20:26 +02:00
Panu Matilainen 3a2d93f311 Limit _smp_mflags to max 16
- patch from Dennis Gilmore
2010-01-22 15:20:08 +02:00
Panu Matilainen ab53232420 Handle JAR files containing filenames with spaces (#243157, #461854, #547704)
- patch originally from  Peter Bieringer
2010-01-22 11:22:07 +02:00
Panu Matilainen afe45959fb Dont try to repack empty JAR's (#269481, #547699)
- patch originally from Kai Bolay
2010-01-22 10:59:42 +02:00
Jonathan Masters 9ed9b4e345 A variety of small cleanups 2008-05-06 19:08:20 -04:00
Jon Masters fcf5e22a65 Bump the release. 2008-04-03 03:14:54 -04:00
Jon Masters 83405d773d Update config.guess|sub, sync with RHEL-5. 2008-04-03 03:11:24 -04:00
Jon Masters 0c5255b638 Set package_name correctly. 2008-04-03 02:46:05 -04:00
Jeremy Katz 75220114eb conflict instead of requires 2007-07-05 14:34:42 -04:00
Jesse Keating e284fd4907 Clean up dist junk; require right aged rpm (remove at F8 final time?) 2007-07-05 12:45:59 -04:00
Jesse Keating 9b11fc216b Enable buildroot check by default 2007-07-05 12:41:21 -04:00
Jeremy Katz 59155fec98 bump version, add %dist bits, add lost changelog entries 2007-06-19 14:55:09 -04:00
Jeremy Katz 9ffd969654 use stock find-lang rather than the (old) copy (#213041) 2007-06-19 14:38:34 -04:00
Jeremy Katz d82d89ec83 %{_gnu} gets defined in the platform definitions and _shouldn't_ be
-gnu on some arm arches (Lennert Buytenhek, #243523)
2007-06-19 14:36:18 -04:00
Jeremy Katz 6b022102df define optflags for modern arm arches (Lennert Buytenhek, #243523) 2007-06-19 14:35:57 -04:00
Jeremy Katz e54f487738 report gnueabi if appropriate for arm (Lennert Buytenhek, #243523) 2007-06-19 14:35:41 -04:00
Jeremy Katz 85ff3763b6 allow disabling jar repacking (#219731) 2007-06-19 14:28:50 -04:00
Jeremy Katz 1b84f70101 fix dist.sh --fc (#223651) 2007-06-19 14:24:12 -04:00
Jeremy Katz a959c1f92d hardlink identical .pyc and .pyo files to save some space. patch from
Ville Skyttä <ville DOT skytta AT iki DOT fi>
2007-06-19 14:20:53 -04:00
Jeremy Katz 9f4238cef9 fix usage of TMPDIR (mattdm, #235614) 2007-06-19 14:16:16 -04:00
Jeremy Katz 1b6281ab55 add install and clean targets to makefile. make the spec file be normal
instead of doing everything manually
2007-06-19 13:54:21 -04:00
Jeremy Katz 5b4d287b6b fix the permissions on these as well so that we're not oding it from the spec
file
2007-06-19 13:53:46 -04:00
Jeremy Katz 33fb6e3b66 use git bits for making the archive 2007-06-19 13:50:17 -04:00
Jeremy Katz 19f1cde13b fix perms 2007-06-19 13:42:44 -04:00
Jeremy Katz acfbad4bf7 bump spec file 2007-06-19 15:42:48 +00:00
Jeremy Katz 95521bebac add support for find-provides.d dir; use for modalias tracking (from jcm) 2007-06-19 15:23:29 +00:00
Jeremy Katz feffba404a add support for kmps/kmodtool stuff (from jcm) 2007-06-19 15:21:46 +00:00
Jeremy Katz 48c39c99dc patch from jcm to adjust kmod handling 2007-06-19 15:18:25 +00:00
Jeremy Katz e053cecd41 add script that does repacking of jar files to avoid multilib conflicts.
originally written by Ben Konrath <bkonrath AT redhat DOT com>
2007-06-19 15:13:23 +00:00
Jon Masters 97a32887d6 Update upstream redhat-rpm-config release. 2006-10-12 03:33:42 +00:00
Jeremy Katz c8ec9fb01f use -mtune=generic for x86 and x86_64 2006-02-03 23:00:26 +00:00
Elliot Lee 12233c1d7b fix #165416 2005-08-17 00:27:33 +00:00
Elliot Lee d3e0d601f6 add wall back in 2005-08-01 17:54:09 +00:00
Elliot Lee d5e4ed68cb add wall back in 2005-08-01 17:53:18 +00:00
Elliot Lee 1986646f85 8.0.37:
On Fri, 29 Jul 2005, Ulrich Drepper wrote:

> Please find attached the hopefully final changes for the compile flags.
>  It's a patch against redhat-rpm-config-8.0.36-1.src.rpm.  The changes are:
>
> ~ enable stack protector with minimal size 4 (default is 8, too high
>   IMO).  Vlad ran some tests on SPEC.  SPEC is highly CPU intensive,
>   unlike 90%+ of the distribution.  Even in those tests the performance
>   decrease was below 1%, probably even in the noise.  Especially the
>   decrease of the minimum size to 4 made no measurable impact.
>
> ~ remove the -fsigned-char flag for ppc.  glibc has not been compiled
>   with the flag anyway, so if anything changes, we eliminate some bugs.
>   The only theoretical issue would be if a library we ship uses CHAR_MAX
>   in an interface.  I personally haven't seen this for good reasons.
>   The only interface I know is localeconv(3) in glibc and this interface
>   is now corrected.
>
> ~ minor fix for SPARC
2005-08-01 17:44:57 +00:00
Elliot Lee f20fd09542 fix 2005-06-16 15:42:31 +00:00
Elliot Lee b8c7c4c827 Enable python, pkgconfig provides 2005-06-15 22:18:12 +00:00
Elliot Lee 5fc6cf03a1 fix 159117 2005-06-10 17:19:17 +00:00
Elliot Lee 1a959d38c8 fix #129025 2005-04-07 03:10:39 +00:00
Elliot Lee 259bb7270c add dist.sh 2005-03-24 20:10:06 +00:00
Elliot Lee ded130c1dd new version 2005-03-23 20:05:40 +00:00
Elliot Lee 6eb38ebaff new version 2005-03-23 19:52:10 +00:00
Elliot Lee f41aa8c35f #147961 2005-03-22 03:30:56 +00:00
Elliot Lee 1518ff2d14 Fix java builds 2005-02-09 15:09:11 +00:00
Elliot Lee 89e3065f19 Add ppc64[ip]series optflags 2004-12-03 19:28:33 +00:00
Elliot Lee f8bcd4e337 sync 2004-12-03 18:52:37 +00:00
Elliot Lee 6d1ad8ea36 sparcv8 support (#117302) 2004-12-02 20:54:26 +00:00
Elliot Lee d10e27e7b7 add _FORTIFY_SOURCE 2004-11-15 15:23:30 +00:00
Adrian Havill 84b567815c add "-f" (--force) to gunzip and bunzip2 for corner cases so that rpmbuild
doesn't interactively ask to overwrite when it doesn't need to
2004-10-15 21:02:36 +00:00
Bill Nottingham 7a4e10bb65 don't filter symbol versioning 2004-10-01 18:54:27 +00:00
Elliot Lee 4b07b8dbc6 8.0.31 2004-06-28 19:48:43 +00:00
Elliot Lee 0f91dc03fc add optflags for PPC 8260/8520 2004-06-28 14:07:05 +00:00
Elliot Lee c9593fd884 fix typo 2004-06-25 16:16:14 +00:00
Elliot Lee fbb9bd1577 oops 2004-06-25 16:15:56 +00:00
Elliot Lee 2c52d52eec 8.0.29 2004-06-25 16:02:37 +00:00
Elliot Lee 3e612b63b9 sync 2004-06-25 16:01:38 +00:00
Elliot Lee 92708fa515 #117217 2004-04-23 14:23:32 +00:00
Elliot Lee 2eb59b7156 sync 2004-03-01 17:29:43 +00:00
Elliot Lee ecdfe2c6d3 fix 108049 2003-11-03 20:35:50 +00:00
Elliot Lee 421fb7784f 8.0.28-1.1 2003-09-17 12:41:38 +00:00
Elliot Lee ff150bb9f8 8.0.28 2003-09-17 12:36:32 +00:00
Elliot Lee 4ccbbe76dc 8.0.27-1 2003-07-15 13:44:02 +00:00
Elliot Lee a2894a5e9a 8.0.27-1 2003-07-15 13:38:58 +00:00
Jens Petersen 9d388dbd19 * Mon Jul 7 2003 Jens Petersen <petersen@redhat.com> - 8.0.26-1
- preserve the vendor field when VENDOR not set
- put VENDOR in the final i386-libc line, not the tentative one
2003-07-07 02:32:13 +00:00
Jens Petersen 7bf42f4c8d * Mon Jul 07 2003 Jens Petersen <petersen@redhat.com> - 8.0.25-1
- update config.{guess,sub} to 2003-06-17
- define VENDOR to be redhat only when /etc/redhat-release present
  [suggested by jbj]
- put VENDOR in vendor field in our config.guess file for
  ia64, ppc, ppc64, s390, s390x, x86_64 and elf32-i386 Linux
- drop the --host, --build, --target and --program-prefix configure options
  from %%configure, since this causes far too many problems
2003-07-07 01:18:33 +00:00
Jens Petersen fb0d40d7ad For Cambridge too. 2003-05-02 10:05:02 +00:00
Jens Petersen dec5bd1983 8.0.24-2
- force config.{guess,sub} executable by chmod in spec file.
2003-05-02 10:00:46 +00:00
Jens Petersen 0c7a682bd0 8.0.24-1
- Re-add config.{sub,guess} executable.
2003-05-02 09:51:49 +00:00
Jens Petersen b14b80a980 Remove non-executable config.{sub,guess}. 2003-05-02 09:48:05 +00:00
Jens Petersen 7bd518af03 Up the release. 2003-05-02 09:41:17 +00:00
Jens Petersen 3f7f45e72a 8.0.23-1
- make config.{guess,sub} executable
2003-05-02 09:27:06 +00:00
Jens Petersen 0a7adcf375 8.0.22-2 for Taroon 2003-05-01 12:27:40 +00:00
Jens Petersen 1688b12454 8.0.22-1
- apply s390 patch to config.sub
2003-05-01 08:19:29 +00:00
Jens Petersen 2a08d46318 - add config.guess and config.sub (2003-02-22)
- make %%configure use them
2003-05-01 08:13:14 +00:00
Elliot Lee 4410abdbbb Unset $DISPLAY in macros 2003-03-03 16:16:20 +00:00
Elliot Lee ae8ce229ab 8.0.21 2003-02-24 18:39:29 +00:00
Elliot Lee e7eb34f089 Reorganize rpmrc/macros to set cflags in a nicer manner. 2003-02-13 16:33:31 +00:00
Elliot Lee 47b9f849d4 8.0.19 2003-01-22 18:30:56 +00:00
Nalin Dahyabhai 7d233e283e add brp-implant-ident-static, which requires mktemp 2003-01-20 20:06:50 +00:00
Bill Nottingham fd6018eddb happy new year 2003-01-09 19:52:24 +00:00
Bill Nottingham 3397996dd9 add brp-strip-static-archive 2003-01-09 19:52:00 +00:00
Bill Nottingham 89a0b75d71 make '-g' in optflags dependent on whether or not debug_package has a
value. This is Ugly(tm).
2002-12-17 07:12:32 +00:00
Elliot Lee 5fbe73ed91 8.0.15-1 2002-12-16 18:53:55 +00:00
Tim Powers 1640cd5cac more debug macro tweaks 2002-12-14 20:37:32 +00:00
Tim Powers 28188548fc forgot the changelog 2002-12-14 18:01:21 +00:00
Tim Powers 4707ac95be add internal dep generation macro, turn it on 2002-12-14 17:57:23 +00:00
Bill Nottingham ff2bb81934 use internal dependency generator 2002-12-13 23:04:56 +00:00
Elliot Lee d4c201f555 8.0.12-1 2002-12-13 17:20:16 +00:00
Alexander Larsson d18a947668 Make a temporary copy of the debug_package macro so that we get the noarch fix 2002-12-13 17:13:18 +00:00
Elliot Lee cec7d078f8 someday I will get it right 2002-12-11 18:05:00 +00:00
Elliot Lee 09f5ffd107 add -g 2002-12-11 15:39:47 +00:00
Elliot Lee e44c237bfb 8.0.9 2002-12-11 15:05:08 +00:00
Bill Nottingham 555b69e7a2 i like make archive :) 2002-12-04 04:57:53 +00:00
Bill Nottingham 47209decbe nuke -g 2002-12-04 04:55:22 +00:00
Elliot Lee c643f846ce 8.0.7-2 2002-11-25 20:44:00 +00:00
Elliot Lee 3f184f50a8 add -g 2002-11-25 19:27:56 +00:00
Elliot Lee 389ef3b072 8.0.7 2002-11-22 18:57:51 +00:00
Elliot Lee dce3663fe6 enable debug packages, etc. 2002-11-22 18:56:01 +00:00
Elliot Lee 53cca9f509 More reasons why rpmrc's "macrofiles" directive is broken. 2002-11-21 17:22:31 +00:00
Elliot Lee 1de7d81cf0 Pass __strip and __objdump macros 2002-11-21 16:54:33 +00:00
Elliot Lee 3b777d0999 8.0.5 2002-11-21 15:16:38 +00:00
Alexander Larsson 27ac1446b0 Make brp-strip* not strip debug objects
Add a _enable_debug_packages macro (commented out)
2002-11-20 16:55:36 +00:00
Elliot Lee f3e01161c3 Fix from bug #77849. 2002-11-14 12:48:21 +00:00
Elliot Lee d4970a5d33 8.0.4 2002-11-06 16:32:52 +00:00
Elliot Lee fa316006e8 remove tracking dependency 2002-10-31 16:23:46 +00:00
Elliot Lee 164e1163e4 find-lang fix(?) for symlinks 2002-10-21 15:28:51 +00:00
Phil Knirsch 0a68ef9360 - Added fix for outdated config.[sub|guess] files in %configure section. 2002-10-16 18:07:49 +00:00
Elliot Lee d5044b55bf 8.0.3 2002-10-16 17:19:55 +00:00
Elliot Lee 7f05ca8c77 Be stricter now. 2002-10-04 13:45:14 +00:00
Jeremy Katz be06bd913d bump to 8.0.2, add a changelog entry 2002-10-03 16:32:45 +00:00
Jeremy Katz 8a919b8bb9 We shouldn't be redefining everything in the redhat-rpm-config macros
file, because that will start overriding things like %{_lib} -- probably
more could have been snipped, but the remaining bits are at least
moderately reasonable to make sure are defined according to "our policy"
2002-10-03 16:31:51 +00:00
Alexander Larsson 61fb9e24cc Add debug package support to %__spec_install_post 2002-09-16 16:22:01 +00:00
Bill Nottingham bfb314aef8 bump version 2002-09-04 03:12:16 +00:00
Elliot Lee 122edab416 7.3.94 2002-08-28 18:45:29 +00:00
Elliot Lee 3031bc234c 7.3.93 2002-07-31 18:57:20 +00:00
Elliot Lee f0352fc040 Part two of new macros 2002-07-31 18:56:20 +00:00
Elliot Lee 00cbca969b Add comment about missing docs flag. 2002-07-31 17:05:22 +00:00
Karsten Hopp 7f634c575d typo 2002-07-15 13:45:55 +00:00
Elliot Lee 8617b2fe71 find-requires fix from 67325 2002-07-11 18:48:52 +00:00
Elliot Lee 38aa583967 find-lang.sh fix from 67368 2002-07-11 18:46:14 +00:00
Elliot Lee 3faabb2c8f fix from 67368 2002-07-11 18:43:40 +00:00
Elliot Lee 3827110e0a Add /etc/rpm/macros back to make #67951 go away 2002-07-11 17:07:42 +00:00
Jens Petersen 22b27c88b9 tidy rpm changelog entry 2002-06-28 06:19:26 +00:00
Jens Petersen cb63b82a2d Add %{?_gnu} to _target_platform.
Use --host, --build, --target and --program-prefix in %configure.
7.3.92-4
2002-06-28 05:25:23 +00:00
Elliot Lee f6a0040f2b ~/.rpmmacros 2002-06-26 14:24:45 +00:00
Elliot Lee 3687e63a72 sync 2002-06-21 18:17:17 +00:00
Elliot Lee d5db7f5ded 7.3.92-2 2002-06-21 18:13:56 +00:00
Elliot Lee 3ee6bad5b9 find-lang fixes 2002-06-20 20:56:07 +00:00
Elliot Lee 8c076a37c8 find-lang fixes 2002-06-20 20:56:07 +00:00
Elliot Lee 668485e883 Locale hack. 2002-06-12 21:04:24 +00:00
Elliot Lee 99968383d1 7.3.91 2002-06-12 13:26:24 +00:00
Elliot Lee f494dd7f79 7.3.91 2002-06-12 13:19:22 +00:00
Elliot Lee 72cfc641ce sync 2002-06-12 13:18:39 +00:00
Elliot Lee 03bb2914ea Initial revision 2002-06-12 12:59:50 +00:00
49 changed files with 7109 additions and 64 deletions

View File

@ -1 +0,0 @@
redhat-rpm-config-9.1.0.tar.bz2

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.noarch.rpm
*.src.rpm
results_redhat-rpm-config/
.build-*.log

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: redhat-rpm-config
# $Id: Makefile,v 1.2 2007/10/15 19:20:28 notting Exp $
NAME := redhat-rpm-config
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

30
STAGE2-redhat-rpm-config Normal file
View File

@ -0,0 +1,30 @@
#requires libtool
cd $SRC/redhat-rpm-config-*
# makefile has been removed :/
# make install
RCCDIR=/usr/lib/rpm/redhat
RPMCFGDIR=/usr/lib/rpm
RPMFATTR=/usr/lib/rpm/fileattrs
mkdir -p /usr/lib/rpm/redhat
install -p -m 644 -t $RCCDIR macros rpmrc
install -p -m 444 -t $RCCDIR redhat-hardened-*
install -p -m 755 -t $RCCDIR config.*
install -p -m 755 -t $RCCDIR dist.sh rpmsort symset-table kmodtool
install -p -m 755 -t $RCCDIR brp-*
install -p -m 755 -t $RCCDIR find-*
mkdir -p $RCCDIR/find-provides.d
install -p -m 644 -t $RCCDIR/find-provides.d firmware.prov modalias.prov
mkdir -p $RPMCFGDIR/macros.d
install -p -m 644 -t $RPMCFGDIR/macros.d macros.*
mkdir -p $RPMFATTR
install -p -m 644 -t $RPMFATTR *.attr
install -p -m 755 -t $RPMCFGDIR kmod.prov
cp -p /usr/share/libtool/config/config.{guess,sub} $RCCDIR/

34
brp-implant-ident-static Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
tempdir=`mktemp -d /tmp/implant-ident-XXXXXX`
if test -z "$tempdir" ; then
exit 1
fi
cleanup() {
rm -f $tempdir/*
rmdir $tempdir
}
trap cleanup 0 1 2 3 4 5 6 7 8 9 11 13 14 15
for library in `find $RPM_BUILD_ROOT -type f -exec file \{\} \; | grep 'current ar archive' | sed 's,:.*,,g' ` ; do
pushd $tempdir > /dev/null
if test -n "$RPM_BUILD_ROOT" ; then
cleanedlibrary=`echo "$library" | sed s,"$RPM_BUILD_ROOT",,g`
else
cleanedlibrary="$library"
fi
ar x "$library"
for object in *.o ; do
echo '$RPM: '${RPM_PACKAGE_NAME:-UNKNOWN_NAME}-${RPM_PACKAGE_VERSION:-UNKNOWN_VERSION}-${RPM_PACKAGE_RELEASE:-UNKNOWN_RELEASE}:"$cleanedlibrary":"$object"' $' > __x_rpm_ident_string.txt
objcopy --add-section .rodata=__x_rpm_ident_string.txt "$object"
ar r "$library" "$object"
done
rm -f *.o
popd > /dev/null
done

105
brp-java-repack-jars Executable file
View File

@ -0,0 +1,105 @@
#!/bin/sh
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
# If zip is not installed, we can't repack the jars.
if [ ! -x /usr/bin/zip ]; then
exit 0
fi
if [ ! -x /usr/bin/unzip ]; then
exit 0
fi
JARS=`find $RPM_BUILD_ROOT -type f -name \*.jar -not -size 0`
if [ ! -z "$JARS" ]; then
# make $RPM_BUILD_ROOT/tmp if it doesn't exist
rmtmp=0
if [ ! -x "$RPM_BUILD_ROOT/tmp" ]; then
mkdir -p $RPM_BUILD_ROOT/tmp
rmtmp=1
fi
# unpack every jar, set the date of the files and directories and
# repack the jar
OLD_IFS="$IFS"
IFS=$(printf '\n\t')
for j in $JARS ; do
JARNAME=`basename "$j"`
JTMPDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp "$JARNAME.tmpdir.XXXXXXXXXX"` || exit 1
JARDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp "$JARNAME.jardir.XXXXXXXXXX"` || exit 1
TIMEREF=`mktemp -p $RPM_BUILD_ROOT/tmp "$JARNAME.timeref.XXXXXXXXXX"` || exit 1
pushd "$JTMPDIR" > /dev/null
/usr/bin/unzip -qq -o "$j"
find -type d -exec chmod a+rx,u+w {} \;
find -type f -exec chmod a+r,u+w {} \;
rm -f "$j"
# Create the directories first.
find -type d | LC_ALL=C sort | while read d; do
mkdir -p "$JARDIR/$d"
done
# Get the modtime from the newest ChangeLog. If the project
# doesn't have a ChangeLog, Jan 1, 1970 will be used.
DATE="1970-01-01 UTC"
if [ -z $_PACKAGE_BUILD_DIR ]; then
_PACKAGE_BUILD_DIR=$RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION
fi
if [ -d $_PACKAGE_BUILD_DIR ]; then
CHANGELOGS=`find $_PACKAGE_BUILD_DIR -type f -name ChangeLog`
if [ ! -z "$CHANGELOGS" ]; then
for c in $CHANGELOGS; do
TMPDATE=`stat -c %y $c | cut -d " " -f 1-2`
if [ `date --date="$TMPDATE" +%s` -gt `date --date="$DATE" +%s` ]; then
DATE="$TMPDATE"
fi
done
fi
fi
# move the contents over to the a new directory in order and set
# the times.
find -type f | LC_ALL=C sort | while read f; do
cp "$f" "$JARDIR/$f"
touch --date="$DATE" "$JARDIR/$f"
done
popd > /dev/null
# Set the times of the directories.
find "$JARDIR" -type d | while read d; do
touch --date="$DATE" "$d"
done
# make the jar
pushd "$JARDIR" > /dev/null
if [ -n "`find -not -name '.'`" ]; then
if [ -e META-INF/MANIFEST.MF ]; then
/usr/bin/zip -q -X -9 "$j" META-INF/MANIFEST.MF
fi
find * -not -name '.' | LC_ALL=C sort | /usr/bin/zip -u -q -X -9 "$j" -@
else
# Put the empty jar back
touch "$j"
fi
popd > /dev/null
# Cleanup.
rm -rf "$JTMPDIR"
rm -rf "$JARDIR"
rm -f "$TIMEREF"
done
IFS="$OLD_IFS"
# remove $RPM_BUILD_ROOT/tmp if we created it
if [ $rmtmp -eq 1 ]; then
rm -rf $RPM_BUILD_ROOT/tmp
fi
fi

13
brp-ldconfig Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh -efu
# Force creating of DSO symlinks.
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
# Create an empty config file for ldconfig to shut up a warning
config=$(mktemp -p "$RPM_BUILD_ROOT")
/sbin/ldconfig -f $(basename "$config") -N -r "$RPM_BUILD_ROOT"
rm -f "$config"
# TODO: warn if it created new symlinks and guide people.

158
brp-mangle-shebangs Executable file
View File

@ -0,0 +1,158 @@
#!/bin/bash -eu
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
exclude_files=""
exclude_files_from=""
exclude_shebangs=""
exclude_shebangs_from=""
usage() {
local verbose=$1 && shift
local outfile=$1 && shift
local status=$1 && shift
(
echo 'usage: brp-mangle-shebangs [--files <regexp>] [--files-from <file>] [--shebangs <regexp>] [--shebangs-from <file>]'
if [ "${verbose}" == "yes" ]; then
echo ' --files: extended regexp of files to ignore'
echo ' --files-from: file containing a list of extended regexps of files to ignore'
echo ' --shebangs: extended regexp of shebangs to ignore'
echo ' --shebangs-from: file containing a list of extended regexps of shebangs to ignore'
fi
) >>${outfile}
exit ${status}
}
while [ $# -gt 0 ] ; do
case "$1" in
--files)
exclude_files="${2}"
shift
;;
--files=*)
exclude_files="${1##--files=}"
;;
--files-from)
exclude_files_from="${2}"
shift
;;
--files-from=*)
exclude_files_from="${1##--files-from=}"
;;
--shebangs)
exclude_shebangs="${2}"
shift
;;
--shebangs=*)
exclude_shebangs="${1##--shebangs=}"
;;
--shebangs-from)
exclude_shebangs_from="${2}"
shift
;;
--shebangs-from=*)
exclude_shebangs_from="${1##--shebangs-from=}"
;;
--help|--usage|"-?"|-h)
usage yes /dev/stdout 0
;;
*)
echo "Unknown option \"${1}\"" 1>&2
usage no /dev/stderr 1
;;
esac
shift
done
cd "$RPM_BUILD_ROOT"
# Large packages such as kernel can have thousands of executable files.
# We take care to not fork/exec thousands of "file"s and "grep"s,
# but run just two of them.
# (Take care to exclude filenames which would mangle "file" output).
find -executable -type f ! -path '*:*' ! -path $'*\n*' \
| file -N --mime-type -f - \
| grep -P ".+(?=: text/)" \
| {
fail=0
while IFS= read -r line; do
f=${line%%:*}
# Remove the dot
path="${f#.}"
if [ -n "$exclude_files" ]; then
echo "$path" | grep -q -E "$exclude_files" && continue
fi
if [ -n "$exclude_files_from" ]; then
echo "$path" | grep -q -E -f "$exclude_files_from" && continue
fi
read shebang_line < "$f"
orig_shebang="${shebang_line#\#!}"
if [ "$orig_shebang" = "$shebang_line" ]; then
echo >&2 "*** WARNING: $f is executable but has no shebang, removing executable bit"
ts=$(stat -c %y "$f")
chmod -x "$f"
touch -d "$ts" "$f"
continue
fi
# Trim spaces
while shebang="${orig_shebang// / }"; [ "$shebang" != "$orig_shebang" ]; do
orig_shebang="$shebang"
done
# Treat "#! /path/to " as "#!/path/to"
orig_shebang="${orig_shebang# }"
shebang="$orig_shebang"
if [ -z "$shebang" ]; then
echo >&2 "*** WARNING: $f is executable but has empty shebang, removing executable bit"
ts=$(stat -c %y "$f")
chmod -x "$f"
touch -d "$ts" "$f"
continue
fi
if [ -n "${shebang##/*}" ]; then
echo >&2 "*** ERROR: $f has shebang which doesn't start with '/' ($shebang)"
fail=1
continue
fi
if ! { echo "$shebang" | grep -q -P "^/(?:usr/)?(?:bin|sbin)/"; }; then
continue
fi
# Replace "special" env shebang:
# /whatsoever/env /whatever/foo → /whatever/foo
shebang=$(echo "$shebang" | sed -r -e 's@^(.+)/env /(.+)$@/\2@')
# /whatsoever/env foo → /whatsoever/foo
shebang=$(echo "$shebang" | sed -r -e 's@^(.+/)env (.+)$@\1\2@')
# If the shebang now starts with /bin, change it to /usr/bin
# https://bugzilla.redhat.com/show_bug.cgi?id=1581757
shebang=$(echo "$shebang" | sed -r -e 's@^/bin/@/usr/bin/@')
# Replace ambiguous python with python2
py_shebang=$(echo "$shebang" | sed -r -e 's@/usr/bin/python(\s|$)@/usr/bin/python2\1@')
if [ "$shebang" != "$py_shebang" ]; then
echo >&2 "*** ERROR: ambiguous python shebang in $path: #!$orig_shebang. Change it to python3 (or python2) explicitly."
fail=1
elif [ "#!$shebang" != "#!$orig_shebang" ]; then
echo "mangling shebang in $path from $orig_shebang to #!$shebang"
ts=$(stat -c %y "$f")
sed -i -e "1c #!$shebang" "$f"
touch -d "$ts" "$f"
fi
done
exit $fail
}

144
brp-python-bytecompile Executable file
View File

@ -0,0 +1,144 @@
#!/bin/bash
errors_terminate=$2
extra=$3
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
# Figure out how deep we need to descend. We could pick an insanely high
# number and hope it's enough, but somewhere, somebody's sure to run into it.
depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \
xargs -0 -n 1 dirname | sed 's,[^/],,g' | sort -u | tail -n 1 | wc -c`
if [ -z "$depth" -o "$depth" -le "1" ]; then
exit 0
fi
# This function now implements Python byte-compilation in two different ways:
# Python >= 3.4 uses a new module compileall2 - https://github.com/fedora-python/compileall2
# Python < 3.4 (inc. Python 2) uses compileall module from stdlib with some hacks
# When we drop support for Python 2, we'd be able to use all compileall2 features like:
# - -s and -p options to manipulate with a path baked into pyc files instead of $real_libdir
# - -o 0 -o 1 to produce multiple files in one run - each with a different optimization level - instead of $options
# - removed useless $depth - both compileall and compileall2 are limited by sys.getrecursionlimit()
# These changes will make this script much simpler
function python_bytecompile()
{
local options=$1
local python_binary=$2
local exclude=$3
local python_libdir=$4
local depth=$5 # Not used for Python >= 3.4
local real_libdir=$6 # Not used for Python >= 3.4
python_version=$($python_binary -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
#
# Python 3.4 and higher
#
if [ "$python_version" -ge 34 ]; then
[ ! -z $exclude ] && exclude="-x '$exclude'"
# /usr/lib/rpm/redhat/ contains compileall2 Python module
# -q disables verbose output
# -f forces the process to overwrite existing compiled files
# -x excludes paths defined by regex
# -e excludes symbolic links pointing outside the build root
# -x and -e together implements the same functionality as the Filter class below
# -s strips $RPM_BUILD_ROOT from the path
# -p prepends the leading slash to the path to make it absolute
PYTHONPATH=/usr/lib/rpm/redhat/ $python_binary -B $options -m compileall2 -q -f $exclude -s $RPM_BUILD_ROOT -p / -e $RPM_BUILD_ROOT $python_libdir
else
#
# Python 3.3 and lower (incl. Python 2)
#
cat << EOF | $python_binary $options
import compileall, sys, os, re
python_libdir = "$python_libdir"
depth = $depth
real_libdir = "$real_libdir"
build_root = "$RPM_BUILD_ROOT"
exclude = r"$exclude"
class Filter:
def search(self, path):
ret = not os.path.realpath(path).startswith(build_root)
if exclude:
ret = ret or re.search(exclude, path)
return ret
sys.exit(not compileall.compile_dir(python_libdir, depth, real_libdir, force=1, rx=Filter(), quiet=1))
EOF
fi
}
# .pyc/.pyo files embed a "magic" value, identifying the ABI version of Python
# bytecode that they are for.
#
# The files below RPM_BUILD_ROOT could be targeting multiple versions of
# python (e.g. a single build that emits several subpackages e.g. a
# python26-foo subpackage, a python31-foo subpackage etc)
#
# Support this by assuming that below each /usr/lib/python$VERSION/, all
# .pyc/.pyo files are to be compiled for /usr/bin/python$VERSION.
#
# For example, below /usr/lib/python2.6/, we're targeting /usr/bin/python2.6
# and below /usr/lib/python3.1/, we're targeting /usr/bin/python3.1
shopt -s nullglob
for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/usr/lib(64)?/python[0-9]\.[0-9]+$"`;
do
python_binary=/usr/bin/$(basename $python_libdir)
real_libdir=${python_libdir/$RPM_BUILD_ROOT/}
echo "Bytecompiling .py files below $python_libdir using $python_binary"
# Generate normal (.pyc) byte-compiled files.
python_bytecompile "" "$python_binary" "" "$python_libdir" "$depth" "$real_libdir"
if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then
# One or more of the files had a syntax error
exit 1
fi
# Generate optimized (.pyo) byte-compiled files.
python_bytecompile "-O" "$python_binary" "" "$python_libdir" "$depth" "$real_libdir"
if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then
# One or more of the files had a syntax error
exit 1
fi
done
# Handle other locations in the filesystem using the default python implementation
# if extra is set to 0, don't do this
if [ 0$extra -eq 0 ]; then
exit 0
fi
# If we don't have a default python interpreter, we cannot proceed
default_python=${1:-/usr/bin/python}
if [ ! -x "$default_python" ]; then
exit 0
fi
# Figure out if there are files to be bytecompiled with the default_python at all
# this prevents unnecessary default_python invocation
find "$RPM_BUILD_ROOT" -type f -name "*.py" | grep -Ev "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" || exit 0
# Generate normal (.pyc) byte-compiled files.
python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/"
if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then
# One or more of the files had a syntax error
exit 1
fi
# Generate optimized (.pyo) byte-compiled files.
python_bytecompile "-O" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/"
if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then
# One or more of the files had a syntax error
exit 1
fi
exit 0

17
brp-strip-lto Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/sh
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
STRIP=${1:-strip}
NCPUS=${RPM_BUILD_NCPUS:-1}
case `uname -a` in
Darwin*) exit 0 ;;
*) ;;
esac
# Strip ELF binaries
find "$RPM_BUILD_ROOT" -type f -name '*.[ao]' \! -regex "$RPM_BUILD_ROOT/*usr/lib/debug.*" -print0 | \
eu-elfclassify --not-program --not-library --not-linux-kernel-module --stdin0 --print0 | xargs -0 -r -P$NCPUS -n32 sh -c "$STRIP -p -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 \"\$@\"" ARG0

390
buildflags.md Normal file
View File

@ -0,0 +1,390 @@
This document contains documentation of the individual compiler flags
and how to use them.
[TOC]
# Using RPM build flags
For packages which use autoconf to set up the build environment, use
the `%configure` macro to obtain the full complement of flags, like
this:
%configure
This will invoke the `./configure` with arguments (such as
`--prefix=/usr`) to adjust the paths to the packaging defaults.
As a side effect, this will set the environment variables `CFLAGS`,
`CXXFLAGS`, `FFLAGS`, `FCFLAGS`, `LDFLAGS` and `LT_SYS_LIBRARY_PATH`,
so they can be used by makefiles and other build tools. (However,
existing values for these variables are not overwritten.)
If your package does not use autoconf, you can still set the same
environment variables using
%set_build_flags
early in the `%build` section. (Again, existing environment variables
are not overwritten.)
Individual build flags are also available through RPM macros:
* `%{build_cflags}` for the C compiler flags (also known as the
`CFLAGS` variable). Also historically available as `%{optflags}`.
Furthermore, at the start of the `%build` section, the environment
variable `RPM_OPT_FLAGS` is set to this value.
* `%{build_cxxflags}` for the C++ compiler flags (usually assigned to
the `CXXFLAGS` shell variable).
* `%{build_fflags} for `FFLAGS` (the Fortran compiler flags, also
known as the `FCFLAGS` variable).
* `%{build_ldflags}` for the link editor (ld) flags, usually known as
`LDFLAGS`. Note that the contents quotes linker arguments using
`-Wl`, so this variable is intended for use with the `gcc` compiler
driver. At the start of the `%build` section, the environment
variable `RPM_LD_FLAGS` is set to this value.
The variable `LT_SYS_LIBRARY_PATH` is defined here to prevent the `libtool`
script (v2.4.6+) from hardcoding %_libdir into the binaries' RPATH.
These RPM macros do not alter shell environment variables.
For some other build tools separate mechanisms exist:
* CMake builds use the the `%cmake` macro from the `cmake-rpm-macros`
package.
Care must be taking not to compile the current selection of compiler
flags into any RPM package besides `redhat-rpm-config`, so that flag
changes are picked up automatically once `redhat-rpm-config` is
updated.
# Flag selection for the build type
The default flags are suitable for building applications.
For building shared objects, you must compile with `-fPIC` in
(`CFLAGS` or `CXXFLAGS`) and link with `-shared` (in `LDFLAGS`).
For other considerations involving shared objects, see:
* [Fedora Packaging Guidelines: Shared Libraries](https://docs.fedoraproject.org/en-US/packaging-guidelines/#_shared_libraries)
# Customizing compiler flags
It is possible to set RPM macros to change some aspects of the
compiler flags. Changing these flags should be used as a last
recourse if other workarounds are not available.
### Lazy binding
If your package depends on the semantics of lazy binding (e.g., it has
plugins which load additional plugins to complete their dependencies,
before which some referenced functions are undefined), you should put
`-Wl,-z,lazy` at the end of the `LDFLAGS` setting when linking objects
which have such requirements. Under these circumstances, it is
unnecessary to disable hardened builds (and thus lose full ASLR for
executables), or link everything without `-Wl,z,now` (non-lazy
binding).
### Hardened builds
By default, the build flags enable fully hardened builds. To change
this, include this in the RPM spec file:
%undefine _hardened_build
This turns off certain hardening features, as described in detail
below. The main difference is that executables will be
position-dependent (no full ASLR) and use lazy binding.
### Annotated builds/watermarking
By default, the build flags cause a special output section to be
included in ELF files which describes certain aspects of the build.
To change this for all compiler invocations, include this in the RPM
spec file:
%undefine _annotated_build
Be warned that this turns off watermarking, making it impossible to do
full hardening coverage analysis for any binaries produced.
It is possible to disable annotations for individual compiler
invocations, using the `-fplugin-arg-annobin-disable` flag. However,
the annobin plugin must still be loaded for this flag to be
recognized, so it has to come after the hardening flags on the command
line (it has to be added at the end of `CFLAGS`, or specified after
the `CFLAGS` variable contents).
### Strict symbol checks in the link editor (ld)
Optionally, the link editor will refuse to link shared objects which
contain undefined symbols. Such symbols lack symbol versioning
information and can be bound to the wrong (compatibility) symbol
version at run time, and not the actual (default) symbol version which
would have been used if the symbol definition had been available at
static link time. Furthermore, at run time, the dynamic linker will
not have complete dependency information (in the form of DT_NEEDED
entries), which can lead to errors (crashes) if IFUNC resolvers are
executed before the shared object containing them is fully relocated.
To switch on these checks, define this macro in the RPM spec file:
%define _strict_symbol_defs_build 1
If this RPM spec option is active, link failures will occur if the
linker command line does not list all shared objects which are needed.
In this case, you need to add the missing DSOs (with linker arguments
such as `-lm`). As a result, the link editor will also generated the
necessary DT_NEEDED entries.
In some cases (such as when a DSO is loaded as a plugin and is
expected to bind to symbols in the main executable), undefined symbols
are expected. In this case, you can add
%undefine _strict_symbol_defs_build
to the RPM spec file to disable these strict checks. Alternatively,
you can pass `-z undefs` to ld (written as `-Wl,-z,undefs` on the gcc
command line). The latter needs binutils 2.29.1-12.fc28 or later.
### Legacy -fcommon
Since version 10, [gcc defaults to `-fno-common`](https://gcc.gnu.org/gcc-10/porting_to.html#common).
Builds may fail with `multiple definition of ...` errors.
As a short term workaround for such failure,
it is possible to add `-fcommon` to the flags by defining `%_legacy_common_support`.
%define _legacy_common_support 1
Properly fixing the failure is always preferred!
# Individual compiler flags
Compiler flags end up in the environment variables `CFLAGS`,
`CXXFLAGS`, `FFLAGS`, and `FCFLAGS`.
The general (architecture-independent) build flags are:
* `-O2`: Turn on various GCC optimizations. See the [GCC manual](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-O2).
Optimization improves performance, the accuracy of warnings, and the
reach of toolchain-based hardening, but it makes debugging harder.
* `-g`: Generate debugging information (DWARF). In Fedora, this data
is separated into `-debuginfo` RPM packages whose installation is
optional, so debuging information does not increase the size of
installed binaries by default.
* `-pipe`: Run compiler and assembler in parallel and do not use a
temporary file for the assembler input. This can improve
compilation performance. (This does not affect code generation.)
* `-Wall`: Turn on various GCC warnings.
See the [GCC manual](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wall).
* `-Werror=format-security`: Turn on format string warnings and treat
them as errors.
See the [GCC manual](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security).
This can occasionally result in compilation errors. In this case,
the best option is to rewrite the source code so that only constant
format strings (string literals) are used.
* `-Wp,-D_FORTIFY_SOURCE=2`: Source fortification activates various
hardening features in glibc:
* String functions such as `memcpy` attempt to detect buffer lengths
and terminate the process if a buffer overflow is detected.
* `printf` format strings may only contain the `%n` format specifier
if the format string resides in read-only memory.
* `open` and `openat` flags are checked for consistency with the
presence of a *mode* argument.
* Plus other minor hardening changes.
(These changes can occasionally break valid programs.)
* `-fexceptions`: Provide exception unwinding support for C programs.
See the [`-fexceptions` option in the GCC
manual](https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fexceptions)
and the [`cleanup` variable
attribute](https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-cleanup-variable-attribute).
This also hardens cancellation handling in C programs because
it is not required to use an on-stack jump buffer to install
a cancellation handler with `pthread_cleanup_push`. It also makes
it possible to unwind the stack (using C++ `throw` or Rust panics)
from C callback functions if a C library supports non-local exits
from them (e.g., via `longjmp`).
* `-Wp,-D_GLIBCXX_ASSERTIONS`: Enable lightweight assertions in the
C++ standard library, such as bounds checking for the subscription
operator on vectors. (This flag is added to both `CFLAGS` and
`CXXFLAGS`; C compilations will simply ignore it.)
* `-fstack-protector-strong`: Instrument functions to detect
stack-based buffer overflows before jumping to the return address on
the stack. The *strong* variant only performs the instrumentation
for functions whose stack frame contains addressable local
variables. (If the address of a variable is never taken, it is not
possible that a buffer overflow is caused by incorrect pointer
arithmetic involving a pointer to that variable.)
* `-grecord-gcc-switches`: Include select GCC command line switches in
the DWARF debugging information. This is useful for detecting the
presence of certain build flags and general hardening coverage.
For hardened builds (which are enabled by default, see above for how
to disable them), the flag
`-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1` is added to the
command line. It adds the following flag to the command line:
* `-fPIE`: Compile for a position-independent executable (PIE),
enabling full address space layout randomization (ASLR). This is
similar to `-fPIC`, but avoids run-time indirections on certain
architectures, resulting in improved performance and slightly
smaller executables. However, compared to position-dependent code
(the default generated by GCC), there is still a measurable
performance impact.
If the command line also contains `-r` (producing a relocatable
object file), `-fpic` or `-fPIC`, this flag is automatically
dropped. (`-fPIE` can only be used for code which is linked into
the main program.) Code which goes into static libraries should be
compiled with `-fPIE`, except when this code is expected to be
linked into DSOs, when `-fPIC` must be used.
To be effective, `-fPIE` must be used with the `-pie` linker flag
when producing an executable, see below.
To support [binary watermarks for ELF
objects](https://fedoraproject.org/wiki/Toolchain/Watermark) using
annobin, the `-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1` flag is
added by default. This can be switched off by undefining the
`%_annotated_build` RPM macro (see above).
### Architecture-specific compiler flags
These compiler flags are enabled for all builds (hardened/annotated or
not), but their selection depends on the architecture:
* `-fstack-clash-protection`: Turn on instrumentation to avoid
skipping the guard page in large stack frames. (Without this flag,
vulnerabilities can result where the stack overlaps with the heap,
or thread stacks spill into other regions of memory.) This flag is
fully ABI-compatible and has adds very little run-time overhead, but
is only available on certain architectures (currently aarch64, i386,
ppc64, ppc64le, s390x, x86_64).
* `-fcf-protection`: Instrument binaries to guard against
ROP/JOP attacks. Used on i686 and x86_64.
* `-m64` and `-m32`: Some GCC builds support both 32-bit and 64-bit in
the same compilation. For such architectures, the RPM build process
explicitly selects the architecture variant by passing this compiler
flag.
* `-fasynchronous-unwind-tables`: Generate full unwind information
covering all program points. This is required for support of
asynchronous cancellation and proper unwinding from signal
handlers. It also makes performance and debugging tools more
useful because unwind information is available without having to
install (and load) debugging ienformation.
Asynchronous unwind tables are enabled for aarch64, i686, ppc64,
ppc64le, s390x, and x86_64. They are not needed on armhfp due to
architectural differences in stack management. On these
architectures, `-fexceptions` (see above) still enables regular
unwind tables (or they are enabled by default even without this
option).
In addition, `redhat-rpm-config` re-selects the built-in default
tuning in the `gcc` package. These settings are:
* **armhfp**: `-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard`
selects an Arm subarchitecture based on the ARMv7-A architecture
with 16 64-bit floating point registers. `-mtune=cortex-8a` selects
tuning for the Cortex-A8 implementation (while preserving compatibility
with other ARMv7-A implementations). `-mabi=aapcs-linux` switches to
the AAPCS ABI for GNU/Linux.
* **i686**: `-march=i686` is used to select a minmum support CPU level
of i686 (corresponding to the Pentium Pro). SSE2 support is
enabled with `-msse2` (so only CPUs with SSE2 support can run the
compiled code; SSE2 was introduced first with the Pentium 4).
`-mtune=generic` activates tuning for a current blend of CPUs
(under the assumption that most users of i686 packages obtain them
through an x86_64 installation on current hardware).
`-mfpmath=sse` instructs GCC to use the SSE2 unit for floating
point math to avoid excess precision issues. `-mstackrealign`
avoids relying on the stack alignment guaranteed by the current
version of the i386 ABI.
* **ppc64le**: `-mcpu=power8 -mtune=power8` selects a minimum supported
CPU level of POWER8 (the first CPU with ppc64le support) and tunes
for POWER8.
* **s390x**: `-march=zEC12 -mtune=z13` specifies a minimum supported CPU
level of zEC12, while optimizing for a subsequent CPU generation
(z13).
* **x86_64**: `-mtune=generic` selects tuning which is expected to
beneficial for a broad range of current CPUs.
* **ppc64** and **aarch64** do not have any architecture-specific tuning.
# Individual linker flags
Linker flags end up in the environment variable `LDFLAGS`.
The linker flags listed below are injected. Note that they are
prefixed with `-Wl` because it is expected that these flags are passed
to the compiler driver `gcc`, and not directly to the link editor
`ld`.
* `-z relro`: Activate the *read-only after relocation* feature.
Constant data and relocations are placed on separate pages, and the
dynamic linker is instructed to revoke write permissions after
dynamic linking. Full protection of relocation data requires the
`-z now` flag (see below).
* `-z defs`: Refuse to link shared objects (DSOs) with undefined symbols
(optional, see above).
For hardened builds, the
`-specs=/usr/lib/rpm/redhat/redhat-hardened-ld` flag is added to the
compiler driver command line. (This can be disabled by undefining the
`%_hardened_build` macro; see above) This activates the following
linker flags:
* `-pie`: Produce a PIE binary. This is only activated for the main
executable, and only if it is dynamically linked. This requires
that all objects which are linked in the main executable have been
compiled with `-fPIE` or `-fPIC` (or `-fpie` or `-fpic`; see above).
By itself, `-pie` has only a slight performance impact because it
disables some link editor optimization, however the `-fPIE` compiler
flag has some overhead.
* `-z now`: Disable lazy binding and turn on the `BIND_NOW` dynamic
linker feature. Lazy binding involves an array of function pointers
which is writable at run time (which could be overwritten as part of
security exploits, redirecting execution). Therefore, it is
preferable to turn of lazy binding, although it increases startup
time.
# Support for extension builders
Some packages include extension builders that allow users to build
extension modules (which are usually written in C and C++) under the
control of a special-purpose build system. This is a common
functionality provided by scripting languages such as Python and Perl.
Traditionally, such extension builders captured the Fedora build flags
when these extension were built. However, these compiler flags are
adjusted for a specific Fedora release and toolchain version and
therefore do not work with a custom toolchain (e.g., different C/C++
compilers), and users might want to build their own extension modules
with such toolchains.
The macros `%{extension_cflags}`, `%{extension_cxxflags}`,
`%{extension_fflags}`, `%{extension_ldflags}` contain a subset of
flags that have been adjusted for compatibility with alternative
toolchains, while still preserving some of the compile-time security
hardening that the standard Fedora build flags provide.
The current set of differences are:
* No GCC plugins (such as annobin) are activated.
* No GCC spec files (`-specs=` arguments) are used.
Additional flags may be removed in the future if they prove to be
incompatible with alternative toolchains.
Extension builders should detect whether they are performing a regular
RPM build (e.g., by looking for an `RPM_OPT_FLAGS` variable). In this
case, they should use the *current* set of Fedora build flags (that
is, the output from `rpm --eval '%{build_cflags}'` and related
commands). Otherwise, when not performing an RPM build, they can
either use hard-coded extension builder flags (thus avoiding a
run-time dependency on `redhat-rpm-config`), or use the current
extension builder flags (with a run-time dependency on
`redhat-rpm-config`).
As a result, extension modules built for Fedora will use the official
Fedora build flags, while users will still be able to build their own
extension modules with custom toolchains.

197
common.lua Normal file
View File

@ -0,0 +1,197 @@
-- Convenience Lua functions that can be used within rpm macros
-- Set a spec variable
-- Echo the result if verbose
local function explicitset(rpmvar, value, verbose)
local value = value
if (value == nil) or (value == "") then
value = "%{nil}"
end
rpm.define(rpmvar .. " " .. value)
if verbose then
rpm.expand("%{echo:Setting %%{" .. rpmvar .. "} = " .. value .. "}")
end
end
-- Unset a spec variable if it is defined
-- Echo the result if verbose
local function explicitunset(rpmvar, verbose)
if (rpm.expand("%{" .. rpmvar .. "}") ~= "%{" .. rpmvar .. "}") then
rpm.define(rpmvar .. " %{nil}")
if verbose then
rpm.expand("%{echo:Unsetting %%{" .. rpmvar .. "}}")
end
end
end
-- Set a spec variable, if not already set
-- Echo the result if verbose
local function safeset(rpmvar, value, verbose)
if (rpm.expand("%{" .. rpmvar .. "}") == "%{" .. rpmvar .. "}") then
explicitset(rpmvar,value,verbose)
end
end
-- Alias a list of rpm variables to the same variables suffixed with 0 (and vice versa)
-- Echo the result if verbose
local function zalias(rpmvars, verbose)
for _, sfx in ipairs({{"","0"},{"0",""}}) do
for _, rpmvar in ipairs(rpmvars) do
local toalias = "%{?" .. rpmvar .. sfx[1] .. "}"
if (rpm.expand(toalias) ~= "") then
safeset(rpmvar .. sfx[2], toalias, verbose)
end
end
end
end
-- Takes a list of rpm variable roots and a suffix and alias current<root> to
-- <root><suffix> if it resolves to something not empty
local function setcurrent(rpmvars, suffix, verbose)
for _, rpmvar in ipairs(rpmvars) do
if (rpm.expand("%{?" .. rpmvar .. suffix .. "}") ~= "") then
explicitset( "current" .. rpmvar, "%{" .. rpmvar .. suffix .. "}", verbose)
else
explicitunset("current" .. rpmvar, verbose)
end
end
end
-- Echo the list of rpm variables, with suffix, if set
local function echovars(rpmvars, suffix)
for _, rpmvar in ipairs(rpmvars) do
rpmvar = rpmvar .. suffix
local header = string.sub(" " .. rpmvar .. ": ",1,21)
rpm.expand("%{?" .. rpmvar .. ":%{echo:" .. header .. "%{?" .. rpmvar .. "}}}")
end
end
-- Returns an array, indexed by suffix, containing the non-empy values of
-- <rpmvar><suffix>, with suffix an integer string or the empty string
local function getsuffixed(rpmvar)
local suffixes = {}
zalias({rpmvar})
for suffix=0,9999 do
local value = rpm.expand("%{?" .. rpmvar .. suffix .. "}")
if (value ~= "") then
suffixes[tostring(suffix)] = value
end
end
-- rpm convention is to alias no suffix to zero suffix
-- only add no suffix if zero suffix is different
local value = rpm.expand("%{?" .. rpmvar .. "}")
if (value ~= "") and (value ~= suffixes["0"]) then
suffixes[""] = value
end
return suffixes
end
-- Returns the list of suffixes, including the empty string, for which
-- <rpmvar><suffix> is set to a non empty value
local function getsuffixes(rpmvar)
suffixes = {}
for suffix in pairs(getsuffixed(rpmvar)) do
table.insert(suffixes,suffix)
end
table.sort(suffixes,
function(a,b) return (tonumber(a) or 0) < (tonumber(b) or 0) end)
return suffixes
end
-- Returns the suffix for which <rpmvar><suffix> has a non-empty value that
-- matches best the beginning of the value string
local function getbestsuffix(rpmvar, value)
local best = nil
local currentmatch = ""
for suffix, setvalue in pairs(getsuffixed(rpmvar)) do
if (string.len(setvalue) > string.len(currentmatch)) and
(string.find(value, "^" .. setvalue)) then
currentmatch = setvalue
best = suffix
end
end
return best
end
-- https://github.com/rpm-software-management/rpm/issues/581
-- Writes the content of a list of rpm variables to a macro spec file.
-- The target file must contain the corresponding anchors.
-- For example writevars("myfile", {"foo","bar"}) will replace:
-- @@FOO@@ with the rpm evaluation of %{foo} and
-- @@BAR@@ with the rpm evaluation of %{bar}
-- in myfile
local function writevars(macrofile, rpmvars)
for _, rpmvar in ipairs(rpmvars) do
print("sed -i 's\029" .. string.upper("@@" .. rpmvar .. "@@") ..
"\029" .. rpm.expand( "%{" .. rpmvar .. "}" ) ..
"\029g' " .. macrofile .. "\n")
end
end
-- https://github.com/rpm-software-management/rpm/issues/566
-- Reformat a text intended to be used used in a package description, removing
-- rpm macro generation artefacts.
-- remove leading and ending empty lines
-- trim intermediary empty lines to a single line
-- fold on spaces
-- Should really be a %%{wordwrap:…} verb
local function wordwrap(text)
text = rpm.expand(text .. "\n")
text = string.gsub(text, "\t", " ")
text = string.gsub(text, "\r", "\n")
text = string.gsub(text, " +\n", "\n")
text = string.gsub(text, "\n+\n", "\n\n")
text = string.gsub(text, "^\n", "")
text = string.gsub(text, "\n( *)[-*—][  ]+", "\n%1 ")
output = ""
for line in string.gmatch(text, "[^\n]*\n") do
local pos = 0
local advance = ""
for word in string.gmatch(line, "%s*[^%s]*\n?") do
local wl, bad = utf8.len(word)
if not wl then
print("%{warn: Invalid UTF-8 sequence detected in:\n" ..
word .. "\nIt may produce unexpected results.\n}")
wl = bad
end
if (pos == 0) then
advance, n = string.gsub(word, "^(%s* ).*", "%1")
if (n == 0) then
advance = string.gsub(word, "^(%s*).*", "%1")
end
advance = string.gsub(advance, " ", " ")
pos = pos + wl
elseif (pos + wl < 81) or
((pos + wl == 81) and string.match(word, "\n$")) then
pos = pos + wl
else
word = advance .. string.gsub(word, "^%s*", "")
output = output .. "\n"
pos = utf8.len(word)
end
output = output .. word
if pos > 80 then
pos = 0
if not string.match(word, "\n$") then
output = output .. "\n"
end
end
end
end
output = string.gsub(output, "\n*$", "\n")
return output
end
return {
explicitset = explicitset,
explicitunset = explicitunset,
safeset = safeset,
zalias = zalias,
setcurrent = setcurrent,
echovars = echovars,
getsuffixed = getsuffixed,
getsuffixes = getsuffixes,
getbestsuffix = getbestsuffix,
writevars = writevars,
wordwrap = wordwrap,
}

1462
config.guess vendored Normal file

File diff suppressed because it is too large Load Diff

1823
config.sub vendored Normal file

File diff suppressed because it is too large Load Diff

66
dist.sh Executable file
View File

@ -0,0 +1,66 @@
#!/bin/bash
# dist.sh
# Author: Tom "spot" Callaway <tcallawa@redhat.com>
# License: GPL
# This is a script to output the value for the %{dist}
# tag. The dist tag takes the following format: .$type$num
# Where $type is one of: el, fc, rh
# (for RHEL, Fedora Core, and RHL, respectively)
# And $num is the version number of the distribution.
# NOTE: We can't detect Rawhide or Fedora Test builds properly.
# If we successfully detect the version number, we output the
# dist tag. Otherwise, we exit with no output.
RELEASEFILE=/etc/redhat-release
function check_num {
MAINVER=`cut -d "(" -f 1 < $RELEASEFILE | \
sed -e "s/[^0-9.]//g" -e "s/$//g" | cut -d "." -f 1`
echo $MAINVER | grep -q '[0-9]' && echo $MAINVER
}
function check_rhl {
grep -q "Red Hat Linux" $RELEASEFILE && ! grep -q "Advanced" $RELEASEFILE && echo $DISTNUM
}
function check_rhel {
egrep -q "(Enterprise|Advanced)" $RELEASEFILE && echo $DISTNUM
}
function check_fedora {
grep -q Fedora $RELEASEFILE && echo $DISTNUM
}
DISTNUM=`check_num`
DISTFC=`check_fedora`
DISTRHL=`check_rhl`
DISTRHEL=`check_rhel`
if [ -n "$DISTNUM" ]; then
if [ -n "$DISTFC" ]; then
DISTTYPE=fc
elif [ -n "$DISTRHEL" ]; then
DISTTYPE=el
elif [ -n "$DISTRHL" ]; then
DISTTYPE=rhl
fi
fi
[ -n "$DISTTYPE" -a -n "$DISTNUM" ] && DISTTAG=".${DISTTYPE}${DISTNUM}"
case "$1" in
--el) echo -n "$DISTRHEL" ;;
--fc) echo -n "$DISTFC" ;;
--rhl) echo -n "$DISTRHL" ;;
--distnum) echo -n "$DISTNUM" ;;
--disttype) echo -n "$DISTTYPE" ;;
--help)
printf "Usage: $0 [OPTIONS]\n"
printf " Default mode is --dist. Possible options:\n"
printf " --el\t\tfor RHEL version (if RHEL)\n"
printf " --fc\t\tfor Fedora version (if Fedora)\n"
printf " --rhl\t\tfor RHL version (if RHL)\n"
printf " --dist\t\tfor distribution tag\n"
printf " --distnum\tfor distribution number (major)\n"
printf " --disttype\tfor distribution type\n" ;;
*) echo -n "$DISTTAG" ;;
esac

50
find-provides Executable file
View File

@ -0,0 +1,50 @@
#!/bin/bash
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
if [ "$1" ]
then
package_name="$1"
fi
filelist=`sed "s/['\"]/\\\&/g"`
[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] &&
echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --provides
#
# --- any other extra find-provides scripts
for i in /usr/lib/rpm/redhat/find-provides.d/*.prov
do
[ -x $i ] &&
(echo $filelist | tr '[:blank:]' \\n | $i | sort -u)
done
#
# --- Kernel module imported symbols
#
# Since we don't (yet) get passed the name of the package being built, we
# cheat a little here by looking first for a kernel, then for a kmod.
#
is_kmod=1
for f in $filelist; do
if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ]
then
is_kernel=1;
fi
if [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
then
unset is_kmod;
fi
done
if [ ! "$is_kernel" ] || [ "$package_name" == "kernel" ]
then
unset is_kmod
fi
[ -x /usr/lib/rpm/redhat/find-provides.ksyms ] && [ "$is_kmod" ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-provides.ksyms
exit 0

24
find-provides.ksyms Executable file
View File

@ -0,0 +1,24 @@
#! /bin/bash
IFS=$'\n'
for module in $(grep -E '/lib/modules/.+\.ko$'); do
if [[ -n $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):0x\1 \2:p') ]]; then
nm $module \
| sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):0x\1 \2:p' \
| awk --non-decimal-data '{printf("ksym(%s) = 0x%08x\n", $2, $1)}' \
| LC_ALL=C sort -u
else
ELFRODATA=$(readelf -R .rodata $module | awk '/0x/{printf $2$3$4$5}')
if [[ -n $(readelf -h $module | grep "little endian") ]]; then
RODATA=$(echo $ELFRODATA | sed 's/\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/g')
else
RODATA=$ELFRODATA
fi
for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) R __crc_(.+):0x\1 \2:p'); do
echo $sym $RODATA
done \
| awk --non-decimal-data '{printf("ksym(%s) = 0x%08s\n", $2, substr($3,($1*2)+1,8))}' \
| LC_ALL=C sort -u
fi
done

39
find-requires Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
#
# Auto-generate requirements for executables (both ELF and a.out) and library
# sonames, script interpreters, and perl modules.
#
ulimit -c 0
filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] && \
echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --requires
#
# --- Kernel module imported symbols
#
# Since we don't (yet) get passed the name of the package being built, we
# cheat a little here by looking first for a kernel, then for a kmod.
#
unset is_kmod
for f in $filelist; do
if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ]
then
is_kmod=1;
elif [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
then
unset is_kmod;
break;
fi
done
# Disabling for now while the Fedora kernel doesn't produce kABI deps.
#[ -x /usr/lib/rpm/redhat/find-requires.ksyms ] && [ "$is_kmod" ] &&
# printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-requires.ksyms
exit 0

74
find-requires.ksyms Executable file
View File

@ -0,0 +1,74 @@
#! /bin/bash
IFS=$'\n'
# Extract all of the symbols provided by this module.
all_provides() {
if [[ -n $(nm "$@" | sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):0x\1 \2:p') ]]; then
nm "$@" \
| sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):0x\1 \2:p' \
| awk --non-decimal-data '{printf("0x%08x\t%s\n", $1, $2)}' \
| LC_ALL=C sort -k2,2 -u
else
ELFRODATA=$(readelf -R .rodata "$@" | awk '/0x/{printf $2$3$4$5}')
if [[ -n $(readelf -h "$@" | grep "little endian") ]]; then
RODATA=$(echo $ELFRODATA | sed 's/\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/g')
else
RODATA=$ELFRODATA
fi
for sym in $(nm "$@" | sed -r -ne 's:^0*([0-9a-f]+) R __crc_(.+):0x\1 \2:p'); do
echo $sym $RODATA
done \
| awk --non-decimal-data '{printf("0x%08s\t%s\n", substr($3,($1*2)+1,8), $2)}' \
| LC_ALL=C sort -k2,2 -u
fi
}
# Extract all of the requirements of this module.
all_requires() {
for module in "$@"; do
set -- $(/sbin/modinfo -F vermagic "$module" | sed -e 's: .*::' -e q)
/sbin/modprobe --dump-modversions "$module" \
| awk --non-decimal-data '
BEGIN { FS = "\t" ; OFS = "\t" }
{printf("0x%08x\t%s\n", $1, $2)}' \
| sed -r -e 's:$:\t'"$1"':'
done \
| LC_ALL=C sort -k2,2 -u
}
# Filter out requirements fulfilled by the module itself.
mod_requires() {
LC_ALL=C join -t $'\t' -j 2 -v 1 \
<(all_requires "$@") \
<(all_provides "$@") \
| LC_ALL=C sort -k1,1 -u
}
if ! [ -e /sbin/modinfo -a -e /sbin/modprobe ]; then
cat > /dev/null
exit 0
fi
modules=($(grep -E '/lib/modules/.+\.ko$'))
if [ ${#modules[@]} -gt 0 ]; then
kernel=$(/sbin/modinfo -F vermagic "${modules[0]}" | sed -e 's: .*::' -e q)
# get all that kernel provides
symvers=$(mktemp -t ${0##*/}.XXXXX)
cat /usr/src/kernels/$kernel/Module.symvers | awk '
BEGIN { FS = "\t" ; OFS = "\t" }
{ print $2 "\t" $1 }
' \
| sed -r -e 's:$:\t'"$kernel"':' \
| LC_ALL=C sort -k1,1 -u > $symvers
# Symbols matching with the kernel get a "kernel" dependency
LC_ALL=C join -t $'\t' -j 1 $symvers <(mod_requires "${modules[@]}") | LC_ALL=C sort -u \
| awk '{ FS = "\t" ; OFS = "\t" } { print "kernel(" $1 ") = " $2 }'
# Symbols from elsewhere get a "ksym" dependency
LC_ALL=C join -t $'\t' -j 1 -v 2 $symvers <(mod_requires "${modules[@]}") | LC_ALL=C sort -u \
| awk '{ FS = "\t" ; OFS = "\t" } { print "ksym(" $1 ") = " $2 }'
fi

14
firmware.prov Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# firmware.prov - Automatically extract any and all firmware dependencies from
# kernel object (.ko) files and add to RPM deps.
IFS=$'\n'
for module in $(grep -E '/lib/modules/.+\.ko$') $*;
do
for firmware in `/sbin/modinfo -F firmware $module`;
do
echo "firmware($firmware)"
done
done

299
forge.lua Normal file
View File

@ -0,0 +1,299 @@
-- Lua code used by macros.forge and derivatives
-- Computes the suffix of a version string, removing vprefix if it matches
-- For example with vprefix 1.2.3: 1.2.3.rc2 → .rc2 but 1.2.30 → 1.2.30 not 0
local function getversionsuffix(vstring,vprefix)
if (string.sub(vstring, 1, #vprefix) == vprefix) and
(not string.match(string.sub(vstring, #vprefix + 1), "^%.?%d")) then
return string.sub(vstring, #vprefix + 1)
else
return vstring
end
end
-- Check if an identified url is sane
local function checkforgeurl(url, id, silent)
local checkedurl = nil
local checkedid = nil
local urlpatterns = {
gitlab = {
pattern = 'https://[^/]+/[^/]+/[^/#?]+',
description = 'https://(…[-.])gitlab[-.]…/owner/repo'},
pagure = {
pattern = 'https://[^/]+/[^/#?]+',
description = 'https://pagure.io/repo'},
pagure_ns = {
pattern = 'https://[^/]+/[^/]+/[^/#?]+',
description = 'https://pagure.io/namespace/repo'},
pagure_fork = {
pattern = 'https://[^/]+/fork/[^/]+/[^/#?]+',
description = 'https://pagure.io/fork/owner/repo'},
pagure_ns_fork = {
pattern = 'https://[^/]+/fork/[^/]+/[^/]+/[^/#?]+',
description = 'https://pagure.io/fork/owner/namespace/repo'},
github = {
pattern = 'https://[^/]+/[^/]+/[^/#?]+',
description = 'https://(…[-.])github[-.]…/owner/repo'},
["code.googlesource.com"] = {
pattern = 'https://code.googlesource.com/[^#?]*[^/#?]+',
description = 'https://code.googlesource.com/…/repo'},
["bitbucket.org"] = {
pattern = 'https://[^/]+/[^/]+/[^/#?]+',
description = 'https://bitbucket.org/owner/repo'}}
if (urlpatterns[id] ~= nil) then
checkedurl = string.match(url,urlpatterns[id]["pattern"])
if (checkedurl == nil) then
if not silent then
rpm.expand("%{error:" .. id .. " URLs must match " .. urlpatterns[id]["description"] .. " !}")
end
else
checkedid = id
end
end
return checkedurl, checkedid
end
-- Check if an url matches a known forge
local function idforge(url, silent)
local forgeurl = nil
local forge = nil
if (url ~= "") then
forge = string.match(url, "^[^:]+://([^/]+)/")
if (forge == nil) then
if not silent then
rpm.expand("%{error:URLs must include a protocol such as https:// and a path starting with / !}")
end
else
if (forge == "pagure.io") then
if string.match(url, "[^:]+://pagure.io/fork/[^/]+/[^/]+/[^/]+") then
forge = "pagure_ns_fork"
elseif string.match(url, "[^:]+://pagure.io/fork/[^/]+/[^/]+") then
forge = "pagure_fork"
elseif string.match(url, "[^:]+://pagure.io/[^/]+/[^/]+") then
forge = "pagure_ns"
elseif string.match(url, "[^:]+://pagure.io/[^/]+") then
forge = "pagure"
end
elseif (string.match(forge, "^gitlab[%.-]") or string.match(forge, "[%.-]gitlab[%.]")) then
forge = "gitlab"
elseif (string.match(forge, "^github[%.-]") or string.match(forge, "[%.-]github[%.]")) then
forge = "github"
end
forgeurl, forge = checkforgeurl(url, forge, silent)
end
end
return forgeurl, forge
end
-- The forgemeta macro main processing function
-- See the documentation in the macros.forge file for argument description
-- Also called directly by gometa
local function meta(suffix, verbose, informative, silent)
local fedora = require "fedora.common"
local ismain = (suffix == "") or (suffix == "0")
if ismain then
fedora.zalias({"forgeurl", "forgesource", "forgesetupargs",
"archivename", "archiveext", "archiveurl",
"topdir", "extractdir", "repo", "owner", "namespace",
"scm", "tag", "commit", "shortcommit", "branch", "version",
"date", "distprefix"}, verbose)
end
local variables = {
default = {
scm = "git",
archiveext = "tar.bz2",
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/[^/]+/([^/?#]+)"))}',
archivename = "%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
topdir = "%{archivename" .. suffix .. "}" },
gitlab = {
archiveurl = "%{forgeurl" .. suffix .. "}/-/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
pagure = {
archiveext = "tar.gz",
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/([^/?#]+)"))}',
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
pagure_ns = {
archiveext = "tar.gz",
namespace = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/([^/]+)/[^/?#]+"))}',
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/[^/]+/([^/?#]+)"))}',
archivename = "%{namespace" .. suffix .. "}-%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
pagure_fork = {
archiveext = "tar.gz",
owner = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/([^/]+)/[^/?#]+"))}',
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/[^/]+/([^/?#]+)"))}',
archivename = "%{owner" .. suffix .. "}-%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
pagure_ns_fork = {
owner = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/([^/]+)/[^/]+/[^/?#]+"))}',
namespace = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/[^/]+/([^/]+)/[^/?#]+")}',
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/[^/]+/[^/]+/([^/?#]+)")}',
archivename = "%{owner" .. suffix .. "}-%{namespace" .. suffix .. "}-%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
github = {
archiveext = "tar.gz",
archivename = "%{repo" .. suffix .. "}-%{fileref" .. suffix .. "}",
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
["code.googlesource.com"] = {
archiveext = "tar.gz",
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://.+/([^/?#]+)"))}',
archiveurl = "%{forgeurl" .. suffix .. "}/+archive/%{ref" .. suffix .. "}.%{archiveext" .. suffix .. "}",
topdir = "" },
["bitbucket.org"] = {
shortcommit = '%{lua:print(string.sub(rpm.expand("%{commit' .. suffix .. '}"), 1, 12))}',
owner = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/([^/?#]+)"))}',
archivename = "%{owner" .. suffix .. "}-%{repo" .. suffix .. "}-%{shortcommit" .. suffix .. "}",
archiveurl = "%{forgeurl" .. suffix .. "}/get/%{ref" .. suffix .. "}.%{archiveext" .. suffix .. "}" } }
-- Packaging a moving branch is quite a bad idea, but since at least Gitlab
-- will treat branches and tags the same way better support branches explicitly
-- than have packagers hijack %{tag} to download branch states
local spec = {}
for _, v in ipairs({'forgeurl','tag','commit','branch','version'}) do
spec[v] = rpm.expand("%{?" .. v .. suffix .. "}")
end
-- Compute the reference of the object to fetch
local isrelease = false
if (spec["tag"] ~= "") then ref = "%{?tag" .. suffix .. "}"
elseif (spec["commit"] ~= "") then ref = "%{?commit" .. suffix .. "}"
elseif (spec["branch"] ~= "") then ref = "%{?branch" .. suffix .. "}"
else ref = "%{?version" .. suffix .. "}"
isrelease = true
end
if (rpm.expand(ref) == "") then
if (suffix == "") then
rpm.expand("%{error:You need to define Version:, %{commit} or %{tag} before the macro invocation !}")
else
rpm.expand("%{error:You need to define %{version" .. suffix .. "}, %{commit" .. suffix .. "} or %{tag" .. suffix .. "} before the macro invocation !}")
end
end
local forgeurl = spec["forgeurl"]
-- For backwards compatibility only
local expliciturl = rpm.expand("%{?-u*}")
if (expliciturl ~= "") then
rpm.expand("%{warn:-u use in %%forgemeta is deprecated, use -z instead to select a separate set of rpm variables!}")
forgeurl = expliciturl
end
local forge
forgeurl, forge = idforge(forgeurl, silent)
if (forge ~= nil) then
fedora.explicitset("forgeurl" .. suffix, forgeurl, verbose)
-- Custom processing of quirky forges that can not be handled with simple variables
if (forge == "github") then
-- Workaround the way GitHub injects "v"s before some version strings (but not all!)
-- To package one of the minority of sane GitHub projects that do not munge their version
-- strings set tag to %{version} in your spec
local fileref = ref
if (ref == "%{?version" .. suffix .. "}") then
ref = "v" .. ref
elseif (fileref ~= "%{?commit" .. suffix .. "}") and
string.match(rpm.expand(fileref), "^v[%d]") then
fileref = string.gsub(rpm.expand(fileref), "^v", "")
elseif (string.match(rpm.expand(fileref), "/")) then
fileref = string.gsub(rpm.expand(fileref), "/", "-")
end
fedora.safeset("fileref" .. suffix, fileref, verbose)
elseif (forge == "code.googlesource.com") then
if (ref == "%{?version" .. suffix .. "}") then
ref = "v" .. ref
end
elseif (forge == "bitbucket.org") then
if (spec["commit"] == "") then
rpm.expand("%{error:All BitBucket URLs require commit value knowledge: you need to define %{commit}!}")
end
end
fedora.safeset("ref" .. suffix, ref, verbose)
-- Mass setting of the remaining variables
for k,v in pairs(variables[forge]) do
fedora.safeset(k .. suffix, variables[forge][k], verbose)
end
for k,v in pairs(variables["default"]) do
if (variables[forge][k] == nil) then
fedora.safeset(k .. suffix, variables["default"][k], verbose)
end
end
end
-- Generic rules
for _, v in ipairs({'archiveurl','archivename','archiveext','topdir'}) do
spec[v] = rpm.expand("%{?" .. v .. suffix .. "}")
end
-- Source URL processing (computing the forgesource spec variable)
local forgesource = "%{archiveurl" .. suffix .. "}"
if (string.match(spec["archiveurl"], "/([^/]+)$") ~= spec["archivename"] .. "." .. spec["archiveext"]) then
forgesource = "%{?archiveurl" .. suffix .. "}#/%{?archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}"
end
fedora.safeset("forgesource" .. suffix, forgesource, verbose)
-- Setup processing (computing the forgesetup and extractdir variables)
local forgesetupargs = "-n %{extractdir" .. suffix .. "}"
local extractdir = "%{topdir" .. suffix .. "}"
if (spec["topdir"] == "") then
forgesetupargs = "-c " .. forgesetupargs
extractdir = "%{archivename" .. suffix .. "}"
end
if not ismain then
if (spec["topdir"] ~= "") then
forgesetupargs = "-T -D -b " .. suffix .. " " .. forgesetupargs
else
forgesetupargs = "-T -D -a " .. suffix .. " " .. forgesetupargs
end
end
fedora.safeset("forgesetupargs" .. suffix, forgesetupargs, verbose)
fedora.safeset("extractdir" .. suffix, extractdir, verbose)
-- dist processing (computing the correct prefix for snapshots)
local distprefix = ""
if not isrelease then
distprefix = string.lower(rpm.expand(ref))
if (ref == "%{?commit" .. suffix .. "}") then
distprefix = string.sub(distprefix, 1, 7)
elseif (ref ~= "%{?branch" .. suffix .. "}") then
distprefix = string.gsub(distprefix, "[%p%s]+", ".")
distprefix = string.gsub(distprefix, "^" .. string.lower(rpm.expand("%{?repo}")) .. "%.?", "")
local v = string.gsub(rpm.expand("%{version}"), "[%p%s]+", ".")
for _, p in ipairs({'','v','v.','version','version.','tags.v', 'tags.v.'}) do
distprefix = getversionsuffix(distprefix, p .. v)
end
distprefix = string.gsub(distprefix, "^%.", "")
end
if (distprefix ~= "") then
distprefix = "%{scm" .. suffix .. "}" .. distprefix
date = rpm.expand("%{?date" .. suffix .. "}")
if (date ~= "") then
distprefix = date .. distprefix
else
distprefix = "%([ -r %{_sourcedir}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "} ] && date +%Y%m%d -u -r %{_sourcedir}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "})" .. distprefix
end
distprefix = "." .. distprefix
end
end
if (spec["version"] ~= "") and
(spec["version"] ~= "0") and
(spec["version"] ~= rpm.expand("%{?version}")) then
distprefix = ".%{version" .. suffix .. "}" .. distprefix
end
if (rpm.expand(distprefix) ~= "") then
if not ismain then
distprefix = string.gsub(distprefix, "^%.", ".s")
end
fedora.safeset ("distprefix" .. suffix, distprefix, verbose)
end
if ismain then
fedora.zalias({"forgeurl", "forgesource", "forgesetupargs",
"archivename", "archiveext", "archiveurl",
"topdir", "extractdir", "repo", "owner", "namespace",
"scm", "shortcommit", "distprefix"}, verbose)
end
-- Final spec variable summary if the macro was called with -i
if informative then
rpm.expand("%{echo:Packaging variables read or set by %%forgemeta}")
fedora.echovars({"forgeurl", "forgesource", "forgesetupargs",
"archivename", "archiveext", "archiveurl",
"topdir", "extractdir", "repo", "owner", "namespace",
"scm", "tag", "commit", "shortcommit", "branch", "version",
"date", "distprefix"}, suffix)
fedora.echovars({"dist"},"")
rpm.expand("%{echo: (snapshot date is either manually supplied or computed once %%{_sourcedir}/%%{archivename" .. suffix .. "}.%%{archiveext" .. suffix .. "} is available)}")
end
end
return {
meta = meta,
}

111
gpgverify Executable file
View File

@ -0,0 +1,111 @@
#!/bin/bash
# Copyright 2018 B. Persson, Bjorn@Rombobeorn.se
#
# This material is provided as is, with absolutely no warranty expressed
# or implied. Any use is at your own risk.
#
# Permission is hereby granted to use or copy this shellscript
# for any purpose, provided the above notices are retained on all copies.
# Permission to modify the code and to distribute modified code is granted,
# provided the above notices are retained, and a notice that the code was
# modified is included with the above copyright notice.
function print_help {
cat <<'EOF'
Usage: gpgverify --keyring=<pathname> --signature=<pathname> --data=<pathname>
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=<pathname> keyring with all the trusted keys and no others
--signature=<pathname> detached signature to verify
--data=<pathname> 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}

2
kmod.attr Normal file
View File

@ -0,0 +1,2 @@
%__kmod_provides %{_rpmconfigdir}/kmod.prov
%__kmod_path ^/lib/modules/.*$

28
kmod.prov Normal file
View File

@ -0,0 +1,28 @@
#!/bin/sh +x
# Kernel build can have many thousands of modules.
# kmod.prov is run for every one of them.
# Try to make this script run as fast as we can.
# For example, use shell string ops instead of external programs
# where possible.
IFS=$'\n'
read -r fname || exit
# Only process files from .../lib/modules/... subtree
[ "${fname#*/lib/modules/*}" != "$fname" ] || exit 0
kmod=${fname##*/} # like basename, but faster
if [ "$kmod" = "modules.builtin" ]; then
for j in $(cat -- "$fname"); do
echo "kmod(${j##*/})"
done
exit 0
fi
kmod=${kmod%.gz}
kmod=${kmod%.xz}
if [ "${kmod%.ko}" != "$kmod" ]; then
echo "kmod($kmod)"
fi

267
kmodtool Executable file
View File

@ -0,0 +1,267 @@
#!/bin/bash
# kmodtool - Helper script for building kernel module RPMs
# Copyright (c) 2003-2006 Ville Skyttä <ville.skytta@iki.fi>,
# Thorsten Leemhuis <fedora@leemhuis.info>
# Jon Masters <jcm@redhat.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
shopt -s extglob
myprog="kmodtool"
myver="0.10.10_kmp2"
knownvariants=@(BOOT|PAE|@(big|huge)mem|debug|enterprise|kdump|?(large)smp|uml|xen[0U]?(-PAE)|xen)
kmod_name=
kver=
verrel=
variant=
kmp=
get_verrel ()
{
verrel=${1:-$(uname -r)}
verrel=${verrel%%$knownvariants}
}
print_verrel ()
{
get_verrel $@
echo "${verrel}"
}
get_variant ()
{
get_verrel $@
variant=${1:-$(uname -r)}
variant=${variant##$verrel}
variant=${variant:-'""'}
}
print_variant ()
{
get_variant $@
echo "${variant}"
}
get_rpmtemplate ()
{
local variant="${1}"
local dashvariant="${variant:+-${variant}}"
case "$verrel" in
*.el*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
*.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
*) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;;
esac
echo "%package -n kmod-${kmod_name}${dashvariant}"
if [ -z "$kmp_provides_summary" ]; then
echo "Summary: ${kmod_name} kernel module(s)"
fi
if [ -z "$kmp_provides_group" ]; then
echo "Group: System Environment/Kernel"
fi
if [ ! -z "$kmp_version" ]; then
echo "Version: %{kmp_version}"
fi
if [ ! -z "$kmp_release" ]; then
echo "Release: %{kmp_release}"
fi
if [ ! -z "$kmp" ]; then
echo "%global _use_internal_dependency_generator 0"
fi
cat <<EOF
Provides: kernel-modules = ${verrel}${variant}
Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
EOF
if [ -z "$kmp" ]; then
echo "Requires: ${kdep}"
fi
#
# RHEL5 - Remove common package requirement on general kmod packages.
# Requires: ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
#
cat <<EOF
Requires(post): /sbin/depmod
Requires(postun): /sbin/depmod
EOF
if [ "no" != "$kmp_nobuildreqs" ]
then
echo "BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}"
fi
if [ "" != "$kmp_override_preamble" ]
then
cat "$kmp_override_preamble"
fi
cat <<EOF
%description -n kmod-${kmod_name}${dashvariant}
This package provides the ${kmod_name} kernel modules built for the Linux
kernel ${verrel}${variant} for the %{_target_cpu} family of processors.
%post -n kmod-${kmod_name}${dashvariant}
if [ -e "/boot/System.map-${verrel}${variant}" ]; then
/sbin/depmod -aeF "/boot/System.map-${verrel}${variant}" "${verrel}${variant}" > /dev/null || :
fi
EOF
if [ ! -z "$kmp" ]; then
cat <<EOF
modules=( \$(find /lib/modules/${verrel}${variant}/extra/${kmod_name}) )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "\${modules[@]}" \
| /sbin/weak-modules --add-modules
fi
%preun -n kmod-${kmod_name}${dashvariant}
rpm -ql kmod-${kmod_name}${dashvariant} | grep '\.ko$' \
> /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
EOF
fi
cat <<EOF
%postun -n kmod-${kmod_name}${dashvariant}
/sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
EOF
if [ ! -z "$kmp" ]; then
cat <<EOF
modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
#rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "\${modules[@]}" \
| /sbin/weak-modules --remove-modules
fi
EOF
fi
echo "%files -n kmod-${kmod_name}${dashvariant}"
if [ "" == "$kmp_override_filelist" ];
then
echo "%defattr(644,root,root,755)"
echo "/lib/modules/${verrel}${variant}/"
echo "/lib/firmware/"
else
cat "$kmp_override_filelist"
fi
}
print_rpmtemplate ()
{
kmod_name="${1}"
shift
kver="${1}"
get_verrel "${1}"
shift
if [ -z "${kmod_name}" ] ; then
echo "Please provide the kmodule-name as first parameter." >&2
exit 2
elif [ -z "${kver}" ] ; then
echo "Please provide the kver as second parameter." >&2
exit 2
elif [ -z "${verrel}" ] ; then
echo "Couldn't find out the verrel." >&2
exit 2
fi
for variant in "$@" ; do
if [ "default" == "$variant" ];
then
get_rpmtemplate ""
else
get_rpmtemplate "${variant}"
fi
done
}
usage ()
{
cat <<EOF
You called: ${invocation}
Usage: ${myprog} <command> <option>+
Commands:
verrel <uname>
- Get "base" version-release.
variant <uname>
- Get variant from uname.
rpmtemplate <mainpgkname> <uname> <variants>
- Return a template for use in a source RPM
rpmtemplate_kmp <mainpgkname> <uname> <variants>
- Return a template for use in a source RPM with KMP dependencies
version
- Output version number and exit.
EOF
}
invocation="$(basename ${0}) $@"
while [ "${1}" ] ; do
case "${1}" in
verrel)
shift
print_verrel $@
exit $?
;;
variant)
shift
print_variant $@
exit $?
;;
rpmtemplate)
shift
print_rpmtemplate "$@"
exit $?
;;
rpmtemplate_kmp)
shift
kmp=1
print_rpmtemplate "$@"
exit $?
;;
version)
echo "${myprog} ${myver}"
exit 0
;;
*)
echo "Error: Unknown option '${1}'." >&2
usage >&2
exit 2
;;
esac
done
# Local variables:
# mode: sh
# sh-indentation: 2
# indent-tabs-mode: nil
# End:
# ex: ts=2 sw=2 et

5
libsymlink.attr Normal file
View File

@ -0,0 +1,5 @@
# Make libfoo.so symlinks require the soname-provide of the target library
%__libsymlink_requires %{_rpmconfigdir}/elfdeps --provides --soname-only
%__libsymlink_magic ^symbolic link to .*lib.*\.so\..*$
%__libsymlink_path ^.*\.so$
%__libsymlink_flags magic_and_path

View File

@ -1,13 +0,0 @@
diff -up redhat-rpm-config-9.0.3/macros.orig redhat-rpm-config-9.0.3/macros
--- redhat-rpm-config-9.0.3/macros.orig 2008-05-06 19:08:20.000000000 -0400
+++ redhat-rpm-config-9.0.3/macros 2009-06-03 15:00:28.000000000 -0400
@@ -67,7 +67,8 @@
%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
- [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
+ if [ "$RPM_BUILD_NCPUS" -gt 16 ]; then echo "-j16"; \\\
+ elif [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
#==============================================================================
# ---- Build policy macros.

274
macros Normal file
View File

@ -0,0 +1,274 @@
# Per-platform rpm configuration file.
#==============================================================================
# ---- per-platform macros.
#
%_vendor redhat
%_os linux
%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
#==============================================================================
# ---- configure macros. note that most of these are inherited
# from the defaults.
#
%_localstatedir /var
%_pkgdocdir %{_docdir}/%{name}
%_docdir_fmt %%{NAME}
%_fmoddir %{_libdir}/gfortran/modules
%source_date_epoch_from_changelog 1
%_enable_debug_packages 1
%_include_minidebuginfo 1
%_include_gdb_index 1
%_debugsource_packages 1
%_debuginfo_subpackages 1
#==============================================================================
# ---- compiler flags.
# C compiler flags. This is traditionally called CFLAGS in makefiles.
# Historically also available as %%{optflags}, and %%build sets the
# environment variable RPM_OPT_FLAGS to this value.
%build_cflags %{optflags}
# C++ compiler flags. This is traditionally called CXXFLAGS in makefiles.
%build_cxxflags %{optflags}
# Fortran compiler flags. Makefiles use both FFLAGS and FCFLAGS as
# the corresponding variable names.
%build_fflags %{optflags} -I%{_fmoddir}
# Link editor flags. This is usually called LDFLAGS in makefiles.
# (Some makefiles use LFLAGS instead.) The default value assumes that
# the flags, while intended for ld, are still passed through the gcc
# compiler driver. At the beginning of %%build, the environment
# variable RPM_LD_FLAGS to this value.
%build_ldflags -Wl,-z,relro %{_ld_as_needed_flags} %{_ld_symbols_flags} %{_hardened_ldflags}
# Expands to shell code to seot the compiler/linker environment
# variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS if they have
# not been set already. RPM_OPT_FLAGS and RPM_LD_FLAGS have already
# been set implicitly at the start of the %%build section.
# LT_SYS_LIBRARY_PATH is used by libtool script.
%set_build_flags \
CFLAGS="${CFLAGS:-%{build_cflags}}" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%{build_cxxflags}}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%{build_fflags}}" ; export FFLAGS ; \
FCFLAGS="${FCFLAGS:-%{build_fflags}}" ; export FCFLAGS ; \
LDFLAGS="${LDFLAGS:-%{build_ldflags}}" ; export LDFLAGS ; \
LT_SYS_LIBRARY_PATH="${LT_SYS_LIBRARY_PATH:-%_libdir:}" ; export LT_SYS_LIBRARY_PATH
# Internal-only. Do not use. Expand a variable and strip the flags
# not suitable to extension builders.
%__extension_strip_flags() %{lua:
local name = rpm.expand("%{1}")
local value = " " .. rpm.expand("%{build_" .. name .. "}")
local result = string.gsub(value, "%s+-specs=[^%s]+", " ")
print(result)
}
# Variants of CFLAGS, CXXFLAGS, FFLAGS, LDFLAGS for use within
# extension builders.
%extension_cflags %{__extension_strip_flags cflags}
%extension_cxxflags %{__extension_strip_flags cxxflags}
%extension_fflags %{__extension_strip_flags fflags}
%extension_ldflags %{__extension_strip_flags ldflags}
# Deprecated names. For backwards compatibility only.
%__global_cflags %{build_cflags}
%__global_cxxflags %{build_cxxflags}
%__global_fflags %{build_fflags}
%__global_fcflags %{build_fflags}
%__global_ldflags %{build_ldflags}
#==============================================================================
# ---- configure and makeinstall.
#
%_configure_gnuconfig_hack 1
%_configure_libtool_hardening_hack 1
# If defined, _configure_disable_silent_rules will cause --disable-silent-rules
# to be added to the list of options passed to the configure script.
# Eventually we'll want to turn this on by default, but this gives packagers a
# way to turn it back off.
# %_configure_disable_silent_rules 1
%configure \
%{set_build_flags}; \
[ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find $(dirname %{_configure}) -name config.guess -o -name config.sub) ; do \
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \
done ; \
[ "%_configure_libtool_hardening_hack" = 1 ] && [ x != "x%{_hardened_ldflags}" ] && \
for i in $(find . -name ltmain.sh) ; do \
%{__sed} -i.backup -e 's~compiler_flags=$~compiler_flags="%{_hardened_ldflags}"~' $i \
done ; \
%{_configure} --build=%{_build} --host=%{_host} \\\
--program-prefix=%{?_program_prefix} \\\
--disable-dependency-tracking \\\
%{?_configure_disable_silent_rules:--disable-silent-rules} \\\
--prefix=%{_prefix} \\\
--exec-prefix=%{_exec_prefix} \\\
--bindir=%{_bindir} \\\
--sbindir=%{_sbindir} \\\
--sysconfdir=%{_sysconfdir} \\\
--datadir=%{_datadir} \\\
--includedir=%{_includedir} \\\
--libdir=%{_libdir} \\\
--libexecdir=%{_libexecdir} \\\
--localstatedir=%{_localstatedir} \\\
--sharedstatedir=%{_sharedstatedir} \\\
--mandir=%{_mandir} \\\
--infodir=%{_infodir}
#==============================================================================
# ---- Build policy macros.
#
#
#---------------------------------------------------------------------
# Expanded at beginning of %install scriptlet.
#
%__spec_install_pre %{___build_pre}\
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
mkdir -p `dirname "$RPM_BUILD_ROOT"`\
mkdir "$RPM_BUILD_ROOT"\
%{nil}
#---------------------------------------------------------------------
# Expanded at end of %install scriptlet.
#
%__arch_install_post /usr/lib/rpm/check-buildroot
# Build root policy macros. Standard naming:
# convert all '-' in basename to '_', add two leading underscores.
%__brp_ldconfig /usr/lib/rpm/redhat/brp-ldconfig
%__brp_compress /usr/lib/rpm/brp-compress
%__brp_strip /usr/lib/rpm/brp-strip %{__strip}
%__brp_strip_lto /usr/lib/rpm/redhat/brp-strip-lto %{__strip}
%__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
%__brp_strip_static_archive /usr/lib/rpm/brp-strip-static-archive %{__strip}
%__brp_python_bytecompile /usr/lib/rpm/redhat/brp-python-bytecompile "%{__python}" "%{?_python_bytecompile_errors_terminate_build}" "%{?_python_bytecompile_extra}"
%__brp_python_hardlink /usr/lib/rpm/brp-python-hardlink
# __brp_mangle_shebangs_exclude - shebangs to exclude
# __brp_mangle_shebangs_exclude_file - file from which to get shebangs to exclude
# __brp_mangle_shebangs_exclude_from - files to ignore
# __brp_mangle_shebangs_exclude_from_file - file from which to get files to ignore
%__brp_mangle_shebangs /usr/lib/rpm/redhat/brp-mangle-shebangs %{?__brp_mangle_shebangs_exclude:--shebangs "%{?__brp_mangle_shebangs_exclude}"} %{?__brp_mangle_shebangs_exclude_file:--shebangs-from "%{__brp_mangle_shebangs_exclude_file}"} %{?__brp_mangle_shebangs_exclude_from:--files "%{?__brp_mangle_shebangs_exclude_from}"} %{?__brp_mangle_shebangs_exclude_from_file:--files-from "%{__brp_mangle_shebangs_exclude_from_file}"}
%__os_install_post \
%{?__brp_ldconfig} \
%{?__brp_compress} \
%{!?__debug_package:\
%{?__brp_strip} \
%{?__brp_strip_comment_note} \
} \
%{?__brp_strip_lto} \
%{?__brp_strip_static_archive} \
%{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \
%{?__brp_python_hardlink} \
%{?__brp_mangle_shebangs} \
%{nil}
%__spec_install_post\
%{?__debug_package:%{__debug_install_post}}\
%{__arch_install_post}\
%{__os_install_post}\
%{nil}
%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
%%install\
%{nil}
#
# Should missing buildids terminate a build?
%_missing_build_ids_terminate_build 1
#
## Automatically compile python files
%py_auto_byte_compile 1
#
## Should python bytecompilation errors terminate a build?
%_python_bytecompile_errors_terminate_build 1
## Should python bytecompilation compile outisde python specific directories?
%_python_bytecompile_extra 0
# Use SHA-256 for FILEDIGESTS instead of default MD5
%_source_filedigest_algorithm 8
%_binary_filedigest_algorithm 8
# Use Zstandard compression for binary payloads
%_binary_payload w19.zstdio
%_hardening_cflags -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
# we don't escape symbols '~', '"', etc. so be careful when changing this
%_hardening_ldflags -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
# Harden packages by default for Fedora 23:
# https://fedorahosted.org/fesco/ticket/1384 (accepted on 2014-02-11)
# Use "%undefine _hardened_build" to disable.
%_hardened_build 1
%_hardened_cflags %{?_hardened_build:%{_hardening_cflags}}
%_hardened_ldflags %{?_hardened_build:%{_hardening_ldflags}}
%_annobin_cflags -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
# Add extra information to binary objects created by gcc for Fedora 28:
# https://pagure.io/fesco/issue/1780 (accepted on 2017-10-30)
# Use "%undefine _annotated_build" to disable.
%_annotated_build 1
%_annotated_cflags %{?_annotated_build:%{_annobin_cflags}}
# Fail linking if there are undefined symbols. Required for proper
# ELF symbol versioning support. Disabled by default.
# Use "%define _ld_strict_symbol_defs 1" to enable.
#%_ld_strict_symbol_defs 1
%_ld_symbols_flags %{?_ld_strict_symbol_defs:-Wl,-z,defs}
# https://fedoraproject.org/wiki/Changes/RemoveExcessiveLinking
# use "%undefine _ld_as_needed" to disable.
%_ld_as_needed 1
%_ld_as_needed_flags %{?_ld_as_needed:-Wl,--as-needed}
%__global_compiler_flags -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches %{_hardened_cflags} %{_annotated_cflags}%{?_legacy_common_support: -fcommon}
# Automatically trim changelog entries after 2 years
%_changelog_trimtime %{lua:print(os.time() - 2 * 365 * 86400)}
#==============================================================================
# ---- Generic auto req/prov filtering macros
#
# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
# prevent anything matching from being scanned for provides
%filter_provides_in(P) %{expand: \
%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
}
# prevent anything matching from being scanned for requires
%filter_requires_in(P) %{expand: \
%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
}
# filter anything matching out of the provides stream
%filter_from_provides() %{expand: \
%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
}
# filter anything matching out of the requires stream
%filter_from_requires() %{expand: \
%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
}
# actually set up the filtering bits
%filter_setup %{expand: \
%global _use_internal_dependency_generator 0 \
%global __deploop() while read FILE; do echo "${FILE}" | /usr/lib/rpm/rpmdeps -%{1}; done | /bin/sort -u \
%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
%global __find_requires /bin/sh -c "%{?__filter_req_cmd} %{__deploop R} %{?__filter_from_req}" \
}
# Temporary shelter for rpm 4.15 refugees
%requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")

39
macros.dwz Normal file
View File

@ -0,0 +1,39 @@
# Macros for reducing debug info size using dwz(1) utility.
# The two default values below should result in dwz taking at most
# 3GB of RAM or so on 64-bit hosts and 2.5GB on 32-bit hosts
# on the largest *.debug files (in mid 2012 those are
# libreoffice-debuginfo, debuginfos containing
# libxul.so.debug and libwebkitgtk-*.so.*.debug).
# This needs to be tuned based on the amount of available RAM
# on build boxes for each architecture as well as virtual address
# space limitations if dwz is 32-bit program. While it needs less
# memory than 64-bit program because pointers are smaller, it can
# never have more than 4GB-epsilon of RAM and on some architecture
# even less than that (e.g. 2GB).
# Number of debugging information entries (DIEs) above which
# dwz will stop considering file for multifile optimizations
# and enter a low memory mode, in which it will optimize
# in about half the memory needed otherwise.
%_dwz_low_mem_die_limit 10000000
# Number of DIEs above which dwz will stop processing
# a file altogether.
%_dwz_max_die_limit 50000000
# On x86_64 increase the higher limit to make libwebkit* optimizable.
# libwebkit* in mid 2012 contains roughly 87mil DIEs, and 64-bit
# dwz is able to optimize it from ~1.1GB to ~410MB using 5.2GB of RAM.
%_dwz_max_die_limit_x86_64 110000000
# On ARM, build boxes often have only 512MB of RAM and are very slow.
# Lower both the limits.
%_dwz_low_mem_die_limit_armv5tel 4000000
%_dwz_low_mem_die_limit_armv7hl 4000000
%_dwz_max_die_limit_armv5tel 10000000
%_dwz_max_die_limit_armv7hl 10000000
%_dwz_limit() %{expand:%%{?%{1}_%{_arch}}%%{!?%{1}_%{_arch}:%%%{1}}}
%_find_debuginfo_dwz_opts --run-dwz\\\
--dwz-low-mem-die-limit %{_dwz_limit _dwz_low_mem_die_limit}\\\
--dwz-max-die-limit %{_dwz_limit _dwz_max_die_limit}

61
macros.fedora-misc Normal file
View File

@ -0,0 +1,61 @@
# Some miscellaneous Fedora-related macros
# List files matching inclusion globs, excluding files matching exclusion blogs
# Optional parameters:
# -i "<globs>" inclusion globs
# -x "<globs>" exclusion globs
# Globs are space-separated lists of shell globs. Such lists require %{quote:}
# use for safe rpm argument passing.
# Alternatively, set the following rpm variables before calling the macro:
# “listfiles_include” inclusion globs
# — “listfiles_exclude” exclusion globs
# Arguments passed to the macro without flags will be interpreted as inclusion
# globs.
%listfiles(i:x:) %{expand:
%if %{lua: print(string.len(rpm.expand("%{?-i*}%{?listfiles_include}%*")))}
listfiles_include=$(realpath -e --relative-base=. %{?-i*} %{?listfiles_include} %* | sort -u)
%if %{lua: print(string.len(rpm.expand("%{?-x*}%{?listfiles_exclude}")))}
while IFS= read -r finc ; do
realpath -qe --relative-base=. %{?-x*} %{?listfiles_exclude} \\
| sort -u | grep -q "${finc}" || echo "${finc}"
done <<< "${listfiles_include}"
%else
echo "${listfiles_include}"
%endif
%endif
}
# https://github.com/rpm-software-management/rpm/issues/581
# Write the contents of a list of rpm variables to a macro file.
# The target file must contain the corresponding anchors.
# For example %writevars -f myfile foo bar will replace:
# @@FOO@@ with the rpm evaluation of %{foo} and
# @@BAR@@ with the rpm evaluation of %{bar}
# in myfile
%writevars(f:) %{lua:
local fedora = require "fedora.common"
local macrofile = rpm.expand("%{-f*}")
local rpmvars = {}
for i = 1, rpm.expand("%#") do
table.insert(rpmvars, rpm.expand("%" .. i))
end
fedora.writevars(macrofile,rpmvars)
}
# gpgverify verifies signed sources. There is documentation in the script.
%gpgverify(k:s:d:) %{lua:
local script = rpm.expand("%{_rpmconfigdir}/redhat/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
}

22
macros.fedora-misc-srpm Normal file
View File

@ -0,0 +1,22 @@
# Some miscellaneous Fedora-related macros
# A directory for rpm macros
%rpmmacrodir /usr/lib/rpm/macros.d
# A directory for appdata metainfo. This has changed between releases so a
# macro is useful.
%_metainfodir %{_datadir}/metainfo
# A directory for SWID tag files describing the installation
%_swidtagdir %{_prefix}/lib/swidtag/fedoraproject.org
# A helper to apply the fedora.wordwrap filter to the content of an rpm
# variable, and print the result. Optional parameter:
# -v <variable_name> (default value: _description)
# Putting multiple lines of UTF-8 text inside a variable is usually
# accomplished with a %%{expand: some_text}.
%wordwrap(v:) %{lua:
local fedora = require "fedora.common"
local variable = "%{" .. rpm.expand("%{-v*}%{!-v:_description}") .. "}"
print(fedora.wordwrap(variable))
}

85
macros.forge Normal file
View File

@ -0,0 +1,85 @@
# Map forge information to rpm metadata. This macro will compute default spec
# variable values.
#
# The following spec variables SHOULD be set before calling the macro:
#
# forgeurl the project url on the forge, strongly recommended;
# Version if applicable, set it with Version: <version>
# tag if applicable
# commit if applicable
# date if applicable (to override the mtime of the Source archive)
#
# Use -z for multiple calls to the macro
#
# The macro will attempt to compute and set the following variables if they are
# not already set by the packager:
#
# forgesource an URL that can be used as SourceX: value
# forgesetupargs the correct arguments to pass to %setup for this source
# used by %forgesetup and %forgeautosetup
# archivename the source archive filename, without extentions
# archiveext the source archive filename extensions, without leading dot
# archiveurl the url that can be used to download the source archive,
# without renaming
# topdir the source archive top directory (can be empty)
# extractdir the source directory created inside %{_builddir} after using
# %%forgesetup, %forgeautosetup or %{forgesetupargs}
# repo the repository name
# owner the repository owner (if used by another computed variable)
# shortcommit the commit hash clamping used by the forge, if any
# scm the scm type, when packaging code snapshots: commits or tags
# distprefix the prefix that needs adding to dist to trace non-release packaging
#
# Most of the computed variables are both overridable and optional.
#
# Optional parameters:
# -a process all sources in one go, instead of using separate -z calls
# -z <number> suffix all the read and written variable names with <number>
# for example read forgeurl<number>, version<number>…
# and generate forgesetupargs<number>, archiveurl<number>…
# The macro assumes that null or nil suffix is used for the primary
# package source.
# -s Silently ignore problems in forgeurl, use it if it can be parsed,
# ignore it otherwise.
# -v Be verbose and print every spec variable the macro sets.
# -i Print some info about the state of spec variables the macro may use or
# set at the end of the processing.
%forgemeta(az:sviu:) %{lua:
local fedora = require "fedora.common"
local forge = require "fedora.srpm.forge"
local verbose = rpm.expand("%{-v}") ~= ""
local informative = rpm.expand("%{-i}") ~= ""
local silent = rpm.expand("%{-s}") ~= ""
local processall = (rpm.expand("%{-a}") ~= "") and (rpm.expand("%{-z}") == "")
if processall then
for _,s in pairs(fedora.getsuffixes("forgeurl")) do
forge.meta(s,verbose,informative,silent)
end
else
forge.meta(rpm.expand("%{-z*}"),verbose,informative,silent)
end
}
# Convenience macro to relay computed arguments to %setup
# Optional parameters:
# -a process all sources in one go, instead of using separate -z calls
# -z <number> read %{?forgesetupargs<number>}
# -v be verbose
%forgesetup(az:v) %{lua:
local fedora = require "fedora.common"
if (rpm.expand("%{-z}") == "") and (rpm.expand("%{-a}") ~= "") then
for _,s in pairs(fedora.getsuffixes("forgesetupargs")) do
print(rpm.expand("%setup %{!-v:-q} %{?forgesetupargs" .. s .. "}\\n"))
end
else
print( rpm.expand("%setup %{!-v:-q} %{?forgesetupargs" .. rpm.expand("%{-z*}") .. "}\\n"))
end
}
# Convenience macro to relay computed arguments to %autosetup
# Parameters relayed to %autosetup: -v -N -S -p
# Optional parameters:
# -z <number> read %{?forgesetupargs<number>}
%forgeautosetup(z:vNS:p:q) %{lua:
print(rpm.expand("%autosetup %{-v} %{-N} %{?-S} %{?-p} %{?forgesetupargs" .. rpm.expand("%{-z*}") .. "}\\n"))
}

63
macros.kmp Normal file
View File

@ -0,0 +1,63 @@
# Use these macros to differentiate between RH and other KMP implementation(s).
redhat_kernel_module_package 1
kernel_module_package_release 1
%__find_provides /usr/lib/rpm/redhat/find-provides
%__find_requires /usr/lib/rpm/redhat/find-requires
#kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ]
# [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ...
%kernel_module_package_buildreqs %global kmodtool_generate_buildreqs 1 \
kernel-devel
%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \
%define kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \
%define kmp_version %{-v*}%{!-v:%{version}} \
%define kmp_release %{-r*}%{!-r:%{release}} \
%define latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \
%{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \
%global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \
flavors="default" \
if [ "i686" == "%{_target_cpu}" ] || [ "x86_64" == "%{_target_cpu}" ] \
then \
xenver=$(rpm -q kernel-xen-devel-%{kverrel}|head -n 1)\
kdver=$(rpm -q kernel-kdump-devel-%{kverrel}|head -n 1)\
if [ "kernel-xen-devel-%{kverrel}" == "$xenver" ] \
then \
flavors="$flavors xen" \
fi \
if [ "kernel-kdump-devel-%{kverrel}" == "$kdver" ] \
then \
flavors="$flavors kdump" \
fi \
fi \
if [ -z "%*" ]; then \
flavors_to_build=$flavors \
elif [ -z "%{-x}" ]; then \
flavors_to_build="%*" \
else \
flavors_to_build=" $flavors "\
echo "[$flavors_to_build]" >/tmp/tmp.txt
for i in %* \
do \
flavors_to_build=${flavors_to_build//$i /}
done \
fi \
echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \
echo "%%global kernel_source() /usr/src/kernels/%kverrel.\\\$([ %%%%{1} = default ] || echo "%%%%{1}.")%_target_cpu" \
if [ ! -z "%{-f*}" ] \
then \
filelist="%{-f*}" \
fi \
if [ ! -z "%{-p*}" ] \
then \
preamble="%{-p*}" \
fi \
nobuildreqs="yes" \
if [ "x%{kmodtool_generate_buildreqs}" != "x1" ] \
then \
nobuildreqs="no" \
fi \
kmp_override_filelist="$filelist" kmp_override_preamble="$preamble" kmp_nobuildreqs="$nobuildreqs" %{kmodtool} rpmtemplate_kmp %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \
)}

2
macros.ldc-srpm Normal file
View File

@ -0,0 +1,2 @@
# arches that ldc builds on
%ldc_arches %{ix86} x86_64 %{arm} aarch64

9
macros.ldconfig Normal file
View File

@ -0,0 +1,9 @@
#%ldconfig /sbin/ldconfig
%ldconfig_post(n:) %{?ldconfig:%post -p %ldconfig %{?*} %{-n:-n %{-n*}}\
%end}
%ldconfig_postun(n:) %{?ldconfig:%postun -p %ldconfig %{?*} %{-n:-n %{-n*}}\
%end}
%ldconfig_scriptlets(n:) %{?ldconfig:\
%ldconfig_post %{?*} %{-n:-n %{-n*}}\
%ldconfig_postun %{?*} %{-n:-n %{-n*}}\
}

5
macros.mono-srpm Normal file
View File

@ -0,0 +1,5 @@
# arches that mono builds on
%mono_arches %{ix86} x86_64 sparc sparcv9 ia64 %{arm} aarch64 alpha s390x ppc ppc64 ppc64le
%_monodir %{_prefix}/lib/mono
%_monogacdir %{_monodir}/gac

7
macros.nodejs-srpm Normal file
View File

@ -0,0 +1,7 @@
# nodejs_arches lists what arches Node.js and dependent packages run on.
#
# Enabling Node.js on other arches requires porting the V8 JavaScript JIT to
# those arches. Support for POWER and aarch64 arrived in nodejs v4. Support
# for s390x arrived in nodejs v6
%nodejs_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x

3
macros.valgrind-srpm Normal file
View File

@ -0,0 +1,3 @@
# valgrind_arches lists what arches Valgrind works on
%valgrind_arches %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64

7
macros.vpath Normal file
View File

@ -0,0 +1,7 @@
# ---- VPATH default settings
# directory where CMakeLists.txt/meson.build/etc. are placed
%_vpath_srcdir .
# directory (doesn't need to exist) where all generated build files will be placed
%_vpath_builddir %_target_platform

76
modalias.prov Normal file
View File

@ -0,0 +1,76 @@
#! /bin/sh
# heavily based upon find-suggests.ksyms by Andreas Gruenbacher <agruen@suse.de>.
# with modifications by Michael Brown <Michael_E_Brown@dell.com>
#
# -- added module versioning info to modalias() symbols
# -- removed code which inspects spec files.
IFS=$'\n'
#
# Initially, dont generate modalias() lines for kernel package. This needs
# additional discussion. Would like to eventually add them for
# completeness, so that we can determine when drivers are folded into
# mainline kernel.
#
case "$1" in
kernel-module-*) ;; # Fedora kernel module package names start with
# kernel-module.
kernel*) is_kernel_package=1 ;;
esac
if ! [ -z "$is_kernel_package" ]; then
cat > /dev/null
exit 0
fi
print_modaliases() {
declare class=$1 variants=$2 pos=$3
if [ -n "$variants" ]; then
echo "${class:0:pos}[$variants]${class:pos+1}"
else
[ -z "$class" ] || echo "$class"
fi
}
combine_modaliases() {
declare tag class variants pos n
read class
while read tag; do
for ((n=0; n<${#class}; n++)); do
if [ "*" != "${class:n:1}" -a \
"${class:0:n}" = "${tag:0:n}" -a \
"${class:n+1}" = "${tag:n+1}" ] &&
( [ -z "$pos" ] || [ $n = $pos ] ); then
variants="${variants:-${class:n:1}}${tag:n:1}"
pos=$n
break
fi
done
if [ $n -eq ${#class} ]; then
print_modaliases "$class" "$variants" "$pos"
variants=
pos=
class=$tag
fi
done
print_modaliases "$class" "$variants" "$pos"
}
for module in $(grep -E '/lib/modules/.+\.ko$') $*; do
# | head -n1 because some modules have *two* version tags. *cough*b44*cough*
modver=$(/sbin/modinfo -F version "$module"| head -n1)
modver=${modver// /_}
# only add version tag if it has a version
if [ -n "$modver" ]; then
/sbin/modinfo -F alias "$module" \
| sed -nre "s,(.+),modalias(\\1) = $modver,p"
else
/sbin/modinfo -F alias "$module" \
| sed -nre "s,(.+),modalias(\\1),p"
fi
done \
| sort -u \
| combine_modaliases

2
redhat-annobin-cc1 Normal file
View File

@ -0,0 +1,2 @@
*cc1_options:
+ %{!-fno-use-annobin:%{!iplugindir*:%:find-plugindir()} -fplugin=annobin}

2
redhat-hardened-cc1 Normal file
View File

@ -0,0 +1,2 @@
*cc1_options:
+ %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}

2
redhat-hardened-ld Normal file
View File

@ -0,0 +1,2 @@
*self_spec:
+ %{!static:%{!shared:%{!r:-pie}}}

View File

@ -1,42 +1,894 @@
# TO WHOM IT MAY CONCERN
#
# 1) Don't add patches, dist-git is the upstream repository for this package.
# 2) When making changes, update version by +1, leave release alone.
#
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
Version: 9.1.0
Version: 153
Release: 1%{?dist}
# No version specified.
License: GPL+
Group: Development/System
URL: http://git.fedoraproject.org/git/redhat-rpm-config
Source: redhat-rpm-config-%{version}.tar.bz2
URL: https://src.fedoraproject.org/rpms/redhat-rpm-config
# Core rpm settings
Source0: macros
Source1: rpmrc
# gcc specs files for hardened builds
Source50: redhat-hardened-cc1
Source51: redhat-hardened-ld
# gcc specs files for annobin builds
Source52: redhat-annobin-cc1
# The macros defined by these files are for things that need to be defined
# at srpm creation time when it is not feasible to require the base packages
# that would otherwise be providing the macros. other language/arch specific
# macros should not be defined here but instead in the base packages that can
# be pulled in at rpm build time, this is specific for srpm creation.
Source100: macros.fedora-misc-srpm
Source102: macros.mono-srpm
Source103: macros.nodejs-srpm
Source104: macros.ldc-srpm
Source105: macros.valgrind-srpm
# Other misc macros
Source150: macros.dwz
Source151: macros.kmp
Source152: macros.vpath
Source153: macros.forge
Source154: macros.ldconfig
Source155: macros.fedora-misc
# Build policy scripts
# this comes from https://github.com/rpm-software-management/rpm/pull/344
# added a python -> python2 conversion for fedora with warning
# and an echo when the mangling happens
Source201: brp-mangle-shebangs
# this comes from rpm itself
# however, now we can do Fedora changes within
Source202: brp-python-bytecompile
# Dependency generator scripts (deprecated)
Source300: find-provides
Source301: find-provides.ksyms
Source304: find-requires
Source305: find-requires.ksyms
Source308: firmware.prov
Source309: modalias.prov
# Misc helper scripts
Source400: dist.sh
Source401: rpmsort
Source402: symset-table
Source403: kmodtool
Source404: gpgverify
# 2016-10-02 snapshots from http://git.savannah.gnu.org/gitweb/?p=config.git
Source500: config.guess
Source501: config.sub
# Dependency generators & their rules
Source600: kmod.attr
Source601: kmod.prov
Source602: libsymlink.attr
# BRPs
Source700: brp-ldconfig
Source701: brp-strip-lto
# Convenience lua functions
Source800: common.lua
Source801: forge.lua
# Documentation
Source900: buildflags.md
BuildArch: noarch
Requires: mktemp
Requires: rpm >= 4.6.0
BuildRequires: libtool
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: perl-generators
Requires: coreutils
Requires: efi-srpm-macros
Requires: fonts-srpm-macros
Requires: fpc-srpm-macros
Requires: ghc-srpm-macros
Requires: gnat-srpm-macros
Requires: go-srpm-macros
Requires: nim-srpm-macros
Requires: ocaml-srpm-macros
Requires: openblas-srpm-macros
Requires: perl-srpm-macros
# ↓ Provides compileall2 Python module
Requires: python-srpm-macros >= 3-46
Requires: rust-srpm-macros
Requires: qt5-srpm-macros
Requires: rpm >= 4.11.0
Requires: dwz >= 0.4
Requires: zip
Requires: (annobin if gcc)
# for brp-mangle-shebangs
Requires: %{_bindir}/find
Requires: %{_bindir}/file
Requires: %{_bindir}/grep
Requires: %{_bindir}/sed
Requires: %{_bindir}/xargs
# -fstack-clash-protection and -fcf-protection require GCC 8.
Conflicts: gcc < 8.0.1-0.22
Provides: system-rpm-config = %{version}-%{release}
%global rrcdir /usr/lib/rpm/redhat
%description
Red Hat specific rpm configuration files.
%prep
%setup -q
%package -n kernel-rpm-macros
Summary: Macros and scripts for building kernel module packages
Requires: redhat-rpm-config >= 13
%build
%description -n kernel-rpm-macros
Macros and scripts for building kernel module packages.
%prep
# Not strictly necessary but allows working on file names instead
# of source numbers in install section
%setup -c -T
cp -p %{sources} .
%install
make DESTDIR=${RPM_BUILD_ROOT} install
cp -p %{_datadir}/libtool/config/config.{guess,sub} ${RPM_BUILD_ROOT}/usr/lib/rpm/redhat/
find ${RPM_BUILD_ROOT} -name \*.orig -delete
# buggy makefile in 9.1.0 leaves changelog in wrong place
find ${RPM_BUILD_ROOT} -name ChangeLog -delete
mkdir -p %{buildroot}%{rrcdir}
install -p -m 644 -t %{buildroot}%{rrcdir} macros rpmrc
install -p -m 444 -t %{buildroot}%{rrcdir} redhat-hardened-*
install -p -m 444 -t %{buildroot}%{rrcdir} redhat-annobin-*
install -p -m 755 -t %{buildroot}%{rrcdir} config.*
install -p -m 755 -t %{buildroot}%{rrcdir} dist.sh rpmsort symset-table kmodtool
install -p -m 755 -t %{buildroot}%{rrcdir} gpgverify
install -p -m 755 -t %{buildroot}%{rrcdir} brp-*
%clean
rm -rf ${RPM_BUILD_ROOT}
install -p -m 755 -t %{buildroot}%{rrcdir} find-*
mkdir -p %{buildroot}%{rrcdir}/find-provides.d
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalias.prov
install -p -m 755 -t %{buildroot}%{rrcdir} brp-*
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.*
mkdir -p %{buildroot}%{_fileattrsdir}
install -p -m 644 -t %{buildroot}%{_fileattrsdir} *.attr
install -p -m 755 -t %{buildroot}%{_rpmconfigdir} kmod.prov
mkdir -p %{buildroot}%{_rpmluadir}/fedora/{rpm,srpm}
install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora common.lua
install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
%files
%defattr(-,root,root)
%doc ChangeLog
%{_prefix}/lib/rpm/redhat
%dir %{rrcdir}
%{rrcdir}/macros
%{rrcdir}/rpmrc
%{rrcdir}/brp-*
%{rrcdir}/dist.sh
%{rrcdir}/gpgverify
%{rrcdir}/redhat-hardened-*
%{rrcdir}/redhat-annobin-*
%{rrcdir}/config.*
%{rrcdir}/find-provides
%{rrcdir}/find-requires
%{rrcdir}/brp-ldconfig
%{_fileattrsdir}/*.attr
%{_rpmconfigdir}/kmod.prov
%{_rpmconfigdir}/macros.d/macros.*-srpm
%{_rpmconfigdir}/macros.d/macros.dwz
%{_rpmconfigdir}/macros.d/macros.forge
%{_rpmconfigdir}/macros.d/macros.ldconfig
%{_rpmconfigdir}/macros.d/macros.vpath
%{_rpmconfigdir}/macros.d/macros.fedora-misc
%dir %{_rpmluadir}/fedora
%dir %{_rpmluadir}/fedora/srpm
%dir %{_rpmluadir}/fedora/rpm
%{_rpmluadir}/fedora/*.lua
%{_rpmluadir}/fedora/srpm/*lua
%doc buildflags.md
%files -n kernel-rpm-macros
%dir %{rrcdir}/find-provides.d
%{rrcdir}/kmodtool
%{rrcdir}/rpmsort
%{rrcdir}/symset-table
%{rrcdir}/find-provides.ksyms
%{rrcdir}/find-requires.ksyms
%{rrcdir}/find-provides.d/firmware.prov
%{rrcdir}/find-provides.d/modalias.prov
%{_rpmconfigdir}/macros.d/macros.kmp
%changelog
* Thu Feb 20 2020 Jason L Tibbitts III <tibbs@math.uh.edu> - 153-1
- Add dependency on fonts-srpm-macros, as those have now been approved by FPC.
* Thu Feb 20 2020 Jeff Law <law@redhat.com> - 152-1
- Use eu-elfclassify to only run strip on ELF relocatables
and archive libraries.
* Fri Feb 14 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 151-1
- Fixup parallel algorithm for brp-strip-lto
* Fri Feb 14 2020 Jeff Law <law@redhat.com> - 150-1
- Strip LTO sections/symbols from installed .o/.a files
* Thu Jan 23 2020 Jeff Law <law@redhat.com> - 149-1
- Allow conditionally adding -fcommon to CFLAGS by defining %%_legacy_common_support
* Mon Jan 20 2020 Florian Weimer <fweimer@redhat.com> - 148-1
- Reenable annobin after GCC 10 integration (#1792892)
* Mon Jan 20 2020 Florian Weimer <fweimer@redhat.com> - 147-1
- Temporarily disable annobin for GCC 10 (#1792892)
* Thu Dec 05 2019 Denys Vlasenko <dvlasenk@redhat.com> - 146-1
- kmod.prov: fix and speed it up
* Tue Dec 03 15:48:18 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 145-1
- %%set_build_flags: define LT_SYS_LIBRARY_PATH
* Thu Nov 21 2019 Denys Vlasenko <dvlasenk@redhat.com> - 144-1
- Speed up brp-mangle-shebangs.
* Tue Nov 05 2019 Lumír Balhar <lbalhar@redhat.com> - 143-1
- Fix brp-python-bytecompile with the new features from compileall2
- Resolves: rhbz#1595265
* Fri Nov 01 2019 Miro Hrončok <mhroncok@redhat.com> - 142-1
- Fix the simple API of %%gpgverify.
* Thu Aug 22 2019 Jason L Tibbitts III <tibbs@math.uh.edu> - 141-2
- Simplify the API of %%gpgverify.
* Thu Jul 25 2019 Richard W.M. Jones <rjones@redhat.com> - 140-2
- Bump version and rebuild.
* Sat Jul 20 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 140-1
- Fixup python-srpm-macros version
* Wed Jul 17 2019 Lumír Balhar <lbalhar@redhat.com> - 139-1
- Use compileall2 Python module for byte-compilation in brp-python-bytecompile
* Tue Jul 09 2019 Miro Hrončok <mhroncok@redhat.com> - 138-1
- Move brp-python-bytecompile from rpm, so we can easily adapt it
* Mon Jul 08 2019 Nicolas Mailhot <nim@fedoraproject.org> - 137-1
- listfiles: make it robust against all kinds of “interesting” inputs
- wordwrap: make list indenting smarter, to produce something with enough
structure that it can be converted into AppStream metadata
* Mon Jul 08 2019 Robert-André Mauchin <zebob.m@gmail.com> - 136-1
- Revert "Fix expansion in listfiles_exclude/listfiles_include"
* Mon Jul 08 2019 Nicolas Mailhot <nim@fedoraproject.org> - 135-1
- Fix expansion in listfiles_exclude/listfiles_include
* Mon Jul 01 2019 Florian Festi <ffesti@redhat.com> - 134-1
- Switch binary payload compression to Zstandard level 19
* Thu Jun 27 2019 Vít Ondruch <vondruch@redhat.com> - 133-2
- Enable RPM to set SOURCE_DATE_EPOCH environment variable.
* Tue Jun 25 08:13:50 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 133-1
- Expand listfiles_exclude/listfiles_include
* Tue Jun 11 2019 Jitka Plesnikova <jplesnik@redhat.com> - 132-1
- Remove perl macro refugees
* Mon Jun 10 2019 Panu Matilainen <pmatilai@redhat.com> - 131-1
- Provide temporary shelter for rpm 4.15 perl macro refugees
* Tue Jun 04 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 130-1
- New macro for wrapping text %%wordwrap
- Smal fix for %%listfiles with no arguments
* Thu May 30 2019 Björn Persson <Bjorn@Rombobjörn.se> - 129-1
- Added gpgverify.
* Tue Jan 15 2019 Panu Matilainen <pmatilai@redhat.com> - 128-1
- Drop redundant _smp_mflag re-definition, use the one from rpm instead
* Thu Dec 20 2018 Florian Weimer <fweimer@redhat.com> - 127-1
- Build flags: Add support for extension builders (#1543394)
* Mon Dec 17 2018 Panu Matilainen <pmatilai@redhat.com> - 126-1
- Silence the annoying warning from ldconfig brp-script (#1540971)
* Thu Nov 15 2018 Miro Hrončok <mhroncok@redhat.com> - 125-1
- Make automagic Python bytecompilation optional
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2
* Thu Nov 08 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 124-1
- forge: add more distprefix cleaning (bz1646724)
* Mon Oct 22 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 123-1
- Add -q option to %%forgesetup
* Sat Oct 20 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 122-1
- Allow multiple calls to forge macros
* Thu Oct 11 2018 Jan Pazdziora <jpazdziora@redhat.com> - 121-1
- Add %_swidtagdir for directory for SWID tag files describing the
installation.
* Mon Sep 10 2018 Miro Hrončok <mhroncok@redhat.com> - 120-1
- Make ambiguous python shebangs error
https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
* Mon Aug 20 2018 Kalev Lember <klember@redhat.com> - 119-1
- Add aarch64 to ldc arches
* Wed Aug 15 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 118-1
- Enable --as-needed by default
* Mon Jul 16 2018 Miro Hrončok <mhroncok@redhat.com> - 117-1
- Mangle /bin shebnags to /usr/bin ones (#1581757)
* Tue Jul 10 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 116-1
- Add option to add -Wl,--as-needed into LDFLAGS
* Mon Jul 09 2018 Kalev Lember <klember@redhat.com> - 115-1
- Disable non-functional ppc64 support for ldc packages
* Tue Jun 26 2018 Panu Matilainen <pmatilai@redhat.com> - 114-1
- Fix kernel ABI related strings (Peter Oros, #26)
- Automatically trim changelog to two years (Zbigniew Jędrzejewski-Szmek, #22)
- Cosmetics cleanups (Zbigniew Jędrzejewski-Szmek, #22)
* Mon Jun 18 2018 Florian Weimer <fweimer@redhat.com> - 113-1
- Build flags: Require SSE2 on i686 (#1592212)
* Mon May 28 2018 Miro Hrončok <mhroncok@redhat.com> - 112-1
- Add a possibility to opt-out form automagic Python bytecompilation
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation
* Wed May 02 2018 Peter Jones <pjones@redhat.com> - 111-1
- brp-mangle-shebangs: add %%{__brp_mangle_shebangs_exclude_file} and
%%{__brp_mangle_shebangs_exclude_from_file} to allow you to specify files
containing the shebangs to be ignore and files to be ignored regexps,
respectively, so that they can be generated during the package build.
* Wed May 2 2018 Florian Weimer <fweimer@redhat.com> - 110-1
- Reflect -fasynchronous-unwind-tables GCC default on POWER (#1550914)
* Wed May 2 2018 Florian Weimer <fweimer@redhat.com> - 109-1
- Use plain -fcf-protection compiler flag, without -mcet (#1570823)
* Tue May 01 2018 Peter Jones <pjones@redhat.com> - 108-1
- Add Requires: efi-srpm-macros for %%{efi}
* Fri Apr 20 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 107-1
- Add %%_metainfodir macro.
- %%forgeautosetup tweak to fix patch application.
* Mon Mar 05 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 106-1
- Update forge macros.
* Wed Feb 28 2018 Florian Weimer <fweimer@redhat.com> - 105-1
- Make -fasynchronous-unwind-tables explicit on aarch64 (#1536431)
* Wed Feb 28 2018 Florian Weimer <fweimer@redhat.com> - 104-1
- Use -funwind-tables on POWER (#1536431, #1548847)
* Sun Feb 25 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 103-1
- Make %%ldconfig_post/%%ldconfig_postun parameterized
* Sat Feb 24 2018 Florian Weimer <fweimer@redhat.com> - 102-1
- Second step of -z now move: removal from GCC specs file (#1548397)
* Sat Feb 24 2018 Florian Weimer <fweimer@redhat.com> - 101-1
- First step of moving -z now to the gcc command line (#1548397)
* Thu Feb 22 2018 Miro Hrončok <mhroncok@redhat.com> - 100-1
- Don't mangle shebangs with whitespace only changes (#1546993)
* Thu Feb 22 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 99-1
- Move %%end to %%ldconfig_scriptlets
* Sat Feb 17 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 98-1
- Explicitly close scriptlets with %%end (ldconfig)
* Wed Feb 14 2018 Miro Hrončok <mhroncok@redhat.com> - 97-1
- Allow to opt-out from shebang mangling for specific paths/shebangs
* Thu Feb 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 96-1
- Simplify/Fix check for shebang starting with "/"
* Wed Feb 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 95-1
- Fix mangling env shebangs with absolute paths
* Sun Feb 4 2018 Florian Weimer <fweimer@redhat.com> - 94-1
- Add RPM macros for compiler/linker flags
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 93-1
- Use newly available /usr/bin/grep
* Wed Jan 31 2018 Peter Robinson <pbrobinson@fedoraproject.org> 92-1
- Use generic tuning for ARMv7
* Tue Jan 30 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 91-1
- The grep package only provides /bin/grep, not /usr/bin/grep.
* Mon Jan 29 2018 Miro Hrončok <mhroncok@redhat.com> - 90-1
- Add brp-mangle-shebangs
* Mon Jan 29 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 89-1
- Add macros.ldconfig
* Mon Jan 29 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 88-1
- Create DSO symlinks automatically
* Mon Jan 29 2018 Florian Weimer <fweimer@redhat.com> - 87-1
- Build flags: Disable -z defs again (#1535422)
* Mon Jan 29 2018 Florian Weimer <fweimer@redhat.com> - 86-1
- Build flags: Enable CET on i686, x86_64 (#1538725)
* Thu Jan 25 2018 Florian Weimer <fweimer@redhat.com> - 85-1
- Build flags: Switch to generic tuning on i686 (#1538693)
* Mon Jan 22 2018 Florian Weimer <fweimer@redhat.com> - 84-1
- Link with -z defs by default (#1535422)
* Mon Jan 22 2018 Florian Weimer <fweimer@redhat.com> - 83-1
- Make armhfp flags consistent with GCC defaults
* Mon Jan 22 2018 Florian Weimer <fweimer@redhat.com> - 82-1
- Make use of -fasynchronous-unwind-tables more explicit (#1536431)
* Mon Jan 22 2018 Florian Weimer <fweimer@redhat.com> - 81-1
- Remove --param=ssp-buffer-size=4
* Mon Jan 22 2018 Florian Weimer <fweimer@redhat.com> - 80-1
- Document build flags
* Fri Jan 19 2018 Panu Matilainen <pmatilai@redhat.com> - 79-1
- Document how to disable hardened and annotated build (#1211296)
* Wed Jan 17 2018 Panu Matilainen <pmatilai@redhat.com> - 78-1
- Fix the inevitable embarrassing typo in 77, doh
* Wed Jan 17 2018 Panu Matilainen <pmatilai@redhat.com> - 77-1
- Macroize build root policies for consistent disable/override ability
* Wed Jan 17 2018 Florian Weimer <fweimer@redhat.com> - 76-1
- Add -fstack-clash-protection for supported architectures (#1515865)
* Wed Jan 17 2018 Florian Weimer <fweimer@redhat.com> - 75-1
- Add _GLIBCXX_ASSERTIONS to CFLAGS/CXXFLAGS (#1515858)
* Mon Jan 15 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 74-1
- Remove Requires: cmake-rpm-macros
* Thu Jan 11 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 73-1
- Add macros.forge for simplifying packaging of forge-hosted packages. See
https://fedoraproject.org/wiki/Forge-hosted_projects_packaging_automation and
https://bugzilla.redhat.com/show_bug.cgi?id=1523779
* Wed Jan 03 2018 Sergey Avseyev <sergey.avseyev@gmail.com> - 72-1
- Add Requires: nim-srpm-macros for %%nim_arches
* Tue Jan 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 71-1
- Require annobin only if gcc is installed
* Thu Dec 21 2017 Björn Esser <besser82@fedoraproject.org> - 70-2
- Add Requires: cmake-rpm-macros for CMake auto-{provides,requires} (#1498894)
* Fri Dec 08 2017 Panu Matilainen <pmatilai@redhat.com> - 70-1
- Update URL to current location at src.fedoraproject.org
* Wed Nov 22 2017 Nick Clifton <nickc@redhat.com> - 69-1
- Enable binary annotations in compiler flags
* Thu Oct 26 2017 Troy Dawson <tdawson@redhat.com> - 68-1
- Remove Requires: fedora-rpm-macros
* Mon Jul 31 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 67-1
- Define _include_gdb_index (RHBZ #1476722)
- Move _debuginfo_subpackages and _debugsource_packages from rpm (RHBZ #1476735)
* Tue Jul 18 2017 Florian Festi <ffesti@redhat.com> - 66-1
- Honor %%kmodtool_generate_buildreqs (#1472201)
* Thu Jul 13 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 65-1
- Add Requires: rust-srpm-macros for %%rust_arches
* Wed Mar 15 2017 Orion Poplawski <orion@cora.nwra.com> - 64-1
- Add Requires: openblas-srpm-macros for %%openblas_arches
* Thu Feb 02 2017 Dan Horák <dan[at]danny.cz> - 63-1
- set zEC12 as minimum architecture level for s390(x) (#1404991)
* Thu Dec 15 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 62-1
- Add macros.vpath (https://fedorahosted.org/fpc/attachment/ticket/655)
* Tue Dec 06 2016 Adam Williamson <awilliam@redhat.com> - 61-1
- revert changes from 60, they break far too much stuff (#1401231)
* Wed Nov 30 2016 Panu Matilainen <pmatilai@redhat.com> - 60-1
- Error on implicit function declaration and -return type for C (#1393492)
* Wed Nov 30 2016 Panu Matilainen <pmatilai@redhat.com> - 59-1
- Move global compiler flags to __global_compiler_flags macro
- Introduce separate __global_fooflags for C, C++ and Fortran
* Tue Nov 29 2016 Panu Matilainen <pmatilai@redhat.com> - 58-1
- Drop atom optimization on i686 (#1393492)
* Tue Nov 15 2016 Dan Horák <dan[at]danny.cz> - 57-1
- set z10 as minimum architecture level for s390(x)
* Fri Nov 11 2016 Panu Matilainen <pmatilai@redhat.com> - 56-1
- Fix directory name mismatch in kernel_source macro (#648996)
* Tue Nov 08 2016 Michal Toman <mtoman@fedoraproject.org> - 55-1
- Add default compiler flags for various MIPS architectures (#1366735)
* Tue Nov 08 2016 Panu Matilainen <pmatilai@redhat.com> - 54-1
- -pie is incompatible with static linkage (#1343892, #1287743)
* Mon Nov 07 2016 Panu Matilainen <pmatilai@redhat.com> - 53-1
- Drop brp-java-repack-jars by request (#1235770)
- Drop brp-implant-ident-static, unused for 13 years and counting
* Mon Nov 07 2016 Lubomir Rintel <lkundrak@v3.sk> - 52-1
- Add valgrind_arches macro for BuildRequires of valgrind
* Fri Nov 04 2016 Stephen Gallagher <sgallagh@redhat.com> - 51-1
- Add s390x build target for Node.js packages
* Mon Oct 31 2016 Kalev Lember <klember@redhat.com> - 50-1
- Add ldc_arches macro
* Mon Oct 17 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 49-1
- Remove hardcoded limit of 16 CPUs for makefile parallelism.
- See https://bugzilla.redhat.com/show_bug.cgi?id=1384938
* Thu Oct 13 2016 Richard W.M. Jones <rjones@redhat.com> 48-1
- Add support for riscv64.
This also updates config.sub/config.guess to the latest upstream versions.
* Wed Oct 12 2016 Peter Robinson <pbrobinson@fedoraproject.org> 47-1
- Enable aarch64 for mono arches
* Mon Oct 03 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 46-1
- Allow %%configure to optionally pass --disable-silent-rules. Define
%%_configure_disable_silent_rules (defaulting to 0) to control this.
* Wed Sep 14 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 45-1
- Add dependency on qt5-srpm-macros.
* Fri Aug 12 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 44-1
- And somehow I managed to make a typo in that dependency.
* Fri Aug 12 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 43-1
- Add dependency on fedora-rpm-macros.
* Tue Apr 12 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 42-1
- Add dependency on fpc-srpm-macros.
* Mon Apr 11 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 41-1
- Add a file for miscellaneous macros, currently containing just %%rpmmacrodir.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 40-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Feb 02 2016 Dan Horák <dan[at]danny.cz> 40-1
- switch to -mcpu=power8 for ppc64le default compiler flags
* Wed Jan 13 2016 Orion Poplawski <orion@cora.nwra.com> 39-1
- Add Requires: python-srpm-macros
* Fri Jan 8 2016 Peter Robinson <pbrobinson@fedoraproject.org> 38-1
- Add missing ARMv6 optflags
* Wed Dec 2 2015 Peter Robinson <pbrobinson@fedoraproject.org> 37-1
- nodejs 4+ now supports aarch64 and power64
* Fri Jul 17 2015 Florian Festi <ffesti@redhat.com> 36-1
- Add Requires: go-srpm-macros (#1243922)
* Thu Jul 09 2015 Sandro Mani <manisandro@gmail.com> 35-1
- Use %%__libsymlink_path instead of %%__libsymlink_exclude_path in libsymlink.attr
* Wed Jul 08 2015 Adam Jackson <ajax@redhat.com> 34-1
- Fix cc1 specs mishandling of incremental linking
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 33-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Jun 05 2015 Dan Horák <dan[at]danny.cz> 33-1
- Mono 4 adds support for ppc64le
* Fri May 29 2015 Florian Festi <ffesti@redhat.com> 32-1
- Support out of source builds for %%_configure_gnuconfig_hack (#1191788)
- Fix typo in %%kernel_module_package (#1159361)
* Tue May 19 2015 Florian Festi <ffesti@redhat.com> 31-1
- Add %%py_auto_byte_compile macro controlling Python bytecompilation
(#976651)
* Wed Apr 29 2015 Florian Festi <ffesti@redhat.com> 30-1
- Fix libsymlink.attr for new magic pattern for symlinks (#1207945)
* Wed Apr 08 2015 Adam Jackson <ajax@redhat.com> 29-1
- Fix ld specs mishandling of incremental linking
* Thu Feb 19 2015 Till Maas <opensource@till.name> - 28-1
- Enable harden flags by default (#1192183)
* Wed Dec 10 2014 Dan Horák <dan[at]danny.cz> - 27-1
- Explicitly set -mcpu/-mtune for ppc64p7 and ppc64le to override rpm defaults
* Mon Sep 22 2014 Panu Matilainen <pmatilai@redhat.com> - 26-1
- Gnat macros are now in a package of their own (#1133632)
* Fri Sep 19 2014 Dan Horák <dan[at]danny.cz> - 25-1
- there is still no properly packaged Mono for ppc64le
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 24-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu Jun 5 2014 Peter Robinson <pbrobinson@fedoraproject.org> 24-1
- ARMv7 has Ada so add it to GNAT_arches
* Sat May 24 2014 Brent Baude <baude@us.ibm.com> - 23-2
- Changed ppc64 to power64 macro for mono_archs
* Tue May 13 2014 Peter Robinson <pbrobinson@fedoraproject.org>
- aarch64 has Ada so add it to GNAT_arches
* Mon May 12 2014 Josh Boyer <jwboyer@fedoraproject.org> - 22-1
- Fix kmod.prov to deal with compressed modules (#1096349)
* Wed Apr 30 2014 Jens Petersen <petersen@redhat.com> - 21-1
- macros.ghc-srpm moved to ghc-rpm-macros package (#1089102)
- add requires ghc-srpm-macros
* Tue Apr 29 2014 Peter Robinson <pbrobinson@fedoraproject.org> 20-1
- With gcc 4.9 aarch64 now supports stack-protector
* Sun Apr 27 2014 Ville Skyttä <ville.skytta@iki.fi> - 19-1
- Drop bunch of duplicated-with-rpm macro definitions and brp-* scripts
* Tue Apr 15 2014 Panu Matilainen <pmatilai@redhat.com> - 18-1
- Temporarily bring back find-requires and -provides scripts to rrc-side
* Tue Apr 15 2014 Panu Matilainen <pmatilai@redhat.com> - 17-1
- Let OCaml handle its own arch macros (#1087794)
* Tue Apr 15 2014 Panu Matilainen <pmatilai@redhat.com> - 16-1
- Move kmod and libsymlink dependency generators here from rpm
* Thu Apr 10 2014 Panu Matilainen <pmatilai@redhat.com> - 15-1
- Drop most of the script-based dependency generation bits
* Tue Apr 08 2014 Panu Matilainen <pmatilai@redhat.com> - 14-1
- Add Mono path macros (#1070936)
- Allow opting out of config.{guess,sub} replacement hack (#991613)
* Tue Apr 08 2014 Panu Matilainen <pmatilai@redhat.com> - 13-1
- Move the remaining dependency generator stuff to the kmp macro package
- Stop overriding rpm external dependency generator settings by default
* Mon Apr 07 2014 Panu Matilainen <pmatilai@redhat.com> - 12-1
- Be more explicit about the package contents
- Split kernel module macros to a separate file
- Split kernel module scripts and macros to a separate package
* Wed Apr 02 2014 Panu Matilainen <pmatilai@redhat.com> - 11-1
- Stop pretending this package is relocatable, its not
- Require rpm >= 4.11 for /usr/lib/rpm/macros.d support etc
- Move our macros out of from /etc, they're not configuration
* Wed Apr 02 2014 Panu Matilainen <pmatilai@redhat.com> - 10-1
- Make fedora dist-git the upstream of this package and its sources
- Add maintainer comments to spec wrt versioning and changes
* Mon Mar 24 2014 Dan Horák <dan[at]danny.cz> - 9.1.0-58
- enable ppc64le otherwise default rpm cflags will be used
* Fri Feb 07 2014 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-57
- config.guess/sub don't need to be group-writable (#1061762)
* Sun Jan 12 2014 Kevin Fenzi <kevin@scrye.com> 9.1.0-56
- Update libtool hardening hack and re-enable (#978949)
* Wed Dec 18 2013 Dhiru Kholia <dhiru@openwall.com> - 9.1.0-55
- Enable "-Werror=format-security" by default (#1043495)
* Wed Sep 04 2013 Karsten Hopp <karsten@redhat.com> 9.1.0-54
- update config.sub with ppc64p7 support (from Fedora automake)
* Fri Aug 16 2013 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-53
- updated config.guess/sub from upstream for little-endian ppc archs
* Mon Jul 29 2013 Petr Pisar <ppisar@redhat.com> - 9.1.0-52
- Perl 5.18 rebuild
* Thu Jul 25 2013 Tomas Mraz <tmraz@redhat.com> 9.1.0-51
- Disable the libtool hack as it is breaking builds
* Wed Jul 24 2013 Kevin Fenzi <kevin@scrye.com> 9.1.0-50
- Make docdirs unversioned on Fedora 20+ (#986871)
- Hack around libtool issue for hardened build for now (#978949)
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 9.1.0-49
- Perl 5.18 rebuild
* Fri Jul 05 2013 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-48
- fix brp-java-repack-jars failing on strange permissions (#905573)
* Thu Jul 04 2013 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-47
- switch from -fstack-protector to -fstack-protector-strong (#978763)
* Thu Jun 27 2013 Panu Matilainen <pmatilai@redhat.com> - - 9.1.0-46
- make cpu limit for building configurable through _smp_ncpus_max macro
* Tue May 21 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 9.1.0-45
- add nodejs_arches macro for ExclusiveArch for Node.js packages
* Mon May 13 2013 Adam Jackson <ajax@redhat.com> 9.1.0-44
- redhat-config-*: Use + to append rather than %%rename, to protect against
multiple -specs= ending up in the command line. (#892837)
* Tue Apr 23 2013 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-43
- Add optflags stack protector override for AArch64 (#909788)
- Also set FCFLAGS from %%configure (#914831)
* Mon Apr 22 2013 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-42
- Switch back to manual config.guess/sub copies for reproducability
- Replace config.guess/sub from %%configure again (#951442)
* Mon Apr 22 2013 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-41
- Add -grecord-gcc-switches to global CFLAGS (#951669)
* Mon Mar 25 2013 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-40
- Add virtual system-rpm-config provide
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.1.0-39
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com> - 9.1.0-38
- add ARM to ghc_arches_with_ghci for ghc-7.4.2 ghci support
(NB this change should not be backported before ghc-7.4.2)
* Fri Nov 9 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 9.1.0-37
- Patch to fix spaces in java jar files
https://bugzilla.redhat.com/show_bug.cgi?id=872737
* Fri Nov 9 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 9.1.0-36
- Patch to fix spaces in files used in filtering macros
https://bugzilla.redhat.com/show_bug.cgi?id=783932
* Wed Oct 3 2012 Ville Skyttä <ville.skytta@iki.fi> - 9.1.0-35
- Drop (un)setting LANG and DISPLAY in build stages, require rpm >= 4.8.0.
* Wed Oct 3 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 9.1.0-34
- Add patch from https://bugzilla.redhat.com/show_bug.cgi?id=783433
to fix spaces in files and directories that are fed to the
brp-python-hardlink script
- Require zip since java repack jars requires it
https://bugzilla.redhat.com/show_bug.cgi?id=857479
- Java jars need the MANIFEST.MF file to be first in the archive
https://bugzilla.redhat.com/show_bug.cgi?id=465664
- Fix kernel_source macro to match the directory that kernel sources are installed in
https://bugzilla.redhat.com/show_bug.cgi?id=648996
- Patch _mandir, _infodir, and _defaultocdir to use _prefix
https://bugzilla.redhat.com/show_bug.cgi?id=853216
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.1.0-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed Jun 27 2012 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-32
- enable minidebuginfo generation (#834073)
* Mon Jun 25 2012 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-31
- revert back to plain -g, -g3 seems to cancel dwz size improvements
* Mon Jun 25 2012 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-30
- require dwz, enable dwarf compression for debuginfo packages (#833311)
* Wed Jun 06 2012 Petr Pisar <ppisar@redhat.com> - 9.1.0-29
- Pull in dependency with macros specific for building Perl source packages
* Sat Mar 3 2012 Jens Petersen <petersen@redhat.com> - 9.1.0-28
- add s390 and s390x to ghc_arches
* Wed Feb 22 2012 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-27
- add GNAT arch definitions
* Sun Jan 15 2012 Dennis Gilmore <dennis@ausil.us> - 9.1.0-26
- per ppc team request drop -mminimal-toc on ppc64
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.1.0-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Dec 27 2011 Jens Petersen <petersen@redhat.com> - 9.1.0-24
- add ghc_arches_with_ghci
* Wed Nov 09 2011 Dennis Gilmore <dennis@ausil.us> - 9.1.0-23
- remove patch that forces --disable-silent-rules to configure
- it breaks anything set to not ignore unknown configure options
* Tue Oct 18 2011 Jens Petersen <petersen@redhat.com> - 9.1.0-22
- add armv5tel to ghc_arches
* Wed Sep 28 2011 Dennis Gilmore <dennis@ausil.us> - 9.1.0-21
- build armv5tel on armv7l since they are the same abi armv7hl is
an incompatible ABI
* Wed Sep 28 2011 Jens Petersen <petersen@redhat.com> - 9.1.0-20
- add armv7hl to ghc_arches
* Sun Sep 25 2011 Ville Skyttä <ville.skytta@iki.fi> - 9.1.0-19
- Fix URL.
* Thu Sep 22 2011 Adam Jackson <ajax@redhat.com> 9.1.0-18
- redhat-hardened-cc1: Inject -fPIE, not -fPIC.
cf. http://lists.fedoraproject.org/pipermail/devel/2011-September/157365.html
* Fri Sep 16 2011 Adam Jackson <ajax@redhat.com> 9.1.0-17
- Expose %%_hardening_{c,ld}flags independently to make it easier for
packages to apply them to selected components
* Wed Aug 10 2011 Colin Walters <walters@verbum.org> - 9.1.0-16
- Globally disable silent rules
* Wed Aug 03 2011 Adam Jackson <ajax@redhat.com> 9.1.0-15
- redhat-hardened-{cc1,ld}: Move some of the rewrite magic to gcc specs so
we don't end up with both -fPIC and -fPIE on the command line
* Mon Aug 01 2011 Adam Jackson <ajax@redhat.com> 9.1.0-14
- redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %%_hardened_build
* Thu Jul 07 2011 Adam Jackson <ajax@redhat.com> 9.1.0-13
- redhat-rpm-config-9.1.0-relro.patch: LDFLAGS, not CFLAGS.
* Sat Jul 02 2011 Jon Masters <jcm@jonmasters.org> - 9.1.0-12
- redhat-rpm-config-9.1.0-arm.patch: Make armv7hl default on all v7 ARM
* Mon Jun 27 2011 Adam Jackson <ajax@redhat.com> - 9.1.0-11
- redhat-rpm-config-9.1.0-relro.patch: Add -Wl,-z,relro to __global_cflags
* Tue Jun 21 2011 Jens Petersen <petersen@redhat.com> - 9.1.0-10
- revert last build since releng prefers exclusivearch here
* Sat Jun 18 2011 Jens Petersen <petersen@redhat.com> - 9.1.0-9
- replace ghc_archs with ghc_excluded_archs
* Mon Jun 13 2011 Dennis Gilmore <dennis@ausil.us> - 9.1.0-8
- add arm hardware float macros, fix up armv7l
* Mon May 30 2011 Dennis Gilmore <dennis@ausil.us> - 9.1.0-7
- add -srpm to the arches files so that the base language macros can
be parallel installable with these
* Fri May 27 2011 Dennis Gilmore <dennis@ausil.us> - 9.1.0-6
- add some specific macros needed at srpm creation time
* Thu May 27 2010 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-5
- adjust to new pkg-config behavior wrt private dependencies (#596433)
* Mon Mar 01 2010 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-4
- avoid unnecessarily running brp-strip-comment-note (#568924)
* Mon Feb 15 2010 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-3
- unbreak find-requires again, doh (#564527)
* Wed Feb 3 2010 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-2
- python byte-compilation errors abort the build by default
* Tue Feb 2 2010 Panu Matilainen <pmatilai@redhat.com> - 9.1.0-1
- new version, lose merged patches (fixes #521141, #455279, #496522, #458648)
- require rpm for parent dir, version >= 4.6.0 for sane keyserver behavior
@ -91,13 +943,13 @@ rm -rf ${RPM_BUILD_ROOT}
- Resolves: #485826.
* Tue Feb 17 2009 Dennis Gilmore <dennis@ausil.us> - 9.0.3-6
- add missing armv7l arch
- add missing armv7l arch
- set the default build arch to match fedora arm build target
* Mon Feb 16 2009 Dennis Gilmore <dennis@ausil.us> - 9.0.3-5
- apply fedora 11 default buildflags
- set 32 bit intel build arch to i586 on compatiable hardware
- set 32 bit sparc build arch to sparcv9 on compatiable hardware
- set 32 bit intel build arch to i586 on compatible hardware
- set 32 bit sparc build arch to sparcv9 on compatible hardware
* Mon Feb 16 2009 Dennis Gilmore <dennis@ausil.us> - 9.0.3-4
- limit _smp_flags to -j16
@ -150,7 +1002,7 @@ rm -rf ${RPM_BUILD_ROOT}
Further debate may see these move elsewhere in the ordering.
* Tue Mar 13 2007 Ben Konrath <bkonrath@redhat.com> 8.0.45-13
- Update brp-java-repack-jars to fix issue with tomcat.
- Update brp-java-repack-jars to fix issue with tomcat.
* Wed Oct 18 2006 Jon Masters <jcm@redhat.com> 8.0.45-12
- Synced kernel_module_package semantics with SuSE.
@ -172,13 +1024,13 @@ rm -rf ${RPM_BUILD_ROOT}
- Fix order of tokens in find command (thanks mikeb@redhat.com)
* Thu Sep 7 2006 Ben Konrath <bkonrath@redhat.com> - 8.0.45-4
- Fix bug in repack jars script.
- Fix bug in repack jars script.
* Wed Sep 6 2006 Jeremy Katz <katzj@redhat.com> - 8.0.45-3
- path fix
* Tue Sep 5 2006 Jeremy Katz <katzj@redhat.com> - 8.0.45-2
- Add script from Ben Konrath <bkonrath@redhat.com> to repack jars to
- Add script from Ben Konrath <bkonrath@redhat.com> to repack jars to
avoid multilib conflicts
* Sun Jul 30 2006 Jon Masters <jcm@redhat.com> - 8.0.45-1
@ -328,7 +1180,7 @@ rm -rf ${RPM_BUILD_ROOT}
- Update macrofiles
* Wed Jul 31 2002 Elliot Lee <sopwith@redhat.com> 7.3.93-1
- Add _unpackaged_files_terminate_build and
- Add _unpackaged_files_terminate_build and
_missing_doc_files_terminate_build to macros
* Thu Jul 11 2002 Elliot Lee <sopwith@redhat.com> 7.3.92-6

1
rpmlint.cf Normal file
View File

@ -0,0 +1 @@
addFilter("no-%build-section")

97
rpmrc Normal file
View File

@ -0,0 +1,97 @@
include: /usr/lib/rpm/rpmrc
optflags: i386 %{__global_compiler_flags} -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
optflags: i486 %{__global_compiler_flags} -m32 -march=i486 -fasynchronous-unwind-tables -fstack-clash-protection
optflags: i586 %{__global_compiler_flags} -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
optflags: i686 %{__global_compiler_flags} -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
optflags: athlon %{__global_compiler_flags} -m32 -march=athlon -fasynchronous-unwind-tables -fstack-clash-protection
optflags: ia64 %{__global_compiler_flags}
optflags: x86_64 %{__global_compiler_flags} -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
optflags: alpha %{__global_compiler_flags} -mieee
optflags: alphaev5 %{__global_compiler_flags} -mieee -mcpu=ev5
optflags: alphaev56 %{__global_compiler_flags} -mieee -mcpu=ev56
optflags: alphapca56 %{__global_compiler_flags} -mieee -mcpu=pca56
optflags: alphaev6 %{__global_compiler_flags} -mieee -mcpu=ev6
optflags: alphaev67 %{__global_compiler_flags} -mieee -mcpu=ev67
optflags: sparc %{__global_compiler_flags} -m32 -mcpu=v7 -mtune=ultrasparc
optflags: sparcv8 %{__global_compiler_flags} -m32 -mcpu=v8
optflags: sparcv9 %{__global_compiler_flags} -m32 -mcpu=ultrasparc
optflags: sparcv9v %{__global_compiler_flags} -m32 -mcpu=niagara
optflags: sparc64 %{__global_compiler_flags} -m64 -mcpu=ultrasparc
optflags: sparc64v %{__global_compiler_flags} -m64 -mcpu=niagara
optflags: m68k %{__global_compiler_flags}
optflags: ppc %{__global_compiler_flags} -m32 -fasynchronous-unwind-tables
optflags: ppciseries %{__global_compiler_flags} -m32
optflags: ppcpseries %{__global_compiler_flags} -m32
optflags: ppc64 %{__global_compiler_flags} -m64 -fasynchronous-unwind-tables -fstack-clash-protection
optflags: ppc64p7 %{__global_compiler_flags} -m64 -O3 -mcpu=power7 -mtune=power7 -fasynchronous-unwind-tables -fstack-clash-protection
optflags: ppc64le %{__global_compiler_flags} -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection
optflags: ppc64iseries %{__global_compiler_flags} -m64
optflags: ppc64pseries %{__global_compiler_flags} -m64
optflags: ppc8260 %{__global_compiler_flags} -m32
optflags: ppc8560 %{__global_compiler_flags} -m32
optflags: parisc %{__global_compiler_flags} -mpa-risc-1-0
optflags: hppa1.0 %{__global_compiler_flags} -mpa-risc-1-0
optflags: hppa1.1 %{__global_compiler_flags} -mpa-risc-1-0
optflags: hppa1.2 %{__global_compiler_flags} -mpa-risc-1-0
optflags: hppa2.0 %{__global_compiler_flags} -mpa-risc-1-0
optflags: mips %{__global_compiler_flags} -march=mips32r2 -mfpxx
optflags: mipsel %{__global_compiler_flags} -march=mips32r2 -mfpxx
optflags: mips64 %{__global_compiler_flags} -march=mips64r2 -mabi=64
optflags: mips64el %{__global_compiler_flags} -march=mips64r2 -mabi=64
optflags: mipsr6 %{__global_compiler_flags} -march=mips32r6
optflags: mipsr6el %{__global_compiler_flags} -march=mips32r6
optflags: mips64r6 %{__global_compiler_flags} -march=mips64r6
optflags: mips64r6el %{__global_compiler_flags} -march=mips64r6
optflags: armv3l %{__global_compiler_flags} -fsigned-char -march=armv3
optflags: armv4b %{__global_compiler_flags} -fsigned-char -march=armv4
optflags: armv4l %{__global_compiler_flags} -fsigned-char -march=armv4
optflags: armv4tl %{__global_compiler_flags} -march=armv4t
optflags: armv5tel %{__global_compiler_flags} -march=armv5te -mfloat-abi=soft
optflags: armv5tejl %{__global_compiler_flags} -march=armv5te -mfloat-abi=soft
optflags: armv6l %{__global_compiler_flags} -march=armv6 -mfloat-abi=soft
optflags: armv6hl %{__global_compiler_flags} -march=armv6 -mfpu=vfp -mfloat-abi=hard
optflags: armv6hnl %{__global_compiler_flags} -march=armv6 -mfpu=neon -mfloat-abi=hard
optflags: armv7l %{__global_compiler_flags} -march=armv7-a -mfloat-abi=soft
optflags: armv7hl %{__global_compiler_flags} -march=armv7-a -mfpu=vfpv3-d16 -mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard
optflags: armv7hnl %{__global_compiler_flags} -march=armv7-a -mfpu=neon -mfloat-abi=hard
optflags: atarist %{__global_compiler_flags}
optflags: atariste %{__global_compiler_flags}
optflags: ataritt %{__global_compiler_flags}
optflags: falcon %{__global_compiler_flags}
optflags: atariclone %{__global_compiler_flags}
optflags: milan %{__global_compiler_flags}
optflags: hades %{__global_compiler_flags}
optflags: s390 %{__global_compiler_flags} -m31 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables
optflags: s390x %{__global_compiler_flags} -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection
optflags: aarch64 %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection
optflags: riscv64 %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection
# set build arch to fedora buildarches on hardware capable of running it
# saves having to do rpmbuild --target=
buildarchtranslate: athlon: i686
buildarchtranslate: geode: i686
buildarchtranslate: pentium4: i686
buildarchtranslate: pentium3: i686
buildarchtranslate: i686: i686
buildarchtranslate: i586: i586
buildarchtranslate: sparcv9: sparcv9
buildarchtranslate: sparcv9v: sparcv9
buildarchtranslate: armv5tejl: armv5tel
buildarchtranslate: armv6l: armv5tel
buildarchtranslate: armv7l: armv5tel
buildarchtranslate: armv7hl: armv7hl
buildarchtranslate: armv7hnl: armv7hl

76
rpmsort Executable file
View File

@ -0,0 +1,76 @@
#! /usr/bin/perl -w
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
use Getopt::Long qw(:config gnu_getopt);
sub rpm_cmp_versions {
my ($evr1, $evr2) = @_;
sub _rpm_cmp {
my ($s1, $s2) = @_;
return defined $s1 <=> defined $s2
unless defined $s1 && defined $s2;
my ($r, $x1, $x2);
do {
$s1 =~ s/^[^a-zA-Z0-9]+//;
$s2 =~ s/^[^a-zA-Z0-9]+//;
if ($s1 =~ /^\d/ || $s2 =~ /^\d/) {
$s1 =~ s/^0*(\d*)//; $x1 = $1;
$s2 =~ s/^0*(\d*)//; $x2 = $1;
$r = length $x1 <=> length $x2 || $x1 cmp $x2;
} else {
$s1 =~ s/^([a-zA-Z]*)//; $x1 = $1;
$s2 =~ s/^([a-zA-Z]*)//; $x2 = $1;
return 0
if $x1 eq '' && $x2 eq '';
$r = $x1 cmp $x2;
}
} until $r;
return $r;
}
my ($e1, $v1, $r1) = $evr1 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
my ($e2, $v2, $r2) = $evr2 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
my $r = _rpm_cmp($e1 || 0, $e2 || 0);
$r = _rpm_cmp($v1, $v2)
unless $r;
$r = _rpm_cmp($r1, $r2)
unless $r;
return $r;
}
my $reorder = sub { return @_ };
my $key = 0;
GetOptions ("r|reverse" => sub { $reorder = sub { return reverse @_ } },
"k|key=i" => \$key)
or do {
print STDERR "Usage\n";
exit 1;
};
if ($key == 0) {
# Sort by entire lines
map { print } &$reorder(sort { rpm_cmp_versions($a, $b) } <>);
} else {
# Sort by field $key
my @data = map { [(split)[$key-1], $_] } <>;
map { print } &$reorder(map { $_->[1] }
sort { rpm_cmp_versions($a->[0], $b->[0]) } @data);
}

View File

@ -1 +0,0 @@
3b71c9d0ccc938989778e3c3892e6b94 redhat-rpm-config-9.1.0.tar.bz2

40
symset-table Executable file
View File

@ -0,0 +1,40 @@
#! /bin/sh
# Create a table of all symbol sets defined in all /boot/symsets*.tar.gz
# files.
#
# Format:
# kernelrelease/modver/symbol <tab> symset <tab> symset_hash
#
# This table is needed for computing the appropriate Requires: tags for
# kernel module packages.
tmpdir=$(mktemp -t -d ${0##*/}.XXXXXX)
trap "cd / ; rm -rf $tmpdir" EXIT
cd $tmpdir
shopt -s nullglob
for symsets in /boot/symsets-*.tar.gz; do
zcat $symsets \
| tar xf -
done
for symsets in /usr/src/kernels/*/symsets-*.tar.gz; do
zcat $symsets \
| tar xf -
done
for symsets in *; do
krel=${symsets#symsets-}
for symset in $symsets/*; do
class=${symset##*/} ; class=${class%.*}
hash=${symset##*.}
awk '
BEGIN { FS = "\t" ; OFS = "\t" }
{ sub(/0x0*/, "", $1)
print krel "/" $1 "/" $2, class, hash }
' krel="$krel" class="$class" hash="$hash" $symset
done
done
# vim:shiftwidth=4 softtabstop=4