2002-03-25 23:16:26 +03:00
# Makefile for rpm scripts.
AUTOMAKE_OPTIONS = 1.4 foreign
EXTRA_DIST = \
2008-10-19 23:16:42 +04:00
posttrans-filetriggers 0ldconfig.filetrigger \
2011-02-04 01:22:05 +03:00
debuginfo.req debuginfo.req.files debuginfo.prov debuginfo.prov.files \
moved functions and find-package from rpm-build to rpm, added .provides.sh
This will allow to relax rpm-build-* dependencies, hopefully without adding
new essential dependencies to rpm (note that rpm already depends on sh and
coreutils; now this also includes grep, and possibly should include sed,
awk, and gzip).
Consider mono-mcs package, which is mono C# compiler. Recently I added
dependency on rpm-build-mono to this package, to enable automatic support
for mono dependencies whenever mono compiler is used. Now the problem
is that rpm-build-mono depends on rpm-build (via /usr/lib/rpm/functions),
and rpm-build in turn requires a lot of packages, e.g. gcc and autotools,
for the purpose of populating base build environment.
To put it another way, the problem is that it is impossible to install
mono compiler (with automatic support for mono dependencies) without also
installing gcc and stuff, which is roughly 100M of unrelated packages.
This seems like a minor problem to me, since every "devel" package (including
compilers) can conventionally require base build environment. However,
Alexander Bokovoy argues that school kids desperately need mono-mcs compiler
on their desktops without gcc and another stuff from the base build environment!
The upshot is that possibly we want to relax rpm-build-* dependencies,
so that those "support for dependencies" packages do not require
full-fledged rpm-build. The easiest way to accomplish this is to
move /usr/lib/rpm/functions from rpm-build to rpm package. I also
choose to move /usr/lib/rpm/find-package as well, along with making
/usr/lib/rpm/.provides.sh, so that rpm-build-* packages depend on
something like /usr/lib/rpm(Fatal), not just rpm.
2007-11-20 08:45:08 +03:00
functions find-package .provides.sh \
2011-01-09 16:55:49 +03:00
find-debuginfo-files \
2008-01-25 22:01:10 +03:00
find-scriptlet-requires \
2002-03-26 00:51:30 +03:00
brp-adjust_libraries brp-alt brp-bytecompile_python \
2017-10-25 06:16:59 +03:00
brp-check_contents brp-cleanup brp-compress brp-debuginfo \
2012-01-25 18:23:12 +04:00
brp-fix-perms brp-fixup brp-hardlink_pyo_pyc \
2009-05-21 02:20:07 +04:00
brp-verify_elf brp-verify-info \
2011-01-15 10:58:41 +03:00
compress_files \
2008-03-17 23:30:44 +03:00
cpp.req cpp.req.files \
2009-09-29 15:06:06 +04:00
find-lang \
2003-11-26 12:01:23 +03:00
fixup-binconfig fixup-pkgconfig fixup-libtool fixup-libraries \
2011-05-14 01:43:39 +04:00
fixup-desktop fixup-desktop.awk \
2008-06-16 12:16:01 +04:00
files.req files.req.files 0common-files.req.list \
2016-12-06 20:08:14 +03:00
is_elf_so_executable \
2007-03-06 23:32:51 +03:00
ldd lib.req lib.req.files lib.prov lib.prov.files shlib.req.awk \
2009-09-29 16:19:33 +04:00
pam.req pam.req.files pam.prov pam.prov.files \
2016-04-05 21:57:18 +03:00
percolate \
2007-10-29 14:16:35 +03:00
pkgconfig.req pkgconfiglib.req pkgconfig.req.files \
2008-11-13 00:57:57 +03:00
rpmlib.req rpmlib.req.files \
2009-09-29 14:31:40 +04:00
rpm2cpio.sh \
factored shebang.req
This is the dependency generator for #! lines.
shebang.req.files makes sure that only executable scripts are processed.
Here is why I chose the "shebang" name.
From Jargon File (4.3.1, 29 Jun 2001) [jargon]:
shebang /sh*-bang/ n. The character sequence "#!" that frequently
begins executable shell scripts under Unix. Probably derived from "shell
bang" under the influence of American slang "the whole shebang"
(everything, the works).
$ cd /usr/lib/perl5/pod
$ grep -i sharpbang *
perltoc.pod:C<shar>, C<sharpbang>, C<shmattype>, C<shortsize>, C<shrpenv>, C<shsharp>,
$ grep -i shebang *
perl58delta.pod:The command-line options -s and -F are now recognized on the shebang
perlbs2000.pod:BS2000 POSIX doesn't support the shebang notation
perlfaq3.pod:batch file and codify it in C<ALTERNATE_SHEBANG> (see the
perlfaq7.pod:line in your perl script (the "shebang" line) does not contain the
perlfaq7.pod:where you expect it so you need to adjust your shebang line.
perlfaq8.pod:but my shebang line is not the path to perl, so the shell runs the
perlglossary.pod:=item shebang
perljp.pod: "shebang"ѹǡJperlѤscriptΤۤȤɤѹʤѲǽȻפޤ
perlplan9.pod:such as "#!/usr/local/bin/perl". This is known as a shebang
perlplan9.pod:shebang path from config information located in Plan 9
perlport.pod:sub-systems do not support the C<#!> shebang trick for script invocation.
perlport.pod:OS/390 will support the C<#!> shebang trick in release 2.8 and beyond.
perlrun.pod:C<ALTERNATE_SHEBANG> (see the F<dosish.h> file in the source
perltoc.pod:serialization, server, service, setgid, setuid, shared memory, shebang,
perlwin32.pod:Perl scripts on UNIX use the "#!" (a.k.a "shebang") line to
$
2007-03-06 02:20:57 +03:00
shebang.req shebang.req.files \
2007-03-06 00:40:45 +03:00
shell.req shell.req.files shell.prov shell.prov.files \
2007-03-07 12:36:29 +03:00
static.req static.req.files \
implemented symlinks.req
Consider R-devel package, which has its own private bin/ directory,
where it keeps certain scripts.
$ rpm -ql R-devel |grep libtool
/usr/lib/R/bin/libtool
$ rpm -ql R-devel |grep texi2dvi
/usr/lib/R/bin/texi2dvi
$
I replace some scripts, such as libtool, with wrappers:
$ tail -1 /usr/lib/R/bin/libtool
exec /usr/bin/libtool "$@"
$
R-devel now has a libtool dependency, generated by shell.req:
$ rpm -qR R-devel |grep libtool
libtool-common
$ rpm -qf /usr/bin/libtool
libtool-common-0.2-alt1
$
However, I want the very same dependency SIMPLY BY PLACING SYMBOLIC LINK
to /usr/bin/libtool. My new script symlinks.req implements this idea.
It works as follows:
1) We check all absolute symbolic links, e.g. -> /usr/bin/libtool.
If symbolic link is absolute, we fetch its value and feed to FindPackage.
Note that FindPackage will first check whether e.g. /usr/bin/libtool is
available under RPM_BUILD_ROOT.
2) We also check all broken symbolic links, e.g. -> ../../../bin/libtool.
The fact that symbolic link is broken means that it cannot be resolved into
buildroot and otherwise must be resolved in the host system after the package
is installed, which is the dependency on where it would point to after install.
This means we must canonicalize the link value, strip RPM_BUILD_ROOT,
and then call FindPackage. Here is what happens:
$ cd `mktemp -d`
$ RPM_BUILD_ROOT=$PWD
$ mkdir -p ./usr/lib/R/bin/
$ ln -s `relative /usr/bin/libtool /usr/lib/R/bin/libtool` $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
$ l $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
lrwxrwxrwx 1 at at 20 Mar 9 22:14 /tmp/.private/at/tmp.AHnBX26473/usr/lib/R/bin/libtool -> ../../../bin/libtool
$ [ -e $RPM_BUILD_ROOT/usr/lib/R/bin/libtool ] || echo broken
broken
$ readlink -vm $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
/tmp/.private/at/tmp.AHnBX26473/usr/bin/libtool
$ to=`!!`; echo ${to#$RPM_BUILD_ROOT}
/usr/bin/libtool
$
And then FindPackage is called with "/usr/bin/libtool".
Now note that if FindPackage is not able to associate e.g. /usr/bin/libtool
with any particular rpm package, it will just place raw dependency on
/usr/bin/libtool. So, this new type of dependencies is a bit dangerous:
basically for each really broken symbolic link there will be an unmet
dependency. On the other hand, this can be viewed as a means of protection
from packages with really broken symbolic links.
If you are frightened with this brand new and dangerous type of dependencies,
please also note that this new type of dependencies is not much more dangerous
than absolute paths to executables in plain shell scripts.
$ /usr/lib/rpm/shell.req -v /dev/stdin <<</i/am/unmet
error: file /i/am/unmet: No such file or directory
shell.req: /dev/stdin: /i/am/unmet -> /i/am/unmet (raw, not found)
/i/am/unmet
$
2007-03-09 21:11:03 +03:00
symlinks.req symlinks.req.files \
2011-09-22 00:43:46 +04:00
tmpdir.sh \
2009-09-29 14:31:40 +04:00
verify-elf
2002-03-25 23:16:26 +03:00
installprefix = $( DESTDIR)
all :
configdir = ${ prefix } /lib/rpm
2017-01-14 16:42:53 +03:00
config_DATA = 0common-files.req.list # .provides.sh
2002-03-25 23:16:26 +03:00
config_SCRIPTS = \
2011-02-04 01:22:05 +03:00
debuginfo.req debuginfo.req.files debuginfo.prov debuginfo.prov.files \
2011-01-09 16:55:49 +03:00
find-debuginfo-files \
2008-01-25 22:01:10 +03:00
find-scriptlet-requires \
2012-01-25 18:16:15 +04:00
brp-alt \
2011-01-15 10:58:41 +03:00
compress_files \
2008-03-17 23:30:44 +03:00
cpp.req cpp.req.files \
2009-09-29 15:06:06 +04:00
find-lang \
2003-11-26 12:01:23 +03:00
fixup-binconfig fixup-pkgconfig fixup-libtool fixup-libraries \
2011-05-14 01:43:39 +04:00
fixup-desktop fixup-desktop.awk \
2008-06-16 12:16:01 +04:00
files.req files.req.files \
2016-12-06 20:08:14 +03:00
is_elf_so_executable \
2007-03-06 23:32:51 +03:00
ldd lib.req lib.req.files lib.prov lib.prov.files shlib.req.awk \
2009-09-29 16:19:33 +04:00
pam.req pam.req.files pam.prov pam.prov.files \
2007-10-29 14:16:35 +03:00
pkgconfig.req pkgconfiglib.req pkgconfig.req.files \
2016-04-05 21:57:18 +03:00
percolate \
2008-11-13 00:57:57 +03:00
rpmlib.req rpmlib.req.files \
2009-09-29 14:31:40 +04:00
rpm2cpio.sh \
factored shebang.req
This is the dependency generator for #! lines.
shebang.req.files makes sure that only executable scripts are processed.
Here is why I chose the "shebang" name.
From Jargon File (4.3.1, 29 Jun 2001) [jargon]:
shebang /sh*-bang/ n. The character sequence "#!" that frequently
begins executable shell scripts under Unix. Probably derived from "shell
bang" under the influence of American slang "the whole shebang"
(everything, the works).
$ cd /usr/lib/perl5/pod
$ grep -i sharpbang *
perltoc.pod:C<shar>, C<sharpbang>, C<shmattype>, C<shortsize>, C<shrpenv>, C<shsharp>,
$ grep -i shebang *
perl58delta.pod:The command-line options -s and -F are now recognized on the shebang
perlbs2000.pod:BS2000 POSIX doesn't support the shebang notation
perlfaq3.pod:batch file and codify it in C<ALTERNATE_SHEBANG> (see the
perlfaq7.pod:line in your perl script (the "shebang" line) does not contain the
perlfaq7.pod:where you expect it so you need to adjust your shebang line.
perlfaq8.pod:but my shebang line is not the path to perl, so the shell runs the
perlglossary.pod:=item shebang
perljp.pod: "shebang"ѹǡJperlѤscriptΤۤȤɤѹʤѲǽȻפޤ
perlplan9.pod:such as "#!/usr/local/bin/perl". This is known as a shebang
perlplan9.pod:shebang path from config information located in Plan 9
perlport.pod:sub-systems do not support the C<#!> shebang trick for script invocation.
perlport.pod:OS/390 will support the C<#!> shebang trick in release 2.8 and beyond.
perlrun.pod:C<ALTERNATE_SHEBANG> (see the F<dosish.h> file in the source
perltoc.pod:serialization, server, service, setgid, setuid, shared memory, shebang,
perlwin32.pod:Perl scripts on UNIX use the "#!" (a.k.a "shebang") line to
$
2007-03-06 02:20:57 +03:00
shebang.req shebang.req.files \
2007-03-06 00:40:45 +03:00
shell.req shell.req.files shell.prov shell.prov.files \
2007-03-07 12:36:29 +03:00
static.req static.req.files \
implemented symlinks.req
Consider R-devel package, which has its own private bin/ directory,
where it keeps certain scripts.
$ rpm -ql R-devel |grep libtool
/usr/lib/R/bin/libtool
$ rpm -ql R-devel |grep texi2dvi
/usr/lib/R/bin/texi2dvi
$
I replace some scripts, such as libtool, with wrappers:
$ tail -1 /usr/lib/R/bin/libtool
exec /usr/bin/libtool "$@"
$
R-devel now has a libtool dependency, generated by shell.req:
$ rpm -qR R-devel |grep libtool
libtool-common
$ rpm -qf /usr/bin/libtool
libtool-common-0.2-alt1
$
However, I want the very same dependency SIMPLY BY PLACING SYMBOLIC LINK
to /usr/bin/libtool. My new script symlinks.req implements this idea.
It works as follows:
1) We check all absolute symbolic links, e.g. -> /usr/bin/libtool.
If symbolic link is absolute, we fetch its value and feed to FindPackage.
Note that FindPackage will first check whether e.g. /usr/bin/libtool is
available under RPM_BUILD_ROOT.
2) We also check all broken symbolic links, e.g. -> ../../../bin/libtool.
The fact that symbolic link is broken means that it cannot be resolved into
buildroot and otherwise must be resolved in the host system after the package
is installed, which is the dependency on where it would point to after install.
This means we must canonicalize the link value, strip RPM_BUILD_ROOT,
and then call FindPackage. Here is what happens:
$ cd `mktemp -d`
$ RPM_BUILD_ROOT=$PWD
$ mkdir -p ./usr/lib/R/bin/
$ ln -s `relative /usr/bin/libtool /usr/lib/R/bin/libtool` $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
$ l $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
lrwxrwxrwx 1 at at 20 Mar 9 22:14 /tmp/.private/at/tmp.AHnBX26473/usr/lib/R/bin/libtool -> ../../../bin/libtool
$ [ -e $RPM_BUILD_ROOT/usr/lib/R/bin/libtool ] || echo broken
broken
$ readlink -vm $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
/tmp/.private/at/tmp.AHnBX26473/usr/bin/libtool
$ to=`!!`; echo ${to#$RPM_BUILD_ROOT}
/usr/bin/libtool
$
And then FindPackage is called with "/usr/bin/libtool".
Now note that if FindPackage is not able to associate e.g. /usr/bin/libtool
with any particular rpm package, it will just place raw dependency on
/usr/bin/libtool. So, this new type of dependencies is a bit dangerous:
basically for each really broken symbolic link there will be an unmet
dependency. On the other hand, this can be viewed as a means of protection
from packages with really broken symbolic links.
If you are frightened with this brand new and dangerous type of dependencies,
please also note that this new type of dependencies is not much more dangerous
than absolute paths to executables in plain shell scripts.
$ /usr/lib/rpm/shell.req -v /dev/stdin <<</i/am/unmet
error: file /i/am/unmet: No such file or directory
shell.req: /dev/stdin: /i/am/unmet -> /i/am/unmet (raw, not found)
/i/am/unmet
$
2007-03-09 21:11:03 +03:00
symlinks.req symlinks.req.files \
2011-09-22 00:43:46 +04:00
tmpdir.sh \
2017-01-14 16:42:53 +03:00
verify-elf \
# 0ldconfig.filetrigger find-package functions posttrans-filetriggers
2007-08-28 18:05:30 +04:00
install-data-local :
2012-01-25 18:16:15 +04:00
$( mkinstalldirs) $( DESTDIR) $( configdir) /brp.d
$( INSTALL) -m755 brp-cleanup $( DESTDIR) $( configdir) /brp.d/008-cleanup.brp
$( INSTALL) -m755 brp-fix-perms $( DESTDIR) $( configdir) /brp.d/016-fix-perms.brp
$( INSTALL) -m755 brp-fixup $( DESTDIR) $( configdir) /brp.d/024-fixup.brp
2017-10-25 06:16:59 +03:00
$( INSTALL) -m755 brp-check_contents $( DESTDIR) $( configdir) /brp.d/028-check_contents.brp
2012-01-25 18:16:15 +04:00
$( INSTALL) -m755 brp-compress $( DESTDIR) $( configdir) /brp.d/032-compress.brp
$( INSTALL) -m755 brp-verify-info $( DESTDIR) $( configdir) /brp.d/040-verify-info.brp
$( INSTALL) -m755 brp-adjust_libraries $( DESTDIR) $( configdir) /brp.d/048-adjust_libraries.brp
$( INSTALL) -m755 brp-debuginfo $( DESTDIR) $( configdir) /brp.d/056-debuginfo.brp
$( INSTALL) -m755 brp-verify_elf $( DESTDIR) $( configdir) /brp.d/064-verify_elf.brp
$( INSTALL) -m755 brp-bytecompile_python $( DESTDIR) $( configdir) /brp.d/072-bytecompile_python.brp
2012-01-25 18:23:12 +04:00
$( INSTALL) -m755 brp-hardlink_pyo_pyc $( DESTDIR) $( configdir) /brp.d/128-hardlink_pyo_pyc.brp
2007-08-28 18:05:30 +04:00
@LN_S@ pkgconfig.req $( DESTDIR) $( configdir) /pkgconfig.prov
@LN_S@ pkgconfig.req.files $( DESTDIR) $( configdir) /pkgconfig.prov.files
2007-10-29 14:16:35 +03:00
@LN_S@ pkgconfig.req.files $( DESTDIR) $( configdir) /pkgconfiglib.req.files