# 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
}
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"}
# 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)}
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
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
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} \
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}