Commit Graph

522 Commits

Author SHA1 Message Date
42eacfcc82 brp-bytecompile_python: exclude paths listed in $RPM_PYTHON3_COMPILE_INCLUDE (ALT#28606)
$RPM_PYTHON3_COMPILE_INCLUDE is usually a subset of
$RPM_PYTHON_COMPILE_INCLUDE, so add the former to the exclude list.
2016-03-09 15:02:22 +00:00
da9e6dfaab ldd.in: pass --list to rtld 2016-01-11 18:19:19 +00:00
Gleb Fotengauer-Malinovskiy
ae81f541b9 compress_files: change default method to xz 2015-12-02 21:46:44 +03:00
Gleb Fotengauer-Malinovskiy
39018f9f32 find-package: add support for newer naming of gcc and libstdc++-devel 2015-05-21 18:07:37 +03:00
6ad3a37cb9 verify-elf: fix regression in verify_lfs 2015-01-28 13:41:37 +00:00
a44f6ae523 verify-elf: make verify_stack work again 2015-01-23 14:56:29 +00:00
213af284d9 fixup-binconfig: strip rpaths
Extend library search path stripping algorithm to handle rpaths.
2014-02-25 12:25:51 +00:00
2992fcc3ab pkgconfig.req.in: allow pkgconfig names to start with + (ALT#29737) 2014-02-25 12:22:12 +00:00
f1dc627616 cpp.req: fix for cpp 4.8.x output
Adapt cpp output parser to handle cpp 4.8.x output properly.

  $ cpp-4.7 /dev/null
  # 1 "/dev/null"
  # 1 "<command-line>"
  # 1 "/dev/null"
  $ cpp-4.8 /dev/null
  # 1 "/dev/null"
  # 1 "<command-line>"
  # 1 "/usr/include/stdc-predef.h" 1 3 4
  # 1 "<command-line>" 2
  # 1 "/dev/null"
2014-02-15 03:06:45 +00:00
6fb9f3ddc8 brp-debuginfo: add $RPM_DEBUGINFO_SKIPLIST support 2013-10-29 00:51:04 +00:00
02fb57b32c fixup-pkgconfig: workaround some broken pkgconfig files (ALT#29427) 2013-10-24 12:42:15 +00:00
98730b6009 find-lang: update copyright information 2013-03-11 23:15:51 +00:00
c525a0dea9 find-lang: minor regexp optimization 2013-03-11 23:13:27 +00:00
d5936fb3eb find-lang: enhance QT files lookup regexps 2013-03-11 23:04:17 +00:00
bd376047fd find-lang: enhance KDE lookup regexps 2013-03-11 22:50:38 +00:00
00809aa77f find-lang: enhance GNOME lookup regexps 2013-03-11 22:38:28 +00:00
9e3d656706 find-lang: enhance man lookup regexps 2013-03-11 21:49:30 +00:00
bdda18ca1f find-lang: enhance .mo files lookup regexps 2013-03-11 21:46:43 +00:00
5a139641b0 find-lang: add --with-qt option to getopt (ALT#28288) 2013-03-10 00:04:56 +00:00
1096c10bec find-lang: add QT .qm files support and --with-qt option (ALT#28288) 2013-03-08 17:07:49 +00:00
2cbf4d4cd9 find-lang: minor cleanup 2013-03-08 15:22:59 +00:00
53e2358f62 scripts/fixup-desktop.awk: fix regexp 2013-01-11 22:36:49 +00:00
d92c009d2d verify-elf: implement LFS check (ALT#28290) 2013-01-10 23:15:07 +00:00
279f487ca4 scripts/functions: export LC_ALL=C
A lot of code relies on C collation, C messages and so on.
Do not pretend it is expected to work with a non-C locale.
2013-01-10 22:38:52 +00:00
1fe269bb6c scripts: cleanup readelf(1) invocations
Prefer long options to short options.
Constistently use --wide option.
2013-01-10 22:04:19 +00:00
5a8fdc10de pkgconfig.req.files: ignore file type, treat all non-symlinks the same way
Stop relying on file(1) output for obvious reasons (see e.g. ALT#28261),
assume that all non-symlinks in pkgconfig directories are valid input.
2012-12-22 14:41:22 +00:00
7d84f7da5a 0ldconfig.filetrigger: execute telinit if appropriate 2012-08-30 23:05:00 +00:00
d78a04e393 brp-fix-perms: fix "find -perm" syntax 2012-08-08 13:15:41 +00:00
8d16b4186d 0common-files.req.list: add /etc/sudoers.d 2012-07-12 10:02:33 +00:00
Igor Vlasenko
da9e0cf514 scripts/find-lang.in: add --all-name option (ALT#27284)
Add PLD/Fedora compatible --all-name option (by mkochano,pascalek@PLD).
2012-05-24 13:44:54 +00:00
Alexey Tourbin
53661a9938 cpp.req: fix double buildroot in filename-specific -I options 2012-02-19 19:09:55 +04:00
Alexey Tourbin
d7b8e36a16 cpp.req: single pkg-config invocation
Running pkg-config multiple times can produce too many cflags, most
of them being dups.  With this change, I rely on pkg-config itself to
discard dups properly - pkg-config(1) manpage says that "duplicate
flags are merged (maintaining proper ordering)".
2012-02-19 18:26:41 +04:00
Alexey Tourbin
50a5ad7320 cpp.req: recover missing once-only pushes using -dI
Hierarchical processing makes cpp.req more susceptible to "once-only
header" optimization.  To demonstrate the problem, I've implemented
some debugging facilities.  Here is how <gtk/gtk.h> is processed.

$ cpp.req -vv /usr/include/gtk-2.0/gtk/gtk.h
[...]
  Include gdk/gdk.h
+ Push /usr/include/gtk-2.0/gdk/gdk.h
    Include gdk/gdkapplaunchcontext.h
+   Push /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h
      Include gio/gio.h
!     Push /usr/include/glib-2.0/gio/gio.h
        Include gio/giotypes.h
        Push /usr/include/glib-2.0/gio/giotypes.h
          Include gio/gioenums.h
          Push /usr/include/glib-2.0/gio/gioenums.h
            Include glib-object.h
            Push /usr/include/glib-2.0/glib-object.h
              Include gobject/gbinding.h
              Push /usr/include/glib-2.0/gobject/gbinding.h
                Include glib.h
                Push /usr/include/glib-2.0/glib.h
[...]
+               Push /usr/include/gtk-2.0/gtk/gtkdebug.h
                  Include glib.h
                Pop
[...]
recovered glib.h -> /usr/include/glib-2.0/glib.h
recovered stdarg.h -> /usr/lib64/gcc/x86_64-alt-linux/4.5.3/include/stdarg.h
recovered time.h -> /usr/include/time.h
recovered glib-object.h -> /usr/include/glib-2.0/glib-object.h

In the output, "Include" lines annotate "#include" instructions which
are about to be processed by cpp; "Push" and "Pop" annotate actual
file operations performed by cpp.  Technically, "Include" annotations
are enabled via -dI option which installs cb_include callback in
gcc/c-ppoutput.c; "Push" and "Pop" are triggered in the guts of the
libcpp library.  The library has hardcoded optimization against repeated
inclusions.  According to "info cpp", "It remembers when a header file
has a wrapper #ifndef.  If a subsequent #include specifies that header,
and the macro in the #ifndef is still defined, it does not bother to
rescan the file at all."  (See should_stack_file in libcpp/files.c.)

This means that, normally, each "Include" should be followed by a
corresponding "Push".  However, due to "once-only header" optimization,
some includes are not followed by a push.  This means that the file
has already been pushed, and it happens to use a wrapper #ifndef.
Note that, in the output, this is exactly the case with <glib2.h>.

Also note that, in the output, files internal to the package are marked
with "+" on the left.  They are tracked down to the first non-packaged
file, which makes a dependency; these files are marked with "!".  The
problem with <glib2.h> is then that it gets first included in an
external file.  Later it is also included in an internal file, but
a "Push" is not triggered.  And since the internal file is subordinate
to <gtk/gtk.h> and is not going to be processed on its own, the
dependency on <glib2.h> is lost.

To recover missing pushes, we have to associate each include with the
first-time push.  In other words, we need a table which maintains a
(header -> filename) mapping; in the above example, the table will
contain (glib.h -> /usr/include/glib-2.0/glib.h).  Using this table,
we can ascertain that each internal #include produced a result.

Now, this might still have some corner cases: includes with
non-canonical header names probably will not be recovered, and it is not
clear whether <foo.h> and "foo.h" should be processed differently.
It works well enough in simple cases, though.
2012-02-19 18:23:24 +04:00
Alexey Tourbin
e4835167bb cpp.req: hierarchical processing - fewer errors and major speedup
I have to admit that cpp.req can be slow and often fails in an ugly
manner.  To address these issues, this change introduces "hierarchical
processing".  Consider the package libgtk+2-devel.  Only a few header
files from this package can be included directly, and these files in
turn include other "private" headers which are protected against direct
inclusion.  The idea is then that only those few files with the highest
rank have to be processed explicitly, and most of the "private" files
can be processed implicitly as they are included on behalf of
higher-ranking files.

To implement the idea, somehow we have to sort the files by their rank.
This probably has to involve some guesswork.  However, assigning higher
ranks to shorter filenames seems to produce nice guesses.  More precisely,
files are sorted by shorter directory names and then by shorter basenames.
Another possible criteria which is not currently implemented is also to
take into account the number of path components in a directory name.

The result is pretty amazing: the amount of time needed to process
libgtk+2-devel headers is reduced from 150s to 5s.  Notably <gtk/gtk.h>
includes 241 packaged files.  This is also due to other optimizations:
packaged files are excluded from dependencies early on, and each
required filename gets passed to FindPackage only once.
2012-02-19 09:13:44 +04:00
Vitaly Kuznetsov
ca5b17e03c introduce brp-hardlink_pyo_pyc (splitted from brp-bytecompile_python)
Hardlinking identical .pyo and .pyc files splitted from brp-bytecompile_python to
brp-hardlink_pyo_pyc to make this brp work for python3 files (generated by separate
brp-bytecompile_python3).
2012-01-25 14:23:12 +00:00
Vitaly Kuznetsov
a771af0403 brp: introduce /usr/lib/rpm/brp.d directory
Made it possible for third party packages to have their own brp-* scripts. All
existent brp-* scripts migrated to /usr/lib/rpm/brp.d, brp-alt taught to execute
all from this directory in alphabetical order. All brp-* scripts obligated to
have three digit prefix (to specify execution order) and .brp suffix.
2012-01-25 14:16:15 +00:00
3a6b8bd83b 0common-files.req.list: remove /etc/sysctl.d
/etc/sysctl.d is going to be added to filesystem package.

This reverts commit bec54ac071.
2011-12-13 14:55:50 +00:00
820414df17 verify-elf: move check for rpath, stack and unresolved symbols to separate functions 2011-12-12 16:27:52 +00:00
c66e9c38e4 verify-elf: more RPATH checks
Check RPATH for non-ascii symbols, invalid absolute and relative paths,
and standard library directories.
2011-12-10 21:51:42 +00:00
6eea0604ad verify-elf: Rewrite error reporting code 2011-12-10 17:50:11 +00:00
9e73931c30 find-debuginfo-files: fix packaging of symlinks
Package only those /usr/lib/debug/* symlinks that complement the package
being processed and point to debuginfo regular files which are going to
be packaged along with these symlinks.

The most obvious consequence of this change is that library symlinks for
use of ld(1) will not result to their
/usr/lib/debug/usr/lib*/libNAME.so.debug counterparts to be packaged.
2011-12-06 15:04:05 +00:00
bf54b11cf4 cpp.req: do not insist on trying c++ mode when c++ support is not installed
When plain cpp check fails, cpp.req tries to process the same file in
c++ mode, which requires c++ support to be installed.  As result, when
c++ support is not installed, cpp.req clutter the log with vain attempts
to process files in c++ mode.  This change reduces the noise by checking
whether c++ support is actually available.
2011-12-04 21:25:53 +00:00
016617f027 find-lang: handle more exotic GNOME help locale directories (ALT#26417) 2011-12-01 02:08:29 +00:00
Alexey Tourbin
7dea69eca4 brp-cleanup: perl cleanup routines moved to rpm-build-perl 2011-10-21 01:27:51 +04:00
19d7160080 find-lang: handle %_datadir/help/%lang/%name subdirectories (ALT#26417) 2011-10-10 21:54:07 +00:00
ae55da575e find-lang: add support for GNOME >= 3.2 help files location (ALT#26417) 2011-10-06 20:38:04 +00:00
Alexey Tourbin
4d747a6312 removed brp-strip & related macros 2011-09-23 03:36:28 +04:00
Alexey Tourbin
8af14dd777 cpp.req: track included files down to the first external file
Some header files have protection against being included into user
code directly.  This means that, when processing such files, cpp
is going to fail, and some dependencies probably will be missing.

/usr/include/gtk-2.0/gtk/gtkaccessible.h:
    20  #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
    21  #error "Only <gtk/gtk.h> can be included directly."
    22  #endif
    23
    24  #ifndef __GTK_ACCESSIBLE_H__
    25  #define __GTK_ACCESSIBLE_H__
    26
    27  #include <atk/atk.h>
    28  #include <gtk/gtkwidget.h>

To remedy the problem, we should, as per the above example, process
gtk/gtk.h dependencies recursively.  Dependencies which we now attribute
to gtk/gtk.h are: 1) files which are packaged within the same subpackage
- these dependencies will be optimized out later by rpm; 2) the first
file not packaged into this subpackage, which is atk/atk.h.  Files below
atk/atk.h are not processed.

    Packaged?     Stack
                +---------------------+
        +       | gtk/gtk.h           |
                +---------------------+
        +       | gtk/gtkaccessible.h | <- SPmark
                +---------------------+
        -       | atk/atk.h           |
                +---------------------+
                | ...                 |

Also note that packaged files in cpp output should not be identified by
filenames, since filenames in the output will be possibly non-canonical.
Therefore I use standard unix technique to identify files by (dev,ino).

/usr/include/boost/spirit/home/support/detail/lexer/containers/ptr_vector.hpp:
     9  #include "../size_t.hpp"
2011-09-22 03:08:14 +04:00
Alexey Tourbin
cf9820cea4 cpp.req: simplify filename handling in cpp output 2011-09-22 03:08:11 +04:00
Alexey Tourbin
3d7945aad6 scripts: introduced tmpdir.sh 2011-09-22 02:58:59 +04:00