[PATCH] generic-build-script

Max Bowsher maxb@ukf.net
Tue Jun 21 23:40:00 GMT 2005


Igor Pechtchanski wrote:
> On Tue, 21 Jun 2005, Max Bowsher wrote:
>> Hmm. It seemed sort-of elegant to me to just use ${PKG}-${VER}, rather than
>> defining another variable.
>> I'd go with just a comment.
> 
> Fair enough.  Want to resubmit the patch with the comment?
> 
>> If not, how about names:
>> 
>> BASEPKG
>> CYGPKG_NV
>> CYGPKG_NVR
>> 
>> or
>> 
>> BASEPKG
>> SHORTPKG
>> FULLPKG
>> ?
> 
> I like the latter, FWIW.  But we could go with ${PKG}-${VER} for now, and
> factor it out into a variable later if it becomes a nuisance.

As I considered the comment, I realized it was easier to explain if both had a name. So, I went with SHORTPKG.


2005-06-21  Max Bowsher  <maxb@ukf.net>

        * generic-build-script (SHORTPKG): New variable.
        (install): Use ${SHORTPKG} instead of ${BASEPKG} when referring to the
        Cygwin package with the release number omitted, rather than the
        upstream base package.



Index: generic-build-script
===================================================================
RCS file: /home/mirror/cvsmirror/cygwin-apps-cvs/packaging/templates/generic-build-script,v
retrieving revision 1.32
diff -u -p -r1.32 generic-build-script
--- generic-build-script        21 Jun 2005 22:08:41 -0000      1.32
+++ generic-build-script        21 Jun 2005 23:35:22 -0000
@@ -34,8 +34,14 @@ tscriptname=`basename $0 .sh`
 export PKG=`echo $tscriptname | sed -e 's/\-[^\-]*\-[^\-]*$//'`
 export VER=`echo $tscriptname | sed -e "s/${PKG}\-//" -e 's/\-[^\-]*$//'`
 export REL=`echo $tscriptname | sed -e "s/${PKG}\-${VER}\-//"`
+# BASEPKG refers to the upstream base package
+# SHORTPKG refers to the Cygwin package
+# Normally, these are identical, but if the Cygwin package name is different
+# from the upstream package name, you will want to redefine BASEPKG.
+# Example: For Apache 2, BASEPKG=httpd-2.x.xx but SHORTPKG=apache2-2.x.xx
 export BASEPKG=${PKG}-${VER}
-export FULLPKG=${BASEPKG}-${REL}
+export SHORTPKG=${PKG}-${VER}
+export FULLPKG=${PKG}-${VER}-${REL}
 
 # determine correct decompression option and tarball filename
 export src_orig_pkg_name=
@@ -178,7 +184,7 @@ install() {
       rm -f ${instdir}${f} ; \
     fi ;\
   done &&\
-  for d in ${prefix}/share/doc/${BASEPKG} ${prefix}/share/doc/Cygwin ; do \
+  for d in ${prefix}/share/doc/${SHORTPKG} ${prefix}/share/doc/Cygwin ; do \
     if [ ! -d ${instdir}${d} ] ; then \
       mkdir -p ${instdir}${d} ;\
     fi ;\
@@ -204,14 +210,14 @@ install() {
   done && \
   if [ ! "x$templist" = "x" ]; then \
     /usr/bin/install -m 644 $templist \
-         ${instdir}${prefix}/share/doc/${BASEPKG} ; \
+         ${instdir}${prefix}/share/doc/${SHORTPKG} ; \
   fi && \
   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 ; \
+      ${instdir}${prefix}/share/doc/Cygwin/${SHORTPKG}.README ; \
   elif [ -f ${srcdir}/CYGWIN-PATCHES/README ] ; then \
     /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \
-      ${instdir}${prefix}/share/doc/Cygwin/${BASEPKG}.README ; \
+      ${instdir}${prefix}/share/doc/Cygwin/${SHORTPKG}.README ; \
   fi && \
   if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.sh ] ; then \
     if [ ! -d ${instdir}${sysconfdir}/postinstall ]; then \



More information about the Cygwin-apps mailing list