summaryrefslogtreecommitdiff
path: root/devel/boost/scripts/do-install
blob: 32b6315369496b9c86286e17a5336cb29dd08e4a (plain) (blame)
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
#!/bin/sh

# Install bjam tool
${BSD_INSTALL_PROGRAM} ${BJAM} ${PREFIX}/bin/

# Install libraries
${FIND} ${WRKSRC}/bin/boost/libs -type f -name "*.a"\
    -exec ${BSD_INSTALL_DATA} \{\} ${PREFIX}/lib \;

${FIND} ${WRKSRC}/bin/boost/libs -type f -name "*.so.1"\
	-exec ${BSD_INSTALL_DATA} \{\} ${PREFIX}/lib \; 

# Create symlinks for shared libraries
cd ${PREFIX}/lib;
for i in libboost*.so.1; do
	${LN} -s $i ${i%%.1};
done;

# Install headers
cd ${WRKSRC} && ${FIND} boost -type d\
    -exec ${MKDIR} ${PREFIX}/include/\{\} \;
cd ${WRKSRC} && ${FIND} boost -type f\
    -exec ${BSD_INSTALL_DATA} \{\} ${PREFIX}/include/\{\} \;

# Documentation & examples
if [ -n ${NOPORTDOCS+xyz} ]; then
    # Fix links to example files
    cd ${WRKSRC}/libs && for dir in *; do
	if [ -d $dir/doc ]; then
	    for file in $dir/doc/*; do
		${GREP} -s -q '\.\./example/' $file && \
		${REINPLACE_CMD} -e\
		"s|../example/|${PREFIX}/share/examples/boost/$dir/|g" $file
	    done;
	fi;
    done;

    # Installation
    ${MKDIR} ${DOCSDIR} ${EXAMPLESDIR}

    ${FIND} ${WRKSRC} -type f -exec chmod 0444 {} \;
    cd ${WRKSRC} &&\
	${FIND} . -name "*.htm" -o -name "*.html"  -o -name "*.css"\
	    -o -name "*.jp*g" -o -name "*.png" -o -name "*.gif"\
	    | ${TAR} cTf - - | ${TAR} xUCf ${DOCSDIR} -

    cd ${WRKSRC}/libs && for dir in *; do
	if [ -d ${WRKSRC}/libs/${dir}/example ]; then
	    ${MKDIR} ${EXAMPLESDIR}/${dir};
	    cd ${WRKSRC}/libs/${dir}/example && ${TAR} cf  - *  \
		| ${TAR} xUCf ${EXAMPLESDIR}/${dir} -;
	fi;
    done;
fi;