Update libnfs-get-orig-source for new upstream snapshot.
[deb_libnfs.git] / debian / libnfs-get-orig-source
CommitLineData
03746e44
AM
1#!/bin/sh
2
3# Script used to generate the orig source tarball for libnfs.
4
5LIBNFS_GIT_URL="git://github.com/sahlberg/libnfs.git"
303c23ca
AM
6LIBNFS_GIT_COMMIT="48593f566ff9e0fee6544ba03478cb996380eaf7"
7DATE_RETRIEVED="20110724"
03746e44
AM
8COMMIT_SHORT_FORM="$(echo $LIBNFS_GIT_COMMIT | \
9 sed -e 's/^\([[:xdigit:]]\{,7\}\).*/\1/')"
10LIBNFS_VERSION="0.0~git${DATE_RETRIEVED}.${COMMIT_SHORT_FORM}"
11
12git clone "$LIBNFS_GIT_URL" "libnfs-${LIBNFS_VERSION}"
13
14cd "libnfs-${LIBNFS_VERSION}"
15git checkout "$LIBNFS_GIT_COMMIT"
16./bootstrap
17cd ..
18
19# Remove temp files and other cruft from source tarball
20# The find command snippet here was taken from debhelper's dh_clean command
21# with some modification to delete more unneeded files.
22echo "Removing temp files and other cruft from source tarball"
23find libnfs-${LIBNFS_VERSION} \( \( -type f -a \
24 \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
25 -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
26 -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
27 -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
28 -o -name config.status -o -name config.cache -o -name config.log \
29 \) -exec rm -f "{}" \; \) -o \
30 \( -type d -a -name autom4te.cache -prune -exec rm -rf "{}" \; \) \)
31rm -rf libnfs-${LIBNFS_VERSION}/.git
32rm -f libnfs-${LIBNFS_VERSION}/.gitignore
33
34# Remove empty directories
35echo "Removing empty directories"
36find libnfs-${LIBNFS_VERSION} -type d -empty -delete
37
38tar --exclude-vcs -czf "libnfs_${LIBNFS_VERSION}.orig.tar.gz" \
39 "libnfs-${LIBNFS_VERSION}/"