root/gs2-extensions/xpdf-tools/trunk/src/move-cmake.sh @ 32239

Revision 32239, 2.3 KB (checked in by ak19, 2 years ago)

Committing new helper script move-cmake.sh that will move cmake out of or back into the compilation area. These 2 functions of the script are called by XPDFTOOL.sh after compiling up xpdftools and by CMAKE.sh when searching for an existing CMake within the xpdftools extension to compile up xpdftools.

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3
4print_usage() {
5    echo ""
6    echo "RUN AS: $0 <away|back>"
7    echo "  in 'back' mode, any existing cmake products will be in the bin subfolder"
8    echo "     ready for compiling"
9    echo "  in 'away' mode, cmake products are moved away into the separate devel folder"
10    echo "     ready for tarring up xpdf-tools"
11    echo ""
12}
13
14
15if [ -z $GEXT_XPDFTOOLS ] ; then
16    source setup.bash > /dev/null
17fi
18
19if [ -z $1 ]; then
20    print_usage
21fi
22
23# installed dir is extension's GSDLOS/bin subfolder, develdir is devel/GSDLOS subfolder
24installed=$GEXTXPDFTOOLS_INSTALLED
25develdir=$GEXT_XPDFTOOLS/devel/$GSDLOS
26
27
28if [ "x$1" == "xaway" ]; then
29    echo "away mode (moving out of the way)"
30    if [ -e "$installed/bin/cmake" ]; then
31   
32    echo "Moving cmake products in xpdftools' installed area into 'devel'"
33   
34    mkdir -p $develdir/bin
35    # 4 files in bin to move to devel/os/bin
36    mv $installed/bin/ccmake $installed/bin/cmake $develdir/bin
37    mv $installed/bin/cpack $installed/bin/ctest $develdir/bin
38   
39    # Could move the entire $installed/doc folder, as only cmake uses it
40    # and not xpdftools nor any other pkg in the xpdftools extension.
41    # If future-proofing, just move the cmake subfolder of doc
42    #mkdir -p $develdir/doc
43    #mv $installed/doc/cmake-3.11 $develdir/doc/.
44    if [ -d $develdir/doc ]; then
45        rm -rf $develdir/doc
46    fi
47    # Now move the $installed/doc folder as it contains only CMake stuff
48    mv $installed/doc $develdir/.
49   
50    if [ -d $develdir/share ]; then
51        rm -rf $develdir/share
52    fi
53    mkdir -p $develdir/share/aclocal
54    mv $installed/share/cmake-3.11 $develdir/share/.
55    mv $installed/share/aclocal/cmake.m4 $develdir/share/aclocal/.
56
57    else
58    echo "NOTE $installed/bin/cmake doesn't exist, so not moving anything"
59    fi
60# Do the reverse of the 'away' mode above for 'back' mode
61elif [ "x$1" == "xback" ]; then
62    echo "back mode (moving cmake back to where it was built)"
63    if [ -e "$develdir/bin/cmake" ]; then
64
65    echo "Moving cmake products from 'devel' back into xpdftools' installed area"
66
67    mv $develdir/bin/* $installed/bin/.
68
69    #mv $develdir/doc/* $installed/doc/.
70    mv $develdir/doc $installed/.
71
72    #if [ -e $develdir/share/aclocal/cmake.m4 ]; then
73    mv $develdir/share/cmake-3.11 $installed/share/.
74    mv $develdir/share/aclocal/cmake.m4 $installed/share/aclocal/.
75    #fi
76    else
77    echo "NOTE: $develdir/bin/cmake doesn't exist, so not moving anything"
78    fi
79fi
Note: See TracBrowser for help on using the browser.