Commit Graph

325 Commits

Author SHA1 Message Date
Neal Gompa (ニール・ゴンパ) 50905f4a59 Use fuzz settings for %autopatch/%autosetup
In the %apply_patches that inspired %autopatch, patch application
respects the fuzz settings that are used for %patch. %autopatch
and %autosetup weren't using this, which led to an inconsistent
patch application behavior.
2016-03-17 11:39:05 +01:00
Michal Toman cd02e0675e Add support for MIPS release 6 - Add mips32 mips64 mipsel and mipseb macros 2016-02-19 12:06:39 +01:00
Andreas Scherer ff30bf02b5 Permit dynamic selection of SCM.
Invoking '%__scm_setup_$__scm' without looking at option '-S' in the
specfile, permits dynamic selection of the SCM on the commandline

   rpmbuild --define="__scm SCM"

Tested with rpmbuild 4.13, git, svn, ... on Linux Mint 17.2.
2016-01-28 16:33:00 +01:00
Andreas Scherer 66d9fdb61a Unknown tag %ifdef.
This example code does not work.
2016-01-28 13:30:28 +01:00
Andreas Scherer 3dbcbd1a03 'quilt push' has option '-q'.
Use macro '%{-q}' to react on '%autosetup [-v]'.
2016-01-28 12:52:16 +01:00
Lubos Kardos 231a7213b9 Fix %autosetup to not cause errors during run of rpmspec tool
Firstly %autosetup showed an error during its expansion if some patch
wasn't available, that is an error was showed during parsing of a spec
file. This caused showing an error during execution of rpmspec
tool (rhbz:1293687).

Now %autosetup doesn't cause an error during parsing of a spec file but
it causes an error during building of specfile if some patch is not
available. Also old macro %patch behaves similarly.
2016-01-19 15:02:43 +01:00
Per Øyvind Karlsen b7b2ab2177 reflect default xz & lzma compression level changes in macros as well 2015-11-19 15:10:43 +01:00
Vít Ondruch 89d1dd0a7c Add RubyGems support.
Allow to expand RubyGems .gem file using regular %setup macro and in
addition generate also associated .gemspec file.
2015-11-12 10:51:30 +01:00
Lubos Kardos 5e94633660 Make terminating build if version format is wrong configurable 2015-10-23 14:24:56 +02:00
Neal Gompa (ニール・ゴンパ) 20383302db Add "-O" to %make_build
In order to preserve our sanity when reading logs of
%make_build output, adding "-O" to %make_build keeps the output
of each thread contiguous, making the resultant build log
readable and useful. See GNU Make manual for details on the switch.

Signed-off-by: Lubos Kardos <lkardos@redhat.com>
2015-10-22 16:11:07 +02:00
Thierry Vignaud 73ea59e0d5 fix %autopatch when patch do not exist
unlike Mageia's %apply_patches which inspired it, %autopatch continues
when it fails to apply a patch because it doesn't exists. Eg:

+ /usr/bin/cat /home/tv/rpmbuild/SOURCES/test.patch2
+ /usr/bin/patch -p1 -s
/usr/bin/cat: /home/tv/rpmbuild/SOURCES/test.patch2: No such file or directory
+ /usr/bin/cat /home/tv/rpmbuild/SOURCES/test.patch
+ /usr/bin/patch -p1 -s

Let's catch that error

Signed-off-by: Lubos Kardos <lkardos@redhat.com>
2015-10-02 15:32:21 +02:00
fin@linux.vnet.ibm.com 8c70222a1f IMA plugin labels ima xattr with file signatures
This plugin extracts file signatures from rpmfiles and writes them to
security.ima xattr. Only non-config file signatures are installed.

Changelog:
- use rpmfi instead of rpmfiles
- use rpmfiFN instead of fsmFsPath

Signed-off-by: Lubos Kardos <lkardos@redhat.com>
2015-08-12 14:23:31 +02:00
Michal Toman a450ffc4ab Add support for MIPS platform 2015-07-15 10:05:55 +02:00
Lubos Kardos 0bce5fcf27 Allow gpg to get passphrase by itself.
Remove rpm asking for passphrase and then passing this passphrase
to gpg via file descriptor (--passphrase-fd) but provide gpg with
access to unredirected stdin to get passphrase directly from user.

Remove also macro %__gpg_check_password_cmd because in this new signing
scheme has no sense. rpm doesn't handle passphrase in any way,
everything is done in gpg including checking of passphrase.

