Commit Graph

267 Commits

Author SHA1 Message Date
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
Panu Matilainen 0de16638aa Use AC_PROG_MKDIR_P for testing mkdir -p capability
- for rpmbuild's purposes MKDIR_P doesn't cut it though, we need to
  point it to something that exists on an installed system
2009-12-23 11:40:55 +02:00
Panu Matilainen b457e2200b Make --httpproxy and friends work again (RhBug:529214)
- macro fiddling to pass the macros set by --httpproxy etc popt aliases
  to the url helper
- ftp proxy and http proxy control the same thing (http proxy) now to
  keep things simple
- while at it, add %__urlhelper_localopts for local customization needs
  without having to override the entire __urlhelperopts macro
2009-10-22 10:37:49 +03:00
Panu Matilainen 63175d4d31 Avoid using python's print for Python 3.x compatibility
- print chanced from statement to a function in python 3, for our
  purposes sys.stdout.write() is sufficient and avoids dealing with
  the incompatibilities between Python 2.x and 3.x
- suggested by David Malcolm / Ville Skyttä
2009-10-19 10:30:48 +03:00
Panu Matilainen 0a2f3e12d2 Support passing extra options to dep generator scripts 2009-10-07 12:09:00 +03:00
Panu Matilainen 15fb8ccb41 Teach the internal dep generator about OCaml
- OCaml seems to have fairly well detectable magic in its files, nice
- Dont call the regular find-requires from the scripts now that internal
  is working
2009-10-06 12:34:44 +03:00
Ville Skyttä 1c83af6e10 Deprecate %__lzma, use %__xz in it. 2009-10-06 10:47:43 +03:00
Panu Matilainen c339c36144 Move the default transaction lock out of BDB environment namespace
- We dont want the transaction lock to get mixed with the BDB environment,
  nor do we want it wiped out with it as the ts lock protects things
  *around* the environment. Unlike the environment, any fcntl locks on
  the file get released when process dies, so if there is a lock,
  there's a process alive holding it and you'd better not remove it.
- Use the same lock path in macro configuration and built-in fallback
- Make it a hidden file to avoid people confusing lock file existence
  with it actually being locked
2009-09-16 15:47:11 +03:00
Panu Matilainen 936e257019 Use %{nvra} as default query format, much simpler... 2009-09-02 15:34:35 +03:00
Panu Matilainen 75c0d816a8 Add provide-extractors for fonts and desktop files
- extract mime handler capabilities from application .desktop files
- extract font family names and supported languages from font files
- both are used by PackageKit for on-demand installing of fonts and
  applications, but are useful for other things too
2009-09-01 10:52:12 +03:00
Panu Matilainen a40e355676 Remove extra trailing } copy-paste error from python_foo macros, duh 2009-08-20 14:10:41 +03:00
Panu Matilainen 3e5097c975 Add some commonly used python macros (ticket #83)
- macros to determine python version and library paths
2009-08-18 09:20:45 +03:00
Panu Matilainen 883253ea6a Add %make_install macro that does the "right thing" wrt modern autotools
- old %makeinstall for broken/ancient autotools left untouched for
  backwards compatibility
2009-08-14 11:27:57 +03:00
Jindrich Novy 7f7188a396 Add bug URL macro so that it could be set distro-wide (rhbz#512774) 2009-08-14 09:36:26 +02:00
Panu Matilainen 1d61f3e34b Build script environment tweaks to improve reproducability
- unset CDPATH (RhBug:426955) and DISPLAY environment variables
- always run in C locale
2009-08-13 17:11:47 +03:00
Panu Matilainen de218d7069 Don't set --target in %configure (RhBug: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
2009-08-13 16:46:18 +03:00
Panu Matilainen 91af91ef8e Nuke long since dead version of %configure macro + update commentary 2009-08-13 16:44:59 +03:00
Panu Matilainen 33d829d362 Add an index for obsoletes (RhBug:507702) 2009-07-03 15:12:07 +03:00
Jindrich Novy 3b9f0b817e Introduce _changelog_trimtime and obsolete _instchangelog 2009-04-16 14:12:20 +02:00
Panu Matilainen 2d2bda29c1 Add built-in %getconfdir macro for getting rpmConfigDir() value
- define %_rpmconfigdir via %getconfdir in the main macro config, this
  avoids it getting lost on macro reloads as happens when building
  several packages at once
2009-03-27 14:01:47 +02:00
Panu Matilainen 64280efc1e Put the PGP foobar signature generation out of its misery
- the last freeware PGP version (6.5.8) is from year 2000 and doesn't
  come close to compiling on modern distros, commercial versions we're
  not interested in
- "PGP" signatures in rpm mean RSA, gpg can handle that just fine since
  forever
- the code's been unused for years, unlikely to be functional anyway...
2009-03-26 09:59:01 +02:00
Panu Matilainen fa0898552d Add support for "lzma alone" compression format (lzdio)
- "lzma alone" is superseeded by XZ but it's used by Suse and Mandriva
  distros so it's nice to have as it doesn't need much, only open differs
  from XZ
- rpmlib() dependency versions are an uuuuuuuugly mess here: Suse used
  "PayloadIsLzma = 4.4.2-1" so that's what we provide to be most compatible
  (hopefully). Built packages require "PayloadIsLzma <= 4.4.6-1" however
  to be compatible with Mandriva 2008.0. Did I already say it's ugly?
- Based on similar patch in Mandriva by Per Øyvind Karlsen, but avoiding
  unnecessary renames in rpmio
2009-03-18 11:24:52 +02:00