Commit Graph

288 Commits

Author SHA1 Message Date
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
Ville Skyttä bcad08867d Add lzip support.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-04-29 08:48:56 +03:00
Panu Matilainen 2a8d036697 Push platform config out of main rpm macros file
- canon arch & color stuff is now calculated per each known arch in
  installplatform, and just a single place where arch name mangling
  is done
2011-03-25 14:48:49 +02:00
Panu Matilainen 1ee7c1a685 Move %_fixperms to main macro config
- Fixing broken permissions in sources isn't exactly platform/vendor
  specific in nature (at least Suse adds this this to their own "platform"
  separately, kinda proving the point)
- Kick out the remaining unused RH-pecific platform.in section
2011-03-25 13:13:41 +02:00
Panu Matilainen 6b6310b152 Bump up default BDB cache- and allowed mmap size considerably
- The former defaults come from nearly a decade ago, things have
  changed a bit since then... Even BDB's own default cache size is
  much larger (8MB) now than what we've been setting.
- Using 64MB cache improves cache hit rate (and performance) massively.
  Last-gasp default to roughly BDB's own current defaults, higher
  settings in the default macro setup.
2011-01-03 15:49:50 +02:00
Panu Matilainen 69187d6bb0 Eliminate ancient dependency loop whiteout mechanism
- Nobody has been relying on this for ages, and with the new ordering
  code since rpm 4.8.x loops are handled much more gracefully than
  before. RIP.
2010-12-15 11:34:50 +02:00
Panu Matilainen a9bc1f51ae Rename pattern -> path for, duh, path patterns
- 4.9 alpha used "pattern" but better fix the stupid name now than
  have to live with the non-obvious name forever
2010-12-10 12:33:46 +02:00
Panu Matilainen f5a657112a Support excluding by path or magic in file classification
- %__foo_exclude_pattern and %__foo_exclude_magic regex'es now allow
  excluding attributes that would otherwise match.
2010-12-10 12:00:50 +02:00
Panu Matilainen f9a32ac3de Lose the remaining dbapi references in code + configuration
- Changing db_api to db_ver to force breakage on anything using the
  value, db_ver containing the BDB major version just to put something
  in the error messages where the dbapi version used to be.
2010-11-04 15:55:19 +02:00
Panu Matilainen 6281e4a215 Only specific cases of collections need extra ordering
- Add a crude flags system to allow selectively enabling the extra
  grouping during ordering: currently only sepolicy collection needs
  this, and its very harmful when applied to more regular collections
  as it creates truly gigantic dependency loops that rpm has no chance
  of sorting out sanely.
2010-10-25 14:19:18 +03:00
Panu Matilainen a916e399ab Hardwire the fundamental BDB access method configuration inside rpm
- The different access methods have different capabilities and are not
  interchangeable in all situations. Currently we can use either
  hash and btree but this might not be always the case for all indexes.
- We'll eventually want to force-switch the index types to our liking,
  but for now follow these simple rules:
  1) For existing databases, we accept both btree and hash
  2) For newly created databases, the main Packages database remains
     a hash, all indexes are btrees.
- Rip out nearly all the rest of the remaining macro configuration.
2010-10-20 16:53:00 +03:00
Panu Matilainen ca36c2a12b Eliminate now unnecessary db rebuild macro goo and other leftovers
- Rpm knows how to handle db rebuilds by itself, no need to expose
  these bits to configuration.
- Also rip out a pile of other leftover "documentation" about BDB
  internal switches.
2010-10-20 15:23:54 +03:00
Panu Matilainen ec6226dd17 Move plugins out of rpm config directory
- Plugins are by their very nature arch specific, while /usr/lib/rpm
  is a hodgepodge of all sorts of ... stuff, most of which is
  arch-independent and all. Use %{_libdir}/rpm-plugins to cleanly
  differentiate 32 vs 64bit plugin paths