We did this modification because of changes in gpg behavior. Since
gpg-2.1 option "--passphrase-fd" doesn't work by default, only when
it is explicitly allowed in gpg.conf. (rhbz:#1228234)
2015-06-10 14:39:28 +02:00
Ville Skyttä 083514dc13 Make terminating build on empty %files manifest files configurable 2015-04-24 15:46:04 +02:00
Lubos Kardos b30fca9eed Add macro _vsflags_query_rpmdb
If it is defined then it is used for queries when "-p" is not set on
commandline. If it is not defined then macro _vsflags_query is used.
For queries with "-p" on commadline macro _vsflags_query is always used.
Macro _vsflags_query_rpmdb is set to 0xf0f00 (no checking) by default.
(rhbz:#438625)
2015-03-20 17:03:38 +01:00
Florian Festi 0fddb3cbd8 Add deprecation warning to %makeinstall (rhbz #1148195) 2015-03-20 12:16:30 +01:00
Panu Matilainen 35a7b29421 Add utf-8 validation to librpmbuild, take 1 (ticket #30, RhBug:948712, ...)
- This adds brutally simple utf-8 validation to spec parse & package
  construction: all string-class tags in headers are checked regardless
  of other tag semantics.
- Parse-time validation is optional via RPMSPEC_NOUTF8
  flag, but package construction time is required as we want to
  stomp RPMTAG_ENCODING to all packages that pass. What is always
  optional is whether non-valid utf-8 strings fail the build, defaulting
  to off (but distros probably want to enable it)
- Note we dont give a damn about the spec itself, only what ends up in
  packages: strings can come from numerous other sources than spec
  directly, and OTOH who cares if eg spec comments are non-utf?
2014-09-08 14:00:19 +03:00
Lubomir Rintel 2d67ca74c9 Detect arm armv6hl, armv7hl and armv7hnl machines
Read presence of relevant extensions from hwcap. Loosely based on what's
currently in use for Fedora (armv7hl) and Pidora (armv6hl).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-06-27 10:26:06 +03:00
Panu Matilainen 713914bde1 Drop the experimental collection support
- The basic concept is not without merit but what was implemented here
  has been stuck in experimental state in middle of two sorta conflicting
  goals for four years now, and world has moved onward in the meanwhile.
  The sepolicy part is better handled in the new selinux plugin, and other
  action business belongs to packages (in the form of some trigger-like
  scripts or such) rather than rpm plugins.
- Deleted here, but the sepolicy plugin functionality still needs
  merging into the new selinux plugin...
- RPMTAG_COLLECTIONS left in place but tagged unimplemented as per policy
  to never actually remove tags
2014-06-17 16:27:24 +03:00
Lubos Kardos 90833a57c5 Reserve space for gpg signature during building of package.
- During building of a package a dummy tag is added to the signature
header. This tag reserves some space for gpg signatures. So during
signing of the package the gpg signatures can be put in this reserved
space and it is not necessary to rewrite the whole package to make some
space for gpg signatures.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-21 13:02:44 +03:00
Michal Schmidt 18e8d2dc0a Expand options in %autopatch only once
- Work around scoping "fun" wrt nested parametrized macro invocations
  combined with macro manipulation from %{lua:...}

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-04-10 13:46:33 +03:00
Michal Schmidt bf02debf73 add support for "%autosetup -S git_am"
- Similar to "%autosetup -S git", but assumes git-formatted patch files
  and hence preserves authorship information and commit messages.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-04-08 16:02:58 +03:00
Panu Matilainen 409fa83c94 Disable curl globbing for remote retrievals
- urlGetFile() can only handle one file at a time, so globbing does
  not make sense and only confuses us. Besides, useful things like
  'rpm -Uvh http://somewhere.org/foo-1.2-1.{i386,x86_64}.rpm'
  work just as well without curl-level globbing.
- Incidentally this is also the documented workaround for using
  IPv6 numerical addresses with curl (RhBug:1076277)
2014-03-17 10:34:10 +02:00
Stanislav Ochotnicky 3f69897743 Use git index in %autosetup (RhBug:1059285)
- Without --index in apply, any file additions will not be committed and
  in case the patch contains *only* file addition the macro can fail
  completely (empty commit). With --index there's no need for -a in
  commit either.
2014-01-30 11:21:18 +02:00
Panu Matilainen 89df36524b Add %make_build macro for hiding parallel-build magic from specs (ticket #115)
- This allows simplifying the make invokations from specs. In particular
  the parallel build options no longer need to be messed with from specs,
  and %__make can be overridden to force a different make implementation
  to be used throughout the spec.
- While a lot of software builds correctly in parallel, there are always
  exceptions... together with _smp_ncpus_max macro this can now be
  expressed with a separate "%global _smp_ncpus_max 1" (or any other
  arbitrary value beyond which parallel build is buggy) line which
  is easy to grep for and experiment with.
2014-01-22 11:12:49 +02:00
Panu Matilainen bdee597417 Include ppc64le in %power64 macro (RhBug:1052930)
- Should've really been in commit cf07feda05
- This kinda points out stupid these manually maintained %fooarch
  macros are, nobody remembers to update them.
2014-01-15 12:55:47 +02:00
Panu Matilainen 453aad2560 First cut at a simple syslog plugin
- Log transaction start + finish, package install/erase and scriptlet
  failures. In case of failures, log a failure summary at transaction
  end.
- Plenty of room for improvement here, such making the logging and
  package identifiers configurable + emitting different messages
  for install/upgrade/erase/cleanup. Its a starting point, nothing
  more...
2013-03-28 11:06:51 +02:00
Panu Matilainen 301daabe78 First cut at selinux plugin to replace the in-core selinux support
- This obviously clashes with the built-in selinux support, but
  we need to have something in place before the built-in version
  is axed so...
2013-03-21 13:35:58 +02:00
Panu Matilainen aa8979f4d1 Make sure PKG_CONFIG_PATH is set according to target libs
- pkg-config isn't multilib-aware by itself so things fail when
  building packages for secondary archs (RhBug:212522)
- A variant of this patch has been in Fedora and RHEL for quite some
  time, but they used to just brutally override whatever might
  have been in PKG_CONFIG_PATH, which can break things in a custom
  setup (RhBug:569773). Append instead of full override.
2013-03-15 12:34:58 +02:00
Ville Skyttä 8002b3f985 Spelling fixes.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-02-19 21:35:40 +02:00
Panu Matilainen 58f41cb4e1 Dont mess with global user identity in __scm_setup_bzr
- Bzr defaults to global value on "bzr whoami", so we would mess
  up user identity on "%autosetup -S bzr". Oops. Move identity setting
  after repo initialization and set the identity per-branch, not global.
  The notion of "per-branch identity" seems odd, but then bzr is...
  I guess this would be bzr-speak for "per-directory identity"
2013-01-28 22:40:11 +02:00
Panu Matilainen 321a87d789 Setup git identity in __scm_setup_git (RhBug:905002)
- For some reason on my own account git keeps functioning even if
  I remove its configuration, but on a newly created account git commit
  bails out with "Please tell me who you are" unless we set the
  (per-repo) configuration here.
2013-01-28 22:31:30 +02:00
Panu Matilainen 1a21dc867d Split __scm_author to separate name and email address macros
- At least git wants name and email separately, change __scm_author
  to combine the two instead. Related to RhBug:905002.
2013-01-28 22:31:05 +02:00
Panu Matilainen 90463ac2ce On a second thought, rename block_shutdown plugin to systemd_inhibit
- This is highly systemd-specific functionality so it makes sense to
  name the plugin in a way that makes it (more) obvious. No other
  changes besides renaming.
2013-01-21 19:27:57 +02:00
Panu Matilainen 2ffdd6206b First cut at shutdown prevention plugin
- We wouldn't want anybody to shutdown (or reboot) the system while a
  transaction is in progress, it's just that there hasn't been a whole lot
  that could've been done about it. Recent systemd versions provide an API to
  prevent shutdowns however:
  http://www.freedesktop.org/wiki/Software/systemd/inhibit
- Add a simple plugin which, if enabled, tries to acquire a shutdown
  inhibitor lock from systemd for the duration of transactionsd. This
  could use better error handling and all... but its a start at least.
- Note that D-BUS is required, but only for the plugin, not (lib)rpm.
2013-01-15 11:40:11 +02:00
Panu Matilainen 9cd34fc882 Rename -debug to -debuginfo to match what everybody uses anyway
- Practically everybody renames the debug information sub-packages
  from -debug to -debuginfo, might as well do so upstream already.
  Intended to do this like five years ago but kept forgetting...
2012-11-01 11:49:38 +02:00
Panu Matilainen 933a3e32dd Dont silence patch by default (RhBug:678000, RhBug:773503)
- Unfortunately patch'es idea of "interesting" output is not ideal for
  our purposes: "patching foo.c" is of little value, but hunks with
  offsets and fuzz can be important and there's no switch to patch
  to get exactly what we want. So let it be chatty... build logs are,
  anyway.
2012-08-02 18:16:09 +03:00
Panu Matilainen a3de720a84 Default to automatic patch application in %autosetup
- Defaults should be for the common case with disablers for those who want
  to do something special, and typically if you have patches you also
  want to apply them. Change it while we still can: eliminate -A option to
  %autosetup and apply all patches unless -N option is used.
2012-07-11 12:07:46 +03:00
Phil Knirsch 105f91fc9a Arch macro for all supported PowerPC 64 processors (RhBug:818320) 2012-06-28 10:21:04 +03:00
Panu Matilainen 5322c3bd4b Add support for quilt (ticket #54) and bzr to %autosetup/patch
- These are both "appears to have roughly the intended effect" level
  tested, but I'm not really familiar with either bzr or quilt so
  any further refinements need to come from people actually familiar
  with these tools.
2012-06-25 10:34:22 +03:00
Panu Matilainen 6c5214950e Add a set of macros to further automate spec %prep tasks
- This adds two main macros (+ bunch of helpers) to automate the
  common case tasks in %prep:
  1) %autopatch which automatically applies all patches from a spec
  2) %autosetup which (optionally) takes care of it all, and (also
     optionally) sets up a git/hg repository of the unpacked source +
     applied patches as it  goes.
- This should be considered a starting point only, there are various
  things to improve. Eg we'd like to be able to make backups
  with plain patch (based on patch number maybe) and at least with git,
  we'd like to be able be (optionally) use 'git am' patching style
  to preserve original authors + commit messages etc.
- A noteworthy point here is that as these are fully implemented as
  macros, they are compatible with several older rpm versions as well.
2012-06-21 13:59:00 +03:00
Panu Matilainen 55bf9abee2 Initial support for "special" %license, similar to %doc (ticket #116)
- Now that this is relatively sanely doable... make %license with
  non-absolute paths behave similarly to %doc, only installing to a
  different directory (%_licensedir) and with different flags:
  licenses are not generic documentation and should not be skipped
  on installation even if --nodocs is used. The common practise of
  stuffing licenses into %doc actually violates various licenses
  which require the license text to always accompany the software.
- While ticket #116 suggests various schemes to reduce disk usage,
  adding some very special logic to installation code just to deal
  with these doesn't seem justifiable, given how small the licenses
  generally are. However with licenses now in their own directory
  structure (/usr/share/licenses by default), running hardlink on
  them is trivial for cases where disk space is tight
  (live images, embedded systems etc)
2012-05-28 16:55:57 +03:00
Christophe Fergeau 185596818f Add support for 7zip compressed tarballs
Teach %prep and %uncompress how to handle 7zip tarballs, with
the mingw toolchain landing in fedora, this may be useful when
crossbuilding Windows sources compressed using 7zip (CxImage is
one such project).
2012-05-22 13:48:01 +03:00
Panu Matilainen 5f0bdf9e8a Eliminate unused selinux file context path macros
- These haven't been used by anything since rpm 4.8.x days,
  nowadays we just use selinux_file_context_path() instead
2012-05-02 15:17:01 +03:00
Ville Skyttä 95fe0d53d4 Add --disable-dependency-tracking to %configure options.
autotools dependency tracking isn't generally useful in rpm builds;
disabling it results in cleaner build logs and possibly slight build
speedups.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-03-07 14:13:03 +02:00
Panu Matilainen fb3afcbff7 Disable source fetch on build by default (for now) + comment
- We need to grow some digest (and why not external signature as well)
  validation mechanism before we can let rpmbuild download + execute
  arbitrary content from the internet, at least by default.
2012-03-07 13:40:08 +02:00
Panu Matilainen d8cd36058b Switch back to former, much smaller BDB memory pool size (RhBug:752897)
- A larger cache is beneficial in various scenarios, but triggers
  horrible worst-case performance under memory pressure (or so my
  current theory goes, there might be other factors too). The
  worst-case degration is orders of magnitude bigger than the best-case
  improvements from the larger cache and for many use-cases doesn't
  make a whole lot difference.  We could/should tune the cache with
  priorizing indexes and all, and perhaps dynamically select the
  cache size but for now, the 1Mb cache size is known to "just work".
2012-02-08 10:56:09 +02:00
Panu Matilainen 8718edcb80 Disable signature checking during database rebuild by default
- While it would be perfectly reasonable to perform signature
  checking during db rebuild, this is problematic as long as our
  keys live in the same database we're rebuilding: the environment
  might be paniced, the indexes required for key lookups might be
  corrupt or non-existent etc - one would assume there's a reason for
  the db is getting rebuilt in the first place. When signature checking
  is enabled, we're forced to generate missing indexes on the potentially
  borked database we're just about to rebuild, which might not go very
  well, and since they keyring loading has no clue its getting called
  from middle of db rebuild it'll try to use a shared environment
  which might be broken ... etc.
2012-02-02 14:41:16 +02:00
Ville Skyttä e254f9b9d4 Add lrzip support.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-04-29 08:49:05 +03:00