blob: 540d840917a144c2028bdb9860541ec164e91b16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/bin/bash
# Copyright 2005 by Red Hat, Inc.
# Author: Mike A. Harris <mharris@redhat.com>
#
# License: MIT/X11
# <FIXME: Insert legal terms here>
set -vx
DESTDIR=$1
MESA_SOURCE_SUBDIR=$2
MESA_SOURCE_FILES=mesa-source-files.lst
OUTPUT_FILE=mesa-source-rpm-filelist.lst
function create_source_file_list {
## Generate mesa-source file list manifest, massaging with grep to filter
## out some things we know aren't needed/wanted.
find . -type f -regex '.*\.[ch]$' | \
sed -e 's#^\./##g' | \
egrep -v '^progs' | \
egrep -v '^src/(glu|glw)' | \
egrep -v '^src/drivers/(dri|dos|windows|glide|svga|ggi)' \
> $MESA_SOURCE_FILES
}
function install_mesa_source_files {
mkdir -p $DESTDIR/$MESA_SOURCE_SUBDIR
touch $OUTPUT_FILE
for file in $(sort < $MESA_SOURCE_FILES | uniq) ; do
DIR=$DESTDIR/${MESA_SOURCE_SUBDIR}/${file%/*}
echo "DSTDIR=$DIR"
[ ! -d $DIR ] && mkdir -p $DIR
install -m 444 $file $DIR/
# Write file to rpm file list manifest
echo "%{mesasourcedir}/${file}" >> $OUTPUT_FILE
done
}
function find_source_dirs {
# Search mesa source dir for directories the package should own
find $DESTDIR/$MESA_SOURCE_SUBDIR -type d | \
sed -e "s#^$DESTDIR/$MESA_SOURCE_SUBDIR#%dir %{mesasourcedir}#g" >> $OUTPUT_FILE
# Ugly hack to cause the 'mesa' dir to be owned by the package too.
# echo "%dir ${MESA_SOURCE_SUBDIR}%/*" >> $OUTPUT_FILE
}
create_source_file_list
install_mesa_source_files
find_source_dirs
set -
|