2010-10-12 17:05:17 +03:00
Panu Matilainen 0048c39479 Add cli switches to override signing key and digest algorithm 2010-10-04 16:04:47 +03:00
Panu Matilainen 6059911eb8 Remove configuration for no longer existing db indexes 2010-09-29 16:44:19 +03:00
Panu Matilainen 8f14d6455a Rip the useless %_signature macro and everything around it 2010-09-28 16:28:21 +03:00
Steve Lawrence 46cdd1b507 Add SELinux policy plugin
This adds a new plugin specifically for a collection to load SELinux
policy. This implements the post_add and pre_remove plugin hooks. The
only time anything happens during the pre_remove hook is if post_add was
not called (i.e.  if the transaction only removes policies).

This plugin extracts all the policy information from packages in the
sepolicy collection during the open te hook. It then determines which
policies should be installed/removed based on if the package is being
installed/removed and the type of the policy and the system policy. It
then executes semodule (or uses libsemanage if semodule cannot be
executed or installing in a chroot) to remove and install the necessary
policies. It then reloads the selinux state, reloads the file contexts,
and if necessary, relabels the file system.
2010-09-01 09:31:03 +03:00
Steve Lawrence f3bcf9a18c Add a generic plugin for use by simple Collections
This patch adds a generic plugin, exec.so, that should be sufficient for the
majority of Collection actions. After all packages in a Collection have been
installed/removed, this plugin executes the arguments by calling system(3),
allowing for a very generic and powerful method to perform many actions.

This also adds two sample macros as examples of the format, using the exec.so
plugin.
2010-06-22 11:12:43 +03:00
Panu Matilainen ba6b82d3fa Simplify the dbenv->open() flags shuffle
- We always create an environment. If we dont have permissions to create
  or join a shared environment, we use a private environment. Instead
  of trying to figure out what to do beforehand, retry dbenv->open()
  with different flags to see if it succeeds. This eliminates some
  potential races when others might create/remove the environment
  while we're pondering about appropriate flags.
- Lose the "create" bdb config option, this is something we always
  want to decide internally.
- Remove "force" bdb config option, DB_FORCE is dbenv->remove() option
  and its value clashes with DB_CREATE...
2010-04-09 14:53:31 +03:00
Panu Matilainen 34b57de830 Eliminate DB_JOINENV usage and config option
- DB_JOINENV is a no-op since BDB >= 4.4
2010-04-08 16:15:16 +03:00
Panu Matilainen 4e51e58c23 Eliminate "thread" BDB option
- this is not something that users should be tweaking
- its never been enabled, leave it that way for now
2010-04-08 16:07:58 +03:00
Panu Matilainen 8f03db2c76 A little bit of sanity to dbiNew()
- lose the hysterical dbi_use_env condition and usedbenv option
  this is always enabled
- ensure mpool is always initialized, lose the config option (this
  is a mandatory BDB subsystem, not a bleeping configurable)
- let pagesize be what it is even when no configuration is present
- avoid overriding dbi_mmapsize and dbi_cachesize if set in the configuratio
- these are all per-environment, not per-dbi settings but for now...
2010-04-08 16:01:20 +03:00
Panu Matilainen 30068b5280 Eliminate exclusive and rdonly BDB configuration options
- we never want DB_CREATE to cause failure - let BDB create the
  db if it needs to, otherwise DB_CREATE doesn't do anything
- rdonly is decided elsewhere, not in bleeping configuration
2010-04-08 14:39:07 +03:00
Panu Matilainen d9691e7257 Remove per-dbi perms and configuration
- the file permissions are per-db global, no need to be able to
  speficy different modes for indexes
2010-04-08 13:46:13 +03:00
Panu Matilainen ea6171dce2 Remove BDB recno + queue access methods from configuration
- these rather limited access methods have never been used for anything,
  rpm always used hash access and later btree to varying degree
2010-03-31 12:17:00 +03:00
Panu Matilainen 9791cf2ab5 Lose shmkey + shared BDB config options
- we dont want anything to do with System V IPC, really... BDB uses
  file backed mmap when it needs, this suits us just fine
