OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 set -u |
| 8 set -e |
| 9 |
| 10 # Change to directory in which we are located. |
| 11 SCRIPTDIR=$(readlink -f "$(dirname "$0")") |
| 12 cd $SCRIPTDIR |
| 13 |
| 14 PACKAGE_NAME="gcpdriver" |
| 15 |
| 16 # Clean up any old data completely |
| 17 rm -rf debian |
| 18 |
| 19 # Target architecture to same as build host. |
| 20 if [ "$(uname -m)" = "x86_64" ]; then |
| 21 TARGETARCH="amd64" |
| 22 else |
| 23 TARGETARCH="i386" |
| 24 fi |
| 25 |
| 26 # Set up the required directory structure |
| 27 mkdir -p debian/usr/lib/cups/backend |
| 28 mkdir -p debian/usr/share/ppd/GCP |
| 29 mkdir -p debian/usr/share/doc/$PACKAGE_NAME |
| 30 mkdir -p debian/DEBIAN |
| 31 chmod 755 debian/DEBIAN |
| 32 |
| 33 # Copy files to the correct location |
| 34 # These files are copied in by the previous GYP target. |
| 35 mv postinst debian/DEBIAN |
| 36 mv postrm debian/DEBIAN |
| 37 mv prerm debian/DEBIAN |
| 38 mv GCP-driver.ppd debian/usr/share/ppd/GCP |
| 39 echo "Architecture:${TARGETARCH}" >> debian/DEBIAN/control |
| 40 cat control >> debian/DEBIAN/control |
| 41 mv changelog debian/usr/share/doc/$PACKAGE_NAME/ |
| 42 gzip --best -f debian/usr/share/doc/$PACKAGE_NAME/changelog |
| 43 mv copyright debian/usr/share/doc/$PACKAGE_NAME/ |
| 44 mv GCP-driver debian/usr/lib/cups/backend |
| 45 |
| 46 # Set permissions as required to roll package |
| 47 chmod 755 debian/DEBIAN/postinst |
| 48 chmod 755 debian/DEBIAN/postrm |
| 49 chmod 755 debian/DEBIAN/prerm |
| 50 chmod -R 755 debian/usr |
| 51 chmod 644 debian/usr/share/doc/$PACKAGE_NAME/* |
| 52 chmod 644 debian/usr/share/ppd/GCP/GCP-driver.ppd |
| 53 |
| 54 # Actually roll the package and rename |
| 55 fakeroot dpkg-deb --build debian |
| 56 mv debian.deb gcp-driver.deb |
| 57 |
| 58 # Clean up |
| 59 rm -rf debian |
| 60 rm control |
OLD | NEW |