-
Notifications
You must be signed in to change notification settings - Fork 0
/
AMD.build
executable file
·112 lines (87 loc) · 2.19 KB
/
AMD.build
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
#
. build_funcs
TARNAME=SuiteSparse
TARNAMEEXTRA=
TARDIR=${SOURCE}/s/SuiteSparse
#TAR_EXT=.tar.gz
VERSION=2.3.1
VERSIONEXTRA=
BUILD=1
#TAR_PROG=
#TAR_OPTS=
PKGNAME=AMD
PKGVERSION=2.0.3
#BUILD_SUFFIX=
#ARCH=noarch
FULL_TARNAME=${TARDIR}/${TARNAME}${TARNAMEEXTRA}-${VERSION}${VERSIONEXTRA}${TAR_EXT}
pre_unpack
PKG=/tmp/package-${PKGNAME}
if [ ! -f ${FULL_TARNAME} ]
then
echo Can\'t find ${FULL_TARNAME}
exit
fi
if [ ! -d ${TARNAME}-${VERSION} ]
then
${TAR_PROG} ${TAR_OPTS} ${FULL_TARNAME}
mv ${TARNAME} ${TARNAME}-${VERSION}
(cd ${TARNAME}-${VERSION}
patch -p1 < ${CWD}/SuiteSparse-2.3.1.diff
tar xf ${SOURCE}/m/metis-4.0.tar.gz
)
fi
pre_configure
cd ${TARNAME}-${VERSION}
fix_perms
(cd AMD/Source
make CFLAGS='-O3 -fexceptions -fPIC'
gcc -shared -Wl,-soname,libamd.so.2 -o ../Lib/libamd.so.2.0.3 `ls *.o` -lm
)
(cd AMD/Doc
make
)
mkdir -p ${PKG}/usr/{include,lib}
cp AMD/Lib/libamd.so* ${PKG}/usr/lib
(cd ${PKG}/usr/lib
ln -s libamd.so.* libamd.so
)
cp AMD/Include/* ${PKG}/usr/include
cp UFconfig/*.h ${PKG}/usr/include
#strip_binaries
fix_links
compress_manpages
compress_info
cp -a \
AUTHORS COPYING* INSTALL NEWS PLANS README* TODO \
${PKG}/usr/doc/${TARNAME}-${VERSION}
mkdir -p ${PKG}/usr/doc/${TARNAME}-${VERSION}
cp AMD/Doc/*pdf ${PKG}/usr/doc/${TARNAME}-${VERSION}
fix_docs
mkdir -p ${PKG}/install
cat <<EOF > ${PKG}/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
${PKGNAME}: ${PKGNAME} ${VERSION}
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
${PKGNAME}:
EOF
post_install
cd ${PKG}
su -c "chown -R root:root ${PKG}; \
find . -type d -exec chmod 755 {} \; ; \
makepkg -l y -c n ${PKGDIR}${PKGNAME}-${PKGVERSION}-${ARCH}-${BUILD}${BUILD_SUFFIX}.tgz; \
chown -R ${USERNAME}:${GROUP} ${PKG}"