Commit 7f1ac373 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Linux packager: Various manpage fixes

This CL:
* Fixes some manpage syntax.
* Compresses the manpages.
* Adds manpage entries for google-chrome-stable and google-chrome for
  the stable channel.
* Fixes a reference to google-chrome in the RPM spec.
* Handles rpmlint suppressions using a conf file instead of just
  filtering out what we don't want.

This fixes the following lint errors:
* lintian:
  * E: chromium-browser-stable: manpage-not-compressed
    usr/share/man/man1/chromium-browser.1
  * W: chromium-browser-stable: manpage-has-errors-from-man
    usr/share/man/man1/chromium-browser.1 1: warning: macro `"' not
    defined
* rpmlint:
  * chromium-browser-stable.x86_64: W: manpage-not-compressed bz2
    /usr/share/man/man1/chromium-browser.1
  * chromium-browser-stable.x86_64: W: manual-page-warning
    /usr/share/man/man1/chromium-browser.1 1: warning: macro `"' not
    defined
  * chromium-browser-stable.x86_64: W: no-manual-page-for-binary
    google-chrome
  * chromium-browser-stable.x86_64: W: no-manual-page-for-binary
    chromium-browser-stable

BUG=771373
R=thestig@chromium.org

Change-Id: I5d1921150945123b72b5f2a50714c3094a526648
Reviewed-on: https://chromium-review.googlesource.com/699855Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506477}
parent a8140751
." This file is processed to generate manpages in the
." build diretory.
.\" This file is processed to generate manpages in the
.\" build diretory.
.TH @@PACKAGE@@ 1 "" "" "USER COMMANDS"
.SH NAME
......
......@@ -294,8 +294,16 @@ stage_install_common() {
# documentation
process_template "${BUILDDIR}/installer/common/manpage.1.in" \
"${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1"
chmod 644 "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1"
"${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1"
gzip -9n "${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1"
chmod 644 "${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1.gz"
# The stable channel allows launching the app without the "-stable"
# suffix like the other channels. Create a linked man page for the
# app-without-the-channel case.
if [ ! -f "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1.gz" ]; then
ln -s "${USR_BIN_SYMLINK_NAME}.1.gz" \
"${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1.gz"
fi
# Check to make sure all the ELF binaries are stripped.
UNSTRIPPED=$(find "${STAGEDIR}/${INSTALLDIR}/" -type f | xargs file |
......@@ -323,7 +331,14 @@ stage_install_common() {
if [[ "${file_type}" = "directory"* ]]; then
local expected_perms=755
elif [[ "${file_type}" = *"symbolic link"* ]]; then
if [ ! -f "${STAGEDIR}/$(readlink "${file}")" ]; then
if [[ "$(readlink ${file})" = "/"* ]]; then
# Absolute symlink.
local expect_exists="${STAGEDIR}/$(readlink "${file}")"
else
# Relative symlink.
local expect_exists="$(dirname "${file}")/$(readlink "${file}")"
fi
if [ ! -f "${expect_exists}" ]; then
echo "Broken symlink: ${file}" 1>&2
exit 1
fi
......
......@@ -86,13 +86,15 @@ rm -rf "$RPM_BUILD_ROOT"
# Be explicit about the files we scatter throughout the system we don't
# accidentally "own" stuff that's not ours (crbug.com/123990).
/etc/cron.daily/@@PACKAGE@@
%ghost %attr(755,root,root) /usr/bin/google-chrome
%ghost %attr(755,root,root) /usr/bin/@@USR_BIN_SYMLINK_NAME@@
/usr/bin/@@USR_BIN_SYMLINK_NAME@@
/usr/share/appdata/@@PACKAGE@@.appdata.xml
/usr/share/applications/@@PACKAGE@@.desktop
/usr/share/gnome-control-center/default-apps/@@PACKAGE@@.xml
%docdir /usr/share/man/man1
/usr/share/man/man1/@@PACKAGE@@.1
# These two files will be the same on non-stable channels.
/usr/share/man/man1/@@PACKAGE@@.1.gz
/usr/share/man/man1/@@USR_BIN_SYMLINK_NAME@@.1.gz
#------------------------------------------------------------------------------
# Pre install script
......
......@@ -10,36 +10,8 @@ rpmlint.
import argparse
import os
import subprocess
import sys
SUPPRESSIONS = [
# Summary message that we would like to filter out.
'checked;',
# Google Chrome is not software available on a distro by default,
# so installing to /opt is correct behavior.
'dir-or-file-in-opt',
# Development builds won't be signed.
'no-signature',
# The setuid sandbox has permissions 4755.
'non-standard-executable-perm',
# The setuid sandbox is a setuid binary.
'setuid-binary',
# Some nacl binaries are statically linked but don't have "static"
# in their name.
'statically-linked-binary'
]
def line_is_suppressed(line):
global SUPPRESSIONS
if line == '':
return True
for suppression in SUPPRESSIONS:
if suppression in line:
return True
return False
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
parser = argparse.ArgumentParser()
parser.add_argument('package', help='path/to/package.rpm')
......@@ -48,12 +20,10 @@ package = os.path.abspath(args.package)
cmd = [
'rpmlint',
'-f',
os.path.join(SCRIPT_DIR, 'rpmlint.conf'),
'-o',
'CompressExtension \'gz\'',
str(package),
]
rpmlint = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, _ = rpmlint.communicate()
filtered = '\n'.join(
[line for line in stdout.split('\n') if not line_is_suppressed(line)])
if filtered != '':
print filtered
sys.exit(filtered != '')
subprocess.check_call(cmd)
# Google Chrome is not software available on a distro by default, so
# installing to /opt is correct behavior.
addFilter("E: dir-or-file-in-opt*")
# Development builds won't be signed.
addFilter("E: no-signature*")
# The setuid sandbox has permissions 4755.
addFilter("E: non-standard-executable-perm*")
# The setuid sandbox is a setuid binary.
addFilter("E: setuid-binary*")
# Some nacl binaries are statically linked but don't have "static" in
# their name.
addFilter("E: statically-linked-binary*")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment