This is the mail archive of the cygwin-apps 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: Files created in postinstall


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

According to Igor Pechtchanski on 7/6/2005 7:47 AM:
>>Oops, I didn't quite get it right - in install(), it needs to copy
>>CYGWIN-PATCHES/manifest.lst to preremove/${PKG}-manifest.lst, not
>>preremove/${PKG}.sh.
> 
> 
> Good, thanks for catching it -- I didn't review the patch yet.  Care to
> send a new one?
> 	Igor

Hmm, I never resubmitted, did I?  Here goes.  Also, are you interested in
patches to g-b-s that use bash features (such as ${foo##*/} as a faster
alternative to `basename $foo`) to spawn fewer processes?

2005-07-29  Eric Blake  <ebb9@byu.net>

	* templates/generic-build-script (options): Add almostall,
	help, version.
	(help, version): New functions.
	(install): Support manifest lists.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC6l+784KuGfSFAYARAmTyAJ92Ygn8z7wX4fS1ArcIFOw1Ngnz6ACeP589
LuaAmP4MgjgPz+dCDA9aQg0=
=lB/f
-----END PGP SIGNATURE-----
Index: templates/generic-build-script
===================================================================
RCS file: /cvs/cygwin-apps/packaging/templates/generic-build-script,v
retrieving revision 1.33
diff -u -p -r1.33 generic-build-script
--- templates/generic-build-script	22 Jun 2005 02:24:26 -0000	1.33
+++ templates/generic-build-script	29 Jul 2005 16:37:39 -0000
@@ -2,7 +2,7 @@
 #
 # Generic package build script
 #
-# $Id: generic-build-script,v 1.33 2005/06/22 02:24:26 igor Exp $
+fullvers='$Id: generic-build-script,v 1.33 2005/06/22 02:24:26 igor Exp $'
 #
 # Package maintainers: if the original source is not distributed as a
 # (possibly compressed) tarball, set the value of ${src_orig_pkg_name},
@@ -122,7 +122,45 @@ if [ -z "$SIG" ]; then
   export SIG=0	# set to 1 to turn on signing by default
 fi
 
-# helper function
+# helper functions
+
+# Provide help.
+help() {
+cat <<EOF
+This is the cygwin packaging script for ${FULLPKG}.
+Usage: $0 <action>
+Actions are:
+    help, --help	Print this message
+    version, --version	Print the version message
+    prep		Unpack and patch into ${srcdir}
+    mkdirs		Make hidden directories needed during build
+    conf, configure	Configure the package (./configure)
+    reconf		Rerun configure
+    build, make		Build the package (make)
+    check, test	    	Run the testsuite (make ${test_rule})
+    clean		Remove built files (make clean)
+    install		Install package to staging area (make install)
+    list		List package contents
+    depend		List package dependencies
+    strip		Strip package executables
+    pkg, package	Prepare the binary package ${bin_pkg_name}
+    mkpatch		Prepare the patch file ${src_patch_name}
+    acceptpatch		Apply a patch to the source
+    spkg, src-package	Prepare the source package ${src_pkg_name}
+    finish		Remove source directory ${srcdir}
+    checksig		Validate GPG signatures (requires gpg)
+    first		Full run for spkg (mkdirs, spkg, finish)
+    almostall		Full run for bin pkg, except for finish
+    all			Full run for bin pkg
+EOF
+}
+
+# Provide version of generic-build-script modified to make this
+version() {
+    vers=`echo "$fullvers" | sed -e 's/.*,v \([0-9.]*\).*/\1/'`
+    echo "${FULLPKG}.sh based on generic-build-script $vers"
+}
+
 # unpacks the original package source archive into ./${BASEPKG}/
 # change this if the original package was not tarred
 # or if it doesn't unpack to a correct directory
@@ -238,6 +276,13 @@ install() {
     fi && \
     /usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/preremove.sh \
       ${instdir}${sysconfdir}/preremove/${PKG}.sh ; \
+  fi &&
+  if [ -f ${srcdir}/CYGWIN-PATCHES/manifest.lst ] ; then
+    if [ ! -d ${instdir}${sysconfdir}/preremove ]; then
+      mkdir -p ${instdir}${sysconfdir}/preremove ;
+    fi &&
+    /usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/manifest.lst \
+      ${instdir}${sysconfdir}/preremove/${PKG}-manifest.lst ;
   fi )
 }
 strip() {
@@ -333,6 +378,8 @@ checksig() {
 }
 while test -n "$1" ; do
   case $1 in
+    help|--help)	help ; STATUS=$? ;;
+    version|--version)	version ; STATUS=$?;;
     prep)		prep ; STATUS=$? ;;
     mkdirs)		mkdirs ; STATUS=$? ;;
     conf)		conf ; STATUS=$? ;;
@@ -356,12 +403,11 @@ while test -n "$1" ; do
     finish)		finish ; STATUS=$? ;;
     checksig)		checksig ; STATUS=$? ;;
     first)		mkdirs && spkg && finish ; STATUS=$? ;;
-    all)		checksig && prep && conf && build && install && \
-			strip && pkg && spkg && finish ; \
-			STATUS=$? ;;
+    almostall)		checksig && prep && conf && build && install && \
+			strip && pkg && spkg ; STATUS=$? ;;
+    all)		almostall && finish ; STATUS=$? ;;
     *) echo "Error: bad arguments" ; exit 1 ;;
   esac
   ( exit ${STATUS} ) || exit ${STATUS}
   shift
 done
-

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