Commit Graph

1000 Commits

Author SHA1 Message Date
Alexey Tourbin
2ae82b0a11 pkgconfiglib.req: also check *.a static libraries 2007-10-16 14:47:34 +04:00
Alexey Tourbin
02e9558ab6 pkgconfiglib.req: checking -rpath is wrong; back to --libs-only-l and --libs-only-L
Contrary to my quick ld(1) interpretation, -rpath option does not really
adjust search path directories.

$ gcc ldtest.c -Wl,-rpath,/usr/lib/gcj-4.1 -ljvm
/usr/bin/ld: cannot find -ljvm
$ gcc ldtest.c -L/usr/lib/gcj-4.1 -ljvm
$

Also note that checking for empty pkg-config output is not realiable:

$ echo "^$(pkg-config --libs-only-l /usr/share/pkgconfig/gtk-doc.pc)\$"
^ $
$
2007-10-16 14:39:28 +04:00
Alexey Tourbin
ae2da665dd pkgconfiglib.req: set up libs= and libdirs= from $pcLibs; consider -Wl,rpath,... 2007-10-16 13:17:39 +04:00
Alexey Tourbin
195dc1f785 pkgconfiglib.req: use 'gcc -print-search-dirs' to set up gcc_libdirs 2007-10-13 22:35:24 +04:00
Alexey Tourbin
a05a5f4f6b pkgconfiglib.req: restored 2007-10-13 21:08:29 +04:00
Alexey Tourbin
d601c3e625 shell.req (ShellReqEND): still check if executable candidates are available
$ cat test1.sh test2.sh
mail
mail() { :; }
$ scripts/shell.req.in test1.sh test2.sh
shell.req.in: /home/at/git.alt/rpm/test1.sh: mail() is possibly defined in /home/at/git.alt/rpm/test2.sh
shell.req.in: /home/at/git.alt/rpm/test1.sh: mail() has execuatable candidate: mail -> /bin/mail (skip)
$
2007-10-09 17:00:25 +04:00
Alexey Tourbin
3064082899 find-package (FindByName): better check for maybe_function 2007-10-09 12:30:05 +04:00
Alexey Tourbin
638b19576a shell.req: aded comment to ShellReqEND 2007-10-09 00:51:29 +04:00
Alexey Tourbin
f7e409e475 shell.req: AddReq/AddProv: factored common code 2007-10-09 00:22:42 +04:00
Alexey Tourbin
6ead9f4389 shell.req: updated /.provides.sh code 2007-10-08 02:42:27 +04:00
Alexey Tourbin
a39795104e shell.req: reworked without temporary files 2007-10-08 02:10:53 +04:00
Alexey Tourbin
d77304d084 shell.req: fixed bug: read does need final newline 2007-10-08 01:22:37 +04:00
Alexey Tourbin
45ac74978f shell.req: renamed "reqs" varible to "out" 2007-10-08 01:08:33 +04:00
Alexey Tourbin
28b996a376 shell.req: consider removing "function" from alias|builtin check 2007-10-08 01:04:26 +04:00
Alexey Tourbin
28850f17b5 shell.req: fold dups after CleanupRpmRequires 2007-10-08 00:54:23 +04:00
Alexey Tourbin
536241cbbe shell.req (CleanupRpmRequires): allow e.g. executable(\ls) and executable("ls") 2007-10-08 00:40:15 +04:00
Alexey Tourbin
66df05529b shell.req: moved alias|builtin check into CleanupRpmRequires 2007-10-08 00:39:03 +04:00
Alexey Tourbin
a90f03397c shell.req: cleanup and validate "$sh --rpm-requires" output 2007-10-07 23:07:11 +04:00
Alexey Tourbin
4a8997aa6f pkgconfig.req: paranoid pkg-config output validation 2007-10-07 17:04:01 +04:00
Alexey Tourbin
566bc6ace5 shell.req: added early first pass for self-requires elimination 2007-10-03 14:33:21 +04:00
Alexey Tourbin
83fa94a314 shell.req: initial attempt to implement self-requires elimination 2007-10-03 14:04:25 +04:00
Alexey Tourbin
3fa83b4f4f pkgconfig.req: factored common code 2007-10-03 00:20:43 +04:00
Alexey Tourbin
318e056f29 4.0.4-alt78
- implemented modular subsystem for find-requires and find-provides;
  there's no separate doc yet, except for my protva2007-ru-short.pdf;
  see also git changelog, especially commit 9717c128
