From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,39bde956b245c191 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.209.68 with SMTP id mk4mr17850567pbc.6.1323000412788; Sun, 04 Dec 2011 04:06:52 -0800 (PST) Path: lh20ni68199pbb.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How to nicely distribute a simple Ada library? Date: Sun, 4 Dec 2011 13:06:50 +0100 Organization: cbb software GmbH Message-ID: <361x89sndsg9$.16ruxrwxud090$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: +P7TheU7NpVgJEnPV0ZXgA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:19331 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-12-04T13:06:50+01:00 List-Id: On Sun, 4 Dec 2011 11:19:49 +0000 (UTC), Natasha Kerensikova wrote: > I have found the packaging policies for Debian, which is very complete > and useful, and for Fedora, which seems nice too but less interesting > for upstream. And I would like to eventually maintain a FreeBSD port. AFAIK, Ada on Fedora is maintained again. E.g. it has GtkAda 2.18 for gcc 4.6 which Debian still lacks. > So my first question is, since the policies say to include in the > package all the body and specification files required to compile > something against the library, but not the others, how can I know which > files are required and which are not? You should maintain dependencies. Your library under Linux would have at least two packages: binary and developing dependant on different sets of packages. > The policies also ask for a .gpr file used for building programs against > the library, which seems different from the .gpr file used to build the > library itself. Should I, as upstream, try to provide both of them, or > should I leave the former .gpr file to the packager? I used to generate the .gpr files for building my libraries. I wrote a script which took the original .gpr file and patched it in order to produce a build-gpr. > I gather that packaging systems have their own way to perform the > installation, but how can I provide an installation mechanism that does > not depend on a distribution? There is no one, AFAIK. Fedora and Debian packaging systems is an utter mess. For my packages I wrote a set of scripts generating the corresponding inputs for both packaging systems. They have little in common. Furthermore, since GNAT distributions on both systems suffer various problems (bugs), to overcome them you might need workarounds, which then would depend on the target system. (I stopped packaging my stuff until Linux distributions mature. Presently I cannot compile much of it either under Fedora or under Debian.) You should likely try to package your stuff manually first, in order to understand the scale of the problem you are face. RPM (Fedora) is considerable easier than Debian packager to start. IMO, packaging is as twice harder than developing and testing a medium sized Ada library. You should really consider if the adventure is worth the efforts... > I would rather avoid automess tools, they > feel extremely overkill compared to the simplicity and presumed > portability of my libraries. I can write a `make install` in pure > makefile language, but is there another more idiomatic way of doing it? Well, but that is not the standard way how packages are distributed in Linux. I wrote a small tool to integrate a library into GNAT GPS without packaging. But it is rather intended for custom libraries distributed in sources. If you plan to distribute your library on "industrial scale", you have to package it properly. > What about windows or mac platforms? For Windows you need to create an *.msi file. If you have a MS Developing Studio, that is relatively simply to do, at least comparing to the exercises needed for RPM and Debian packages. > And while all the above assumes a GNAT toolchain, there are probably > people using other compiles. I guess I cannot really support all Ada > compilers that exist (especially those to which I don't have access), so > the burden for porting the library to their toolchain is probably > theirs, but is there any step I should to make it easier for them? >From a packaged library I would expect a full integration into GNAT GPS. That means placing files on certain GNAT-specific locations depending on the GNAT installation at hand. OK, Linux does not really support GPS, or, for that matter, gprbuild either. Under Debian there exists a GPS package, but it was not gcc 4.6, last time I checked it. > And lastly, is there anything else I should know to make my libraries > easier to use for packagers and users? 1. Always provide gpr files. Whatever configuration you need should be done using project variables. 2. Don't use any tools (e.g. make, autoconf, etc). Many nice Ada libraries became unusable because in 2-3 years the makefile stopped working and nobody knew how to fix it. 3. Don't use preprocessor! [Since AdaCore introduced it, there are troubles installing Win32Ada]. If you need to tune the source, take the varying part of it, make it a proper Ada package. Place two versions of this package into separate subdirectories. Make a scenario variable to select the file in the .gpr file. 4. Never set linker options using pragmas! Linker options belong to the .gpr file. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de