dev/debian-build/dbuild
author Paul Crowley <paul@lshift.net>
Thu, 08 Sep 2011 09:18:32 +0100
changeset 335 0d15506351db
parent 334 b7e56688dd14
child 336 5874d49da474
permissions -rwxr-xr-x
Make dbuild_release call dbuild
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
280
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     1
#!/bin/sh
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     2
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     3
set -e
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     4
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     5
cd $(hg root)
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     6
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     7
PACKAGE=$(dpkg-parsechangelog | sed -n 's/^Source: \(.*\)/\1/p')
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     8
DEBIAN_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*\)/\1/p')
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     9
# Lazy, but hey
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    10
UPSTREAM_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-[^-]*/\1/p')
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    11
BUILDDIR=$(pwd)/build/debian
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    12
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    13
echo PACKAGE $PACKAGE
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    14
echo DEBIAN_VERSION $DEBIAN_VERSION
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    15
echo UPSTREAM_VERSION $UPSTREAM_VERSION
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    16
echo BUILDDIR $BUILDDIR
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    17
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    18
rm -rf ${BUILDDIR}
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    19
mkdir -p ${BUILDDIR}
334
b7e56688dd14 Common dir for all files in orig.tar.gz
Paul Crowley <paul@lshift.net>
parents: 328
diff changeset
    20
hg st -mac0n -X '.hg*' -X 'dev/**' -X 'debian/**' | cpio -p -0 -d \
b7e56688dd14 Common dir for all files in orig.tar.gz
Paul Crowley <paul@lshift.net>
parents: 328
diff changeset
    21
   ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
b7e56688dd14 Common dir for all files in orig.tar.gz
Paul Crowley <paul@lshift.net>
parents: 328
diff changeset
    22
(cd ${BUILDDIR} ; tar cvzf \
b7e56688dd14 Common dir for all files in orig.tar.gz
Paul Crowley <paul@lshift.net>
parents: 328
diff changeset
    23
   ${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.gz \
b7e56688dd14 Common dir for all files in orig.tar.gz
Paul Crowley <paul@lshift.net>
parents: 328
diff changeset
    24
   ${PACKAGE}-${UPSTREAM_VERSION} )
b7e56688dd14 Common dir for all files in orig.tar.gz
Paul Crowley <paul@lshift.net>
parents: 328
diff changeset
    25
hg st -mac0n -I 'debian/**' | cpio -p -0 -d \
280
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    26
   ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    27
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    28
cd ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    29
#dpkg-buildpackage -kFD56DDC0
335
0d15506351db Make dbuild_release call dbuild
Paul Crowley <paul@lshift.net>
parents: 334
diff changeset
    30
dpkg-buildpackage $DPKG_BUILDPACKAGE_OPTIONS
280
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    31
cd ..
9a171c093f61 Add crazy dbuild script
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    32
lintian -i --pedantic -IE ${PACKAGE}_${DEBIAN_VERSION}_*.changes
314
c02eae7665af Fix white space
Paul Crowley <paul@lshift.net>
parents: 281
diff changeset
    33
#sudo pbuilder --build ${PACKAGE}_${DEBIAN_VERSION}.dsc