- improved /usr/lib/rpm/find-package algorithms
- shell.req: non-executable scripts are now processed as well as executable
  ones; also, more shebang variants are recognized, e.g. "#!/usr/bin/env bash"
- symlinks.req: new dependency generator for external symbolic links
- pkgconfig.req: pkg-config(1) errors no longer silently ignored
- rpm-build: decoupled rpm-build-tcl from the base build environment
2007-09-30 15:05:06 +04:00
Alexey Tourbin
7ee459ab6b pkgconfiglib.req: removed
'pkg-config --libs' seems to deploy dependencies recursively,
which is what I did not expect.

$ grep Requires pango.pc
Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0
$ grep Lib pango.pc
Libs: -lpango-1.0 -lm
$ pkg-config --libs-only-l pango.pc
-lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
$

I need some time to devise a better implementation.
2007-09-30 14:59:22 +04:00
Alexey Tourbin
517efb4b7d pkgconfiglib.req: allow absolute symbolic links under RPM_BUILD_ROOT 2007-09-29 16:46:28 +04:00
Alexey Tourbin
9b744d4512 pkgconfig.req.files: don't warn on symbolic links 2007-09-29 14:31:09 +04:00
Alexey Tourbin
3309458461 4.0.4-alt78
- implemented modular subsystem for find-requires and find-provides;
  there's no separate doc yet, except for my protva2007-ru-short.pdf;
  see also git changelog, especially commit 9717c128
- improved /usr/lib/rpm/find-package algorithms
- shell.req: non-executable scripts are now processed as well as executable
  ones; also, more shebang variants are recognized, e.g. "#!/usr/bin/env bash"
- symlinks.req: new dependency generator for external symbolic links
- pkgconfig.req: pkg-config(1) errors no longer silently ignored
- pkgconfiglib.req: new dependency analyzer for "Libs" field in *.pc files;
  maps e.g. "-lfoo" -> /usr/lib/libfoo.so -> libfoo-devel
2007-09-24 21:44:26 +04:00
Alexey Tourbin
bdbafde580 Merge branch 'altlinux-4.0' of git.alt:/people/ldv/packages/rpm into mod
Also immediately fixup last changelog entry date, to preserve the order.

Conflicts:

	rpm-4_0.spec
	scripts/find-package.in
2007-09-24 21:15:02 +04:00
Alexey Tourbin
385ae84711 spec: rpm-build: decoupled rpm-build-tcl
There's been some discussion on the list as to which rpm-build-*
packages rpm-build should depend on.

The upshot is this:

1) The language should be widely used, and its scripts should
be found in a number of packages not specific to the language
(e.g. packages which do not require %name-devel for build).

2) rpm-build-%name scripts, along with finding dependencies,
should have the effect of syntax check.  This is what makes
them beneficial for all packages, and this is the reason why
rpm-build should pick up such rpm-build-%name package.

Now I think that Tcl fails both points.  Current tcl.req analyzer
simply cannot process Tcl scripts reliably, only Tcl modules.
But Tcl modules are certainly specific to the Tcl language,
and building Tcl modules apparently should involve tcl-devel.
I have just added rpm-build-tcl dependency to tcl-devel.

