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]

[ITP] cygport

I would like to propose my cygport package as a new package
building/maintaining method, as well as a new package for the distribution.

What is cygport?

cygport is a new method of building packages.  See README for my
(lengthy) explanation of why I created this, but here's the concept
behind it, and a brief tutorial.

cygport takes the g-b-s concept and splits it into two: the information
specific to the package and how to build it goes into a
PACKAGE-VERSION-RELEASE.cygport file.  /usr/bin/cygport itself does the
actual building work, like a g-b-s on overdrive, based on the
information in the .cygport package file.

For example, this is p7zip-4.39-1.cygport:

DESCRIPTION="Portable 7-zip compression tool"

src_compile() {
    cd ${B}
    cygmake 7za 7zr

src_test() {
    cd ${B}
    make test || error "7za tests failed"
    make test_7zr || error "7zr tests failed"

src_install() {
    cd ${B}

    dobin ${B}/bin/7za.exe ${B}/bin/7zr.exe
    dosym 7za.exe /usr/bin/7z

    doman ${S}/man1/7za.1 ${S}/man1/7zr.1
    echo ".so 7za.1" > ${D}/usr/share/man/man1/7z.1

    dodoc ${S}/DOCS/*.txt
    cp -r ${S}/DOCS/MANUAL ${D}/usr/share/doc/${P}/html

(Yes, the syntax is *inspired* by Gentoo Portage, but not identical, and
the code behind it is mostly my own.)

Now, all that's necessary is to run:

cygport ./p7zip-4.39-1.cygport get prep compile install list deps

This will download the upstream source, unpack it, compile it, install
it to DESTDIR, then show you the file list and binary dependencies.

You write a Cygwin README and setup.hint, cp them to
p7zip-4.39-1/CYGWIN-PATCHES, then run:

cygport ./p7zip-4.39-1.cygport install pkg

And you have your packages all ready to go.  In fact, there's even a
release-ready directory of your packages in p7zip-4.39-1/dist/p7zip/.

cygport also includes a number of "cygclasses" which can help build a
number of different types of packages with minimal effort.  For example,
most CPAN perl modules can be written in two lines, e.g.

inherit perl

That's all; perl.cygclass will take care of the rest.

There's also support for split packages; i.e. creating multiple binary
packages from a single source, as with libraries; e.g.


inherit gnome2

PKG_NAMES="${PN} ${PN}-devel ${PN}-doc"
PKG_HINTS="setup devel doc"
PKG_CONTENTS[0]="etc/ usr/bin/ usr/lib/bonobo/ usr/share/doc/ \
PKG_CONTENTS[1]='usr/include/ usr/lib/lib* usr/lib/pkgconfig/'

Note that neither src_compile() nor src_install() are written, because
gnome2.cygclass provides a default src_compile and uses the cygport
default src_install (cd ${B}; make install DESTDIR=${D}).

cygport also automatically handles most common postinstall steps,
including writing postinstall/preremove scripts for most common tasks.

The cygport-generated -src packages are much like the current
g-b-s-generated ones, except that a .cygport file is in place of the
build script.

What is cygport NOT?

* A distribution management tool.  cygport knows nothing about installed
packages, dependency resolution (although it does check for the programs
it needs to run, and a few check_* functions are available), or
installing to the system.

* Complete.  See TODO, and much more documentation is also needed.

* Perfect.  I've been using this for a while now, and having built
_numerous_ packages with it (including all of X11R7.0), it's coming
along, but there's still work to do.

Here are the URLs and setup.hint.  To build the source package, you'll
need to install the binary package, then run:

cygport cygport-0.1.92-1.cygport ('all' or 'almostall check finish')

Running check will show you cygport bootstrapping itself, much like I do
from my source repository.  cygport is just a collection of bash
scripts, so the build itself doesn't take long at all.

(BTW, don't bother trying 'cygport cygport-0.1.92-1.cygport get'; I have
yet to put ordinary source tarballs anywhere yet.  The examples above do
work, though.)

category: Devel
requires: autoconf automake bash bzip2 coreutils cygwin diffstat
diffutils file grep gzip libtool1.5 make patch sed tar unzip wget
sdesc: "Cygwin source packaging tool"
ldesc: "This is cygport, a revolutionary new method for building and
maintaining packages for the Cygwin distribution"


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