toolkit/crashreporter/google-breakpad/src/third_party/glog/packages/rpm.sh

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rwxr-xr-x

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 #!/bin/sh -e
     3 # Run this from the 'packages' directory, just under rootdir
     5 # We can only build rpm packages, if the rpm build tools are installed
     6 if [ \! -x /usr/bin/rpmbuild ]
     7 then
     8   echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2
     9   exit 0
    10 fi
    12 # Check the commandline flags
    13 PACKAGE="$1"
    14 VERSION="$2"
    15 fullname="${PACKAGE}-${VERSION}"
    16 archive=../$fullname.tar.gz
    18 if [ -z "$1" -o -z "$2" ]
    19 then
    20   echo "Usage: $0 <package name> <package version>" 1>&2
    21   exit 0
    22 fi
    24 # Double-check we're in the packages directory, just under rootdir
    25 if [ \! -r ../Makefile -a \! -r ../INSTALL ]
    26 then
    27   echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2
    28   echo "Also, you must run \"make dist\" before running this script." 1>&2
    29   exit 0
    30 fi
    32 if [ \! -r "$archive" ]
    33 then
    34   echo "Cannot find $archive. Run \"make dist\" first." 1>&2
    35   exit 0
    36 fi
    38 # Create the directory where the input lives, and where the output should live
    39 RPM_SOURCE_DIR="/tmp/rpmsource-$fullname"
    40 RPM_BUILD_DIR="/tmp/rpmbuild-$fullname"
    42 trap 'rm -rf $RPM_SOURCE_DIR $RPM_BUILD_DIR; exit $?' EXIT SIGHUP SIGINT SIGTERM
    44 rm -rf "$RPM_SOURCE_DIR" "$RPM_BUILD_DIR"
    45 mkdir "$RPM_SOURCE_DIR"
    46 mkdir "$RPM_BUILD_DIR"
    48 cp "$archive" "$RPM_SOURCE_DIR"
    50 rpmbuild -bb rpm/rpm.spec \
    51   --define "NAME $PACKAGE" \
    52   --define "VERSION $VERSION" \
    53   --define "_sourcedir $RPM_SOURCE_DIR" \
    54   --define "_builddir $RPM_BUILD_DIR" \
    55   --define "_rpmdir $RPM_SOURCE_DIR"
    57 # We put the output in a directory based on what system we've built for
    58 destdir=rpm-unknown
    59 if [ -r /etc/issue ]
    60 then
    61    grep "Red Hat.*release 7" /etc/issue >/dev/null 2>&1 && destdir=rh7
    62    grep "Red Hat.*release 8" /etc/issue >/dev/null 2>&1 && destdir=rh8
    63    grep "Red Hat.*release 9" /etc/issue >/dev/null 2>&1 && destdir=rh9
    64    if grep Fedora /etc/issue >/dev/null; then 
    65 	destdir=fc`grep Fedora /etc/issue | cut -d' ' -f 4`;
    66    fi
    67 fi
    69 rm -rf "$destdir"
    70 mkdir -p "$destdir"
    71 # We want to get not only the main package but devel etc, hence the middle *
    72 mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm "$destdir"
    74 echo
    75 echo "The rpm package file(s) are located in $PWD/$destdir"

mercurial