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