1 # this is a sample shell script used for building a cmake
2 # based project for a cygwin setup package.
4 # get the current directory
5 TOP_DIR
=`cd \`echo "$0" |
sed -n '/\//{s/\/[^\/]*$//;p;}'\
`;pwd`
7 # create build directory
11 mkdir
-p "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build"
16 # untar source tree and apply patch
21 tar xvfj @CPACK_PACKAGE_FILE_NAME@.
tar.bz2
22 patch -p0 < "@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch" &&
27 # configure the build tree in .build directory
32 cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
37 # build the package in the .build directory
41 cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
47 # clean the build tree
51 cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
60 cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
62 mv @CPACK_PACKAGE_FILE_NAME@
-@CPACK_CYGWIN_PATCH_NUMBER@.
tar.bz2
"$TOP_DIR"
66 # create the source package
70 cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
71 cpack
--config CPackSourceConfig.cmake
&&
72 mv @CPACK_PACKAGE_FILE_NAME@
-@CPACK_CYGWIN_PATCH_NUMBER@
-src.
tar.bz2
"$TOP_DIR"
80 rm -rf "@CPACK_PACKAGE_FILE_NAME@"
85 prep
) prep
; STATUS
=$?
;;
86 mkdirs
) mkdirs
; STATUS
=$?
;;
87 conf
) conf
; STATUS
=$?
;;
88 build
) build
; STATUS
=$?
;;
89 clean
) clean
; STATUS
=$?
;;
90 package
) pkg
; STATUS
=$?
;;
91 pkg
) pkg
; STATUS
=$?
;;
92 src-package
) spkg
; STATUS
=$?
;;
93 spkg
) spkg
; STATUS
=$?
;;
94 finish
) finish
; STATUS
=$?
;;
96 prep
&& conf
&& build
&& pkg
&& spkg
&& finish
;
99 *) echo "Error: bad argument (all or one of these: prep mkdirs conf build clean package pkg src-package spkg finish)" ; exit 1 ;;