source: openpam/trunk/dist.sh @ 315

Last change on this file since 315 was 297, checked in by Dag-Erling Smørgrav, 15 years ago

Dynamically branding a release with today's date has caused trouble
in the past, and it confuses autoconf. From now on, dist.sh will
extract the release date from openpam_version.h.

File size: 964 bytes
Line 
1#!/bin/sh
2#
3# $P4: //depot/projects/openpam/dist.sh#11 $
4#
5
6set -e
7
8srcdir=$(dirname $(realpath $0))
9release=$(perl -ne '/^#define\s+_OPENPAM_VERSION\s+(\d+)/ && print $1' \
10    $srcdir/include/security/openpam_version.h)
11distname="openpam-${release}"
12tarball="${distname}.tar.gz"
13
14install -d -m 0755 "${distname}"
15grep '^[A-Za-z].*/$' MANIFEST | while read dir; do
16    echo "Creating ${dir}"
17    install -d -m 0755 "${distname}/${dir}" || exit 1
18done
19grep '^[A-Za-z].*[^/]$' MANIFEST | while read file; do
20    echo "Adding ${file}"
21    install -c -m 0644 "${file}" "${distname}/${file}" || exit 1
22done
23for file in autogen.sh configure depcomp install-sh ltmain.sh ; do
24    echo "Adjusting permissions for ${file}"
25    chmod a+x "${distname}/${file}"
26done
27find "${distname}" | sort -r | xargs touch -t "${release}0000"
28tar zcf "${tarball}" "${distname}"
29dd if=/dev/zero of="${tarball}" conv=notrunc bs=4 oseek=1 count=1
30rm -rf "${distname}"
31
32echo
33md5 "${tarball}"
Note: See TracBrowser for help on using the repository browser.