Commit Graph

368 Commits

Author SHA1 Message Date
Kirill A. Shutemov 60835b2018 Use getauxval(3) to read auxv data
glibc >= 2.16 provides getauxval(): a reliable way to retrieve a value
from the auxiliary vector. It doesn't rely on /proc filesystem.

Let's switch to it and get rid of /proc dependency.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-07-02 12:43:53 +03:00
Panu Matilainen 7c8faacf0d Remove bundled mergesort() copy, use one from the system if available
- The mergesort() implementation we've carried all this time (even if
  not compiled in when glibc is used) is one with the nasty BSD
  advertisement clause, ugh. Better remove it late than never,
  but let systems having mergesort() in their system libraries
  (such as OSX) use it instead of qsort().
2013-03-19 08:25:14 +02:00
Panu Matilainen 7734015540 Use lutimes() instead of utimes() on systems that have it
- This makes symlink timestamps reflect build-time instead of
  installation time, similarly to everything else. On systems that
  support lutimes(), that is.
2013-03-13 11:39:00 +02:00
Panu Matilainen 324e16726c Use utimes() instead of the obsolescent utime() for setting file times
- We dont have or care about microsecond precision, but this is the
  more modern interface ... and on some systems there's an equivalent
  that allows symlink timestamps to be set, but no such equivalent
  exists for utime()
2013-03-13 11:26:00 +02:00
Mark Wielaard dd0ea43f14 Fixup find-requires linking for srcdir != builddir.
When configuring with srcdir != builddir the find-requires link would fail:
ln: failed to create symbolic link './autodeps/find-requires'

Do the link in the same way as find-provides with an explicit ${srcdir}.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-03-06 10:12:21 +02:00
Mark Wielaard 51dad76334 Require dbus >= 1.3 for DBUS_TYPE_UNIX_FD usage.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-03-05 22:02:36 +02:00
Panu Matilainen 49519f2564 Acommodate to glibc 2.17 __secure_getenv() renaming
- glibc 2.17 renames __secure_getenv() to secure_getenv() so now we
  need to test for both. Meh.
2013-01-28 18:53:12 +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 9b995a7674 Get rid of long since deprecated VFY_VerifyDigest() uses
- VFY_VerifyDigest() has been deprecated since NSS >= 3.12 and for
  a good reason too: with VFY_VerifyDigest() caller needs to painfully
  enumerate every possible supported enc + hash combination, only for
  NSS to revert the process. Use the saner VFY_VerifyDigestDirect()
  interface instead and test for its presence in configure.
- This means we now require NSS >= 3.12 but as that's already 4.5 years
  old and included in ancient beasts like RHEL-4, this doesn't seem
  exactly unreasonable requirement. And then there's always beecrypt...
2012-11-29 12:35:13 +02:00
Panu Matilainen e1c67173d3 Remove extra ',' in NSS configure checks, whoops 2012-11-29 12:32:25 +02:00
Panu Matilainen 829d922abe Bumb version to indicate branch-point 2012-11-07 14:52:47 +02:00
Panu Matilainen 5ecfdcea4e Use private NSS context if NSS supports it (RhBug:871485)
- Older NSS versions operate on global context, which can cause
  all sorts of trouble when an API user tries to use NSS for their
  own purposes: eg they might want to use NSS databases which is not
  possible once we've initialized NSS with NSS_NoDB_Init(). Further
  background on the subject at https://wiki.mozilla.org/NSS_Library_Init
- Use private private NSS context when possible (NSS >= 3.12.5) to
  avoid such clashes, but keep support for older versions for now.
2012-10-31 09:43:38 +02:00
Panu Matilainen 0660fe9442 Default to NSS crypto though...
- NSS is a big and quirky monster for our needs but that's what we've
  been defaulting to for the last years, and then there are those
  certifications...
