Commit Graph

1170 Commits

Author SHA1 Message Date
Alexey Tourbin
2bf12baa21 find-package (FindByPath): implemented smart check for alternatives, cf. bug #13374
Some examples.

1)
$ sh -efu -c '. scripts/find-package.in; FindPackage script /usr/share/libtool'
/usr/share/libtool
$ sh -efu -c '. scripts/find-package.in; FindPackage script /usr/share/libtool/'
/usr/share/libtool
$

This shows that alterntaives check is no longer restricted to deficient
	readlink "$rep" |grep '^/etc/alternatives/'
logic.  Old behaviour was:

$ sh -efu -c '. /usr/lib/rpm/find-package; FindPackage script /usr/share/libtool'
/usr/share/libtool
$ sh -efu -c '. /usr/lib/rpm/find-package; FindPackage script /usr/share/libtool/'
sh: script: checking contents_index_all for /usr/share/libtool-1.5
sh: script: /usr/share/libtool-1.5 -> libtool_1.5 (via contents_index_all)
libtool_1.5
$

2)
$ sh -efu -c '. scripts/find-package.in; FindPackage script /usr/share/libtool/../autoconf'
/usr/share/autoconf
/usr/share/libtool
$

This shows that any number of alternatives can be resolved within a single path.

3)
$ sh -efu -c '. scripts/find-package.in; FindPackage script /usr/share/libtool/config.guess'
/usr/share/libtool
sh: script: alternative /usr/share/libtool prevents /usr/share/libtool/config.guess resolution
$

This shows that we cannot resolve paths under alternatives directory.

4)
$ sh -efu -c '. scripts/find-package.in; FindPackage script /usr/share/libtool/../../bin/perl'
/usr/share/libtool
perl-base
$

This shows that we actually CAN resolve paths which are not under alternatives directory.
2007-11-17 15:04:06 +03:00
Alexey Tourbin
347a9eb418 symlinks.req: do only one single step of symlink resolution 2007-11-17 10:52:57 +03:00
745b1ae3e0 4.0.4-alt80
- Merged ARM support changes made by Kirill Shutemov.
- Minor scripts/* cleanup.
2007-11-10 20:47:04 +00:00
b29c6e2b2d scripts/pam.*.files: Optimize filename check 2007-11-10 20:47:03 +00:00
5209355a19 scripts/*.req.files: Fix "not executable" wording 2007-11-10 20:47:02 +00:00
66ee80b813 scripts/*.files: Use single quotes for constant strings 2007-11-10 20:47:01 +00:00
5b9096b561 scripts/*.in: s|/usr/lib/rpm/|@RPMCONFIGDIR@/|g 2007-11-10 20:46:59 +00:00
5e023d62c1 scripts/functions: Minor code cleanup
Fatal, Verbose, Debug: Use Info().
ValidateBuildRoot: Use single quotes for constant string.
SetupMethods: Do not initialize loop variable. Use "tr -s".
RunMethods: Do not initialize loop variable. Use "echo ''" trick. Cleanup "$@" use.
ArgvFileAction: Do not initialize auto variable.
2007-11-10 20:46:29 +00:00
e6d18b0591 Merge branch 'altlinux-4.0' 2007-11-10 13:27:49 +00:00
Kirill A. Shutemov
629b4b18bc Add armv5tejl support 2007-11-10 13:26:47 +00:00
Kirill A. Shutemov
80426c365f rpmrc.in: remove -fsigned-char from optflags for arm* 2007-11-10 13:26:46 +00:00
Kirill A. Shutemov
f002179ab8 Refresh ARM support
Add arm and armb CANONARCH: common CANONARCH for general purpose distribution. It's armv4 without Thumb now.
Update %optflags for ARM
Add %arm macros: list of all ARM processors
2007-11-10 13:26:45 +00:00
Kirill A. Shutemov
06eb5ce9e7 Do not check STACK entry in ARM ELF files 2007-11-10 13:26:44 +00:00
a6f4e2a41e More %_target_platform tweaks: cleanup build_os filter; initialize %_gnueabi; replace %_gnu with %_gnueabi in %_target_platform 2007-11-10 13:26:21 +00:00
Kirill A. Shutemov
ddab849441 - %_gnu appended to %_target_platform
- %_gnu is -gnueabi for gnueabi targets
2007-11-10 15:45:30 +03:00
Alexey Tourbin
35ddf662d8 4.0.4-alt79
- shell.req: implemented strong self-requires elimination within
  a package; if ANY shell script defines function "foo", dependencies
  on "foo" are discarded in all shell scripts throughout the package;
  a warning is issued if e.g. /usr/bin/foo executable is available
- pkgconfiglib.req: new dependency generator for "Libs" field in *.pc
  files; maps e.g. "-lfoo" -> /usr/lib/libfoo.so -> libfoo-devel
2007-10-29 17:16:14 +03:00
Alexey Tourbin
488d03d395 pkgconfiglib.req: downgraded a few Verbose messages to Debug 2007-10-29 14:55:54 +03:00
Alexey Tourbin
e247bb88db enabled pkgconfiglib.req 2007-10-29 14:21:47 +03:00
Alexey Tourbin
68bf0157e9 shell.req (ShellReq): still check if executable candidates are available, even in the first pass
$ cat test.sh
rsync() { command rsync -vP "$@" ; }
$ scripts/shell.req.in test.sh
shell.req.in: /home/at/git.alt/rpm/test.sh: rsync() is possibly used before its definition
shell.req.in: /home/at/git.alt/rpm/test.sh: rsync() has execuatable candidate: rsync -> rsync (skip)
$
2007-10-29 13:36:36 +03:00
Alexey Tourbin
3f1e70716d pkgconfiglib.req: use "pkg-config --disable-recursion" to get libs and libdirs 2007-10-29 12:29:04 +03:00
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