2010-03-31 01:59:27 +03:00
Panu Matilainen 025886592e We dont want to use DB_HOME environment, ever
- rpm has its own switches for overriding the db home when that's
  necessary, DB_HOME it should use not
2010-03-31 01:53:27 +03:00
Panu Matilainen 6a3464740a We dont have any temporary databases anymore, lose the config switches
- The last temporary db was Depends which is now replaced with an
  in-memory hash, and the temporary dbs were troublesome with
  chroot operations anyway, good riddance
2010-03-31 01:45:26 +03:00
Panu Matilainen fb2a6cb031 Make rpmdb index list hard-wired
- We dont grow new indexes every other day, and especially this
  is not activity that users need to be able to do
- Gets rid of the hysterical initialization and million can't happen
  NULL-checks
2010-03-31 01:05:03 +03:00
Panu Matilainen 8c7e53ec80 First take at pluggable file attribute + dependency extraction system
- move most of the hardwired classification logic from rpmfc C-code
  to macro-based configuration, supporting drop-in addition of arbitrary
  new attributes + dependency extractors based on regex matching of
  libmagic file types and paths
- just the initial rough conversion of our built-in dependency types,
  various open questions + todo-items remain, plus likely fair amount
  of more-or-less subtle breakage
2010-03-23 16:32:46 +02:00
Panu Matilainen 89b3b38612 Lose unused temporary/pseudo rpmdbi tags
- we haven't had any temporary dbis since rpm 4.8.0 where Depends
  got axed, the rest were just nonexistent fluff anyway
2010-03-19 16:55:27 +02:00
Panu Matilainen e9e3b5eb6e fontconfig -> font dependency extractor rename
- No functional changes, just clearing the naming conventions to avoid
  having to extra mapping for attribute -> extractor name. The current
  font provides are handled by fontconfig, but that's just an internal
  implementation detail.
2010-02-18 12:31:34 +02:00
Panu Matilainen 11ed0f75fe Script/interpreter terminology renaming
- No functional changes, just making more obvious mapping between
  attributes and the dependency extractor names. This also leaves the
  term "interpreter" free for use for the actual interpreters, such
  as interpreter(python) provides if we go that way (ticket #136).
2010-02-18 10:35:21 +02:00
Panu Matilainen 33ea7cbd96 Permit requires extraction too from fontconfig and desktop files
- presently unused but...
2010-02-10 11:22:04 +02:00
Panu Matilainen 87c237bebf Split elf dependency extraction out of librpmbuild to external helper
- Elf dependency extraction code code lifted from rpmfcELF() and refactored
  to saner pieces. Having it in separate executable also frees librpmbuild
  of libelf dependency, clean up the unnecessary linkage etc from
  autofoo
- This lets internal dependency generator for elf files be
  overridden without losing file coloring (which is required for
  correct multilib handling). It also permits non-native elf files
  (eg when cross-building) to be handled by providing a custom
  elf dependency helper
- On the flip side, this inevitably slows down builds somewhat as
  two fork-exec's are needed for every elf file, but unlike invoking
  something like the python interpreter, this is a slim helper...
- All dependency extractors of the internal dependency generator are now
  external helpers (how twisted is that, huh? :) and thus can be customized
  and filtered through %__foo_provides|requires macros
2010-02-10 11:20:51 +02:00
Panu Matilainen a79822f382 Separate helper for script interpreters, split out of librpmbuild
- permit overriding/customization of script interepreter dependencies
- unlike the C-version, the interpreter.req only looks at the first line
  for shebang: libmagic only looks at the first line too, so anything
  else will never get classified as scripts in the first place
2010-02-10 11:19:49 +02:00
Panu Matilainen 5f2d9d1187 Use %{__make} macro instead of "make"
- allows easy overriding of the used make version for %make_install and
  %makeinstall
2010-01-22 14:52:14 +02:00
Panu Matilainen 458c913e46 Add %{__id_u} back, duh
- appears to be rather commonly used afterall
- dont bother with the former id|sed foo though
2010-01-06 12:58:49 +02:00