PATCH: generic-build-script
Dario Alcocer
alcocer@helixdigital.com
Thu May 29 05:00:00 GMT 2003
The attached patch adds the following to the generic-build-script:
* automatically determines the correct decompression option for tar
from the original source tarball
* 'mkdirs' removes the .build, .inst, and .sinst directories, to
increase the likelihood that 'mkpatch' will generate a 'clean' patch
(i.e. no extraneous files.)
* added COPYING to the list of files copied to the binary package by
the 'install' option
* 'strip' option avoids returning an error if no DLLs or EXEs are found
to contain symbolic debugging information
--
Dario Alcocer -- Sr. Software Developer, Helix Digital Inc.
alcocer@helixdigital.com -- http://www.helixdigital.com
-------------- next part --------------
--- generic-build-script.orig 2003-05-23 06:57:40.000000000 -0700
+++ generic-build-script 2003-05-28 21:45:33.000000000 -0700
@@ -24,10 +24,17 @@
export VER=`echo $tscriptname | sed -e 's/^[^\-]*\-//' -e 's/\-[^\-]*$//'`
export REL=`echo $tscriptname | sed -e 's/^[^\-]*\-[^\-]*\-//'`
export FULLPKG=${PKG}-${VER}-${REL}
-# if the orig src package is bzip2'ed, remember to
-# change 'z' to 'j' in the 'tar xvzf' commands in the
-# prep) and mkpatch) sections
-export src_orig_pkg_name=${PKG}-${VER}.tar.gz
+
+# determine correct decompression option and tarball filename
+if [ -e ${PKG}-${VER}.tar.gz ] ; then
+ export opt_decomp=z
+ export src_orig_pkg_ext=gz
+elif [ -e ${PKG}-${VER}.tar.bz2 ] ; then
+ export opt_decomp=j
+ export src_orig_pkg_ext=bz2
+fi
+
+export src_orig_pkg_name=${PKG}-${VER}.tar.${src_orig_pkg_ext}
export src_pkg_name=${FULLPKG}-src.tar.bz2
export src_patch_name=${FULLPKG}.patch
export bin_pkg_name=${FULLPKG}.tar.bz2
@@ -52,13 +59,14 @@
mkdirs() {
(cd ${topdir} && \
+ rm -fr ${objdir} ${instdir} ${srcinstdir} && \
mkdir -p ${objdir} && \
mkdir -p ${instdir} && \
mkdir -p ${srcinstdir} )
}
prep() {
(cd ${topdir} && \
- tar xvzf ${src_orig_pkg} ; \
+ tar xv${opt_decomp}f ${src_orig_pkg} ; \
cd ${topdir} && \
patch -p0 < ${src_patch}
&& mkdirs )
@@ -104,7 +112,7 @@
templist=""; \
for f in ${srcdir}/ANNOUNCE ${srcdir}/CHANGES ${srcdir}/INSTALL \
${srcdir}/KNOWNBUG ${srcdir}/LICENSE ${srcdir}/README \
- ${srcdir}/TODO ; do \
+ ${srcdir}/TODO ${srcdir}/COPYING ; do \
if [ -f $f ] ; then \
templist="$templist $f"; \
fi ; \
@@ -122,13 +130,16 @@
${instdir}${prefix}/doc/Cygwin/${PKG}-${VER}.README ; \
fi ;\
fi ;\
+ if [ -f ${srcdir}/CYGWIN-PATCHES/postinstall.sh ] ; then \
/usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/postinstall.sh \
- ${instdir}${sysconfdir}/postinstall/${PKG}.sh )
+ ${instdir}${sysconfdir}/postinstall/${PKG}.sh
+ fi )
}
strip() {
(cd ${instdir} && \
find . -name "*.dll" | xargs strip > /dev/null 2>&1
- find . -name "*.exe" | xargs strip > /dev/null 2>&1 )
+ find . -name "*.exe" | xargs strip > /dev/null 2>&1
+ true )
}
pkg() {
(cd ${instdir} && \
@@ -136,7 +147,7 @@
}
mkpatch() {
(cd ${srcdir} && \
- tar xvzf ${src_orig_pkg} ;\
+ tar xv${opt_decomp}f ${src_orig_pkg} ;\
mv ${PKG}-${VER} ../${PKG}-${VER}-orig && \
cd ${topdir} && \
diff -urN -x '.build' -x '.inst' -x '.sinst' \
More information about the Cygwin-apps
mailing list