SHA256
1
0
forked from pool/rpmlint
rpmlint/libtool-wrapper-check.diff

43 lines
1.7 KiB
Diff

--- BinariesCheck.py
+++ BinariesCheck.py
@@ -165,6 +165,7 @@
is_elf = string.find(i[1], 'ELF') != -1
is_ar = string.find(i[1], 'current ar archive') != -1
is_ocaml_native = string.find(i[1], 'Objective caml native') != -1
+ is_shell = string.find(i[1], "shell script") != -1
is_binary = is_elf or is_ar or is_ocaml_native
if is_binary:
@@ -278,6 +279,16 @@
printError(pkg, 'invalid-directory-reference', i[0],
'(line %s)' % ", ".join(lines))
+ if is_shell:
+ count= 0
+ for l in file(pkg.dirName() + i[0], "r"):
+ count = count + 1
+ if (l.find("This wrapper script should never be moved out of the build directory") != -1):
+ printError(pkg, 'libtool-wrapper-in-package', i[0])
+ break
+ if (count > 20):
+ break;
+
if has_lib != []:
if exec_files != []:
for f in exec_files:
@@ -341,6 +352,14 @@
Another common mistake that causes this problem is linking with
``gcc -Wl,-shared'' instead of ``gcc -shared''.''',
+'libtool-wrapper-in-package',
+'''Your package contains a libtool wrapper shell script. This
+will not work. Instead of install'ing the libtool wrapper file,
+run
+
+libtool --mode=install install -m perm <file> <dest>
+
+to install the relinked file.''',
'binary-or-shlib-defines-rpath',
'''The binary or shared library defines `RPATH'. Usually this is a
bad thing because it hardcodes the path to search libraries and so