Commit Graph

377 Commits

Author SHA1 Message Date
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
Panu Matilainen 4c62ae4a5b Bump version to appear newer than 4.12.x branch 2014-08-27 11:38:09 +03:00
Panu Matilainen f8868f11d7 Check for sys/auxv.h header, always include if present
- We'll need this to access any HWCAP_* bits for platforms that need it,
  regardless of whether getauxval() is present or not. On glibc
  systems this is likely to be equivalent, on others dunno (Solaris
  appears to have sys/auxv.h header as well)
2014-06-27 10:24:07 +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
Michael Schroeder 13a1ef9fb5 Add a %_rundir macro to the platform files.
The default value is /run, it can be changed with the --with-rundir
configure option.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-07 09:12:46 +03:00
Panu Matilainen d07af12947 Use pax format for dist tarballs.
- Last year somebody decided that uid/gid stored in automake'd archives
  is somehow important, causing ustar format to be unusable with large
  uid/gid :(
  https://lists.gnu.org/archive/html/automake/2013-02/msg00075.html
2014-04-07 12:47:55 +03:00
Panu Matilainen 48e94a1247 Dont bother looking for platform specific dependency generator scripts
- These scripts fell out of fashion more than ten years ago...
2014-03-31 17:01:05 +03:00
Florian Festi d24a1f8eec Add rpm2archive utility for converting rpm payload to tar archives.
This is needed as the new payload format for large files is not compatible with
rpm2cpio which basically just dumps the payload which happened to be cpio.

Use configure parameter --without-archive to not build this tool and get rid of the libarchive requirement.
2014-03-11 10:49:55 +01:00
Ville Skyttä e4191162e1 Search for 7za and 7z for 7-zip.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-08-15 07:44:48 +03:00
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