- Also default to external beecrypt even if --with-beecrypt is used
2012-10-19 15:45:14 +03:00
Michael Schroeder 98e7823089 Add support for beecrypt as an alternative crypto implementation
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-10-19 15:43:09 +03:00
Panu Matilainen 789e258d6c Run gcc supported flags test without our stricter warning flags
- Fixes fallout from commit f9c69f803f74bd458269c7a06def494ea63387e6:
  running these tests with -Wstrict-prototypes causes all these tests
  to fail as AC_LANG_PROGRAM() uses an incomplete prototype for
  main() :(
2012-08-14 08:44:32 +03:00
Panu Matilainen f9c69f803f Run gcc supported flags test with -Werror
- On gcc versions supporting -fstack-protector, not all platforms
  support this feature, causing gcc to emit only a warning instead
  of an error. Which then causes warning-spew on every compiled file.
  Run all the supported flag tests with -Werror to turn the warnings
  into errors, there could be other similar cases besides stack protector.
- Patch originally from Arnaud Patard according to this Mandriva commit:
  http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages?view=revision&revision=448632
2012-07-12 13:04:43 +03:00
Panu Matilainen bf3a14a866 Dont use mmap() for anything, axe the code instead
- Commit 4cb02aa928 asked to see
  what breaks when mmap() is used, now we know: large package support
  broke when enabling it. Could be fixed of course by eg adding
  a size cap to the fsm part as well, but just doesn't seem worth it:
  I fail to measure any meaningful performance improvement from mmap
  usage in either case, and added complexity for what is close to
  zero benefit just doesn't make sense... and various sources in fact
  note the rpm usage (read through the entire file sequentially) as one
  of the cases where mmap() is NOT beneficial due to mmap() high
  setup + teardown cost + page fault speed (or lack of thereof).
2012-07-02 15:02:11 +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 7c8c36c334 Fall back to using fsync() on systems without fdatasync()
- While fdatasync() is widely available on modernish systems,
  OS X doesn't have it
2012-06-21 09:45:16 +03:00
Panu Matilainen ac8a0175be Only use local mempcpy() if system libraries dont provide one
- Obvious yes, but how come this didn't barf on my other rather
  identical system? Meh.
2012-05-31 18:10:33 +03:00
Panu Matilainen bf088dbeb5 Bury our glob() implementation entirely inside rpmglob.c (RhBug:819680)
- Lump glob.h and glob.c into rpmglob.c in all their g(l)ory libc
  decorations and make everything static to stop overriding system
  library symbols with our own glob().
2012-05-31 16:46:40 +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 72b6a384f5 Bump version to appear newer than 4.10.x branch 2012-03-20 10:05:49 +02:00
Panu Matilainen b542b2fbc6 Allow silent build on automake versions that support it 2012-03-09 12:16:11 +02:00
Panu Matilainen dbea7fa32e GCC warning option tweaks
- WTH are we compiling with -Wno-char-subscripts? This appears to have
  been there since the dawn of times, and at least nowadays removing
  it causes no new warnings.
- Re-enable -Wstrict-prototypes, either NSS headers have gotten fixed
  or GCC has gotten smarter and no longer whines about broken
  system headers.
2011-09-01 20:26:13 +03:00
Panu Matilainen b37b4fbd48 Remove support for ancient bzip2 library versions
- bzip2 1.0 is over ten years old by now, anybody still using versions
  older than that get what they deserve...
2011-08-19 10:25:11 +03:00
Panu Matilainen 4b7e6cb79f zlib is mandatory, fail at configure if missing + remove conditionals
- Unlike bz2 and xz/lz, zlib compression is not tracked by any rpmlib
  feature and is part of the original package format really, zlib
  simply must be always present.
2011-07-08 10:31:34 +03:00
Panu Matilainen 5cd1e56cd2 Enable GLOB_ONLYDIR of the bundled glob() on platforms that support it 2011-06-28 08:37:41 +03: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 a81d933cc3 Only enable test-suite if fakechroot is available 2011-04-04 14:31:17 +03:00
Panu Matilainen f825911b73 Use pkg-config to find Lua + determine flags (ticket #88)
- Additionally clean up the logic a bit and dont bother building
  any lua-related bits if disabled
2011-03-28 12:54:42 +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 2b6486a69b Replace distro/vendor autodetection with a configure switch
- it's not rpm's job, not is it possible for rpm to know about
  distribution/vendor names and preferences
- use build_vendor as the canonical vendor (affecting %{_vendor} default
  and macro + rpmrc paths) unless overridden by --with-vendor=name
2011-03-25 11:25:47 +02:00
Florian Festi a0d04112c0 Move find-provides and find-requires link to autodeps/
Implement link reaction with less copied code
2011-03-25 10:10:52 +01:00
Jindrich Novy b159519d9d Remove checks of unused things from configure.ac 2011-03-23 13:37:44 +01:00
Jindrich Novy b03685d320 Don't use mtrace(3), muntrace(3) and don't check for mcheck.h
- valgrind is good for these things without touching the code
2011-03-23 12:37:25 +01:00
Jindrich Novy c61391e647 Remove libio support to suppress timedRead() 2011-03-23 11:25:06 +01:00
Panu Matilainen 16aea81dc7 Preliminary distutils support for the python bindings
- Steps towards separating rpm-python from the main rpm tarball even
  though developed within the rpm repository.
- Having the bindings in a separate tarball makes it simpler to build
  them for different python versions, notably python 3 (RhBug:531543)
2011-03-09 15:37:07 +02:00
Panu Matilainen 584b9d4f5a Make peace with autoconf-2.68 2011-03-04 18:34:01 +02:00
Panu Matilainen 454859f3cb Only sepolicy-plugin needs linking to libsemanage 2010-12-22 14:58:11 +02:00
Panu Matilainen 4a3d7f2c73 Bump HEAD version at branch-point 2010-12-03 14:11:48 +02:00
Panu Matilainen 71c8f49ca4 Fix BDB version check in configure to work with >= 5 too 2010-10-26 11:54:55 +03:00
Panu Matilainen 9f2c1bd909 Move librpmsign to its own subdirectory in the sources 2010-10-22 15:00:49 +03:00
Panu Matilainen a4adf99b0f Add configure switch to disable plugins build
- For now this is really just to allow building statically while
  hacking, for "real world" use this has implications on collections
  support etc which is not handled by this patch.
2010-10-01 10:43:55 +03:00
Panu Matilainen 8b4ccff2e3 Handle enable/disable python to configure.ac more sanely
- Conditionalize the python subdir on toplevel make instead of
  python subdir makefile.
2010-10-01 10:34:36 +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 34b5d67c2d Use selabel interfaces instead of matchpathcon
This replaces the old matchpathcon interfaces with the new selabel
interfaces for relabeling files, storing an selabel handle in the
transaction set.

With this change, also comes an added distinction between --nocontexts
being specified and a failure to read the load file contexts.
Previously, there was no distinction, and both cases used the
RPMTRANS_FLAG_NOCONTEXTS flag.

However, with the new policy plugin, it is necessary to make such a
distinction. This is because matchpathcon_init (now selabel interfaces)
can fail at the beginning of the transaction, but succeed later after
new policy is installed. Because of this, we may need to enable/disable
RPMTRANS_FLAG_NOCONTEXTS multiple times. However, because this flag
could also mean --nocontexts, we cannot do that. By storing the selabel
handle in the rpmts, we can easily keep track if the handle has been
successfully created, rather than overloading RPMTRANS_FLAG_NOCONTEXTS
with two meanings.
2010-09-01 09:30:51 +03:00
Panu Matilainen b6adef396b Add configure.ac check for need to -ldl
- without this the build can barf on unresolved dl* symbols with a
  linker defaulting to --no-add-needed
2010-06-23 15:59:49 +03:00