This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
g-b-s and bin dir
- From: Warren Young <warren at etr-usa dot com>
- To: Cygwin Apps List <cygwin-apps at cygwin dot com>
- Date: Thu, 27 Oct 2005 05:40:39 -0600
- Subject: g-b-s and bin dir
I'm attempting to create my first Cygwin package, and decided to use the
generic-build-script method.
The package is ctags (http://ctags.sourceforge.net/), which builds just
fine out of the box. With a bit of scripting [*] I have the build
process automated. Problem is, the generated binary tarball has no
binaries in it. It only has usr/share/doc/*. I don't see the binaries
in ctags-$VER/.inst/usr/bin, either.
I don't know if this is because of some nonstandardness in the ctags
autoconf setup, or if g-b-s is not passing the right options to the
configure script.
Exuberant Ctags uses autoconf only; no automake. The install target in
the top-level Makefile puts the binaries in $(bindir), which is set from
the corresponding autoconf variable. As g-b-s runs configure, ${bindir)
ends up being /usr/bin, so when the g-b-s inst step runs, the binaries
go to /usr/bin, not to $UNPACKED_TARBALL/.inst/usr/bin.
Who is at fault here, and how do I fix it?
[*] I've attached the build script I'm using. It's a driver for g-b-s,
to handle things that I think g-b-s should handle already. Whoever is
maintaining g-b-s these days can feel free to rob whatever code they
want from this.
With this interface, you just say "./build ctags 5.5.4 1" to create
ctags-5.5.4-1[-src].tar.bz2. It requires that you have a README file in
the current directory, which is based on the generic README file from
the cygwin.com docs; the build script does variable replacement in it
for package name, version number, and release number. I've attached my
original README file so you can see what the build script has to work
with. The build script also requires that the original source tarball
be in the current directory.
This mechanism works best if you have a directory dedicated to a given
package. I use ~/src/ctags, for instance. The build script, the
README, and any tarballs are here.
#!/bin/sh
if [ $# -lt 3 ]
then
echo usage: $0 pkg version release
echo
exit 1
fi
PKG=$1
VER=$2
REL=$3
ID1="$PKG-$VER"
ID2="$PKG-$VER-$REL"
TARBALL="$ID1.tar.gz"
SRCID="$ID2-src.tar.bz2"
BUILD="./$ID2.sh"
if [ ! -e "$TARBALL" ]
then
echo Could not find tarball: $TARBALL
echo
exit 1
fi
rm -rf $ID1
tar xvzf $TARBALL
mkdir $ID1/CYGWIN-PATCHES
sed -e s/PKG/$PKG/g -e s/VER/$VER/g -e s/REL/$REL/g < README > $ID1/CYGWIN-PATCHES/$PKG.README
$BUILD mkdirs && $BUILD spkg &&
( cp $SRCID /tmp && cd /tmp && tar xjf $SRCID && $BUILD all )
mv /tmp/$ID2.tar.bz2 . && rm -f /tmp/$PKG-*
Exuberant Ctags
------------------------------------------
Exuberant Ctags is an indexing and cross-reference tool for many
programming languages. It is typically used in conjunction with a
programmer's text editor, such as Vim or Emacs.
Runtime requirements:
Should work with any version of Cygwin.
Build requirements:
A bare Cygwin installation plus gcc should suffice.
Canonical homepage:
http://ctags.sourceforge.net/
Canonical download:
http://prdownloads.sourceforge.net/ctags/PKG-VER.tar.gz
License:
GPL
Language:
Written in C. Works with source code for any of 33 different
programming languages, as of this writing.
------------------------------------
Build instructions:
unpack PKG-VER-REL-src.tar.bz2
if you use setup to install this src package, it will be
unpacked under /usr/src automatically
cd /usr/src
./PKG-VER-REL.sh all
This will create:
/usr/src/PKG-VER-REL.tar.bz2
/usr/src/PKG-VER-REL-src.tar.bz2
Or use './PKG-VER-REL.sh prep' to get a patched source directory
To find out the files included in the binary distribution, you can
use "cygcheck -l PKG", or browse the listing for the appropriate version
at <http://cygwin.com/packages/>.
------------------
Port Notes:
Official distribution builds out of the box. No changes required.
For more information about this package, see the upstream documentation in
/usr/share/doc/PKG-VER.
Cygwin port maintained by Warren Young <warren at etr dash usa dot com>
Please address all questions to the Cygwin mailing list at <cygwin@cygwin.com>