This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
New patch for generic-build-script
- From: Yaakov Selkowitz <yselkowitz at users dot sourceforge dot net>
- To: cygwin-apps at cygwin dot com
- Date: Wed, 18 Feb 2004 00:24:26 -0500
- Subject: New patch for generic-build-script
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Igor,
OK, here's the patch again, along with my ChangeLog. Feel free to edit
as necessary.
Yaakov
2004-02-17 Yaakov Selkowitz <yselkowitz AT users DOT sourceforge DOT net>
* generic-build-script: Add 'configure', 'make', and 'test'
arguments as aliases for 'conf', 'build', and 'check'
respectively. Add 'first' argument that calls mkdir(), spkg(),
and finish(). Add checksig() to beginning of 'all' sequence.
(install_docs): Add ABOUT-NLS, FAQ, THANKS.
(SIG): Define as 1 (on by default).
(reconf): New function for clean reconfigure.
(install): Clean ${instdir} before install. Automatically gzip
info and man pages, if present. Code cleanup.
(list): Simplify sed expression.
(depend): New function for listing runtime dependencies of
package executables and libraries.
(strip,mkpatch): Remove redirection of output to /dev/null.
(spkg): Improve readability. Change test of ${SIG} to equality.
(checksig): Change order to ORIGINAL PACKAGE, SCRIPT, PATCH.
Change test of ${SIG} to equality.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAMvcHpiWmPGlmQSMRAnB1AJ94zOX6FJ7Y8LInjO5V091+e3YrMQCfXM6z
nUQa5TGs7L7o6lPUbsMerYc=
=otD5
-----END PGP SIGNATURE-----
--- generic-build-script-orig 2004-02-17 19:23:24.621960000 -0500
+++ generic-build-script 2004-02-18 00:18:01.195696000 -0500
@@ -80,6 +80,7 @@
MY_LDFLAGS=
export install_docs="\
+ ABOUT-NLS \
ANNOUNCE \
AUTHORS \
BUG-REPORTS \
@@ -88,6 +89,7 @@
COPYING \
CREDITS \
ChangeLog \
+ FAQ \
HOW-TO-CONTRIBUTE \
INSTALL \
KNOWNBUG \
@@ -97,9 +99,11 @@
NOTES \
PROGLIST \
README \
+ THANKS \
TODO \
"
export test_rule=test
+export SIG=1 #set to 0 to turn off signing by default
# helper function
# unpacks the original package source archive into ./${BASEPKG}/
@@ -134,6 +138,12 @@
--libexecdir='${sbindir}' --localstatedir=/var \
--datadir='${prefix}/share' )
}
+reconf() {
+ (cd ${topdir} && \
+ rm -fr ${objdir} && \
+ mkdir -p ${objdir} && \
+ conf )
+}
build() {
(cd ${objdir} && \
CFLAGS="${MY_CFLAGS}" make )
@@ -148,6 +158,7 @@
}
install() {
(cd ${objdir} && \
+ rm -fr ${instdir}/* && \
make install DESTDIR=${instdir} && \
for f in ${prefix}/share/info/dir ${prefix}/info/dir ; do \
if [ -f ${instdir}${f} ] ; then \
@@ -159,6 +170,14 @@
mkdir -p ${instdir}${d} ;\
fi ;\
done &&\
+ if [ -d ${instdir}${prefix}/share/info ] ; then \
+ find ${instdir}${prefix}/share/info -name "*.info" | xargs gzip -q ; \
+ fi ; \
+ if [ -d ${instdir}${prefix}/share/man ] ; then \
+ find ${instdir}${prefix}/share/man -name "*.1" -o -name "*.3" -o \
+ -name "*.3x" -o -name "*.3pm" -o -name "*.5" -o -name "*.6" -o \
+ -name "*.7" -o -name "*.8" | xargs gzip -q ; \
+ fi ; \
templist="" && \
for f in ${install_docs} ; do \
if [ -f ${srcdir}/$f ] ; then \
@@ -172,11 +191,9 @@
if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.README ]; then \
/usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/${PKG}.README \
${instdir}${prefix}/share/doc/Cygwin/${BASEPKG}.README ; \
- else \
- if [ -f ${srcdir}/CYGWIN-PATCHES/README ]; then \
- /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \
- ${instdir}${prefix}/share/doc/Cygwin/${BASEPKG}.README ; \
- fi ;\
+ elif [ -f ${srcdir}/CYGWIN-PATCHES/README ] ; then \
+ /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \
+ ${instdir}${prefix}/share/doc/Cygwin/${BASEPKG}.README ; \
fi && \
if [ -f ${srcdir}/CYGWIN-PATCHES/postinstall.sh ] ; then \
if [ ! -d ${instdir}${sysconfdir}/postinstall ]; then \
@@ -188,12 +205,19 @@
}
strip() {
(cd ${instdir} && \
- find . -name "*.dll" -or -name "*.exe" | xargs strip > /dev/null 2>&1 ; \
+ find . -name "*.dll" -or -name "*.exe" | xargs strip 2>&1 ; \
true )
}
list() {
(cd ${instdir} && \
- find . -name "*" ! -type d | sed 's/\.\/\(.*\)/\1/' ; \
+ find . -name "*" ! -type d | sed 's%^\.% %' ; \
+ true )
+}
+depend() {
+ (cd ${instdir} && \
+ find ${instdir} -name "*.exe" -o -name "*.dll" | xargs cygcheck | \
+ sed -e '/\.exe/d' -e 's,\\,/,g' | sort -bu | xargs -n1 cygpath -u \
+ | xargs cygcheck -f | sed 's%^% %' ; \
true )
}
pkg() {
@@ -202,7 +226,7 @@
}
mkpatch() {
(cd ${srcdir} && \
- find . -name "autom4te.cache" | xargs rm -rf > /dev/null ; \
+ find . -name "autom4te.cache" | xargs rm -rf && \
unpack ${src_orig_pkg} && \
mv ${BASEPKG} ../${BASEPKG}-orig && \
cd ${topdir} && \
@@ -213,12 +237,18 @@
}
spkg() {
(mkpatch && \
- if [ "${SIG}" ]; then name=${srcinstdir}/${src_patch_name} text="PATCH" sigfile; fi && \
+ if [ "${SIG}" -eq 1 ] ; then \
+ name=${srcinstdir}/${src_patch_name} text="PATCH" sigfile ; \
+ fi && \
cp ${src_orig_pkg} ${srcinstdir}/${src_orig_pkg_name} && \
- if [ -e ${src_orig_pkg}.sig ]; then cp ${src_orig_pkg}.sig ${srcinstdir}/; fi && \
+ if [ -e ${src_orig_pkg}.sig ] ; then \
+ cp ${src_orig_pkg}.sig ${srcinstdir}/ ; \
+ fi && \
cp $0 ${srcinstdir}/`basename $0` && \
name=$0 text="SCRIPT" sigfile && \
- if [ "${SIG}" ]; then cp $0.sig ${srcinstdir}/; fi && \
+ if [ "${SIG}" -eq 1 ] ; then \
+ cp $0.sig ${srcinstdir}/ ; \
+ fi && \
cd ${srcinstdir} && \
tar cvjf ${src_pkg} * )
}
@@ -226,7 +256,7 @@
rm -rf ${srcdir}
}
sigfile() {
- if [ \( "${SIG}" \) -a \( -e $name \) -a \( \( ! -e $name.sig \) -o \( $name -nt $name.sig \) \) ]; then \
+ if [ \( "${SIG}" -eq 1 \) -a \( -e $name \) -a \( \( ! -e $name.sig \) -o \( $name -nt $name.sig \) \) ]; then \
if [ -x /usr/bin/gpg ]; then \
echo "$text signature need to be updated"; \
rm -f $name.sig; \
@@ -234,22 +264,22 @@
else \
echo "You need the gnupg package installed in order to make signatures."; \
fi; \
- fi;
+ fi
}
checksig() {
if [ -x /usr/bin/gpg ]; then \
- if [ -e $0.sig ]; then \
- echo "SCRIPT signature follows:"; \
- /usr/bin/gpg --verify $0.sig $0; \
- else \
- echo "SCRIPT signature missing."; \
- fi; \
if [ -e ${src_orig_pkg}.sig ]; then \
echo "ORIGINAL PACKAGE signature follows:"; \
/usr/bin/gpg --verify ${src_orig_pkg}.sig ${src_orig_pkg}; \
else \
echo "ORIGINAL PACKAGE signature missing."; \
fi; \
+ if [ -e $0.sig ]; then \
+ echo "SCRIPT signature follows:"; \
+ /usr/bin/gpg --verify $0.sig $0; \
+ else \
+ echo "SCRIPT signature missing."; \
+ fi; \
if [ -e ${src_patch}.sig ]; then \
echo "PATCH signature follows:"; \
/usr/bin/gpg --verify ${src_patch}.sig ${src_patch}; \
@@ -257,18 +287,23 @@
echo "PATCH signature missing."; \
fi; \
else
- echo "You need the gnupg package installed in order to check signatures."; \
- fi;
+ echo "You need the gnupg package installed in order to check signatures." ; \
+ fi
}
case $1 in
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=$? ;;
+ depend) depend ; STATUS=$? ;;
strip) strip ; STATUS=$? ;;
package) pkg ; STATUS=$? ;;
pkg) pkg ; STATUS=$? ;;
@@ -277,7 +312,8 @@
spkg) spkg ; STATUS=$? ;;
finish) finish ; STATUS=$? ;;
checksig) checksig ; STATUS=$? ;;
- all) prep && conf && build && install && \
+ first) mkdirs && spkg && finish ; STATUS=$? ;;
+ all) checksig && prep && conf && build && install && \
strip && pkg && spkg && finish ; \
STATUS=$? ;;
*) echo "Error: bad arguments" ; exit 1 ;;