]> git.pld-linux.org Git - packages/chromium-browser.git/commitdiff
launcher: inline commandline options help from manpage
authorElan Ruusamäe <glen@delfi.ee>
Tue, 12 Feb 2013 11:50:51 +0000 (13:50 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 12 Feb 2013 11:50:51 +0000 (13:50 +0200)
chromium-browser.sh
chromium-browser.spec

index 8146f91e40f72847725a6ce3fa46ebdf1e756b92..8aa1e380ea2393642ee035ffd55a741b5350af0e 100755 (executable)
@@ -6,7 +6,7 @@ GDB=/usr/bin/gdb
 # Allow the user to override command-line flags, http://bugs.gentoo.org/357629
 # This is based on Debian's chromium-browser package, and is intended
 # to be consistent with Debian.
-if [ -f /etc/$APPNAME/default ] ; then
+if [ -f /etc/$APPNAME/default ]; then
        . /etc/$APPNAME/default
 fi
 
@@ -16,15 +16,18 @@ die() {
 }
 
 usage() {
-       echo "$APPNAME [-h|--help] [-g|--debug] [--temp-profile] [options] [URL]"
-       echo
-       echo "        -g or --debug           Start within $GDB"
-       echo "        -h or --help            This help screen"
-       echo "        --temp-profile          Start with a new and temporary profile"
-       echo
-       echo "Other supported options are:"
-       MANWIDTH=80 man $APPNAME | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
-       echo "See 'man $APPNAME' for more details"
+       cat <<EOF
+$APPNAME [-h|--help] [-g|--debug] [--temp-profile] [options] [URL]
+
+               -g or --debug           Start within $GDB
+               -h or --help            This help screen
+               --temp-profile          Start with a new and temporary profile
+
+Other supported options are:
+
+@OPTIONS@
+See 'man $APPNAME' for more details
+EOF
 }
 
 export LD_LIBRARY_PATH=$LIBDIR${LD_LIBRARY_PATH:+:"$LD_LIBRARY_PATH"}
@@ -46,7 +49,7 @@ fi
 
 # lsb_release is slow so try to source the static file /etc/lsb-release
 # instead, and fallback to lsb_release if we didn't get the information we need
-if [ -e /etc/lsb-release ] ; then
+if [ -e /etc/lsb-release ]; then
        . /etc/lsb-release
 fi
 DIST=${DISTRIB_ID:-$(lsb_release -si)}
@@ -109,7 +112,7 @@ if [ $want_temp_profile -eq 1 ]; then
 fi
 
 if [ $want_debug -eq 1 ]; then
-       if [ ! -x $GDB ] ; then
+       if [ ! -x $GDB ]; then
                die "Sorry, can't find usable $GDB. Please install it."
        fi
 
index 88d27fa69b40e4aec0843ad48caef162c70b2af9..43d55c33d6141f240650248049798e445d4d133f 100644 (file)
@@ -160,6 +160,7 @@ BuildRequires:      libstdc++-devel
 BuildRequires: libxml2-devel
 BuildRequires: libxslt-devel
 BuildRequires: lzma
+BuildRequires: man-db
 %{?with_system_minizip:BuildRequires:  minizip-devel}
 BuildRequires: nspr-devel
 BuildRequires: nss-devel >= 1:3.12.3
@@ -437,6 +438,10 @@ test -e Makefile || %{__python} build/gyp_chromium \
        CFLAGS="%{rpmcflags} %{rpmcppflags}" \
        CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
 
+cd ../out/%{!?debug:Release}%{?debug:Debug}
+MANWIDTH=80 man ./chrome.1 > man.out
+%{__sed} -e '1,/OPTIONS/d; /ENVIRONMENT/,$d' man.out > options.txt
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/{themes,plugins,extensions} \
@@ -445,7 +450,14 @@ install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/{themes,plugins,extensions} \
 cd out/%{!?debug:Release}%{?debug:Debug}
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/default
 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
-%{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
+%{__sed} -i -e '
+       s,@libdir@,%{_libdir}/%{name},
+
+       /@OPTIONS@/ {
+               r options.txt
+               d
+       }
+' $RPM_BUILD_ROOT%{_bindir}/%{name}
 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
This page took 0.027809 seconds and 4 git commands to generate.