libheimdal/heimdal-patch-source.sh
Jörg Lorenzen d31e954f39 Accepting request 329265 from home:enzokiel:branches:network
- Added a patched instead of the original tarball because only
  shared libraries will be build and source files of these (not to
  be build) programs have problematic licenses.
- Added script heimdal-patch-source.sh to sources.
- Added patch heimdal-patched.diff that fixes configure.ac and
  several Makefile.am files to successfully build patched source.
- Removed unneeded dependencies in spec file for build.

OBS-URL: https://build.opensuse.org/request/show/329265
OBS-URL: https://build.opensuse.org/package/show/network/libheimdal?expand=0&rev=7
2015-09-05 11:04:36 +00:00

47 lines
794 B
Bash

#!/bin/bash
REMOVE_DIRS=(
admin
appl
etc
kadmin
kcm
kpasswd
kuser
packages
po
tests
tools
windows
)
set -o errexit
CMDNAME=${0##*/}
SOURCEDIR=${0%$CMDNAME}
BASENAME=${1%.tar.gz}
trap "rm -rf \"$BASENAME-patched.tar\" \"$BASENAME-patched.tar.bz2\"" ERR
for (( N=0; N<${#REMOVE_DIRS[@]}; N++ )) ; do
REMOVE_DIRS[N]="*/${REMOVE_DIRS[N]}"
done
cd "$SOURCEDIR" > /dev/null
if [ ! -f "$BASENAME.tar.gz" ]; then
exit 0
fi
if [ -f "$BASENAME-patched.tar.bz2" ] && [ "$BASENAME.tar.gz" -ot "$BASENAME-patched.tar.bz2" ]; then
if [ $CMDNAME -ot "$BASENAME-patched.tar.bz2" ]; then
exit 0
fi
fi
gzip -d "$BASENAME.tar.gz"
mv -f "$BASENAME.tar" "$BASENAME-patched.tar"
tar --wildcards --delete -f "$BASENAME-patched.tar" "${REMOVE_DIRS[@]}"
bzip2 "$BASENAME-patched.tar"