This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pending patches for generic build script


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Igor Pechtchanski wrote:

| Thanks for the patch.  Some of it intersects with my and others' fixes (I
| planned to integrate patches in chronological order), but most of it is
| original and sounds very useful.  It's on my queue.  I'll use this message
| as a sort of a ChangeLog -- please let me know if you'd rather construct
| your own ChangeLog entries.

OK, they say release and release often, right? :-)  This patch is "take
two" for me and should replace my previous patch.

My revised "ChangeLog" follows. Thanks!

Yaakov


* provides variables for multiple binary packages, meaning that only the 'pkg' section has to be modified when this is necessary

* adds function 'reconf', 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 configure again.

* 'install' first clears the instdir, useful when changes need to be
made to install paths, etc.; this provides a clean install always

* automatic gzip-ing of man and info files (still experimental).

* adds to and alphabetizes the standard text doc list, making it easier
(and less common) to add to this list as necessary for an individual package

* /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' which lists the package dependencies of the
executable and libraries, indented two spaces for use in the Cygwin README.

* adds options to call existing functions: 'configure' calls 'conf',
'make' calls 'build', 'test' calls 'check'.

* adds option 'first' (never figured out what else to call it), which
calls 'mkdirs' 'spkg' and 'finish'.  I use it after patching the src
tree to create the -src tarball, which afterwards I call 'all' to build
the binary package in one step.

* some substitution of "&& \" instead of "; \", and other code cleanup.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAKkMWpiWmPGlmQSMRAraFAJ933PvgVGQ1Q4W5Jni1bO3ka4pA7ACg539i
lTxb+HdOLj1v4H7r/3bahpA=
=4MN0
-----END PGP SIGNATURE-----
--- generic-build-script-orig	2004-02-09 23:43:00.216696000 -0500
+++ generic-build-script	2004-02-11 09:37:09.903897600 -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
@@ -66,10 +75,10 @@
 }
 prep() {
   (cd ${topdir} && \
-  tar xv${opt_decomp}f ${src_orig_pkg} ; \
+  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,69 @@
 }
 install() {
   (cd ${objdir} && \
-  make install DESTDIR=${instdir}
+  rm -fr ${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 &&\
+  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 && \
+  if [ -d ${instdir}${prefix}/share/info ] ; then
+    find ${instdir}${prefix}/share/info -name "*.info" | xargs gzip -q ;\
+  fi && \
   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} ;\
+      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"; \
+  done && \
+  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 
+    if [ ! -d ${instdir}${sysconfdir}/postinstall ] ; then 
+      mkdir -p ${instdir}${sysconfdir}/postinstall ; \
+    fi ; \
     /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" -o -name "*.dll" | xargs cygcheck | \
+  sed -e '/\.exe/d' \ -e 's,\\,/,g' | sort -bu | xargs -n1 cygpath -u \
+  | xargs cygcheck -f | sed 's/\(.*\)/  \1/' )
 }
 pkg() {
   (cd ${instdir} && \
@@ -151,8 +180,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 +203,27 @@
   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=$? ;;
   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}
-

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]