If too many Tcl packages break because of this change,
which is not likely, I can re-add rpm-build-tcl dependency here.
However, this will also enroll tcl into the base build system.
2007-09-24 16:49:54 +04:00
Alexey Tourbin
b653a847dc spec: do not package Specfile.pm
This Specfile.pm file is not usable anyway -- its path should match
at least */RPM/Specfile.pm.  And now we have perl-RPM-Specfile package.
2007-09-24 16:06:12 +04:00
Alexey Tourbin
fddaf81544 functions (SetupMethods): "[!" in shell pattern is better than "[^" 2007-09-24 03:14:24 +04:00
Alexey Tourbin
5844214067 shell.req: find re-exec interpreter only if the script is executable 2007-09-24 02:59:25 +04:00
Alexey Tourbin
8ee696768c shebang.req.files: added "executable not executable" warning 2007-09-24 02:57:42 +04:00
Alexey Tourbin
7d68978688 find-package (FindByPath): ignore /dev/* /proc/* /sys/* dependencies 2007-09-23 01:23:34 +04:00
Alexey Tourbin
d9b38d645f find-package (FindByPath): render $RPM_BUILD_DIR* dependencies invalid 2007-09-21 15:58:05 +04:00
Alexey Tourbin
8dd5a961e8 find-package (FindByPath): consider (not-so-) broken symbolic links inside RPM_BUILD_ROOT 2007-09-19 14:16:01 +04:00
Alexey Tourbin
d74f8d9a69 find-package (findByName): replaced /usr/bin/which with custom shell code
This is to address a few problems:

1) When checking RPM_BUILD_ROOT, st_mode test performed by /usr/bin/which
is not quite reliable.  Files can be packaged with different %attr mode.

2) When checking RPM_BUILD_ROOT, there could be symbolic links there
which are (not-so-) broken.

3) When checking host system, files like /sbin/init (which is 0700)
are effectively bypassed by /usr/bin/which.

4) There's an ongoing practice of placing shell function libraries
under /usr/bin, e.g. /usr/bin/git-sh-setup.  These files are sourced
from within shell scripts and need not be executable at all.

This leads me to the point that permission check, which is performed by
/usr/bin/which, is not needed at all.  Note that things are getting more like
contents_index_bin search.  And for RPM_BUILD_ROOT, we do not even require
strong stat-wise file existence.

I like this new term: "strong stat-wise file existence".
It's awesome.
2007-09-19 12:57:08 +04:00
Alexey Tourbin
3925c4c392 find-package (FindByName): manage "not found" verbosity 2007-09-19 11:08:53 +04:00
Alexey Tourbin
a1e07a6d21 find-package (FindByName): added sbin-ish paths under /etc 2007-09-19 10:33:12 +04:00
Alexey Tourbin
d03deaf0fa find-package: implemented different PATHs for user and root code (the */sbin scripts)
also appended /usr/games to both user and root PATHs
2007-09-19 00:17:53 +04:00
Alexey Tourbin
b0190e3888 lib.prov: fixed DEF_RPM_FINDPROV_LIB_PATH 2007-09-16 17:31:49 +04:00
Alexey Tourbin
7ece64adc3 find-package (FindPackage): unquoted $valid case paterns 2007-09-12 20:07:43 +04:00
Alexey Tourbin
e5f015d831 find-package (FindPackage): fixed shell syntax (D'oh!) 2007-09-12 19:34:01 +04:00
Alexey Tourbin
4eb4ccf490 find-package: fixed Verbose message for contents_index_bin 2007-09-12 19:28:46 +04:00
Alexey Tourbin
2b1c36538f find-package: implemented protection against shell metacharacters and evil paths
There are two possibilities for protection:
1) we should protect at least from very evil shell metacharacters,
like [$*], and also from [:cntrl:] (e.g. newline).
2) we can provide an exhaustive list of characters that are valid
for non-evil pathnames and commands, and issue mandatory warning
if the command or path appears to be evil.

I chose the latter approach.
Valid character range is 'A-Za-z0-9/@=.,:_+-'.

Note that (almost) all files from our base build system
are valid paths:

$ valid='A-Za-z0-9/@=.,:_+-'
$ hsh-run -- rpm -qal |grep "[^$valid]"
/usr/bin/[
/usr/share/man/man1/[.1.bz2
(contains no files)
(contains no files)
$

Later we'll see if the range of valid characters needs to be extended.
2007-09-10 13:32:26 +04:00
Alexey Tourbin
9196764224 pkgconfiglib.req: better error message 2007-08-29 02:19:10 +04:00
Alexey Tourbin
cc20bfa4b1 pkgconfiglib.req: use CanonPath for libdir before rpmquery 2007-08-29 01:59:16 +04:00
427194b25b 4.0.4-alt77.M40.1
- rpmdb/header.c (guess_category_value):
  Allowed overriding locale using $RPM_LANGUAGE_I18NSTRING for header FindI18NString.
- build.c (buildForTarget):
  Changed to pass --wildcards to tar on build from tarball (RH#206841).
- GROUPS: Added "System/Legacy libraries" (#12629).
- scripts/find-package.in (FindPackage):
  Speedup index processing order by checking binary index prior to complete index.
2007-08-28 16:59:22 +00:00
Alexey Tourbin
0e085c0a83 pkgconfiglib.req: new pkgconfig.req mode (makes dependencies on Libs)
This will grab libraries from ^Libs: clause and map each library
to rpm dependency, which is typically lib*-devel package.

$ grep ^Libs: /usr/lib/pkgconfig/directfb.pc
Libs: -ldirectfb -lpthread -ldl -lz
$

It works like this:

$ ln -s pkgconfig.req.in scripts/pkgconfiglib.req.in
$ scripts/pkgconfiglib.req.in -v /usr/lib/pkgconfig/directfb.pc
pkgconfiglib.req.in: /usr/lib/pkgconfig/directfb.pc: libdirectfb.so -> libdirectfb-devel
libdirectfb-devel
pkgconfiglib.req.in: /usr/lib/pkgconfig/directfb.pc: libz.so -> zlib-devel
zlib-devel
pkgconfiglib.req.in: /usr/lib/pkgconfig/directfb.pc: libfusion.so -> libdirectfb-devel
libdirectfb-devel
pkgconfiglib.req.in: /usr/lib/pkgconfig/directfb.pc: libdirect.so -> libdirectfb-devel
libdirectfb-devel
pkgconfiglib.req.in: /usr/lib/pkgconfig/directfb.pc: libpthread.so -> glibc-devel (skip)
pkgconfiglib.req.in: /usr/lib/pkgconfig/directfb.pc: libdl.so -> glibc-devel (skip)
$

Some minor problems:

$ scripts/pkgconfiglib.req.in /usr/lib/pkgconfig/*.pc >/dev/null
pkgconfiglib.req.in: /usr/lib/pkgconfig/avahi-qt3.pc: cannot find libavahi-qt3.so library path (skip)
pkgconfiglib.req.in: /usr/lib/pkgconfig/libgdiplus.pc: cannot find libexif.so library path (skip)
pkgconfiglib.req.in: /usr/lib/pkgconfig/valgrind.pc: cannot find libcoregrind.so library path (skip)
pkgconfiglib.req.in: /usr/lib/pkgconfig/valgrind.pc: cannot find libvex.so library path (skip)
pkgconfiglib.req.in: /usr/lib/pkgconfig/valgrind.pc: cannot find libgcc.so library path (skip)
$
2007-08-28 20:40:22 +04:00
Alexey Tourbin
63ac11f82e pkgconfig.req: better diagnostics
(old)
$ /usr/lib/rpm/pkgconfig.req /usr/lib/pkgconfig/gtkextra-2.0.pc
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-2.0', required by 'GtkExtra', not found
$

(new)
$ scripts/pkgconfig.req.in /usr/lib/pkgconfig/gtkextra-2.0.pc
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-2.0', required by 'GtkExtra', not found
pkgconfig.req.in: failed to process /usr/lib/pkgconfig/gtkextra-2.0.pc
$
2007-08-28 18:52:13 +04:00