Chromium Code Reviews| Index: cloud_print/virtual_driver/posix/linux_packaging/build.sh |
| diff --git a/cloud_print/virtual_driver/posix/linux_packaging/build.sh b/cloud_print/virtual_driver/posix/linux_packaging/build.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..ce3f1fec5b4e3ad15ba2a2e5f2fef5ce32b6f88a |
| --- /dev/null |
| +++ b/cloud_print/virtual_driver/posix/linux_packaging/build.sh |
| @@ -0,0 +1,62 @@ |
| +#!/bin/bash |
| +# |
| +# Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +set -u |
| +set -e |
| + |
| +# Change to directory in which we are located. |
| +SCRIPTDIR=$(readlink -f "$(dirname "$0")") |
| + |
| +PACKAGE_NAME="gcpdriver" |
| + |
| +cd $SCRIPTDIR |
|
Scott Byer
2011/08/16 23:31:25
move this up to after SCRIPTDIR assignment, to kee
abeera
2011/08/16 23:55:03
Done.
|
| + |
| +##clean up any old data completely |
|
Scott Byer
2011/08/16 23:31:25
nit:extra hash, no space
abeera
2011/08/16 23:55:03
Done.
|
| +rm -rf debian |
| + |
| +# Target architecture to same as build host. |
| +if [ "$(uname -m)" = "x86_64" ]; then |
| + TARGETARCH="amd64" |
| +else |
| + TARGETARCH="i386" |
| +fi |
| + |
|
Scott Byer
2011/08/16 23:31:25
nit: extra line
abeera
2011/08/16 23:55:03
Done.
|
| + |
| +#Set up the required directory structure |
|
Scott Byer
2011/08/16 23:31:25
nit: here and elsewhere, space after hash
abeera
2011/08/16 23:55:03
Done.
|
| +mkdir -p debian/usr/lib/cups/backend |
| +mkdir -p debian/usr/share/ppd/GCP |
| +mkdir -p debian/usr/share/doc/$PACKAGE_NAME |
| +mkdir -p debian/DEBIAN |
| +chmod 755 debian/DEBIAN |
| + |
| +#Copy files to the correct location |
| +mv postinst debian/DEBIAN |
|
Scott Byer
2011/08/16 23:31:25
Aren't these going to want to be copies instead? W
|
| +mv postrm debian/DEBIAN |
| +mv prerm debian/DEBIAN |
| +mv GCP-driver.ppd debian/usr/share/ppd/GCP |
| +echo "Architecture:${TARGETARCH}" >> debian/DEBIAN/control |
| +cat control >> debian/DEBIAN/control |
| +mv changelog debian/usr/share/doc/$PACKAGE_NAME/ |
| +gzip --best -f debian/usr/share/doc/$PACKAGE_NAME/changelog |
| +mv copyright debian/usr/share/doc/$PACKAGE_NAME/ |
| +mv GCP-driver debian/usr/lib/cups/backend |
| + |
| +#Set permissions as required to roll package |
| +chmod 755 debian/DEBIAN/postinst |
| +chmod 755 debian/DEBIAN/postrm |
| +chmod 755 debian/DEBIAN/prerm |
| +chmod -R 755 debian/usr |
| +chmod 644 debian/usr/share/doc/$PACKAGE_NAME/* |
| +chmod 644 debian/usr/share/ppd/GCP/GCP-driver.ppd |
| + |
| +#Actually roll the package and rename |
| +fakeroot dpkg-deb --build debian |
| +mv debian.deb gcp-driver.deb |
| + |
| +##Clean up |
| +rm -rf debian |
| +rm control |
| + |