This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: Pending patches for generic build script
- From: Yaakov Selkowitz <yselkowitz at users dot sourceforge dot net>
- To: cygwin-apps at cygwin dot com
- Date: Tue, 10 Feb 2004 01:34:20 -0500
- Subject: Re: Pending patches for generic build script
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Igor and rlc,
Not sure which one (or both) of you is dealing with these, but I've got
one of my own patches for the build script, attached here.
To summarize and explain:
* provides variables for multiple binary packages, meaning that only the
'pkg' section has to be modified when this is necessary
* adds functions 'reconf' and 'reinstall', mainly for package makers
using the script to drive the initial build process, when they realize
that changes need to be made and want to get a clean conf or install
* automatic gzip-ing of man files (I just added this one recently,
haven't tested it too much yet)
* /etc/postinstall created only if there's a postinstall.sh
* slightly modified 'list' output, which indents two spaces and prints
the leading slash, for use in the Cygwin README
* adds function 'depend' (straight from Igor); it would be nice to have
this indented two spaces, like for 'list', but I haven't done that yet
* adds options to call existing functions: 'configure' calls 'conf',
'make' calls 'build' (a typo I've made more than enough times :-),
'test' calls 'check'.
* adds option 'first' (never figured out what else to call it), which
calls 'mkdirs' 'spkg' and 'finish'. I use it for patching the src tree
and creating the -src tarball, which afterwards I call 'all' to build
the binary package in one step.
* some cleanup of "&& \" instead of "; \", and other code cleanup.
I know you have a lot of patches to look at now, but there are a few
things here which have been very helpful to me, so I wanted to share
them while the topic is pending.
BTW--and I hope this isn't OT--if you have Qt3 installed from the
KDE-Cygwin project, then you might want to try my port of xxdiff,
available from my sf.net project site:
http://prdownloads.sourceforge.net/cygwin-ports/xxdiff-3.0.2-1.tar.bz2?download
http://prdownloads.sourceforge.net/cygwin-ports/xxdiff-3.0.2-1-src.tar.bz2?download
Drop me a note (offlist of course) if you have any comments on xxdiff.
Thanks for your work!
Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAKHtppiWmPGlmQSMRAiEcAJ0W/x1/R3yPCPcI7EYK/HUgwbdkkQCgvpYk
F+2/HpqN/kNidSBtPQHDrAg=
=ty5U
-----END PGP SIGNATURE-----
--- generic-build-script-orig 2004-02-09 23:43:00.216696000 -0500
+++ generic-build-script 2004-02-10 01:00:22.794072000 -0500
@@ -21,9 +21,13 @@
tscriptname=`basename $0 .sh`
export PKG=`echo $tscriptname | sed -e 's/\-[^\-]*\-[^\-]*$//'`
+export PKG2=lib${PKG}
+export PKG3=lib${PKG}-devel
export VER=`echo $tscriptname | sed -e "s/${PKG}\-//" -e 's/\-[^\-]*$//'`
export REL=`echo $tscriptname | sed -e "s/${PKG}\-${VER}\-//"`
export FULLPKG=${PKG}-${VER}-${REL}
+export FULLPKG2=${PKG2}-${VER}-${REL}
+export FULLPKG3=${PKG3}-${VER}-${REL}
# determine correct decompression option and tarball filename
if [ -e ${PKG}-${VER}.tar.gz ] ; then
@@ -38,11 +42,16 @@
export src_pkg_name=${FULLPKG}-src.tar.bz2
export src_patch_name=${FULLPKG}.patch
export bin_pkg_name=${FULLPKG}.tar.bz2
+export bin_pkg2_name=${FULLPKG2}.tar.bz2
+export bin_pkg3_name=${FULLPKG3}.tar.bz2
export src_orig_pkg=${topdir}/${src_orig_pkg_name}
export src_pkg=${topdir}/${src_pkg_name}
export src_patch=${topdir}/${src_patch_name}
export bin_pkg=${topdir}/${bin_pkg_name}
+export bin_pkg2=${topdir}/${bin_pkg2_name}
+export bin_pkg3=${topdir}/${bin_pkg3_name}
+
export srcdir=${topdir}/${PKG}-${VER}
export objdir=${srcdir}/.build
export instdir=${srcdir}/.inst
@@ -68,8 +77,8 @@
(cd ${topdir} && \
tar xv${opt_decomp}f ${src_orig_pkg} ; \
cd ${topdir} && \
- patch -p0 < ${src_patch}
- && mkdirs )
+ patch -p0 < ${src_patch} && \
+ mkdirs )
}
conf() {
(cd ${objdir} && \
@@ -82,6 +91,11 @@
--libexecdir='${sbindir}' --localstatedir=/var \
--datadir='${prefix}/share' )
}
+reconf() {
+ (cd ${objdir} && \
+ rm -fr * && \
+ conf )
+}
build() {
(cd ${objdir} && \
CFLAGS="${MY_CFLAGS}" make )
@@ -96,54 +110,65 @@
}
install() {
(cd ${objdir} && \
- make install DESTDIR=${instdir}
+ make install DESTDIR=${instdir} && \
for f in ${prefix}/share/info/dir ${prefix}/info/dir ; do
- if [ -f ${instdir}${f} ] ; then \
+ if [ -f ${instdir}${f} ] ; then
rm -f ${instdir}${f} ; \
fi ;\
done &&\
+ find ${instdir}${prefix}/share/man -name "*.1" -o -name "*.3" -o -name \
+ "*.5" -o -name "*.6" -o -name "*.7" -o -name "*.8" \
+ | xargs gzip -q && \
for d in ${prefix}/share/doc/${PKG}-${VER} ${prefix}/share/doc/Cygwin \
- ${sysconfdir}/postinstall ; do
+ ; do
if [ ! -d ${instdir}${d} ] ; then
mkdir -p ${instdir}${d} ;\
fi ;\
done &&\
- templist=""; \
- for f in ${srcdir}/ANNOUNCE ${srcdir}/CHANGES ${srcdir}/INSTALL \
- ${srcdir}/KNOWNBUG ${srcdir}/LICENSE ${srcdir}/README \
- ${srcdir}/TODO ${srcdir}/COPYING ; do \
- if [ -f $f ] ; then \
- templist="$templist $f"; \
+ templist=""; && \
+ for f in ${srcdir}/ABOUT-NLS ${srcdir}/ANNOUNCE ${srcdir}/AUTHORS \
+ ${srcdir}/ChangeLog ${srcdir}/CHANGES ${srcdir}/COPYING \
+ ${srcdir}/INSTALL ${srcdir}/KNOWNBUG ${srcdir}/LICENSE \
+ ${srcdir}/NEWS ${srcdir}/README ${srcdir}/THANKS \
+ ${srcdir}/TODO ; do
+ if [ -f $f ] ; then
+ templist="$templist $f" ; \
fi ; \
done && \
- if [ ! "x$templist" = "x" ]; then \
+ if [ ! "x$templist" = "x" ]; then
/usr/bin/install -m 644 $templist \
${instdir}${prefix}/share/doc/${PKG}-${VER} ;
fi && \
- if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.README ]; then \
+ if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.README ]; then
/usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/${PKG}.README \
${instdir}${prefix}/share/doc/Cygwin/${PKG}-${VER}.README ; \
- else \
- if [ -f ${srcdir}/CYGWIN-PATCHES/README ]; then \
- /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \
- ${instdir}${prefix}/share/doc/Cygwin/${PKG}-${VER}.README ; \
- fi ;\
- fi ;\
- if [ -f ${srcdir}/CYGWIN-PATCHES/postinstall.sh ] ; then \
+ elif [ -f ${srcdir}/CYGWIN-PATCHES/README ]; then
+ /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \
+ ${instdir}${prefix}/share/doc/Cygwin/${PKG}-${VER}.README ; \
+ fi && \
+ if [ -f ${srcdir}/CYGWIN-PATCHES/postinstall.sh ] ; then
+ mkdir -p ${instdir}${sysconfdir}/postinstall ;
/usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/postinstall.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
- true )
+ find . -name "*.dll" -o -name "*.exe" | xargs strip 2>&1 )
}
list() {
(cd ${instdir} && \
- find . -name "*" ! -type d | sed 's/\.\/\(.*\)/\1/'
- true )
+ find . -name "*" ! -type d | sed 's/\.\(.*\)/ \1/' )
+}
+depend() {
+ (cd ${instdir} && \
+ find ${instdir} -name '*.exe' | xargs cygcheck | sed -e '/\.exe/d' \
+ -e 's,\\,/,g' | sort -bu | xargs -n1 cygpath -u | xargs cygcheck -f )
+}
+reinstall() {
+ (cd ${instdir} && \
+ rm -fr * && \
+ install )
}
pkg() {
(cd ${instdir} && \
@@ -151,8 +176,8 @@
}
mkpatch() {
(cd ${srcdir} && \
- find . -name "autom4te.cache" | xargs rm -rf > /dev/null
- tar xv${opt_decomp}f ${src_orig_pkg} ;\
+ find . -name "autom4te.cache" | xargs rm -rf && \
+ tar xv${opt_decomp}f ${src_orig_pkg} && \
mv ${PKG}-${VER} ../${PKG}-${VER}-orig && \
cd ${topdir} && \
diff -urN -x '.build' -x '.inst' -x '.sinst' \
@@ -174,22 +199,28 @@
prep) prep ; STATUS=$? ;;
mkdirs) mkdirs ; STATUS=$? ;;
conf) conf ; STATUS=$? ;;
+ configure) conf ; STATUS=$? ;;
+ reconf) reconf ; STATUS=$? ;;
build) build ; STATUS=$? ;;
+ make) build ; STATUS=$ ;;
check) check ; STATUS=$? ;;
+ test) check ; STATUS=$? ;;
clean) clean ; STATUS=$? ;;
install) install ; STATUS=$? ;;
list) list ; STATUS=$? ;;
strip) strip ; STATUS=$? ;;
+ depend) depend ; STATUS=$? ;;
+ reinstall) reinstall ; STATUS=$? ;;
package) pkg ; STATUS=$? ;;
pkg) pkg ; STATUS=$? ;;
mkpatch) mkpatch ; STATUS=$? ;;
src-package) spkg ; STATUS=$? ;;
spkg) spkg ; STATUS=$? ;;
finish) finish ; STATUS=$? ;;
+ first) mkdirs && spkg && finish ; STATUS=$? ;;
all) prep && conf && build && install && \
strip && pkg && spkg && finish ; \
STATUS=$? ;;
*) echo "Error: bad arguments" ; exit 1 ;;
esac
exit ${STATUS}
-