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]

cygport: variable package names


Hi Yaakov,

While packaging openssl it occured to me that I had lost a feature of my
old packaging script.  The script evaluated the version number of the
runtime package and created the package name from there:

  SHLIB_VERSION_NUMBER=

  function get_openssl_version()
  {
    [...]
    eval `grep '^SHLIB_VERSION_NUMBER=' Makefile`
    if [ -z "${SHLIB_VERSION_NUMBER}" ]
    then
      echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile."
      echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile."
      exit 1
    fi
  }
  [...]
  get_openssl_version
  [...]
  # Runtime package
  tar cjf libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \
       usr/bin/cyg*dll

This feature is lost in the cygport script now:

  PKG_NAMES="openssl openssl-devel libopenssl100"
  openssl_CONTENTS="etc usr/bin/openssl.exe [...]"
  openssl_devel_CONTENTS="usr/include usr/lib/*.a [...]"
  libopenssl100_CONTENTS="usr/bin/cyg*dll"

I tried to resurrect it, but it doesn't work.  What I did was to replace
the aforementioned four lines with the following:

  eval `grep '^SHLIB_VERSION_NUMBER=' ${B}/Makefile`
  if [ -z "${SHLIB_VERSION_NUMBER}" ]
  then
    echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile."
    echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile."
    exit 1
  fi
  SHLIB_VERSION="${SHLIB_VERSION_NUMBER//[!0-9]/}"
  PKG_NAMES="openssl openssl-devel libopenssl${SHLIB_VERSION}"
  openssl_CONTENTS="etc usr/bin/openssl.exe [...]"
  openssl_devel_CONTENTS="usr/include usr/lib/*.a [...]"
  eval libopenssl${SHLIB_VERSION}_CONTENTS="usr/bin/cyg*dll"
  
The problem is, that the cygport file is apparently (and obviously I
guess) included before important variables are set.  So, at the point
the top-level stuff in the cygport file is evaluated, variables like
${S} or ${B} are just not set.  Therefore, the above fails with

  grep: /Makefile: No such file or directory
  Error: Couldn't retrieve OpenSSL shared lib version from Makefile.
  Check value of variable SHLIB_VERSION_NUMBER in Makefile.

That means, I can't create variable package names, at least I don't
understand how I could do it.  Is that possible in a different way?

If it's not possible, would it make sense to add the ability to create
a src_package() function which could be used to create variable package
names or to add other pre-package steps?


TIA,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


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