rpm2html-1.11.2/Copyright0000664000076400007640000000242607565426467013757 0ustar hanyhany Copyright (C) 1998-2002 Daniel Veillard. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is fur- nished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from him. rpm2html-1.11.2/BUGS0000664000076400007640000000035007245006316012517 0ustar hanyhany- rpm2html doesn't clean the output directory you should probably add a line in your crontab to remove old html files just before launching rpm2html. Daniel.veillard@imag.fr $Id: BUGS,v 1.3 2001/02/21 18:45:34 veillard Exp $ rpm2html-1.11.2/README0000664000076400007640000000231707576704443012736 0ustar hanyhany PROJECT is dead, if someone feels like taking over, contact me, I will provide all bits I have. daniel@veillard.com README for rpm2html Version 0.90 Rpm2html tries to solve 2 big problems one face when grabbing a RPM package from a mirror on the net and trying to install it: - it gives more information than just the filename before installing the package. - it tries to solve the dependancy problem by analyzing all the Provides and Requires of the set of RPMs. It shows the cross references by the way of hypertext links. The second point will only be efficient if the actual number of RPM indexed is important. I can see various usages for this software: - indexing mirrors sites (e.g. Sunsite, RedHat and their mirrors world wide). - indexing CD-ROM before shipping to provide an easier view of the packages available using the standard tool (an HTML browser). - exporting as a set of HTML pages the current setup of a linux machine, this may prove useful for system administration. Check INSTALL for installation instruction. Read BUGS to learn about registered misbehaviours Daniel $Id: README,v 1.12 2002/12/14 19:40:19 veillard Exp $ rpm2html-1.11.2/TODO0000664000076400007640000001074211452634006012530 0ustar hanyhanyTodo: - change URLs to old rpmfind.net to new website - new website (at Savannah) - make it possible to configure extension of output files while with templates we can produce .xml, .php, ...) - try to speed-up processing by comparing last-modification-time of package and pages which are generated (only) from that package and generate the page only if package is newer, i.e. the modification date of the package file is newer then either mod. data of the package's HTML page, template's file, configuration's file or mod. time of the rpm2html binary itself - try to further speed-up processing by caching package attributes in DB cache (db4?) and only process packages not in the cache or if they were modified from previous run - then also regenerate only pages generated from changed info (this means making some package -> page "dependency" tracking) - resolve errors with libxml as experienced for example by users of RDF functionality: xmlEncodeEntitiesReentrant : input not UTF-8 (reported by Andreas Radke) - resolve 'make dist' (does not work) vs. 'make distrib' (works) in Makefile - do not cosider new packages based on their time of creation but based on their apearing in the repo (i.e. if the lastOprevious time the rpm2html was running and the package was not there - and now is - it is new) => there should be some status info implemented to keep track of known (thus not new) packages - necessary especialy for RDF feed: when packages are added into repo days or even weeksafter creation are then not indicated as new - GPG signatures: when GPG support is compiled in, add configuration parameter to turn it off - add to the PHP searches - handle directories with invalid chars for URI, either escape, or more brutal/simple, skip them. - Maintain the coherency RPM <-> HTML when packages are removed, with links to non-existent of updated packages. - Overflow of buffer containing the file-list, and max size. Crash with 80000 bytes ! (XXX that's probably alredy fixed or if not than approach similar to changelog fixing can be used) - User-provided Header and Footer. (we can do this with templates) - Extraction and display of more information: + ICON + GIF + XPM - make 'protectemails' mangle 'mail' so that those maintainers who wish to mangle e-mails do not have to change value of both 'protectemails' and 'mail' options Nice: - integrate a portaloo - store all metadata in the database - cleanup the Vendor/Distribution/Packager/dist mess of the database - build a database of GPG/PGP keys and associated packagers/distributions - add a Project database, offer ways for users to complement it - extend the database based cleanup to also remove HTML pages. Done: - Switch to PNG and get rid of those 2 GIFs ! - Generate RDF channels per distro or subdirs - Timestamps - Config file using per-directory entries + Local URL + Remote URL + Color + SRC URL - Config for Remote distributors - Source RPM handling - Extraction and display of more information: + COPYRIGHT + PACKAGER + URL - an Index file with stats and infos - ByName index - Documentation - Packaging - Give package sources information using dir colors. Maybe color should be defined in a different way. - Multi-platform (see also OS). A given package may be available for more than one platform - Localization. - More navigarion links in the Header of generated files, direct links to Group, Date, Vendor - Handle the file modification time to avoid rewriting all the files at each run, if not needed. This break HTTP caching ! - Handle more than 2 Gig of RPM data. - Correct HTML output. - Limit size of ByDate.html - Add "More..." links to ByDate when overriding the limit of the page size. - Split the ByName to be actually a set of links to smaller pages. - Warns if case of lack of resources lists. - Check for -lintl in configure.in and add -lintl in Makefile.ini (Cristian Bradiceanu ). - Provide a mechanism to add per-base links in the navigation headers (for search or help). - Added a man(1) page provided by Manu :-) ROUAT - Add 'changelog' fields to the resulting pages (Gary Thomas ). - Enforce new pages and directory to be world-readable (Kirk Bauer ) - Provide RPM packages for sources and i386 ! - Site mapping, per-directory output and navigation. - Maintain the coherency RPM <-> RDF when packages are removed $Id: TODO,v 1.42 2010/10/05 14:36:54 hany Exp $ rpm2html-1.11.2/INSTALL0000664000076400007640000000557111452634006013075 0ustar hanyhany INSTALLING rpm2html =================== rpm2html uses the RPM library, which in turn uses the libdb library. If one of these seems to be missing you should install the rpm-devel and db packages. If available, installing rpm2html should hopefully be as simple as: ./configure make su make install edit /usr/local/share/rpm2html.config (see below) and create the directory to hold the HTML output. make test To verify that the configuration is Ok, And you are ready to install it in your crontab NOTE : ====== - autoconf take /usr/local as the standard prefix, it is possible to override the installation to some place elsewhere. - while in use, rpm2html need only 2 files in the system : the binary and the config(s) file passed as argument(s). - No special permission are needed it just need write access to the output directory and be able to read the RPM directories and files. - if you get "/bin/sh: aclocal-1.10: command not found" from "make", run `./autogen.sh` The CONFIGURATION FILE: ======================= Is a text file, lines beginning with semicolumns are comments. The first part is a global section defining some important parameters of rpm2html. Parameters are defined with the syntax: variable=value Values shouln't be quoted and end up with the end of line Variable | Value ------------------------------------------------------------ maint | The maintainer of the local mirror, NEEDED ! mail | The E-mail of the maintainer, NEEDED ! dir | The directory for for the HTML output, NEEDED ! url | The URL for the HTML files on the WWW server host | The hostname for the server. header | An URL followed by a description (Feedback, Search ...). After these variables, one section should be filled for each directory on your system containing RPM files. It starts with the directory filename between brackets: [The name between brackets is the directory, NEEDED !] The special directory name [localbase] extract information from the RPM base of installed software instead of listing a directory. It allows to dump HTML pages for the installed RPM base on a machine. All the variables defined below until the next directory or the end of file pertain to this directory. Here are the possible variables: Variable | Value --------------------------------------------------- name | A significant name for this mirror, NEEDED ! ftp | The original FTP/HTTP url, NEEDED ! ftpsrc | Where the associated sources are stored color | Background color for pages trust | Unused yet subdir | The subdirectory for HTML output It is possible to indicate other mirrors by adding some mirror=value lines withing the section. The first one will be considered the local one. See PRINCIPLES for a more general comments daniel@veillard.com $Id: INSTALL,v 1.11 2010/10/05 14:36:54 hany Exp $ rpm2html-1.11.2/CHANGES0000664000076400007640000001256207276003465013045 0ustar hanyhanyTue May 8 16:47:35 CEST 2001 Daniel Veillard * all: Moved to sources.redhat.com 1.2.2 ===== * add the multi-rpm base support. 1.2.1 ===== * correct the nasty solaris quick sort bug... 1.0: ==== * serious memory usage debugging. * speedup code, hash table for resources. * reduced a lot memory consumption by separating extra RPM data. * added the mirrors.html link to the links headers. * updated to the latest XML code, memory leak proofed. * improved the indexes page output. 0.99: ===== * parse SuSE sources RPMs with .spm suffixes * changed the output for source RPMs * exit if config file is corrupted * cleanup of the RDF tree output (new module cleanup.c). 0.98: ===== * Rpm2html now dumps mirror informations from the config file too to allow the rpmfind clients to get distribution informations and mirrors lists. * Upgraded the XML/RDF encoding libraries, the old RDF encoding compatibility flag should be removed in the next release. 0.97: ===== * Applied autoconf/makefiles patches from Karl Eichwalder * Added the generation of the RDF "apropos" description 0.96: ===== * Cleaned up the make, now libxml builds in the local tree, and it's possible to build outside of source tree. 0.95: ===== * separated rpmfind from rpm2html, it's now standalone 0.94: ===== * Mainly working on the rpmfind stuff, integrated with libWWW which already improves performances a lot even if it does only one request at a time * rpmfind now allow querying for a specific version of a package like "rpmfind gcc-2.7.2-3". * rpm2html is now available from the W3C public CVS tree 0.93: ===== * Enhancement to rpmfind, distribution detection, * Fixed the binary RPM * rpm2html now show new packages with a "new" icon. * Moved to the W3C Copyright (BSD like) since I'm using W3C resources. 0.92: ===== * First shipping of rpmfind, unfortunately it wasn't included in the binary RPM :-\ 0.91: ===== * Intermediate bug-fix release 0.90: ===== * Makefile.in (dir.gif.h): Call compressor with path. * Started adding RDF parser and generation, modification of HTML entities encoding, since XML will have a different one. Bug fixes. * Removal of main static buffer size problems. * Work on an RDF api 0.85: ===== * corrected a bug in the FTP URL for subtrees * started adding code to dump the real tree * got rid of scandir() and isblank() for portability 0.80: ===== * added a count to Group, Distribs and Packagers lists * Added msg.de and change the installation process, install the config file in @sysconfdir@ and msg.* in @datadir@ thanks to Karl Eichwalder * Added Map of the site, and dump of information per directory. Involved a lot of changes internally. * Use subdir command rather than dir for per-distribution HTML subtrees. * Changed the sort algorithm, was too slow for big archives. 0.70: ===== * Memory debugging through Insure++, removed a few nasty things. * Changes to support Caldera packages. * Warns in case of lack of resource lists. * Extended the language files. * Added extra header configuration. * Added patches from Gary Thomas (Changelog, zlib, typos). 0.60: ===== * ByDate is now completely splitted in reasonably sized chunks with next pointers. * ByName is now splitted into N separate files depending on the package first letter. 0.50: ===== * Added a fixed size limit to ByDate.html ... People are interested in fresh RPMs, not in a 800Kb HTML page ! MAX_PAGE_LENGHT in rpm2html.h for # of packages. * Added a -force flag to force the output of HTML pages, bypassing the file timestamp checking. * Added recursion in directories. The HTML follow the directory tree and is built on the fly. * Corrected serious errors in the HTML output. * Added a Spanish setup file, thanks to iolalla . Check http://keynes.cti.unav.es/eurielec/ too. 0.40: ===== * Multiple architecture support has been added. * Inserted table breaks in big lists of packages, this slighly breaks the nice alignment but helps the browser rendering a lot ! * Handle the file modification time to avoid rewriting all the files at each run, if not needed. This was breaking HTTP caching based on file timestamps! * Handle more than 2 Gig of RPM data. * Correct HTML output to be HTML 4.0 compliant. 0.30: ===== * Corrected bugs concerning generated links for Vendor and Distribution. * Added an header for navigation. * Corrected a small bug concerning the color front-end packing 0.25: ===== * Applied patches from Elliot Lee. * IMPORTANT: - the "url" field in the config file now indicate the URL (absolute or relative) to the set of generated HTML files, not the rpm2html Home page anymore ! - The mirrors for a directory are now indicated using the "mirror" keyword ! - Also there is no more way to change the rpm2html URI from the config file, one need to recompile. * Added PRINCIPLES and CHANGES * General cleanup of the configuration file handling. * Support for differents architectures (via directories). 0.2: ==== * A better page colorization rendering * Added the support for localization * Added support to dump the actual installed RPM base on the local machine. 0.1: ==== * First release $Id: CHANGES,v 1.41 2001/05/08 14:48:21 veillard Exp $ rpm2html-1.11.2/PRINCIPLES0000664000076400007640000001116506521237045013436 0ustar hanyhany How does rpm2html works ? ========================= The input of rpm2html are: 1/ a list of configuration files 2/ [optional] a language message file. Each configuration file is handled independently as if if was a new invocation of rpm2html. A configuration file represents a list of directories and a distribution as a whole. All the references between packages listed in the directories of a single config file are marked by hyperlinks in the resulting HTML files. Here is the process leading to the creation of the HTML pages: 1/ The configuration file is parsed, it sets all the default values for rpm2html. Then all the directory entries are parsed and a list of directories to scan is built. 2/ For each directory, the RPM are scanned, the HTML page describing the package is generated immediately. All resources provided and needed by the RPM file are stored in a list of resources. A list of parsed RPMs is also constructed. 3/ Once all the RPM for this config file have been scanned all resources are dumped in resources files with links to the RPM providing them (one could also add the RPM needing them but everything needs libc for example). 4/ The sorted lists of packages are generated by sorting the RPM list for various criteria and general front-end pages are generated unsing the new list order. 5/ The main page is generated with links to the various front-end pages, statistics and description of the packages analyzed. 6/ All the lists are freed and global variables are reset. rpm2html is now ready to handle the next configuration file. A configuration file represent a "distribution" where all the cross-links makes sense, e.g.: -->Dist --> srcs --> noarch --> i386 --> sparc --> alpha --> ppc Here is a possible configuration file for such a distribution where all the HTML files are stored in the same directory: ------------------- config.onedir ----------------- ; ; Sample configuration file for rpm2html ; when using a single directory for all HTML output ; maint=Joe mail=joe@mydistrib.org dir=/home/http/html/MyDistrib url=http://www.mydistrib.org/pub/mydistrib ftpsrc=ftp://ftp.mydistrib.org/pub/mydistrib/srcs host=MyDistrib.Org header=mailto:joe@mydistrib.org Feedback [/MyDistrib/RPM/srcs] name=Sources for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/srcs [/MyDistrib/RPM/noarch] name=Arch independant packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/noarch [/MyDistrib/RPM/i386] name=i386 packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/i386 [/MyDistrib/RPM/alpha] name=Alpha packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/alpha [/MyDistrib/RPM/sparc] name=Sparc packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/sparc [/MyDistrib/RPM/ppc] name=PPC packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/ppc ------------------------------------------------- In the second example, the front-end HTML pages are stored in a general directory, as well as all the resources pages. The HTML pages are stored in separate directories. To be able to provide cross linking between HTML pages located in different directories on the server, the "subdir" giving the relative URL path for the HTML directories is needed, e.g. : ----------------- config.multidir --------------- ; ; Sample configuration file for rpm2html ; when using separate directories for the HTML files. ; maint=Joe mail=joe@mydistrib.org dir=/home/http/html/MyDistrib ftpsrc=ftp://ftp.mydistrib.org/pub/mydistrib/srcs url=/mydistrib host=MyDistrib.Org header=mailto:joe@mydistrib.org Feedback [/MyDistrib/RPM/srcs] name=Sources for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/srcs subdir=srcs [/MyDistrib/RPM/noarch] name=Arch independant packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/noarch ftpsrc=ftp://ftp.mydistrib.org/pub/mydistrib/noarch subdir=noarch [/MyDistrib/RPM/i386] name=i386 packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/i386 subdir=i386 [/MyDistrib/RPM/alpha] name=Alpha packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/alpha subdir=alpha [/MyDistrib/RPM/sparc] name=Sparc packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/sparc subdir=sparc [/MyDistrib/RPM/ppc] name=PPC packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/ppc subdir=ppc ------------------------------------------------- In that case the HTTP server tree follow closely the ditribution tree but this is not mandatory. Daniel.Veillard@apocalypse.org $Id: PRINCIPLES,v 1.5 1998/04/28 02:25:41 veillard Exp $ rpm2html-1.11.2/missing0000777000076400007640000000000011466331653021204 2/usr/share/automake-1.11/missingustar hanyhanyrpm2html-1.11.2/NEWS0000664000076400007640000001460211466345163012546 0ustar hanyhanyrpm2html 1.11.2 *************** This release is considered development and may break compatibility with RPM releases other than rpm.org's rpm 4.6 . More testing is needed for development releases. Changes since last release 1.11.1: Minor improvements and fixes: * option 'dump_html_only_if_rpm_newer' has been added so users can enable the comparison of file modification timestamps of the RPM file and dumped HTML file - when enabled, HTML file is dumped for RPM file only if HTML does not exists yet or its timestamp is older than that of RPM file (default is disabled) note: for now it works only for per-RPM package HTML pages. rpm2html 1.11.1 *************** This release is considered development and may break compatibility with RPM releases other than rpm.org's rpm 4.6 . More testing is needed for development releases. Changes since last release 1.11.0: Minor improvements and fixes: * smoother RPM build using the supplied spec * reenabled support for package signature processing for RPM prior to 4.6 * fixed typos in man page (patch from Michal Čihař ) * removed double open which can bring speed-ups around 20% rpm2html 1.11.0 *************** This release is considered development and may break compatibility with RPM releases other than rpm.org's rpm 4.6 . Testing is needed for such releases. Changes since last release 1.10.0: New minor features: * preliminary support for compilation against RPM.org's rpm 4.6 using rpmlegacy.h rpm2html 1.10.0 *************** This release is considered stable and is not expected to break things. Changes since last release 1.9.7: None. Changes since last stable release 1.8.3: Some new features: * e-mail protection (mangle e-mail adresses in HTML output) * 'Mirrors' link can be configured in configuration file (see 'header=... Mirrors' line in example configuration files) * option 'rdf_count_limit' has been added so users can customize the limit of RDF export (default value was and still is 20) * possibility to build rpm2html using Lazarus libtemplate (http://www.lazarusid.com/libtemplate.shtml) and option 'html_template' to specify template to use * option 'cve_linking' (enabled by default) which adds hyperlinks to any CVE-xxxx-yyyy and CAN-xxxx-yyyy numbers occuring in the changelog (links go to cve.mitre.org) - based on patch from blacksuninc@users.sourceforge.net and a lot of bugfixes. rpm2html 1.9.7 ************** This release is considered development but it is not expected to break things. Changes since last release 1.9.6: New minor features: * protect more email addresses in changelog, not just those enclosed in <> plus protect also email addresses from PGP/GPG signatures and fixes: * fixed usage of configure's --with-gpg parameter - happened to be broken a while ago thus making it impossible to enable GPG support * do not use whole local directory name in page title rpm2html 1.9.6 ************** This release is considered development but it is not expected to break things. Changes since last release 1.9.5: Just fixes: * fixed error messages like "couldn't open /usr/share/man/man5/aliases.5.gz.rdf for writing !" * fixed error when compiling without libtemplate support * added 'BuildRequires: automake' into RPM spec file rpm2html 1.9.5 ************** This release is considered development but it is not expected to break things. Changes since last release 1.9.4: Just fixes: * fixed "rdf_count_limit" option handling (option has been so far ignored by mistake) * fixed setting of 'next_page' template variable for 'dates_next_page' template item ("..." link at the end of "by date" pages) rpm2html 1.9.4 ************** This release is considered development but (again and this time hopefully for real) is not expected to break things. Changes since last release 1.9.3: Just fixes: * fixed some memory leaks * fixed segmentation fault occuring when generating pages describing local configuration with libtemplate enabled * added missing BuildRequires into spec file Plus little more verbose messages has been added informing the user which general group of page generation is being done. rpm2html 1.9.3 ************** This release is considered development but (again) is not expected to break things. Changes since last release 1.9.2: New features: * possibility to build rpm2html using Lazarus libtemplate (http://www.lazarusid.com/libtemplate.shtml) and option 'html_template' to specify template to use * option 'cve_linking' (enabled by default) which adds hyperlinks to any CVE-xxxx-yyyy and CAN-xxxx-yyyy numbers occuring in the changelog (links go to cve.mitre.org) - based on patch from blacksuninc@users.sourceforge.net Fixes: * accept '(' and ')' in resource names thus fixing the Requires list for 64-bit packages - patch by R. Scott Bailey * accept '(' and ')' in groups thus reduce the amount of "garbled group" warnings * little documentation clean-up and update rpm2html 1.9.2 ************** This release is considered development but (again) is not expected to break things. Changes since last release 1.9.1: New features: * option 'rdf_count_limit' has been added so users can customize the limit of RDF export (default value was and still is 20) Fixes: * disabled length check for "garbled" warnings rpm2html 1.9.1 ************** This release is considered development but is not expected to break things. Changes since last release 1.9.0: New features: * 'Mirrors' link can be configured in configuration file (see 'header=... Mirrors' line in example configuration files) Fixes: * home page URLs has been updated * moderated "Invalid package : garbled release" error message: release is considered garbled if it is longer than 65 characters (instead of 20) * fixed coredumps caused by large changelogs rpm2html 1.9.0 ************** This release is considered development but is not expected to break things. Changes since last release 1.8.3: * added new feature: e-mail protection (mangle e-mail adresses in HTML output) - see 'protectemails' entry in manuel.html or example configuration files * fixed changelog parsing * fixed handling of empty filelists * home page URL has been updated in manuel.html rpm2html 1.8.3 ************** Changes since 1.8.2: * GIF images replaced with PNG images * fixed bugs in configure.in affecting usage of 'configure --with-gpg' $Id: NEWS,v 1.20 2010/11/09 22:25:55 hany Exp $ rpm2html-1.11.2/AUTHORS0000664000076400007640000000000007330561073013075 0ustar hanyhanyrpm2html-1.11.2/rpm2html.spec0000664000076400007640000002554411466345217014477 0ustar hanyhanySummary: Translates an RPM database and dependency information into HTML Name: rpm2html %define version 1.11.2 Version: %{version} Release: 1%{?dist} Group: Applications/System Source0: http://savannah.nongnu.org/download/rpm2html/rpm2html-%{version}.tar.gz URL: http://www.nongnu.org/rpm2html/ License: MIT BuildRoot: %{_tmppath}/%{name}-root BuildPreReq: rpm-devel BuildRequires: automake BuildRequires: bzip2-devel BuildRequires: libtemplate-devel BuildRequires: libxml2-devel BuildRequires: popt BuildRequires: zlib-devel Requires: gnupg %description The rpm2html utility automatically generates web pages that describe a set of RPM packages. The goals of rpm2html are to identify the dependencies between various packages, and to find the package(s) that will provide the resources needed to install a given package. Rpm2html analyzes the provides and requires of the given set of RPMs, and then shows the dependency cross-references using hypertext links. Rpm2html can now dump the meta data associated with RPM files into standard RDF files. Install rpm2html if you want a utility for translating information from an RPM database into HTML. %prep %setup -q %build ./autogen.sh %configure --sysconfdir=/etc \ --with-gpg \ --with-template make %{?_smp_mflags} # enable 'html_template' option sed -i -e 's#^;html_template=rpm2html.tpl#html_template=%{_sysconfdir}/%{name}.tpl#g' rpm2html.config* %install rm -rf $RPM_BUILD_ROOT install -d ${RPM_BUILD_ROOT}%{_bindir} install -d ${RPM_BUILD_ROOT}%{_sysconfdir} install -d ${RPM_BUILD_ROOT}%{_datadir}/rpm2html install -d ${RPM_BUILD_ROOT}%{_mandir}/man1 install -m 0755 rpm2html ${RPM_BUILD_ROOT}%{_bindir} install -m 0644 msg.* ${RPM_BUILD_ROOT}%{_datadir}/rpm2html/ install -m 0644 rpm2html.config rpm2html.tpl ${RPM_BUILD_ROOT}%{_sysconfdir} install -m 0644 rpm2html.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/rpm2html.1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc CHANGES BUGS Copyright PRINCIPLES README TODO %doc rpm2html-cdrom.config rpm2html-en.config rpm2html-rdf.config %{_datadir}/rpm2html %{_bindir}/rpm2html* %{_datadir}/rpm2html/msg.* %{_mandir}/man1/* %config(noreplace) %{_sysconfdir}/rpm2html.config %config(noreplace) %{_sysconfdir}/rpm2html.tpl %changelog * Tue Nov 9 2010 Peter Hanecak 1.11.2-1 - configure.in rpm2html.h: release 1.11.1 (development release) - NEWS rpm2html.spec.in: updated - config.c, html.c, rpm2html.config.test, rpm2html-en.config, rpm2html.h, rpmopen.c: added global option 'dump_html_only_if_rpm_newer' (off by default) * Thu Sep 30 2010 Peter Hanecak 1.11.1-1 - configure.in rpm2html.h: release 1.11.0 (development release) - NEWS rpm2html.spec.in: updated - rpmopen.c: removed double open - should speed things up around 20% - INSTALL: added "./autogen.sh" tip - rpm2html.1: fixed typos - patch from Michal Čihař - rpm2html.spec.in: run ./autogen.sh before ./configure to properly deal with various version of autotools we may encounter on various build machines - rpmopen.c: reenabled support for package signature processing for RPM prior to 4.6 * Tue Apr 28 2009 Peter Hanecak 1.11.0-1 - config.h.in configure.in rpmdata.h rpmopen.c: preliminary support for compilation against RPM.org's rpm 4.6 using rpmlegacy.h * Tue Apr 28 2009 Peter Hanecak 1.10.0-1 - configure.in rpm2html.h: release 1.10.0 (stable release) - NEWS rpm2html.spec.in: updated * Sat Nov 29 2008 Peter Hanecak 1.9.7-1 - html.c: do not use whole local directory name in page title - rpmopen.c: protect even email addresses from PGP/GPG signatures - rpmdata.c: protect more email addresses in changelog, not just those enclosed in <> - Makefile.am: fixed usage of configure's --with-gpg parameter * Wed Aug 29 2007 Peter Hanecak 1.9.6-1 - rdf.c: fixed error messages like "couldn't open /usr/share/man/man5/aliases.5.gz.rdf for writing !" - rpm2html.spec.in: added BuildRequires: automake - config.c: fixed error when compiling without libtemplate support * Tue May 15 2007 Peter Hanecak 1.9.5-1 - ChangeLog: fixed typo - html.c: fixed handling of "rdf_count_limit" option introduced in 1.9.2 - option has been so far ignored by mistake - html.c: fixed setting of 'next_page' template variable for 'dates_next_page' template item * Sat Apr 14 2007 Peter Hanecak 1.9.4-1 - config.c, rpmopen.c: fixed some memory leaks - html.c, rdf.c: little more verbose messages - html.c, rpm2html.tpl: fixed segmentation fault occuring when generating pages describing local configuration with libtemplate enabled - html.c: fixed minor typos - rpm2html.spec.in: added missing BuildRequires * Sun Apr 1 2007 Peter Hanecak 1.9.3-1 - build using Lazarus libtemplate - accept '(' and ')' in resource names thus fixing the Requires list for 64-bit packages - accept '(' and ')' in groups thus reduced the amount of "garbled group" warnings - added hyperlinking to any CVE-xxxx-yyyy and CAN-xxxx-yyyy numbers occuring in the changelog - little documentation clean-up and update - %%{dist} added to release - configs are now noreplace - removed crude autogen.sh hack - do not strip binary - properly install translations * Sun Sep 25 2005 Peter Hanecak 1.9.2-1 - option 'rdf_count_limit' has been added so users can customize the limit of RDF export (default value was and still is 20) - disabled length check for "garbled" warnings * Thu Aug 18 2005 Peter Hanecak 1.9.1-1 - 'Mirrors' link can be configured in configuration file (see 'header=... Mirrors' line in example configuration files) - home page URLs has been updated - moderated "Invalid package : garbled release" error message: release is considered garbled if it is longer than 65 characters (instead of 20) - fixed coredumps caused by large changelogs * Tue Apr 5 2005 Peter Hanecak 1.9.0-1 - added new feature: e-mail protection (mangle e-mail adresses in HTML output) - see 'protectemails' entry in manuel.html or example configuration files - fixed changelog parsing - fixed handling of empty filelists - home page URL has been updated in manuel.html * Mon Mar 14 2005 Peter Hanecak 1.8.3-1 - GIFs transformed to PNGs - fixed bugs in configure.in affecting usage of 'configure --with-gpg' - project maintenance taken over by me (Peter Hanecak) * Fri Sep 26 2003 Daniel Veillard 1.8.2-1 - made a new release based on the patches from Peter Hanecak * Fri Sep 26 2003 Peter Hanecak 1.8.1-2 - synchronized with Daniel Veillard's rpm2html-1.8.1-1 package - rpm2html-1.8.1-rpm42.patch based on rpm42 patch for apt by Gary Peck * Mon Aug 11 2003 Peter Hanecak 1.7-8.1 - synchronized with RedHat's rpm2html-1.7-8 package * Thu Nov 7 2002 Daniel Veillard - release of 1.8 - a bunch of cleanups w.r.t. spec, Makefiles, etc... - make sure RDF files are indented * Wed Aug 14 2002 Jeff Johnson 1.7-8 - initial port to rpm-4.1. * Tue Apr 30 2002 Peter Hanecak - rebuild against rpm-4.0.4 - droped old unused patches * Wed Feb 6 2002 Peter Hanecak - update to 1.7 - merged some stuff from RedHat's rpm2html-1.7-4 package - s/Copyright/License - dropped rpm2html-1.5-sig-5.patch and rpm2html-dup.patch patches * Wed Jan 02 2002 Florian La Roche - rebuild against new libs - update config.guess and config.sub for IA64 * Tue Jul 24 2001 Daniel Veillard - upgraded to 1.7 - cleaned up a potential problem with libxml2 - fixed BuildPrereqs * Wed Jul 18 2001 Daniel Veillard - upgraded to version 1.6 - removed the mysql support, this is too specific * Tue Jul 10 2001 Elliot Lee - Rebuild against rpm-4.0.3-0.65 - Use %%{?_smp_mflags} * Fri Jun 29 2001 Jeff Johnson - rebuild against rpm-4.0.3-0.54. * Wed May 23 2001 Jeff Johnson - rebuild against rpm-4.0.3-0.26. * Tue Dec 26 2000 Jeff Johnson - build against rpm-4.0.2-0.9. * Tue Dec 12 2000 Jeff Johnson - rebuild to remove 0777 directories. * Mon Dec 11 2000 Peter Hanecak - rpm2html-dup.patch by Alexey Nogin * Wed Nov 8 2000 Peter Hanecak - rpm2html-1.5-sig-5.patch: summary of previous patches plus typo fixes * Tue Nov 7 2000 Peter Hanecak - rpm2html-1.5-sig-speedup.patch to avoid unnecessary signature resolving * Sun Nov 5 2000 Peter Hanecak - rpm2html-1.5-sig-4.patch: summary of rpm2html-1.4-sig.patch and rpm2html-1.5-sig-memleak.patch plus configurable "resolving" feature using gnupg * Thu Nov 2 2000 Jeff Johnson - update to 1.5. - enable mysql support by default. * Wed Oct 25 2000 Peter Hanecak - rpm2html-1.5-sig-memleak.patch by Daniel Veillard * Tue Oct 3 2000 Peter Hanecak - rpm2html-1.4-sig.patch - experimental enhancement to include package signature info in .html pages * Mon Sep 25 2000 Peter Hanecak - update to 1.5 - .bz2 source archive - merged some stuff from Daniel Veillard's 1.5-1 spec * Fri Aug 4 2000 Jeff Johnson - remove exec permissions on data files. * Fri Jul 28 2000 Peter Hanecak - update to 1.4 - spec improvements * Thu Jul 13 2000 Prospector - automatic rebuild * Sun Jun 25 2000 Peter Hanecak - merged stuff from RedHat's rpm2html-1.2-8 - patches ported forward - rpm-4.0 patch - build against rpm-4.0-0.45 * Thu Jun 22 2000 Jeff Johnson - update to 1.4. * Tue Jun 20 2000 Jeff Johnson - coagulate rpm310/rpm40 patch into one. - better autoconf tests. * Mon Jun 19 2000 Jeff Johnson - rebuild against rpm-4.0-0.40 (needs -ldb-3.1). * Thu Jun 1 2000 Matt Wilson - use _mandir macros - build against new librpm to get correct libbz2 deps * Sat May 13 2000 Jeff Johnson - use rpm-3.1 API (hack). * Tue Feb 15 2000 Jeff Johnson - fix filename lossage with rpm-3.0.4. * Mon Feb 7 2000 Jeff Johnson - compress man pages. * Sat Oct 16 1999 Peter Hanecak - updated to 1.3 - some spec stuff from Daniel Veillard's spec * Sat Sep 25 1999 Jeff Johnson - recompile with rpm-3.0.3-1. * Thu Aug 12 1999 Jeff Johnson - move to Red Hat 6.1 distribution. * Wed Jul 21 1999 Tim Powers - rebuilt for 6.1 * Fri Apr 9 1999 Jeff Johnson - update to 1.2. * Fri Apr 2 1999 Jeff Johnson - repackage for Red Hat 6.0. rpm2html-1.11.2/rpm2html.spec.in0000664000076400007640000002554711466345056015110 0ustar hanyhanySummary: Translates an RPM database and dependency information into HTML Name: rpm2html %define version @VERSION@ Version: %{version} Release: 1%{?dist} Group: Applications/System Source0: http://savannah.nongnu.org/download/rpm2html/rpm2html-%{version}.tar.gz URL: http://www.nongnu.org/rpm2html/ License: MIT BuildRoot: %{_tmppath}/%{name}-root BuildPreReq: rpm-devel BuildRequires: automake BuildRequires: bzip2-devel BuildRequires: libtemplate-devel BuildRequires: libxml2-devel BuildRequires: popt BuildRequires: zlib-devel Requires: gnupg %description The rpm2html utility automatically generates web pages that describe a set of RPM packages. The goals of rpm2html are to identify the dependencies between various packages, and to find the package(s) that will provide the resources needed to install a given package. Rpm2html analyzes the provides and requires of the given set of RPMs, and then shows the dependency cross-references using hypertext links. Rpm2html can now dump the meta data associated with RPM files into standard RDF files. Install rpm2html if you want a utility for translating information from an RPM database into HTML. %prep %setup -q %build ./autogen.sh %configure --sysconfdir=/etc \ --with-gpg \ --with-template make %{?_smp_mflags} # enable 'html_template' option sed -i -e 's#^;html_template=rpm2html.tpl#html_template=%{_sysconfdir}/%{name}.tpl#g' rpm2html.config* %install rm -rf $RPM_BUILD_ROOT install -d ${RPM_BUILD_ROOT}%{_bindir} install -d ${RPM_BUILD_ROOT}%{_sysconfdir} install -d ${RPM_BUILD_ROOT}%{_datadir}/rpm2html install -d ${RPM_BUILD_ROOT}%{_mandir}/man1 install -m 0755 rpm2html ${RPM_BUILD_ROOT}%{_bindir} install -m 0644 msg.* ${RPM_BUILD_ROOT}%{_datadir}/rpm2html/ install -m 0644 rpm2html.config rpm2html.tpl ${RPM_BUILD_ROOT}%{_sysconfdir} install -m 0644 rpm2html.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/rpm2html.1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc CHANGES BUGS Copyright PRINCIPLES README TODO %doc rpm2html-cdrom.config rpm2html-en.config rpm2html-rdf.config %{_datadir}/rpm2html %{_bindir}/rpm2html* %{_datadir}/rpm2html/msg.* %{_mandir}/man1/* %config(noreplace) %{_sysconfdir}/rpm2html.config %config(noreplace) %{_sysconfdir}/rpm2html.tpl %changelog * Tue Nov 9 2010 Peter Hanecak 1.11.2-1 - configure.in rpm2html.h: release 1.11.1 (development release) - NEWS rpm2html.spec.in: updated - config.c, html.c, rpm2html.config.test, rpm2html-en.config, rpm2html.h, rpmopen.c: added global option 'dump_html_only_if_rpm_newer' (off by default) * Thu Sep 30 2010 Peter Hanecak 1.11.1-1 - configure.in rpm2html.h: release 1.11.0 (development release) - NEWS rpm2html.spec.in: updated - rpmopen.c: removed double open - should speed things up around 20% - INSTALL: added "./autogen.sh" tip - rpm2html.1: fixed typos - patch from Michal Čihař - rpm2html.spec.in: run ./autogen.sh before ./configure to properly deal with various version of autotools we may encounter on various build machines - rpmopen.c: reenabled support for package signature processing for RPM prior to 4.6 * Tue Apr 28 2009 Peter Hanecak 1.11.0-1 - config.h.in configure.in rpmdata.h rpmopen.c: preliminary support for compilation against RPM.org's rpm 4.6 using rpmlegacy.h * Tue Apr 28 2009 Peter Hanecak 1.10.0-1 - configure.in rpm2html.h: release 1.10.0 (stable release) - NEWS rpm2html.spec.in: updated * Sat Nov 29 2008 Peter Hanecak 1.9.7-1 - html.c: do not use whole local directory name in page title - rpmopen.c: protect even email addresses from PGP/GPG signatures - rpmdata.c: protect more email addresses in changelog, not just those enclosed in <> - Makefile.am: fixed usage of configure's --with-gpg parameter * Wed Aug 29 2007 Peter Hanecak 1.9.6-1 - rdf.c: fixed error messages like "couldn't open /usr/share/man/man5/aliases.5.gz.rdf for writing !" - rpm2html.spec.in: added BuildRequires: automake - config.c: fixed error when compiling without libtemplate support * Tue May 15 2007 Peter Hanecak 1.9.5-1 - ChangeLog: fixed typo - html.c: fixed handling of "rdf_count_limit" option introduced in 1.9.2 - option has been so far ignored by mistake - html.c: fixed setting of 'next_page' template variable for 'dates_next_page' template item * Sat Apr 14 2007 Peter Hanecak 1.9.4-1 - config.c, rpmopen.c: fixed some memory leaks - html.c, rdf.c: little more verbose messages - html.c, rpm2html.tpl: fixed segmentation fault occuring when generating pages describing local configuration with libtemplate enabled - html.c: fixed minor typos - rpm2html.spec.in: added missing BuildRequires * Sun Apr 1 2007 Peter Hanecak 1.9.3-1 - build using Lazarus libtemplate - accept '(' and ')' in resource names thus fixing the Requires list for 64-bit packages - accept '(' and ')' in groups thus reduced the amount of "garbled group" warnings - added hyperlinking to any CVE-xxxx-yyyy and CAN-xxxx-yyyy numbers occuring in the changelog - little documentation clean-up and update - %%{dist} added to release - configs are now noreplace - removed crude autogen.sh hack - do not strip binary - properly install translations * Sun Sep 25 2005 Peter Hanecak 1.9.2-1 - option 'rdf_count_limit' has been added so users can customize the limit of RDF export (default value was and still is 20) - disabled length check for "garbled" warnings * Thu Aug 18 2005 Peter Hanecak 1.9.1-1 - 'Mirrors' link can be configured in configuration file (see 'header=... Mirrors' line in example configuration files) - home page URLs has been updated - moderated "Invalid package : garbled release" error message: release is considered garbled if it is longer than 65 characters (instead of 20) - fixed coredumps caused by large changelogs * Tue Apr 5 2005 Peter Hanecak 1.9.0-1 - added new feature: e-mail protection (mangle e-mail adresses in HTML output) - see 'protectemails' entry in manuel.html or example configuration files - fixed changelog parsing - fixed handling of empty filelists - home page URL has been updated in manuel.html * Mon Mar 14 2005 Peter Hanecak 1.8.3-1 - GIFs transformed to PNGs - fixed bugs in configure.in affecting usage of 'configure --with-gpg' - project maintenance taken over by me (Peter Hanecak) * Fri Sep 26 2003 Daniel Veillard 1.8.2-1 - made a new release based on the patches from Peter Hanecak * Fri Sep 26 2003 Peter Hanecak 1.8.1-2 - synchronized with Daniel Veillard's rpm2html-1.8.1-1 package - rpm2html-1.8.1-rpm42.patch based on rpm42 patch for apt by Gary Peck * Mon Aug 11 2003 Peter Hanecak 1.7-8.1 - synchronized with RedHat's rpm2html-1.7-8 package * Thu Nov 7 2002 Daniel Veillard - release of 1.8 - a bunch of cleanups w.r.t. spec, Makefiles, etc... - make sure RDF files are indented * Wed Aug 14 2002 Jeff Johnson 1.7-8 - initial port to rpm-4.1. * Tue Apr 30 2002 Peter Hanecak - rebuild against rpm-4.0.4 - droped old unused patches * Wed Feb 6 2002 Peter Hanecak - update to 1.7 - merged some stuff from RedHat's rpm2html-1.7-4 package - s/Copyright/License - dropped rpm2html-1.5-sig-5.patch and rpm2html-dup.patch patches * Wed Jan 02 2002 Florian La Roche - rebuild against new libs - update config.guess and config.sub for IA64 * Tue Jul 24 2001 Daniel Veillard - upgraded to 1.7 - cleaned up a potential problem with libxml2 - fixed BuildPrereqs * Wed Jul 18 2001 Daniel Veillard - upgraded to version 1.6 - removed the mysql support, this is too specific * Tue Jul 10 2001 Elliot Lee - Rebuild against rpm-4.0.3-0.65 - Use %%{?_smp_mflags} * Fri Jun 29 2001 Jeff Johnson - rebuild against rpm-4.0.3-0.54. * Wed May 23 2001 Jeff Johnson - rebuild against rpm-4.0.3-0.26. * Tue Dec 26 2000 Jeff Johnson - build against rpm-4.0.2-0.9. * Tue Dec 12 2000 Jeff Johnson - rebuild to remove 0777 directories. * Mon Dec 11 2000 Peter Hanecak - rpm2html-dup.patch by Alexey Nogin * Wed Nov 8 2000 Peter Hanecak - rpm2html-1.5-sig-5.patch: summary of previous patches plus typo fixes * Tue Nov 7 2000 Peter Hanecak - rpm2html-1.5-sig-speedup.patch to avoid unnecessary signature resolving * Sun Nov 5 2000 Peter Hanecak - rpm2html-1.5-sig-4.patch: summary of rpm2html-1.4-sig.patch and rpm2html-1.5-sig-memleak.patch plus configurable "resolving" feature using gnupg * Thu Nov 2 2000 Jeff Johnson - update to 1.5. - enable mysql support by default. * Wed Oct 25 2000 Peter Hanecak - rpm2html-1.5-sig-memleak.patch by Daniel Veillard * Tue Oct 3 2000 Peter Hanecak - rpm2html-1.4-sig.patch - experimental enhancement to include package signature info in .html pages * Mon Sep 25 2000 Peter Hanecak - update to 1.5 - .bz2 source archive - merged some stuff from Daniel Veillard's 1.5-1 spec * Fri Aug 4 2000 Jeff Johnson - remove exec permissions on data files. * Fri Jul 28 2000 Peter Hanecak - update to 1.4 - spec improvements * Thu Jul 13 2000 Prospector - automatic rebuild * Sun Jun 25 2000 Peter Hanecak - merged stuff from RedHat's rpm2html-1.2-8 - patches ported forward - rpm-4.0 patch - build against rpm-4.0-0.45 * Thu Jun 22 2000 Jeff Johnson - update to 1.4. * Tue Jun 20 2000 Jeff Johnson - coagulate rpm310/rpm40 patch into one. - better autoconf tests. * Mon Jun 19 2000 Jeff Johnson - rebuild against rpm-4.0-0.40 (needs -ldb-3.1). * Thu Jun 1 2000 Matt Wilson - use _mandir macros - build against new librpm to get correct libbz2 deps * Sat May 13 2000 Jeff Johnson - use rpm-3.1 API (hack). * Tue Feb 15 2000 Jeff Johnson - fix filename lossage with rpm-3.0.4. * Mon Feb 7 2000 Jeff Johnson - compress man pages. * Sat Oct 16 1999 Peter Hanecak - updated to 1.3 - some spec stuff from Daniel Veillard's spec * Sat Sep 25 1999 Jeff Johnson - recompile with rpm-3.0.3-1. * Thu Aug 12 1999 Jeff Johnson - move to Red Hat 6.1 distribution. * Wed Jul 21 1999 Tim Powers - rebuilt for 6.1 * Fri Apr 9 1999 Jeff Johnson - update to 1.2. * Fri Apr 2 1999 Jeff Johnson - repackage for Red Hat 6.0. rpm2html-1.11.2/rpm2html.10000664000076400007640000001254311452634006013670 0ustar hanyhany.\" @(#)Rpm2html-0.70 .\" Copyright 1998 Daniel Veillard .TH rpm2html 1 "22 Feb 1998" .SH NAME rpm2html \- make an html database from rpm repository .SH SYNOPSIS .B rpm2html .RB [ \-q ][ \-v ][ \-force ][ \-lang " langfile] " config-file .SH DESCRIPTION .IX Rpm2html tries to solve 2 big problems one face when grabbing a RPM package from a mirror on the net and trying to install it: .TP 5 - it gives more information than just the filename before installing the package. .BR .TP 5 - it tries to solve the dependency problem by analyzing all the Provides and Requires of the set of RPMs. It shows the cross references by the way of hypertext links. .BR .IX .RE .LP The second point will only be efficient if the actual number of indexed RPMs is important. Each configuration file is handled independently as if it was a new invocation of rpm2html. A configuration file represents a list of directories and a ditribution as a whole. All the references between packages listed in the directories of a single config file are marked by hyperlinks in the resulting HTML files. Here is the process leading to the creation of the HTML pages: 1/ The configuration file is parsed, it sets all the default values for rpm2html. Then all the directory entries are parsed and a list of directories to scan is built. 2/ For each directory, the RPM are scanned, the HTML page describing the package is generated immediately.All ressources provided and needed by the RPM file are stored in a list of ressources. A list of parsed RPMs is also constructed. 3/ Once all the RPM for this config file have been scanned all ressources are dumped in ressources files with links to the RPM providing them (one could also add the RPM needing them but everything needs libc for example). 4/ The sorted lists of packages are generated by sorting the RPM list for various criteria and general front-end pages are generated unsing the new list order. 5/ The main page is generated with links to the various front-end pages, statistics and description of the packages analyzed. 6/ All the lists are freed and global variables are reset. rpm2html is now ready to handle the next configuration file. .SH CONFIGURATION A configuration file a text file, lines beginning with semicolumns are comments. The first part is a global section defining some important parameters of rpm2html. Parameters are defined with the syntax: .TP 5 variable=value .RE Values shouln't be quoted and end up with the end of line The folowing variables are supported: .RE .TP 10 .IR maint The maintainer of the local mirror, NEEDED ! .TP 10 .IR mail The E-mail of the maintainer, NEEDED ! .TP 10 .IR dir The directory for for the HTML output, NEEDED ! .TP 10 .IR url The URL for the HTML files on the WWW server .TP 10 .IR host The hostname for the server. .RE .BR After these variables, one section should be filled for each directory on your system containing RPM files. It starts with the directory filename between brackets: [The name between brackets is the directory, NEEDED !] The special directory name [localbase] extract information from the RPM base of installed software instead of listing a directory. It allows to dump HTML pages for the installed RPM base on a machine. All the variables defined below until the next directory or the end of file pertain to this directory. Here are the possible variables: .TP 10 .I name A significant name for this mirror, NEEDED ! .TP 10 .I ftp The original FTP/HTTP url, NEEDED ! .TP 10 .I ftpsrc Where the associated sources are stored .TP 10 .I color Background color for pages .TP 10 .I trust Unused yet .TP 10 .I url The local FTP/HTTP url. .RE It is possible to indicate other mirrors by adding some mirror=value lines withing the section. The first one will be considered the local one. .SH EXAMPLE Example of configuration files: .BR .nf .sp ; ; Sample configuration file for rpm2html ; maint=Joe mail=joe@mydistrib.org dir=/home/http/html/MyDistrib url=/Mydistrib tree=true rdf=true rdf_dir=/home/ftp/pub/mydistrib/RDF [/MyDistrib/RPM/noarch] name=Arch independent packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/noarch subdir=noarch [/MyDistrib/RPM/i386] name=i386 packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/i386 ftpsrc=ftp://ftp.mydistrib.org/pub/mydistrib/srcs color=#e0ffff subdir=i386 mirror=ftp://ftp.mydistrib.org/pub/mydistrib/i386 mirror=ftp://ftp.elsewhere.org/pub/mydistrib/i386 [/MyDistrib/RPM/alpha] name=Alpha packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/alpha ftpsrc=ftp://ftp.mydistrib.org/pub/mydistrib/srcs color=#ffe0ff subdir=alpha mirror=ftp://ftp.mydistrib.org/pub/mydistrib/alpha mirror=ftp://ftp.elsewhere.org/pub/mydistrib/alpha [/MyDistrib/RPM/sparc] name=Sparc packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/sparc ftpsrc=ftp://ftp.mydistrib.org/pub/mydistrib/srcs color=#ffffe0 subdir=sparc [/MyDistrib/RPM/ppc] name=PPC packages for MyDistrib ftp=ftp://ftp.mydistrib.org/pub/mydistrib/ppc ftpsrc=ftp://ftp.mydistrib.org/pub/mydistrib/srcs color=#e0ffe0 subdir=ppc mirror=ftp://ftp.mydistrib.org/pub/mydistrib/ppc mirror=ftp://ftp.pear.com/pub/mydistrib/ppc .sp .SH OPERANDS The following operands are supported: .TP 5 .I files List of configuration files .SH "EXIT STATUS" The following exit values are returned: .TP 4 .B 0 Successful completion. .TP .B >0 An error occurred. .SH SEE ALSO .BR rpm(1), rpm2html-1.11.2/ChangeLog0000664000076400007640000003530411466345127013623 0ustar hanyhanyTue Nov 9 23:05:47 CET 2010 Peter Hanecak * configure.in rpm2html.h: release 1.11.2 (development release) * NEWS rpm2html.spec.in: updated * config.c, html.c, rpm2html.config.test, rpm2html-en.config, rpm2html.h, rpmopen.c: added global option 'dump_html_only_if_rpm_newer' (off by default) Tue Oct 5 16:33:05 CEST 2010 Peter Hanecak * INSTALL, SQL_TODO, TODO, cleanup.c, help.html, language.c, manuel.html, memory.c, mirror.html, mirroring.html, rdf.c, rdf.h, rdf_api.c, rpm2html.1, rpm2html.tpl, rpmdata.h, rpmopen.c, rpmopen.py, sql.c, mirrorfind/mirrorfind.c: fixed typo - s/informations/information (thanks to Michal Čihař ) Thu Sep 30 21:37:10 CEST 2010 Peter Hanecak * configure.in rpm2html.h: release 1.11.1 (development release) * NEWS rpm2html.spec.in: updated * rpm2html.spec.in: fixed minor typo Wed Sep 29 21:58:42 CEST 2010 Peter Hanecak * rpmopen.c: removed double open - should speed things up around 20% Mon May 3 22:29:19 CEST 2010 Peter Hanecak * INSTALL: added "./autogen.sh" tip Mon Jan 4 22:23:16 CET 2010 Peter Hanecak * rpm2html.1: fixed typos - patch from Michal Čihař Mon Jul 6 21:18:02 CEST 2009 Peter Hanecak * rpm2html.spec.in: run ./autogen.sh before ./configure to properly deal with various version of autotools we may encounter on various build machines * rpmopen.c: reenabled support for package signature processing for RPM prior to 4.6 Tue Apr 28 22:28:17 CEST 2009 Peter Hanecak * configure.in rpm2html.h: release 1.11.0 (development release) * NEWS rpm2html.spec.in: updated * config.h.in configure.in rpmdata.h rpmopen.c: preliminary support for compilation against RPM.org's rpm 4.6 using rpmlegacy.h Tue Apr 28 20:42:32 CEST 2009 Peter Hanecak * configure.in rpm2html.h: release 1.10.0 (stable release) * NEWS rpm2html.spec.in: updated Thu Dec 4 18:18:43 CET 2008 Peter Hanecak * rpm2html.1: applied patch from Michal Čihař to fix escaping in command line options section Sat Nov 29 21:11:10 CET 2008 Peter Hanecak * configure.in rpm2html.h: release 1.9.7 (development release) Sun Nov 16 23:16:23 CET 2008 Peter Hanecak * html.c: do not use whole local directory name in page title Fri Nov 14 00:55:48 CET 2008 Peter Hanecak * rpmopen.c: protect even email addresses from PGP/GPG signatures * rpmdata.c: protect more email addresses in changelog, not just those enclosed in <> * Makefile.am: fixed usage of configure's --with-gpg parameter Tue Aug 28 22:54:02 CEST 2007 Peter Hanecak * configure.in rpm2html.h: release 1.9.6 (development release) * NEWS rpm2html.spec.in: updated * rdf.c: fixed error messages like "couldn't open /usr/share/man/man5/aliases.5.gz.rdf for writing !" * rpm2html.spec.in: added BuildRequires: automake Fri Jul 13 00:20:15 CEST 2007 Peter Hanecak * config.c: fixed error when compiling without libtemplate support Tue May 15 23:56:32 CEST 2007 Peter Hanecak * configure.in rpm2html.h: release 1.9.5 (development release) * NEWS rpm2html.spec.in: updated * ChangeLog: fixed typo Tue May 15 01:04:43 CEST 2007 Peter Hanecak * html.c: fixed handling of "rdf_count_limit" option introduced in 1.9.2 - option has been so far ignored by mistake Sat May 12 00:41:37 CEST 2007 Peter Hanecak * html.c: fixed setting of 'next_page' template variable for 'dates_next_page' template item Sat Apr 14 17:37:49 CEST 2007 Peter Hanecak * configure.in rpm2html.h: release 1.9.4 (development release) * NEWS rpm2html.spec.in: updated * rpm2html.h: updated URL and contact info * config.c, rpmopen.c: fixed some memory leaks * html.c, rdf.c: little more verbose messages * html.c, rpm2html.tpl: fixed segmentation fault occuring when generating pages describing local configuration with libtemplate enabled Mon Apr 2 23:28:37 CEST 2007 Peter Hanecak * html.c: fixed minor typos * rpm2html.spec.in: added missing BuildRequires Sun Apr 1 14:35:48 CEST 2007 Peter Hanecak * rpm2html.spec.in: do not strip binary * rpm2html.spec.in: properly install translations * rpm2html.spec.in: removed crude autogen.sh hack * rpmopen.c: fixed bug #17152: dependencies on 64-bit packages are ignored * config.c, html.c, rpm2html-en.config, rpm2html.config.test, rpm2html.h: added hyperlinking to any CVE-xxxx-yyyy and CAN-xxxx-yyyy numbers occuring in the changelog - see 'cve_linking' option enabled by default (based on patch from blacksuninc@users.sourceforge.net) * configure.in rpm2html.h: release 1.9.3 (development release) * NEWS rpm2html.spec.in: updated * rpm2html.spec.in: build using Lazarus libtemplate * rpm2html.spec.in: %%{dist} added to release * rpm2html.spec.in: configs are now noreplace * rpmfind.html, history.html, links.html: removed - too old to maintain * PROJECT_ABANDONNED, docs.html, download.html, faq.html, feedback.html, help.html, index.html, license.html, mirroring.html, mirrors.html, news.html, resync.py, template.html: documentation clean-up and update of URLs * Makefile.am, config.c, config.h.in, configure.in, html.c, rpm2html.c, rpm2html.h, rpm2html.tpl: added support for Lazarus libtemplate Wed Jun 28 21:39:53 CEST 2006 Peter Hanecak * rpmopen.c: accept '(' and ')' in group - recently quite a lot of packages contain them so this supresses "Invalid package .rpm : garbled group" message for such packages Sun Sep 25 18:33:33 CEST 2005 Peter Hanecak * configure.in rpm2html.h: release 1.9.2 (development release) * NEWS rpm2html.spec.in: updated * config.c html.c rpm2html-en.config rpm2html.config.test rpm2html.h: hardcoded RDF export count limit of 20 transformed to configuration option "rdf_count_limit" (with default value 20) * rpmopen.c: disabled length check for "garbled" warnings Thu Aug 18 22:23:54 CEST 2005 Peter Hanecak * configure.in rpm2html.h: release 1.9.1 (development release) * NEWS rpm2html.spec.in: updated * TODO: updated * updated address of FSF Fri Apr 29 22:52:06 CEST 2005 Peter Hanecak * html.py, rpm2html.spec.in: updated URLs * html.c, html.py, resync.py, rpm2html-en.config, rpm2html-rdf.config, rpm2html.config: transformed 'Mirrors' link to be configurable in configuration file * ChangeLog NEWS: updated * rpmopen.c: checkReleaseName(): release is considered garbled if it is longer than 65 characters (instead of 20) Thu Apr 28 19:59:32 CEST 2005 Peter Hanecak * rpmopen.c: fixed coredumps caused by large changelogs Tue Apr 5 21:29:54 CEST 2005 Peter Hanecak * configure.in rpm2html.h: release 1.9.0 (development release) * ChangeLog NEWS rpm2html.spec.in: updated * TODO: updated * Makefile.am: removed 'mkinstalldirs' from 'FILES' so distribution tarball creation works again Wed Mar 16 22:04:14 CET 2005 Peter Hanecak * rpmopen.c: changelog parsing fix * rpmopen.c: empty filelist handling fixed * config.c rpm2html.h rpmdata.c rpmdata.h rpmopen.c: new feature: e-mail protection (e-mails are mangled in HTML output); turned off by default * resync.py rpm2html-en.config rpm2html.config rpm2html.config.mirrors rpm2html.config.test: added 'protectemails=true' option * manuel.html: added info about 'protectemails' option * manuel.html: updated homepage URL * TODO: updated Tue Mar 15 18:33:54 CET 2005 Peter Hanecak * TODO: updated Mon Mar 14 15:04:44 CET 2005 Peter Hanecak * configure.in rpm2html.h: release 1.8.3 * ChangeLog NEWS rpm2html.spec.in: updated * configure.in: fixed bugs affecting usage of 'configure --with-gpg' Tue Mar 8 15:51:05 CET 2005 Peter Hanecak * DoInstall DoUpgrade Makefile.am html.c mirroring.html msg.cz msg.pl: GIFs transformed to PNGs * dir.png french.png mirroring.png new.png: created from GIFs * dir.gif french.gif mirroring.gif new.gif: removed * PROJECT_ABANDONNED: maintenance takeover notice Tue Dec 16 17:41:59 CET 2003 Fabrice Bellet * rpmopen.c: bugs with rpm-4.2 : wrong prototype of rpmReadSignature(), and fixed the way the filelist is built. Fri Sep 26 21:48:47 CEST 2003 Daniel Veillard * configure.in rpm2html.spec.in: applied patches from Peter Hanecak and released 1.8.2 Tue Apr 29 19:03:16 CEST 2003 Daniel Veillard * index.html: cleaned up the status Mon Apr 7 23:07:15 CEST 2003 Daniel Veillard * search.php: test of CVS Thu Apr 3 17:09:09 CEST 2003 Daniel Veillard * search.php: link to the BitTorrent service, improve text. Wed Feb 12 11:16:08 CET 2003 Fabrice Bellet * rpmopen.c: set the transaction flags to perform minimal checkings, to solve performance issues with rpm-4.1. Tue Dec 17 19:50:43 CET 2002 Daniel Veillard * search.html: set focus to the form first field. Sat Dec 14 20:39:07 CET 2002 Daniel Veillard * index.html README: stoping the project. Tue Dec 10 16:42:10 CET 2002 Daniel Veillard * rpmopen.c: Hugh I Buchanan found a problem when package signature can't be verified on new librpm versions. Sat Nov 16 12:33:01 CET 2002 Daniel Veillard * everything: released 1.8.0 and then 1.8.1 * download: updated the CVS informations to point to the new CVS Fri Sep 13 10:49:42 CEST 2002 Daniel Veillard * search.php: restored the search based on provides name Wed Mar 27 09:07:02 CET 2002 Daniel Veillard * mirrors.html: updated the address of the mirror in Hong Kong Sat Mar 16 09:29:43 CET 2002 Daniel Veillard * faq.html: the question about the MD5 mismatch is really the top FAQ nowadays. Sun Feb 17 00:33:15 CET 2002 Daniel Veillard * config.py rpmopen.py sql.py html.py: lot of work on the pythonization, dumps rdf resources, database cleanups... Thu Feb 14 23:48:53 CET 2002 Daniel Veillard * config.py: the configuration file parser. Thu Feb 14 22:22:49 CET 2002 Daniel Veillard * rpmopen.py: filling up the DB and starting to dump pages Thu Feb 14 14:20:28 CET 2002 Daniel Veillard * sql.py rpmopen.py: more work toward Python translation Wed Feb 13 23:32:21 CET 2002 Daniel Veillard * sql.py: start migrating at least part of the code to python Sun Jan 27 22:19:17 CET 2002 Daniel Veillard * search.php: cleaned up the PHP code and added System and Arch optional filters. Sat Jan 26 12:52:37 CET 2002 Daniel Veillard * searchnvr.php: to use in conjunction with /var/log/rpmpkgs when trying to salvage a machine whose RPM database content has been lost Sun Nov 11 17:00:28 CET 2001 Daniel Veillard * search.php: improved the query to extract the site URLs Sat Aug 18 13:50:44 CEST 2001 Daniel Veillard * Makefile.am configure.in: fixing the Makefiles when compiling with the database support enabled, this time the mechanism should be reliable. Tue Aug 14 12:40:03 CEST 2001 Daniel Veillard * rpmopen.c: fix to compile with rpm < 4.0.3 Mon Aug 13 10:56:31 CEST 2001 Daniel Veillard * search.php: try to avoid generating // in URL paths Sun Jul 29 06:01:48 EDT 2001 Daniel Veillard * AUTHORS ChangeLog NEWS acconfig.h config.guess config.h.in config.sub configure.in rpm2html.[hc] rpm2html.spec rpmopen.c: switched to automake, release now 3 digits, cleanups for rpm-4.0.3 Tue Jul 24 22:35:55 CEST 2001 Daniel Veillard * Makefile.in configure.in rpm2html.h: release of version 1.7 Thu Jul 19 21:37:27 CEST 2001 Daniel Veillard * rdf_api.c: fixed a problem with libxml2 * sql.c sqltools.c: fixed an RDF resource generation error Wed Jul 18 18:48:50 CEST 2001 Daniel Veillard * Makefile.in configure.in rpm2html.h: release of version 1.6 uses libxml2 by default now * Changelog INSTALL *.html: changed email address * rdf_api.c: cleanup for libxml2 * rpm2html.spec: upgraded to use Red Hat's one * rpmopen.c: patch for recent RPMs Fri Jun 22 18:22:25 CEST 2001 Daniel Veillard * rpm2html-en.config: fixed the RH 7.1 alpha paths Fri Jun 22 10:31:44 CEST 2001 Fabrice Bellet * search.php: order matching packages according to their "major.minor.micro.extra" version number. Tue Jun 19 10:46:43 CEST 2001 Daniel Veillard * download.html: added a link to the commit logs archives Mon Jun 18 20:26:21 CEST 2001 Daniel Veillard * rpm2html-mysql-setup.txt: added a seriously modified version of the contribution by Michael B. Weiner Tue Jun 12 13:20:12 CEST 2001 Daniel Veillard * rpm2html.config: fix to close bug #44237 apache root has changed to conform the LSB. Also updated the Red Hat ftp URLs Tue May 22 12:50:09 CEST 2001 Daniel Veillard * search.php: www.rpmfind.net is speakeasy, FTP should be directed there. Tue May 22 12:31:05 CEST 2001 Daniel Veillard * search.php: changed '-$arch' to '.$arch' in the link name output Mon May 21 09:05:34 CEST 2001 Daniel Veillard * config.test rpm2html-en.config rpm2html.config.mirrors: fixed a few RDF links Mon May 21 08:59:52 CEST 2001 Daniel Veillard * mirrors.html: updated UserFriendly Network URL Thu May 17 12:35:12 PDT 2001 Daniel Veillard * sql.c: changed reindex to use rpm2html-local.config instead of rpm2html-en.config Thu May 17 20:51:30 CEST 2001 Daniel Veillard * rpm2html-en.config: added speakeasy and fr2 lists of mirrors Mon May 14 14:16:58 CEST 2001 Daniel Veillard * rpm2html-en.config: fixed helix -> ximian, new tree for redhat and powertools Sun May 13 10:49:27 PDT 2001 Daniel Veillard * search.php: fixed the display of the mirrors, added queries Sun May 13 10:27:22 PDT 2001 Daniel Veillard * sql.c search.php: starting to add a Searches table for mirrors * Changelog: added to follow a good established tradition rpm2html-1.11.2/msg.fr0000664000076400007640000000544206777046340013174 0ustar hanyhany; ; Automatically generated rpm2html 0.1 language file ; .html Gnr par index.html Groups.html ByDate.html ByName.html Vendors.html Distribs.html Bienvenue sur le repertoire RPM de

rpm2html gnre automatiquement des pages HTML qui dcrivent un ensemble de paquetages RPM.

Le but de rpm2html est aussi d'identifier les dpendances entre divers paquetages, et fournit ainsi le moyen de trouver les paquetages fournissant les ressources necessaire a l'installation d'un autre paquetage. Chaque paquetage est analys pour en extraire les dpendances et les ressources qu'il offre. Ces relations sont matrialises a l'aide de liens hypertextes. Il est alors possible de trouver le paquetage fournissant la ressource dont vous avez besoin juste a l'aide de quelques click!

L'utilit de ces pages peut etre grandement amliore par un indexage, il est alors possible de trouver instantanment les paquetages qui fournissent une fonctionnalit cherche (du moins tant que le mainteneur du paquetage l'a comment correctement).

Des instructions pour construire votre mirroir de ce site sont disponibles.

Cette archive hberge %d RPMs pour un total de %d MOctets de donnes %d RPM sont actuellement installs sur cette machine pour un total de %d MOctets La liste des RPM indexs par categorie RPM indexs par date de cration RPM indexs par nom RPM indexs par mainteneur RPM indexs par distribution RPM indexs par date d'installation Rpertoire des sources Mirroir local Mirroirs La gnration a pris secondes Bienvenue sur description RPM de De Nom Distribution Version Vendeur Release Date de construction Date d'installation Groupe Site de construction Taille RPM des sources Mainteneur Url Description Fournit Ncessite Copyright Fichiers Pas de fichiers dans le paquetage ! Pas de description ! Ressource RPM Fournie par Index par groupe RPMs du groupe Index par distribution RPMs de la distribution Index par vendeur RPMs fournis par Index par date de cration Index par date d'installation RPMs de moins de trois jours RPMs de moins d'une semaine RPMs de moins de deux semaines RPMs de moins d'un mois RPMs de plus d'un mois RPMs installs il y a moins de trois jours RPMs installs il y a moins d'une semaine RPMs installs il y a moins de deux semaines RPMs installs il y a moins d'un mois RPMs installs il y a plus d'un mois Index par nom Pas de description ! Inconnu Nant groupe/inconnu site.inconnu Index Paquetages commencant par la lettre Attention : ce paquetage n'exporte pas de listes de ressources Essayez d'en slectionner un autre Suite Historique Sous-Repertoires Tree.html Parcourez l'arbre resultant rpm2html-1.11.2/msg.es0000664000076400007640000000567206531461200013161 0ustar hanyhany; ; Automatically generated rpm2html 0.1 language file ; .html Generado por index.html Groups.html ByDate.html ByName.html Vendors.html Distribs.html Bienvenido a la base de datos de RPMs de

rpm2html genera automáticamente paginas web describiendo paquetes RPM.

El objetivo de rpm2html es identificar las dependencias entre distintos paquetes y facilitar asi el acceso a los recursos necesarios para la instalación de un paquete en particular. Cada paquete es analizado para conocer sus dependencias y utilidades que ofrece. Estas relaciones son reflejadas empleando vinculos (links) a las distintas paginas generadas. De ese modo encontrar el paquete que necesita es simplemente cuestión de unos pocos clics!

Estas paginas permiten una mayor comodida a la hora de encontrar los paquetes buscados instantaneamente, conociendo las funciones del paquete (en la medida que el creador del paquete lo comente correctamente).

Este archivo tiene registrados %d RPMs (%d MBytes de datos) En este ordenador están instalados %d RPMs (%d MBytes de datos) La lista de RPM indexados por categorias RPM indexados por fecha de creación RPM indexados por nombre RPM indexados por gestor del paquete RPM indexados por distribución RPM indexados por la fecha de instalación Lugares donde encontrar los códigos fuentes Mirror local Mirrors Tiempo de generación segundos Bienvenido a la descripción RPM de De Nombre Distribución Versión Distribuidor Revisión Fecha de compilación Fecha de instalación Grupo Máquina de compilación Tamaño RPM del código fuente Mantenido por Url Descripción Proporciona Requerimientos Copyright Ficheros No hay lista de ficheros en el paquete ! No hay Sumario! Recursos RPM Distribuido por RPMs ordenados por Grupo RPMs del Grupo RPMs ordenados por Distribución RPMs de la Distribución RPMs ordenados por distribuidor RPMs distribuidos por RPMs ordenados por fecha de creación RPMs ordenados por fecha de instalación RPMs de menos de 3 dias de antigüedad RPMs de menos de 1 semana de antigüedad RPMs de menos de 2 semanas de antigüedad RPMs de menos de 1 mes de antigüedad RPMS de mas de 1 mes de antigüedad RPMs instalados hace menos de 3 dias RPMs instalados hace menos de 1 semana RPMs instalados hace menos de 2 semanas RPMs instalados hace menos de 1 mes RPMs instalados hace mas de 1 mes RPMs ordenados por Nombre No hay Descripcion ! Desconocido Ninguno grupo/desconocido host.desconocido Indice Paquetes que comienzan por Atención este paquete no devuelve listas de recursos válidas Intente escoger otro Más Log de cambios Subdirectorios Tree.html Navegar por el árbol de directorios rpm2html-1.11.2/msg.de0000664000076400007640000000526006475620755013156 0ustar hanyhany; ; Automatically generated rpm2html 0.70 language file ; .html Erzeugt von index.html Groups.html ByDate.html ByName.html Vendors.html Distribs.html Willkommen beim RPM-Archiv bei

rpm2html erzeugt automatisch Web-Seiten, die einen Satz vonRPM-Paketen beschreiben.

Der Zweck von rpm2html ist es auch, die Abhngigkeiten zwischen verschiedenen Paketen herauszufinden und anzuzeigen, welches Paket bzw. welche Pakete notwendig sind, im ein bestimmtes Paket zu installieren. Jedes Paket wird analysiert, um seine Abhngigkeiten herauszufinden und auch die Fhigkeiten, die es zu Verfgung stellt. Diese Beziehungen werden mit Hilfe von Hyperlinks in den erzeugten Seiten dargestellt. Das richtige Paket herauszufinden ist deshalb nur eine Sache von ein paar "Klicks"!

Eine ausgesprochene Annehmlichkeit besteht in der Mglichkeit, all diese Seiten zu indizieren; so ist es dem Benutzer mglich, sofort das oder die Pakete mit der gewnschten Funktionalitt zu finden (jedenfalls dann, wenn der Paket-Maintainer das RPM in geeigneter Weise beschrieben hat.

Dies Archiv beherbert %d RPMs, zusammen %d MBytes an Daten Auf dieser Maschine sind %d RPMs installiert, zusammen %d MBytes an Daten Die Liste von RPM mit Index nach Kategorien RPM mit Index nach Datum der Herstellung RPM mit Index nach Namen RPM mit Index nach Maintainer RPM mit Index nach Distribution RPM mit Index nach Datum der Installation Archiv fr Quellen Lokaler Mirror Mirrors Erzeugung hat gedauert Sekunden Willkommen bei der RPM Beschreibung von Von Name Distribution Version Vendor Release Build Datum Install date Group Build host Size Source RPM Packager Url Summary Provides Requires Copyright Dateien Keine Dateiliste im Paket ! Keine Kurzbeschreibung ! RPM resource Zur Verfgung gestellt von RPM sortiert nach Group RPM von Group RPM sortiert nach Distribution RPM von Distribution RPM sortiert nach Vendor RPM ausgeliefert von RPM sortiert nach Herstellungsdatum RPM sortiert nach Installationsdatum RPMs weniger als 3 Tage alt RPMs weniger als 1 Woche alt RPMs weniger als less 2 Wochen alt RPMs weniger als 1 Monat alt RPMs mehr als 1 Monat alt RPMs installiert vor weniger als 3 Tagen RPMs installiert vor weniger als 1 Woche RPMs installiert vor weniger als 2 Wochen RPMs installiert vor weniger als 1 Monat RPMs installiert vor mehr als 1 Monat RPM sortiert nach Name Keine Beschreibung ! Unbekannt Kein unbekannt/group unbekannt.host Index Pakete beginnen mit dem Buchstaben Warnung: Dies Paket stellt keine gltige resources Listen zur Verfgung Versuch, ein anderes zu whlen Mehr Changelog rpm2html-1.11.2/msg.pl0000664000076400007640000000635410213334344013163 0ustar hanyhany; ; rpm2html language file ; ; Polish version by: Andrzej Baginski ; created: Sep 25 1998 ; last modified: Sep 25 1998 ; ; ; rpm2html language file ; .html Wygenerowany przez index.html Groups.html ByDate.html ByName.html Vendors.html Distribs.html Witam w archiwum pakietw RPM na serwerze

rpm2html automatycznie generuje strony webowe opisujce pakiety RPM.

New Uytkownicy programu Rpmfind (pozwala zautomatyzowa przeszukiwanie pakietw z bazy RPMw), musz zaktualizowa swoje wersje do wersji 0.98 lub nowszej poniewa wsteczna kompatybilno wkrtce zostanie zaniechana. Aktualizacja ...

Celem programu rpm2html jest rwnie identyfikacja rnic pomidzy rnymi pakietami oraz odnajdywanie pakietw wymaganych przy instalacji danego pakietu. Kady pakiet jest analizowany by wycign z niego zasoby ktre zawiera. Te zalenoci s wyraane w hiper-poczeniach zawartych na generowanych stronach. Znalezienie zalenoci zasobw pakietu ktrego potrzebujesz jest kwestj kilku klikni myszk!

Ostateczny efekt jest gwarantowany przez indeksowanie zbioru stron pozwalajc w ten sposb uytkownikowi na instynktowne wyszukiwanie pakietu(w) speniajcych dane kryteria (przy zaoeniu, e opiekun pakietu poprawnie opisa pakiet).

Naucz si jak zbudowa wasny mirror. Prosz nie prbowa mirrorowa kopii tego narzdzia webowego

Archiwum zawiera %d RPMw zajmujcych %d MBajtw danych Na tym serwerze jest zainstalowanych %d RPMw, zajmujcych %d MBajtw danych Lista RPMw wg kategorii RPMw wg daty utworzenia RPMw wg nazwy RPMw wg opiekuna pakietu RPMw wg dystrybucji RPMw wg daty instalacji Archiwum rde Lokalny mirror Mirrory Generowanie trwao sekund. Witam w opisie RPMu Katalogi Nazwa Dystrybucja Wersja Dostawca Rewizja Data budowania pakietu Data instalacji Grupa Serwer na ktrym zbudowano pakiet Rozmiar rdowy RPM Pakujcy Url Opis Zalenoci Wymaga Prawa autorskie Pliki Brak listy plikw w pakiecie ! Brak opisu ! Zasb RPM Dostarczono przez RPMy wg grupy RPM(y) z grupy RPMy wg dystrybucji RPM(y) z dystrybucji RPMy wg dostawcy RPM(y) dostarczon(y/e) przez RPMy wg daty utworzenia RPMy wg daty instalacji RPMy nie starsze ni trzy dni RPMy nie starsze ni jeden tydzie RPMy nie starsze ni dwa tygodnie RPMy nie starsze ni jeden miesic RPMy starsze ni 1 miesic RPMy zainstalowane wczesniej ni trzy dni temu RPMy zainstalowane wczesniej ni jeden tydzie temu RPMy zainstalowane wczesniej ni dwa tygodnie temu RPMy zainstalowane wczesniej ni jeden miesic temu RPMy zainstalowane wczesniej ni 1 miesic temu RPMy wg nazwy Brak Opisu ! Nieznany Nic nieznany/grupa nieznany.host Indeks pakiet(y/w) na liter Uwaga: ten pakiet nie eksportuje odpowiednich list zasobw Sprbuj wybra inny Wicej Historia zmian Podkatalogi Tree.html Przegldaj drzewko dystrybucji rpm2html-1.11.2/msg.cz0000664000076400007640000000551110213334344013156 0ustar hanyhany.html Generovno index.html Groups.html ByDate.html ByName.html Vendors.html Distribs.html Vtejte v archivu RPM balk na

rpm2html automaticky generuje Web strnky popisujc databzi RPM balk.

Nov Uivatel Rpmfind( umoujcho automatizovat hledn balku z RPM databze.), mus provst upgrade na verzi 0.98 nebo novej z dvodu blizkho zruen zptn kompatibility upgrade ...

Clem rpm2html je tak identifikovat zvislosti mezi rznmi balky a nalezen balku() poskytujcch zdroje potebn pro instalaci danho balku. Kad balk je analyzovn pro zjitn zvislost a zdroj, kter nabz. Tyto vztahy jsou vyjdeny pomoc odkaz v generovanch strnkch. Nalezen balku poskytujc zdroj je pak otzkou nkolika mlo klik my!

Dal vhodou jsou azen strnky umoujc uivateli najt balk podle rznch kritri(s ohledem na sprvn popis balk od sprvce).

Naute se jak vytvoit vae vlastn zrcadlo tto st (v anglitin). Nedlejte zrcadlo pomoc Web-koprovacch program

Tento archv obsahuje %d RPMs reprezentujcch %d MB dat Na tomto potai je instalovno %d RPMs reprezentujicch %d MB dat Seznam RPM azench podle kategorie RPM azench podle data vytvoen RPM azench podle jmna RPM azench podle drbe RPM azench podle distribuce RPM azench podle data vytvoen Archiv zdroj Lokln zrcadlo Zrcadla Generovn trvalo sekund Vtejte v popisu RPM z Jmno Distribuce Verze Sprvce Release Datum pekladu Datum instalace Kategorie Pekldno na Velikost Zdrojov balk Balk vytvoil URL Shrnut Poskytuje Vyaduje Autorsk prva Soubory Nen seznam soubor v balku ! Nen shrnut ! RPM zdroj Poskytovno RPM azen podle kategorie RPM z kategorie RPM azen podle distribuce RPM z distribuce RPM azen podle sprvce RPM kde distribce je RPM azen podle data instalace RPM azen podle data vytvoen RPM mn ne ti dny star RPM mn ne jeden tden star RPM mn ne dva tdny star RPM mn ne jeden msc star RPM vce ne jeden msc star RPM vytvoen mn ne ped temi dny RPM vytvoen mn ne ped jednm tdnem RPM vytvoen mn ne ped dvmi tdny RPM vytvoen mn ne ped jednm mscem RPM vytvoen vce ne ped jednm mscem index podle jmna dn popis ! neoznaena Nic nezmm/kategorie neznm.pota Index Balky zanajc psmenem Varovn: tento balk neexportuje sprvn seznam zdroj Vyzkouejte jin Vce Zmna logu Podadrese Tree.html Prohldnout strom distribuce rpm2html-1.11.2/dir.png0000664000076400007640000000047310213334344013320 0ustar hanyhanyPNG  IHDR2o5PLTE̙f3333tRNS@f pHYs  tIME0XvVtEXtCommentThis art is in the public domain. Kevin Hughes, kevinh@eit.com, September 1995LMIDATc` *`f ) @P< 0v3],*  `!@B1CUIENDB`rpm2html-1.11.2/new.png0000664000076400007640000000036010213334344013326 0ustar hanyhanyPNG  IHDR Uk PLTE v]<tRNS@fbKGDH pHYs  tIME9 q]IDAT ̡ 0@OBETL٠aA\R| CH|Gwntw^&Es;rV3"HIENDB`rpm2html-1.11.2/rpm2html.tpl0000664000076400007640000004022511452634006014325 0ustar hanyhany rpm2html-1.11.2/configure0000775000076400007640000061670311466345213013764 0ustar hanyhany#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="rpm2html.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS GPG_FLAGS GPG_PROG SQL_OBJ SQL_PROGS SQL_FLAGS WITH_MYSQL_FALSE WITH_MYSQL_TRUE EGREP GREP CPP XML_CFLAGS XML_LIBS XML_CONFIG XML2_CONFIG USE_RPM310 RPM_LIBS RPM_CFLAGS HAVE_RPM42 USE_RPMIO GZIP TAR MV RM CP LN_S am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM RPM2HTML_VERSION_NUMBER RPM2HTML_VERSION_INFO RPM2HTML_VERSION RPM2HTML_MICRO_VERSION RPM2HTML_MINOR_VERSION RPM2HTML_MAJOR_VERSION host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_rpm_prefix with_rpm_includes with_rpm_flags with_sql with_gpg with_template ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error "unrecognized option: \`$ac_option' Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rpm-prefix Prefix for RPM (/usr) --with-rpm-includes Includes for RPM (/usr/include/rpm) --with-rpm-flags Libs for RPM (/usr/lib) --with-sql Add the SQL support (off) --with-gpg Add the GPG support (off) --with-template Add the libtemplate support (off) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do for ac_t in install-sh install.sh shtool; do if test -f "$ac_dir/$ac_t"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/$ac_t -c" break 2 fi done done if test -z "$ac_aux_dir"; then as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac RPM2HTML_MAJOR_VERSION=1 RPM2HTML_MINOR_VERSION=11 RPM2HTML_MICRO_VERSION=2 RPM2HTML_VERSION=$RPM2HTML_MAJOR_VERSION.$RPM2HTML_MINOR_VERSION.$RPM2HTML_MICRO_VERSION RPM2HTML_VERSION_INFO=`expr $RPM2HTML_MAJOR_VERSION + $RPM2HTML_MINOR_VERSION`:$RPM2HTML_MICRO_VERSION:$RPM2HTML_MINOR_VERSION RPM2HTML_VERSION_NUMBER=`expr $RPM2HTML_MAJOR_VERSION \* 10000 + $RPM2HTML_MINOR_VERSION \* 100 + $RPM2HTML_MICRO_VERSION` VERSION=${RPM2HTML_VERSION} am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=rpm2html VERSION=$VERSION cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "no acceptable C compiler found in \$PATH See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { as_fn_set_status 77 as_fn_error "C compiler cannot create executables See \`config.log' for more details." "$LINENO" 5; }; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of object files: cannot compile See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CP+set}" = set; then : $as_echo_n "(cached) " >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_CP" && ac_cv_path_CP="/bin/cp" ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 $as_echo "$CP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_RM+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm" ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 $as_echo "$RM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MV+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/mv" ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 $as_echo "$MV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_TAR+set}" = set; then : $as_echo_n "(cached) " >&6 else case $TAR in [\\/]* | ?:[\\/]*) ac_cv_path_TAR="$TAR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="/bin/tar" ;; esac fi TAR=$ac_cv_path_TAR if test -n "$TAR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 $as_echo "$TAR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GZIP+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GZIP in [\\/]* | ?:[\\/]*) ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GZIP" && ac_cv_path_GZIP="/bin/gzip" ;; esac fi GZIP=$ac_cv_path_GZIP if test -n "$GZIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 $as_echo "$GZIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for z in z gz ; do as_ac_Lib=`$as_echo "ac_cv_lib_${z}''_deflate" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -l${z}" >&5 $as_echo_n "checking for deflate in -l${z}... " >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l${z} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char deflate (); int main () { return deflate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval as_val=\$$as_ac_Lib if test "x$as_val" = x""yes; then : LIBS="-l${z} $LIBS"; break fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bzread in -lbz2" >&5 $as_echo_n "checking for bzread in -lbz2... " >&6; } if test "${ac_cv_lib_bz2_bzread+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bzread (); int main () { return bzread (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bz2_bzread=yes else ac_cv_lib_bz2_bzread=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_bzread" >&5 $as_echo "$ac_cv_lib_bz2_bzread" >&6; } if test "x$ac_cv_lib_bz2_bzread" = x""yes; then : LIBS="$LIBS -lbz2" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzread in -lbz2" >&5 $as_echo_n "checking for BZ2_bzread in -lbz2... " >&6; } if test "${ac_cv_lib_bz2_BZ2_bzread+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char BZ2_bzread (); int main () { return BZ2_bzread (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bz2_BZ2_bzread=yes else ac_cv_lib_bz2_BZ2_bzread=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzread" >&5 $as_echo "$ac_cv_lib_bz2_BZ2_bzread" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzread" = x""yes; then : LIBS="$LIBS -lbz2" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: rpm needs libbz2.a (from the bzip2 package)" >&5 $as_echo "$as_me: WARNING: rpm needs libbz2.a (from the bzip2 package)" >&2;} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 $as_echo_n "checking for gettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_gettext+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gettext (); int main () { return gettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_gettext=yes else ac_cv_lib_intl_gettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 $as_echo "$ac_cv_lib_intl_gettext" >&6; } if test "x$ac_cv_lib_intl_gettext" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" fi ac_fn_c_check_func "$LINENO" "dbopen" "ac_cv_func_dbopen" if test "x$ac_cv_func_dbopen" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_create in -ldb-3.1" >&5 $as_echo_n "checking for db_create in -ldb-3.1... " >&6; } if test "${ac_cv_lib_db_3_1_db_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-3.1 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char db_create (); int main () { return db_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_db_3_1_db_create=yes else ac_cv_lib_db_3_1_db_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db_3_1_db_create" >&5 $as_echo "$ac_cv_lib_db_3_1_db_create" >&6; } if test "x$ac_cv_lib_db_3_1_db_create" = x""yes; then : LIBS="-ldb-3.1 $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_create in -ldb-3.0" >&5 $as_echo_n "checking for db_create in -ldb-3.0... " >&6; } if test "${ac_cv_lib_db_3_0_db_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-3.0 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char db_create (); int main () { return db_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_db_3_0_db_create=yes else ac_cv_lib_db_3_0_db_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db_3_0_db_create" >&5 $as_echo "$ac_cv_lib_db_3_0_db_create" >&6; } if test "x$ac_cv_lib_db_3_0_db_create" = x""yes; then : LIBS="-ldb-3.0 $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -ldb1" >&5 $as_echo_n "checking for dbopen in -ldb1... " >&6; } if test "${ac_cv_lib_db1_dbopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb1 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dbopen (); int main () { return dbopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_db1_dbopen=yes else ac_cv_lib_db1_dbopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db1_dbopen" >&5 $as_echo "$ac_cv_lib_db1_dbopen" >&6; } if test "x$ac_cv_lib_db1_dbopen" = x""yes; then : LIBS="-ldb1 $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -ldb" >&5 $as_echo_n "checking for dbopen in -ldb... " >&6; } if test "${ac_cv_lib_db_dbopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dbopen (); int main () { return dbopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_db_dbopen=yes else ac_cv_lib_db_dbopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db_dbopen" >&5 $as_echo "$ac_cv_lib_db_dbopen" >&6; } if test "x$ac_cv_lib_db_dbopen" = x""yes; then : LIBS="-ldb $LIBS" else LIBS="-lbz2 -lpthread -lrt $LIBS" fi fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poptGetContext in -lpopt" >&5 $as_echo_n "checking for poptGetContext in -lpopt... " >&6; } if test "${ac_cv_lib_popt_poptGetContext+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpopt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char poptGetContext (); int main () { return poptGetContext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_popt_poptGetContext=yes else ac_cv_lib_popt_poptGetContext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptGetContext" >&5 $as_echo "$ac_cv_lib_popt_poptGetContext" >&6; } if test "x$ac_cv_lib_popt_poptGetContext" = x""yes; then : LIBS="-lpopt $LIBS" else as_fn_error "*** libpopt not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fopen in -lrpmio" >&5 $as_echo_n "checking for Fopen in -lrpmio... " >&6; } if test "${ac_cv_lib_rpmio_Fopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpmio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char Fopen (); int main () { return Fopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rpmio_Fopen=yes else ac_cv_lib_rpmio_Fopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpmio_Fopen" >&5 $as_echo "$ac_cv_lib_rpmio_Fopen" >&6; } if test "x$ac_cv_lib_rpmio_Fopen" = x""yes; then : LIBS="-lrpmio $LIBS"; cat >>confdefs.h <<_ACEOF #define USE_RPMIO 1 _ACEOF USE_RPMIO=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpmdbOpen in -lrpmdb" >&5 $as_echo_n "checking for rpmdbOpen in -lrpmdb... " >&6; } if test "${ac_cv_lib_rpmdb_rpmdbOpen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpmdb -lrpm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rpmdbOpen (); int main () { return rpmdbOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rpmdb_rpmdbOpen=yes else ac_cv_lib_rpmdb_rpmdbOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpmdb_rpmdbOpen" >&5 $as_echo "$ac_cv_lib_rpmdb_rpmdbOpen" >&6; } if test "x$ac_cv_lib_rpmdb_rpmdbOpen" = x""yes; then : LIBS="-lrpm -lrpmdb $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpmReadConfigFiles in -lrpm" >&5 $as_echo_n "checking for rpmReadConfigFiles in -lrpm... " >&6; } if test "${ac_cv_lib_rpm_rpmReadConfigFiles+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rpmReadConfigFiles (); int main () { return rpmReadConfigFiles (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rpm_rpmReadConfigFiles=yes else ac_cv_lib_rpm_rpmReadConfigFiles=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpm_rpmReadConfigFiles" >&5 $as_echo "$ac_cv_lib_rpm_rpmReadConfigFiles" >&6; } if test "x$ac_cv_lib_rpm_rpmReadConfigFiles" = x""yes; then : LIBS="-lrpm $LIBS" else as_fn_error "*** librpm not found" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpmBuildFileList in -lrpm" >&5 $as_echo_n "checking for rpmBuildFileList in -lrpm... " >&6; } if test "${ac_cv_lib_rpm_rpmBuildFileList+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rpmBuildFileList (); int main () { return rpmBuildFileList (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rpm_rpmBuildFileList=yes else ac_cv_lib_rpm_rpmBuildFileList=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpm_rpmBuildFileList" >&5 $as_echo "$ac_cv_lib_rpm_rpmBuildFileList" >&6; } if test "x$ac_cv_lib_rpm_rpmBuildFileList" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRPM 1 _ACEOF LIBS="-lrpm $LIBS" else cat >>confdefs.h <<_ACEOF #define HAVE_RPM42 1 _ACEOF fi RPM_CFLAGS="-I/usr/include/rpm" RPM_LIBS="-L/usr/lib" # Check whether --with-rpm-prefix was given. if test "${with_rpm_prefix+set}" = set; then : withval=$with_rpm_prefix; fi if test "$with_rpm_prefix" != "" ; then RPM_CFLAGS="-I$with_rpm_prefix/include/rpm" RPM_LIBS="-L$with_rpm_prefix/libs" fi # Check whether --with-rpm-includes was given. if test "${with_rpm_includes+set}" = set; then : withval=$with_rpm_includes; fi if test "$with_rpm_includes" != "" ; then RPM_CFLAGS="-I$with_rpm_includes" fi # Check whether --with-rpm-flags was given. if test "${with_rpm_flags+set}" = set; then : withval=$with_rpm_flags; fi if test "$with_rpm_flags" != "" ; then RPM_LIBS="-L$with_rpm_flags" fi cat >>confdefs.h <<_ACEOF #define USE_RPM310 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpmReadConfigFiles in -lrpm" >&5 $as_echo_n "checking for rpmReadConfigFiles in -lrpm... " >&6; } if test "${ac_cv_lib_rpm_rpmReadConfigFiles+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rpmReadConfigFiles (); int main () { return rpmReadConfigFiles (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rpm_rpmReadConfigFiles=yes else ac_cv_lib_rpm_rpmReadConfigFiles=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpm_rpmReadConfigFiles" >&5 $as_echo "$ac_cv_lib_rpm_rpmReadConfigFiles" >&6; } if test "x$ac_cv_lib_rpm_rpmReadConfigFiles" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRPM 1 _ACEOF LIBS="-lrpm $LIBS" else as_fn_error "*** rpm lib not found" "$LINENO" 5 fi # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$XML2_CONFIG"; then ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XML2_CONFIG="xml2-config" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XML2_CONFIG=$ac_cv_prog_XML2_CONFIG if test -n "$XML2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5 $as_echo "$XML2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$XML2_CONFIG" = "" then # Extract the first word of "xml-config", so it can be a program name with args. set dummy xml-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_XML_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$XML_CONFIG"; then ac_cv_prog_XML_CONFIG="$XML_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XML_CONFIG="xml-config" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XML_CONFIG=$ac_cv_prog_XML_CONFIG if test -n "$XML_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML_CONFIG" >&5 $as_echo "$XML_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$XML_CONFIG" != "" then XML_LIBS="`$XML_CONFIG --libs`" XML_CFLAGS="`$XML_CONFIG --cflags`" else echo 'rpm2html needs libxml(2) to be installed' echo 'On Linux you will need the libxml(2) and libxml(2)-devel packages' echo 'You can find them at ftp://xmlsoft.org/' exit 1 fi else XML_LIBS="`$XML2_CONFIG --libs`" XML_CFLAGS="`$XML2_CONFIG --cflags`" fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then : break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then : break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in db_185.h db1/db.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in rpm/rpmio.h do : ac_fn_c_check_header_mongrel "$LINENO" "rpm/rpmio.h" "ac_cv_header_rpm_rpmio_h" "$ac_includes_default" if test "x$ac_cv_header_rpm_rpmio_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RPM_RPMIO_H 1 _ACEOF fi done for ac_header in stdarg.h sys/stat.h sys/types.h time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in zlib.h rpm/rpmlib.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in rpm/rpmlegacy.h do : ac_fn_c_check_header_mongrel "$LINENO" "rpm/rpmlegacy.h" "ac_cv_header_rpm_rpmlegacy_h" "$ac_includes_default" if test "x$ac_cv_header_rpm_rpmlegacy_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RPM_RPMLEGACY_H 1 _ACEOF fi done for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if test "${ac_cv_lib_intl_strftime+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = x""yes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done for ac_func in gethostname strdup strndup strerror snprintf unlink do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done SQL_FLAGS= SQL_OBJ= SQL_PROGS= # Check whether --with-sql was given. if test "${with_sql+set}" = set; then : withval=$with_sql; fi if test "$with_sql" = "yes" ; then LIBS="$LIBS -L/usr/lib/mysql" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient" >&5 $as_echo_n "checking for mysql_init in -lmysqlclient... " >&6; } if test "${ac_cv_lib_mysqlclient_mysql_init+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mysql_init (); int main () { return mysql_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mysqlclient_mysql_init=yes else ac_cv_lib_mysqlclient_mysql_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_init" >&5 $as_echo "$ac_cv_lib_mysqlclient_mysql_init" >&6; } if test "x$ac_cv_lib_mysqlclient_mysql_init" = x""yes; then : LIBS="$LIBS -lmysqlclient" else as_fn_error "*** libmysqlclient not found" "$LINENO" 5 fi echo Enabling SQL support SQL_FLAGS="-DWITH_SQL" SQL_OBJ=sql.o SQL_PROGS=sqltools fi if test "${with_sql}" = "yes"; then WITH_MYSQL_TRUE= WITH_MYSQL_FALSE='#' else WITH_MYSQL_TRUE='#' WITH_MYSQL_FALSE= fi GPG_FLAGS= GPG_PROG= # Check whether --with-gpg was given. if test "${with_gpg+set}" = set; then : withval=$with_gpg; fi if test "x$with_gpg" != "x" ; then if test "$with_gpg" = "yes" ; then # Extract the first word of "gpg", so it can be a program name with args. set dummy gpg; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GPG_PROG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GPG_PROG in [\\/]* | ?:[\\/]*) ac_cv_path_GPG_PROG="$GPG_PROG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPG_PROG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GPG_PROG" && ac_cv_path_GPG_PROG="/usr/bin/gpg" ;; esac fi GPG_PROG=$ac_cv_path_GPG_PROG if test -n "$GPG_PROG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPG_PROG" >&5 $as_echo "$GPG_PROG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else # Extract the first word of "gpg", so it can be a program name with args. set dummy gpg; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GPG_PROG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GPG_PROG in [\\/]* | ?:[\\/]*) ac_cv_path_GPG_PROG="$GPG_PROG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPG_PROG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GPG_PROG" && ac_cv_path_GPG_PROG=""$with_gpg"" ;; esac fi GPG_PROG=$ac_cv_path_GPG_PROG if test -n "$GPG_PROG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPG_PROG" >&5 $as_echo "$GPG_PROG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$USE_RPMIO" != "x1" ; then as_fn_error "*** librpmio not found, use --without-gpg" "$LINENO" 5 fi echo Enabling GPG support GPG_FLAGS="-DWITH_GPG -DGPG_PROG=\\\"$GPG_PROG\\\"" fi # Check whether --with-template was given. if test "${with_template+set}" = set; then : withval=$with_template; fi if test "$with_template" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tpl_parse in -ltemplate" >&5 $as_echo_n "checking for tpl_parse in -ltemplate... " >&6; } if test "${ac_cv_lib_template_tpl_parse+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltemplate $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tpl_parse (); int main () { return tpl_parse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_template_tpl_parse=yes else ac_cv_lib_template_tpl_parse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_template_tpl_parse" >&5 $as_echo "$ac_cv_lib_template_tpl_parse" >&6; } if test "x$ac_cv_lib_template_tpl_parse" = x""yes; then : LIBS="-ltemplate $LIBS" $as_echo "#define HAVE_LIBTEMPLATE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tpl_parse in -lllt" >&5 $as_echo_n "checking for tpl_parse in -lllt... " >&6; } if test "${ac_cv_lib_llt_tpl_parse+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lllt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tpl_parse (); int main () { return tpl_parse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_llt_tpl_parse=yes else ac_cv_lib_llt_tpl_parse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_llt_tpl_parse" >&5 $as_echo "$ac_cv_lib_llt_tpl_parse" >&6; } if test "x$ac_cv_lib_llt_tpl_parse" = x""yes; then : LIBS="-lllt $LIBS" $as_echo "#define HAVE_LIBTEMPLATE 1" >>confdefs.h else as_fn_error "*** libtemplate not found" "$LINENO" 5 fi fi echo Enabling libtemplate support fi ac_config_files="$ac_config_files rpm2html.spec Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_MYSQL_TRUE}" && test -z "${WITH_MYSQL_FALSE}"; then as_fn_error "conditional \"WITH_MYSQL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "rpm2html.spec") CONFIG_FILES="$CONFIG_FILES rpm2html.spec" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit $? fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi rpm2html-1.11.2/configure.in0000664000076400007640000001346511466344642014367 0ustar hanyhanydnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.2) AC_INIT(rpm2html.c) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST RPM2HTML_MAJOR_VERSION=1 RPM2HTML_MINOR_VERSION=11 RPM2HTML_MICRO_VERSION=2 RPM2HTML_VERSION=$RPM2HTML_MAJOR_VERSION.$RPM2HTML_MINOR_VERSION.$RPM2HTML_MICRO_VERSION RPM2HTML_VERSION_INFO=`expr $RPM2HTML_MAJOR_VERSION + $RPM2HTML_MINOR_VERSION`:$RPM2HTML_MICRO_VERSION:$RPM2HTML_MINOR_VERSION RPM2HTML_VERSION_NUMBER=`expr $RPM2HTML_MAJOR_VERSION \* 10000 + $RPM2HTML_MINOR_VERSION \* 100 + $RPM2HTML_MICRO_VERSION` AC_SUBST(RPM2HTML_MAJOR_VERSION) AC_SUBST(RPM2HTML_MINOR_VERSION) AC_SUBST(RPM2HTML_MICRO_VERSION) AC_SUBST(RPM2HTML_VERSION) AC_SUBST(RPM2HTML_VERSION_INFO) AC_SUBST(RPM2HTML_VERSION_NUMBER) VERSION=${RPM2HTML_VERSION} AM_INIT_AUTOMAKE(rpm2html, $VERSION) AC_SUBST(VERSION) dnl Checks for programs. AC_PROG_CC AC_PROG_LN_S AC_PROG_INSTALL AC_PATH_PROG(CP, cp, /bin/cp) AC_PATH_PROG(RM, rm, /bin/rm) AC_PATH_PROG(MV, mv, /bin/mv) AC_PATH_PROG(TAR, tar, /bin/tar) AC_PATH_PROG(GZIP, gzip, /bin/gzip) dnl Checks for libraries. dnl Replace `main' with a function in -lrpm: for z in z gz ; do AC_CHECK_LIB(${z}, deflate, [LIBS="-l${z} $LIBS"; break]) done AC_CHECK_LIB(bz2, bzread, [LIBS="$LIBS -lbz2"], AC_CHECK_LIB(bz2, BZ2_bzread, [ LIBS="$LIBS -lbz2" ], AC_MSG_WARN([rpm needs libbz2.a (from the bzip2 package)]))) AC_SUBST(LIBS) AC_CHECK_LIB(intl, gettext) AC_CHECK_FUNC(dbopen, [], [ AC_CHECK_LIB(db-3.1, db_create, [LIBS="-ldb-3.1 $LIBS"], AC_CHECK_LIB(db-3.0, db_create, [LIBS="-ldb-3.0 $LIBS"], AC_CHECK_LIB(db1, dbopen, [LIBS="-ldb1 $LIBS"], AC_CHECK_LIB(db, dbopen, [LIBS="-ldb $LIBS"], [LIBS="-lbz2 -lpthread -lrt $LIBS"])))) ]) AC_CHECK_LIB(popt, poptGetContext, [LIBS="-lpopt $LIBS"], AC_MSG_ERROR(*** libpopt not found)) AC_CHECK_LIB(rpmio, Fopen, [LIBS="-lrpmio $LIBS"; AC_DEFINE_UNQUOTED(USE_RPMIO, 1) AC_SUBST(USE_RPMIO) USE_RPMIO=1 ]) AC_CHECK_LIB(rpmdb, rpmdbOpen, [LIBS="-lrpm -lrpmdb $LIBS"], AC_CHECK_LIB(rpm, rpmReadConfigFiles, [LIBS="-lrpm $LIBS"], AC_MSG_ERROR(*** librpm not found) ), -lrpm ) AC_CHECK_LIB(rpm, rpmBuildFileList, [], [AC_DEFINE_UNQUOTED(HAVE_RPM42, 1) AC_SUBST(HAVE_RPM42)], ) dnl dnl Is there a specific path for RPM stuff ? dnl RPM_CFLAGS="-I/usr/include/rpm" RPM_LIBS="-L/usr/lib" AC_ARG_WITH(rpm-prefix, [ --with-rpm-prefix Prefix for RPM (/usr)]) if test "$with_rpm_prefix" != "" ; then RPM_CFLAGS="-I$with_rpm_prefix/include/rpm" RPM_LIBS="-L$with_rpm_prefix/libs" fi AC_ARG_WITH(rpm-includes, [ --with-rpm-includes Includes for RPM (/usr/include/rpm)]) if test "$with_rpm_includes" != "" ; then RPM_CFLAGS="-I$with_rpm_includes" fi AC_ARG_WITH(rpm-flags, [ --with-rpm-flags Libs for RPM (/usr/lib)]) if test "$with_rpm_flags" != "" ; then RPM_LIBS="-L$with_rpm_flags" fi AC_SUBST(RPM_CFLAGS) AC_SUBST(RPM_LIBS) dnl hack: we're gonna use rpm-3.1 AC_DEFINE_UNQUOTED(USE_RPM310, 1) AC_SUBST(USE_RPM310) AC_CHECK_LIB(rpm, rpmReadConfigFiles,,AC_MSG_ERROR(*** rpm lib not found)) dnl dnl Checking for libxml dnl AC_CHECK_PROG(XML2_CONFIG, xml2-config, xml2-config) if test "$XML2_CONFIG" = "" then AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config) if test "$XML_CONFIG" != "" then XML_LIBS="`$XML_CONFIG --libs`" XML_CFLAGS="`$XML_CONFIG --cflags`" else echo 'rpm2html needs libxml(2) to be installed' echo 'On Linux you will need the libxml(2) and libxml(2)-devel packages' echo 'You can find them at ftp://xmlsoft.org/' exit 1 fi else XML_LIBS="`$XML2_CONFIG --libs`" XML_CFLAGS="`$XML2_CONFIG --cflags`" fi AC_SUBST(XML_LIBS) AC_SUBST(XML_CFLAGS) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(db_185.h db1/db.h) AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h) AC_CHECK_HEADERS(rpm/rpmio.h) AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h) AC_CHECK_HEADERS(zlib.h rpm/rpmlib.h) AC_CHECK_HEADERS(rpm/rpmlegacy.h) dnl Checks for library functions. AC_FUNC_STRFTIME AC_CHECK_FUNCS(gethostname strdup strndup strerror snprintf unlink) dnl dnl Do we plug in the database backend ? dnl SQL_FLAGS= SQL_OBJ= SQL_PROGS= AC_ARG_WITH(sql, [ --with-sql Add the SQL support (off)]) if test "$with_sql" = "yes" ; then LIBS="$LIBS -L/usr/lib/mysql" AC_CHECK_LIB(mysqlclient, mysql_init, [LIBS="$LIBS -lmysqlclient"], AC_MSG_ERROR(*** libmysqlclient not found)) echo Enabling SQL support SQL_FLAGS="-DWITH_SQL" SQL_OBJ=sql.o SQL_PROGS=sqltools fi AM_CONDITIONAL(WITH_MYSQL, test "${with_sql}" = "yes") AC_SUBST(SQL_FLAGS) AC_SUBST(SQL_PROGS) AC_SUBST(SQL_OBJ) dnl dnl Do we plug in the gpg? dnl GPG_FLAGS= GPG_PROG= AC_ARG_WITH(gpg, [ --with-gpg Add the GPG support (off)]) if test "x$with_gpg" != "x" ; then if test "$with_gpg" = "yes" ; then AC_PATH_PROG(GPG_PROG, gpg, /usr/bin/gpg) else AC_PATH_PROG(GPG_PROG, gpg, "$with_gpg") fi dnl for now, signature resolving code is implemented only with librpmio dnl so without librpmio it wont work if test "x$USE_RPMIO" != "x1" ; then AC_MSG_ERROR([*** librpmio not found, use --without-gpg]) fi echo Enabling GPG support GPG_FLAGS="-DWITH_GPG -DGPG_PROG=\\\"$GPG_PROG\\\"" fi AC_SUBST(GPG_FLAGS) AC_SUBST(GPG_PROG) AC_ARG_WITH(template, [ --with-template Add the libtemplate support (off)]) if test "$with_template" = "yes" ; then AC_CHECK_LIB(template, tpl_parse, [LIBS="-ltemplate $LIBS" AC_DEFINE([HAVE_LIBTEMPLATE], 1, [use templating engine libtemplate])], [AC_CHECK_LIB(llt, tpl_parse, [LIBS="-lllt $LIBS" AC_DEFINE([HAVE_LIBTEMPLATE], 1, [use templating engine libtemplate])], [AC_MSG_ERROR(*** libtemplate not found)])]) echo Enabling libtemplate support fi AC_OUTPUT(rpm2html.spec Makefile) rpm2html-1.11.2/config.h.in0000664000076400007640000000703711466345217014076 0ustar hanyhany/* config.h.in. Generated from configure.in by autoheader. */ #undef USE_RPM310 #undef USE_RPMIO #undef HAVE_RPM42 /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_DB1_DB_H /* Define to 1 if you have the header file. */ #undef HAVE_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define to 1 if you have the `rpm' library (-lrpm). */ #undef HAVE_LIBRPM /* use templating engine libtemplate */ #undef HAVE_LIBTEMPLATE /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_RPM_RPMIO_H /* Define to 1 if you have the header file. */ #undef HAVE_RPM_RPMLEGACY_H /* Define to 1 if you have the header file. */ #undef HAVE_RPM_RPMLIB_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unlink' function. */ #undef HAVE_UNLINK /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION rpm2html-1.11.2/Makefile.am0000664000076400007640000000600511107137070014065 0ustar hanyhanyAUTOMAKE_OPTIONS=no-dependencies NAME=rpm2html FIND_FILES= cleanup.c compressor.c config.c html.c language.c \ memory.c rdf_api.c rdf.c rpm2html.c rpmdata.c rpmopen.c stringbuf.c \ sql.c sqltools.c config.h html.h language.h memory.h rdf_api.h \ rdf.h rpm2html.h rpmdata.h sql.h stringbuf.h MAKE_FILES=configure configure.in config.h.in Makefile.am Makefile.in \ autogen.sh install-sh config.guess config.sub acconfig.h CONFIG= rpm2html.config rpm2html-rdf.config rpm2html-cdrom.config rpm2html-en.config USELESS=COPYING depcomp FILES= Copyright BUGS README TODO INSTALL CHANGES PRINCIPLES \ missing NEWS AUTHORS \ rpm2html.spec rpm2html.spec.in rpm2html.1 ChangeLog \ msg.fr msg.es msg.de msg.pl msg.cz dir.png new.png \ rpm2html.tpl \ $(MAKE_FILES) $(CONFIG) $(RDF_FILES) $(FIND_FILES) $(USELESS) INCLUDES = -I$(top_srcdir) -I$(top_builddir) $(CFLAGS) $(XML_CFLAGS) \ $(RPM_CFLAGS) $(SQL_FLAGS) $(GPG_FLAGS) noinst_PROGRAMS = compressor compressor_SOURCES = compressor.c compressor_LDFLAGS = compressor_LDADD = $(LIBS) LDADDS = $(XML_LIBS) $(LIBS) if WITH_MYSQL bin_PROGRAMS = rpm2html sqltools sqltools_SOURCES = sql.c cleanup.c config.c html.c language.c \ memory.c rdf_api.c rdf.c sqltools.c rpmdata.c rpmopen.c stringbuf.c \ dir.png.h new.png.h sqltools_LDFLAGS = sqltools_LDADD = $(LDADDS) rpm2html_SOURCES = sql.c cleanup.c config.c html.c language.c \ memory.c rdf_api.c rdf.c rpm2html.c rpmdata.c rpmopen.c stringbuf.c \ dir.png.h new.png.h rpm2html_LDFLAGS = rpm2html_LDADD = $(LDADDS) else bin_PROGRAMS = rpm2html rpm2html_SOURCES = cleanup.c config.c html.c language.c \ memory.c rdf_api.c rdf.c rpm2html.c rpmdata.c rpmopen.c stringbuf.c \ dir.png.h new.png.h rpm2html_LDFLAGS = rpm2html_LDADD = $(LDADDS) endif all: rpm2html clean: rm -f dir.png.h new.png.h html.o: dir.png.h new.png.h dir.png.h : $(srcdir)/dir.png $(top_builddir)/compressor if [ ! -f dir.png ] ; then $(CP) $(srcdir)/dir.png . ; fi $(top_builddir)/compressor dir.png new.png.h : $(srcdir)/new.png $(top_builddir)/compressor if [ ! -f new.png ] ; then $(CP) $(srcdir)/new.png . ; fi $(top_builddir)/compressor new.png distrib : clean pissmeoff @(rm -rf $(NAME)-$(VERSION); ln -s . $(NAME)-$(VERSION)) @(cd $(srcdir) ; tar cvf - `for i in $(FILES); \ do echo $(NAME)-$(VERSION)/$$i ; \ done` | $(GZIP) > $(NAME)-$(VERSION).tar.gz) @$(RM) $(srcdir)/$(NAME)-$(VERSION) rpm : distrib @(rpmbuild -ta $(srcdir)/$(NAME)-$(VERSION).tar.gz) pissmeoff $(USELESS): @rm -f $(USELESS) @touch $(USELESS) install : $(bin_PROGRAMS) install -c -d $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1/ \ $(DESTDIR)$(datadir)/$(NAME) $(DESTDIR)$(sysconfdir) install -c rpm2html $(DESTDIR)$(bindir) install -c -m 644 rpm2html.1 $(DESTDIR)$(mandir)/man1/ install -c -d $(DESTDIR)$(datadir)/$(NAME) install -c -m 644 msg.* $(DESTDIR)$(datadir)/$(NAME) install -c -m 644 rpm2html.config $(DESTDIR)$(sysconfdir)/rpm2html.config @echo "Don't forget to edit $(sysconfdir)/rpm2html.config" rpm2html-1.11.2/Makefile.in0000664000076400007640000006207011466345213014112 0ustar hanyhany# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = compressor$(EXEEXT) @WITH_MYSQL_FALSE@bin_PROGRAMS = rpm2html$(EXEEXT) @WITH_MYSQL_TRUE@bin_PROGRAMS = rpm2html$(EXEEXT) sqltools$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/rpm2html.spec.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS TODO acconfig.h config.guess \ config.sub install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = rpm2html.spec CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_compressor_OBJECTS = compressor.$(OBJEXT) compressor_OBJECTS = $(am_compressor_OBJECTS) am__DEPENDENCIES_1 = compressor_DEPENDENCIES = $(am__DEPENDENCIES_1) compressor_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(compressor_LDFLAGS) \ $(LDFLAGS) -o $@ am__rpm2html_SOURCES_DIST = cleanup.c config.c html.c language.c \ memory.c rdf_api.c rdf.c rpm2html.c rpmdata.c rpmopen.c \ stringbuf.c dir.png.h new.png.h sql.c @WITH_MYSQL_FALSE@am_rpm2html_OBJECTS = cleanup.$(OBJEXT) \ @WITH_MYSQL_FALSE@ config.$(OBJEXT) html.$(OBJEXT) \ @WITH_MYSQL_FALSE@ language.$(OBJEXT) memory.$(OBJEXT) \ @WITH_MYSQL_FALSE@ rdf_api.$(OBJEXT) rdf.$(OBJEXT) \ @WITH_MYSQL_FALSE@ rpm2html.$(OBJEXT) rpmdata.$(OBJEXT) \ @WITH_MYSQL_FALSE@ rpmopen.$(OBJEXT) stringbuf.$(OBJEXT) @WITH_MYSQL_TRUE@am_rpm2html_OBJECTS = sql.$(OBJEXT) cleanup.$(OBJEXT) \ @WITH_MYSQL_TRUE@ config.$(OBJEXT) html.$(OBJEXT) \ @WITH_MYSQL_TRUE@ language.$(OBJEXT) memory.$(OBJEXT) \ @WITH_MYSQL_TRUE@ rdf_api.$(OBJEXT) rdf.$(OBJEXT) \ @WITH_MYSQL_TRUE@ rpm2html.$(OBJEXT) rpmdata.$(OBJEXT) \ @WITH_MYSQL_TRUE@ rpmopen.$(OBJEXT) stringbuf.$(OBJEXT) rpm2html_OBJECTS = $(am_rpm2html_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) @WITH_MYSQL_FALSE@rpm2html_DEPENDENCIES = $(am__DEPENDENCIES_2) @WITH_MYSQL_TRUE@rpm2html_DEPENDENCIES = $(am__DEPENDENCIES_2) rpm2html_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(rpm2html_LDFLAGS) \ $(LDFLAGS) -o $@ am__sqltools_SOURCES_DIST = sql.c cleanup.c config.c html.c language.c \ memory.c rdf_api.c rdf.c sqltools.c rpmdata.c rpmopen.c \ stringbuf.c dir.png.h new.png.h @WITH_MYSQL_TRUE@am_sqltools_OBJECTS = sql.$(OBJEXT) cleanup.$(OBJEXT) \ @WITH_MYSQL_TRUE@ config.$(OBJEXT) html.$(OBJEXT) \ @WITH_MYSQL_TRUE@ language.$(OBJEXT) memory.$(OBJEXT) \ @WITH_MYSQL_TRUE@ rdf_api.$(OBJEXT) rdf.$(OBJEXT) \ @WITH_MYSQL_TRUE@ sqltools.$(OBJEXT) rpmdata.$(OBJEXT) \ @WITH_MYSQL_TRUE@ rpmopen.$(OBJEXT) stringbuf.$(OBJEXT) sqltools_OBJECTS = $(am_sqltools_OBJECTS) @WITH_MYSQL_TRUE@sqltools_DEPENDENCIES = $(am__DEPENDENCIES_2) sqltools_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(sqltools_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(compressor_SOURCES) $(rpm2html_SOURCES) \ $(sqltools_SOURCES) DIST_SOURCES = $(compressor_SOURCES) $(am__rpm2html_SOURCES_DIST) \ $(am__sqltools_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GPG_FLAGS = @GPG_FLAGS@ GPG_PROG = @GPG_PROG@ GREP = @GREP@ GZIP = @GZIP@ HAVE_RPM42 = @HAVE_RPM42@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RM = @RM@ RPM2HTML_MAJOR_VERSION = @RPM2HTML_MAJOR_VERSION@ RPM2HTML_MICRO_VERSION = @RPM2HTML_MICRO_VERSION@ RPM2HTML_MINOR_VERSION = @RPM2HTML_MINOR_VERSION@ RPM2HTML_VERSION = @RPM2HTML_VERSION@ RPM2HTML_VERSION_INFO = @RPM2HTML_VERSION_INFO@ RPM2HTML_VERSION_NUMBER = @RPM2HTML_VERSION_NUMBER@ RPM_CFLAGS = @RPM_CFLAGS@ RPM_LIBS = @RPM_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQL_FLAGS = @SQL_FLAGS@ SQL_OBJ = @SQL_OBJ@ SQL_PROGS = @SQL_PROGS@ STRIP = @STRIP@ TAR = @TAR@ USE_RPM310 = @USE_RPM310@ USE_RPMIO = @USE_RPMIO@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML_CFLAGS = @XML_CFLAGS@ XML_CONFIG = @XML_CONFIG@ XML_LIBS = @XML_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = no-dependencies NAME = rpm2html FIND_FILES = cleanup.c compressor.c config.c html.c language.c \ memory.c rdf_api.c rdf.c rpm2html.c rpmdata.c rpmopen.c stringbuf.c \ sql.c sqltools.c config.h html.h language.h memory.h rdf_api.h \ rdf.h rpm2html.h rpmdata.h sql.h stringbuf.h MAKE_FILES = configure configure.in config.h.in Makefile.am Makefile.in \ autogen.sh install-sh config.guess config.sub acconfig.h CONFIG = rpm2html.config rpm2html-rdf.config rpm2html-cdrom.config rpm2html-en.config USELESS = COPYING depcomp FILES = Copyright BUGS README TODO INSTALL CHANGES PRINCIPLES \ missing NEWS AUTHORS \ rpm2html.spec rpm2html.spec.in rpm2html.1 ChangeLog \ msg.fr msg.es msg.de msg.pl msg.cz dir.png new.png \ rpm2html.tpl \ $(MAKE_FILES) $(CONFIG) $(RDF_FILES) $(FIND_FILES) $(USELESS) INCLUDES = -I$(top_srcdir) -I$(top_builddir) $(CFLAGS) $(XML_CFLAGS) \ $(RPM_CFLAGS) $(SQL_FLAGS) $(GPG_FLAGS) compressor_SOURCES = compressor.c compressor_LDFLAGS = compressor_LDADD = $(LIBS) LDADDS = $(XML_LIBS) $(LIBS) @WITH_MYSQL_TRUE@sqltools_SOURCES = sql.c cleanup.c config.c html.c language.c \ @WITH_MYSQL_TRUE@ memory.c rdf_api.c rdf.c sqltools.c rpmdata.c rpmopen.c stringbuf.c \ @WITH_MYSQL_TRUE@ dir.png.h new.png.h @WITH_MYSQL_TRUE@sqltools_LDFLAGS = @WITH_MYSQL_TRUE@sqltools_LDADD = $(LDADDS) @WITH_MYSQL_FALSE@rpm2html_SOURCES = cleanup.c config.c html.c language.c \ @WITH_MYSQL_FALSE@ memory.c rdf_api.c rdf.c rpm2html.c rpmdata.c rpmopen.c stringbuf.c \ @WITH_MYSQL_FALSE@ dir.png.h new.png.h @WITH_MYSQL_TRUE@rpm2html_SOURCES = sql.c cleanup.c config.c html.c language.c \ @WITH_MYSQL_TRUE@ memory.c rdf_api.c rdf.c rpm2html.c rpmdata.c rpmopen.c stringbuf.c \ @WITH_MYSQL_TRUE@ dir.png.h new.png.h @WITH_MYSQL_FALSE@rpm2html_LDFLAGS = @WITH_MYSQL_TRUE@rpm2html_LDFLAGS = @WITH_MYSQL_FALSE@rpm2html_LDADD = $(LDADDS) @WITH_MYSQL_TRUE@rpm2html_LDADD = $(LDADDS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 rpm2html.spec: $(top_builddir)/config.status $(srcdir)/rpm2html.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) compressor$(EXEEXT): $(compressor_OBJECTS) $(compressor_DEPENDENCIES) @rm -f compressor$(EXEEXT) $(compressor_LINK) $(compressor_OBJECTS) $(compressor_LDADD) $(LIBS) rpm2html$(EXEEXT): $(rpm2html_OBJECTS) $(rpm2html_DEPENDENCIES) @rm -f rpm2html$(EXEEXT) $(rpm2html_LINK) $(rpm2html_OBJECTS) $(rpm2html_LDADD) $(LIBS) sqltools$(EXEEXT): $(sqltools_OBJECTS) $(sqltools_DEPENDENCIES) @rm -f sqltools$(EXEEXT) $(sqltools_LINK) $(sqltools_OBJECTS) $(sqltools_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic clean-noinstPROGRAMS ctags \ dist dist-all dist-bzip2 dist-gzip dist-lzma dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS all: rpm2html clean: rm -f dir.png.h new.png.h html.o: dir.png.h new.png.h dir.png.h : $(srcdir)/dir.png $(top_builddir)/compressor if [ ! -f dir.png ] ; then $(CP) $(srcdir)/dir.png . ; fi $(top_builddir)/compressor dir.png new.png.h : $(srcdir)/new.png $(top_builddir)/compressor if [ ! -f new.png ] ; then $(CP) $(srcdir)/new.png . ; fi $(top_builddir)/compressor new.png distrib : clean pissmeoff @(rm -rf $(NAME)-$(VERSION); ln -s . $(NAME)-$(VERSION)) @(cd $(srcdir) ; tar cvf - `for i in $(FILES); \ do echo $(NAME)-$(VERSION)/$$i ; \ done` | $(GZIP) > $(NAME)-$(VERSION).tar.gz) @$(RM) $(srcdir)/$(NAME)-$(VERSION) rpm : distrib @(rpmbuild -ta $(srcdir)/$(NAME)-$(VERSION).tar.gz) pissmeoff $(USELESS): @rm -f $(USELESS) @touch $(USELESS) install : $(bin_PROGRAMS) install -c -d $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1/ \ $(DESTDIR)$(datadir)/$(NAME) $(DESTDIR)$(sysconfdir) install -c rpm2html $(DESTDIR)$(bindir) install -c -m 644 rpm2html.1 $(DESTDIR)$(mandir)/man1/ install -c -d $(DESTDIR)$(datadir)/$(NAME) install -c -m 644 msg.* $(DESTDIR)$(datadir)/$(NAME) install -c -m 644 rpm2html.config $(DESTDIR)$(sysconfdir)/rpm2html.config @echo "Don't forget to edit $(sysconfdir)/rpm2html.config" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rpm2html-1.11.2/autogen.sh0000764000076400007640000000224607565426467014063 0ustar hanyhany#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. THEDIR=`pwd` cd $srcdir DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have autoconf installed to compile libxml." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have automake installed to compile libxml." echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz" echo "(or a newer version if it is available)" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi test -f rpm2html.c || { echo "You must run this script in the top-level libxml directory" exit 1 } if test -z "$*"; then echo "I am going to run ./configure with no arguments - if you wish " echo "to pass any to it, please specify them on the $0 command line." fi aclocal $ACLOCAL_FLAGS automake --add-missing autoconf cd $THEDIR if test x$OBJ_DIR != x; then mkdir -p "$OBJ_DIR" cd "$OBJ_DIR" fi $srcdir/configure "$@" echo echo "Now type 'make' to compile rpm2html." rpm2html-1.11.2/install-sh0000664000076400007640000001272106432753036014047 0ustar hanyhany#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 rpm2html-1.11.2/config.guess0000764000076400007640000011315410301176074014355 0ustar hanyhany#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # Netbsd (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; sparc*:NetBSD:*) echo `uname -p`-unknown-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) case "${HPUX_REV}" in 11.[0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; esac ;; esac fi ;; esac if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; hppa*:OpenBSD:*:*) echo hppa-unknown-openbsd exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in big) echo mips-unknown-linux-gnu && exit 0 ;; little) echo mipsel-unknown-linux-gnu && exit 0 ;; esac ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_supported_targets=`cd /; ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-pc-linux-gnu\n", argv[1]); # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rpm2html-1.11.2/config.sub0000764000076400007640000006710410301176074014023 0ustar hanyhany#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-07' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[34] | sh[34]eb | shbe | shle \ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | stormy16 | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 \ | we32k \ | x86 | xscale \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alphapca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cray2-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [cjt]90) basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rpm2html-1.11.2/acconfig.h0000664000076400007640000000006507735114132013761 0ustar hanyhany#undef USE_RPM310 #undef USE_RPMIO #undef HAVE_RPM42 rpm2html-1.11.2/rpm2html.config0000664000076400007640000000326710603751267015006 0ustar hanyhany; ; Sample configuration file for rpm2html ; ; $Id: rpm2html.config,v 1.39 2007/04/01 15:41:43 hany Exp $ ; ; maintainer of the local rpm mirror maint=Root ; mail for the maintainer mail=root@localhost ; Directory to store the HTML pages produced dir=/var/www/html/rpm2html ; The relative URL for front pages url=/rpm2html ; A feedback in the navigation bar ;header=mailto:daniel@veillard.com Feedback ; Link to the help file header=http://rpmfind.net/linux/rpm2html/mirrors.html Mirrors header=http://rpmfind.net/linux/rpm2html/help.html Help header=http://rpmfind.net/linux/rpm2html/search.php Search ; ; Do not dump to disk, just to the database ; html=true ;html_template=rpm2html.tpl rdf=false protectemails=true ; ; Configuration for an RPM directory ; ; [The name between brackets is the directory, NEEDED !] ; name=A significant name for this mirror, NEEDED ! ; ftp=The original FTP/HTTP url, NEEDED ! ; ftpsrc=Where the associated sources are stored ; color=Background color for pages ; subdir=in which subdir should the HTML be stored ; URL can be defined for mirrors the first one is the "local" one ; mirror = ftp://rpmfind.net/linux/redhat/redhat-6.1/i386/RedHat/RPMS ; mirror = ftp://ftp.redhat.com/pub/redhat/redhat-6.1/i386/RedHat/RPMS ; [/usr/src/redhat/RPMS] name=Locally compiled packages color=#e0e0ff subdir=compiled ftp=file:///usr/src/redhat/RPMS ftpsrc=file:///usr/src/redhat/SRPMS [localbase] name=Installed RPMs in default base color=#e0ffe0 subdir=local ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/RedHat/RPMS/ ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/SRPMS/ [/mnt/cdrom] name=Content of CD-ROM color=#ffe0ff subdir=cdrom ftp=file:/mnt/cdrom tree=true rpm2html-1.11.2/rpm2html-rdf.config0000664000076400007640000002337510234514265015554 0ustar hanyhany; ; Configuration file for rpm2html pages for RDF mirrors ; See http://rpmfind.net/linux/rpm2html/mirror.html ; ; $Id: rpm2html-rdf.config,v 1.8 2005/04/29 20:27:33 hany Exp $ ; ; maintainer of the local rpm mirror maint=Daniel Veillard ; mail for the maintainer mail=veillard@imag.fr ; Directory to store the HTML pages produced dir=/serveur/WWW/public/linux/test/ ; The relative URL for front pages url=/linux/test ; A feedback in the navigation bar ;header=mailto:daniel@veillard.com Feedback ; Link to the list of mirrors ; header=http://rpmfind.net/linux/rpm2html/mirrors.html Mirrors ; Link to the search engine in the navigation bar ; header=search.html Search ; Link to the help file ; header=help.html Help tree=true ; ; Configuration for an RPM directory ; ; [The name between brackets is the directory, NEEDED !] ; name=A significant name for this mirror, NEEDED ! ; ftp=The original FTP/HTTP url, NEEDED ! ; ftpsrc=Where the associated sources are stored ; color=Background color for pages ; subdir=subdirectory for generated pages ; url= relative URL for pages in this directory ; URL can be defined for mirrors the first one is the "local" one ; mirror = ftp://rpmfind.net/linux/redhat/redhat-4.2/i386/RedHat/RPMS ; mirror = ftp://ftp.redhat.com/pub/redhat/redhat-4.2/i386/RedHat/RPMS ; [/linux/RDF/redhat/5.1/i386] name=RedHat-5.1 for i386 subdir=redhat/5.1/i386 ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/SRPMS color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/redhat-5.1/i386/RedHat/RPMS mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/i386/RedHat/RPMS [/linux/RDF/redhat/redhat-5.1/i386/gnome] name=Gnome for i386 subdir=redhat/5.1/gnome/i386 ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/i386/gnome/ ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/i386/gnome/SRPMS color=#908c78 mirror=ftp://rpmfind.net/linux/redhat/redhat-5.1/i386/gnome mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/i386/gnome [/linux/redhat/redhat-5.1/alpha/RedHat/RPMS] name=RedHat-5.1 for alpha subdir=redhat/5.1/alpha ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/alpha/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/SRPMS color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/redhat-5.1/alpha/RedHat/RPMS mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/alpha/RedHat/RPMS [/linux/redhat/redhat-5.1/alpha/gnome] name=Gnome for alpha subdir=redhat/5.1/gnome/alpha ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/alpha/gnome/ ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/alpha/gnome/SRPMS color=#908c78 mirror=ftp://rpmfind.net/linux/redhat/redhat-5.1/alpha/gnome mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/alpha/gnome [/linux/redhat/5.1/sparc] name=RedHat-5.1 for sparc subdir=redhat/5.1/sparc ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/sparc/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/SRPMS color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/redhat-5.1/sparc/RedHat/RPMS mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.1/sparc/RedHat/RPMS [/linux/RDF/5.0/i386] name=RedHat-5.0 for i386 subdir=5.0/i386 ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/SRPMS color=#e0ffe0 subdir=5.0/i386 mirror=ftp://rpmfind.net/linux/redhat/redhat-5.0/i386/RedHat/RPMS mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/i386/RedHat/RPMS [/linux/RDF/5.0/alpha] name=RedHat-5.0 for alpha subdir=5.0/alpha ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/alpha/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/SRPMS color=#ffe0ff subdir=5.0/alpha mirror=ftp://rpmfind.net/linux/redhat/redhat-5.0/alpha/RedHat/RPMS mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/alpha/RedHat/RPMS [/linux/RDF/5.0/i386/updates] name=RedHat-5.0 Updates for i386 subdir=5.0/i386/updates ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/updates/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/updates/SRPMS color=#c0ffc0 mirror=ftp://rpmfind.net/linux/redhat/redhat-5.0/updates/i386 mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/updates/i386 [/linux/RDF/5.0/alpha/updates] name=RedHat-5.0 Updates for alpha subdir=5.0/alpha/updates ftp=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/updates/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/updates/SRPMS color=#ffc0ff mirror=ftp://rpmfind.net/linux/redhat/redhat-5.0/updates/alpha mirror=ftp://ftp.redhat.com/pub/redhat/redhat-5.0/updates/alpha [/linux/RDF/contrib] name=RedHat Contribs for i386 subdir=contrib ftp=ftp://ftp.redhat.com/pub/contrib/i386 ftpsrc=ftp://ftp.redhat.com/pub/contrib/SRPMS color=#ffffff mirror=ftp://rpmfind.net/linux/contrib/i386 mirror=ftp://ftp.redhat.com/pub/contrib/i386 [/linux/RDF/contrib/alpha] name=RedHat Contribs for alpha subdir=contrib/alpha ftp=ftp://ftp.redhat.com/pub/contrib/alpha ftpsrc=ftp://ftp.redhat.com/pub/contrib/SRPMS color=#fff0ff mirror=ftp://rpmfind.net/linux/contrib/alpha mirror=ftp://ftp.redhat.com/pub/contrib/alpha [/linux/RDF/contrib/noarch] name=Noarch RedHat Contribs subdir=contrib/noarch ftp=ftp://ftp.redhat.com/pub/contrib/noarch ftpsrc=ftp://ftp.redhat.com/pub/contrib/SRPMS color=#ffffff mirror=ftp://rpmfind.net/linux/contrib/noarch mirror=ftp://ftp.redhat.com/pub/contrib/noarch [/linux/RDF/contrib/hurricane/i386] name=Hurricane Contribs for i386 subdir=contrib/hurricane/i386 ftp=ftp://ftp.redhat.com/pub/contrib/hurricane/i386 ftpsrc=ftp://ftp.redhat.com/pub/contrib/hurricane/SRPMS color=#efffef mirror=ftp://rpmfind.net/linux/contrib/hurricane/i386 mirror=ftp://ftp.redhat.com/pub/contrib/hurricane/i386 [/linux/RDF/contrib/hurricane/alpha] name=Hurricane Contribs for alpha subdir=contrib/hurricane/alpha ftp=ftp://ftp.redhat.com/pub/contrib/hurricane/alpha ftpsrc=ftp://ftp.redhat.com/pub/contrib/hurricane/SRPMS color=#fff0ff mirror=ftp://rpmfind.net/linux/contrib/hurricane/alpha mirror=ftp://ftp.redhat.com/pub/contrib/hurricane/alpha [/linux/RDF/i386] name=RedHat-4.2 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/SRPMS color=#ffe0e0 subdir=i386 mirror=ftp://rpmfind.net/linux/redhat/redhat-4.2/i386/RedHat/RPMS mirror=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/i386/RedHat/RPMS [/linux/RDF/i386/updates] name=RedHat-4.2 Updates for i386 subdir=i386/updates ftp=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/updates/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/updates/SRPMS color=#ffc0c0 mirror=ftp://rpmfind.net/linux/redhat/redhat-4.2/updates/i386 mirror=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/updates/i386 [/linux/RDF/sparc/updates] name=RedHat-4.2 Updates for Sparc subdir=sparc/updates ftp=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/updates/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/updates/SRPMS color=#c0c0ff mirror=ftp://rpmfind.net/linux/redhat/redhat-4.2/updates/sparc mirror=ftp://ftp.redhat.com/pub/redhat/redhat-4.2/updates/sparc [/linux/RDF/suse/5.2] name=SuSE 5.2 subdir=suse/5.2 ftp=ftp://ftp.suse.com/pub/SuSE-Linux/5.2/suse color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/5.2/suse mirror=ftp://ftp.suse.com/pub/SuSE-Linux/5.2/suse [/linux/RDF/suse/5.1] name=SuSE 5.1 subdir=suse/5.1 ftp=ftp://ftp.suse.com/pub/SuSE-Linux/5.1/suse color=#ffffb0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/5.1/suse mirror=ftp://ftp.suse.com/pub/SuSE-Linux/5.1/suse [/linux/RDF/suse/updates] name=SuSE Updates subdir=suse/updates ftp=ftp://ftp.suse.com/pub/SuSE-Linux/SuSE-Linux/suse_update color=#ffffa0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/suse_update mirror=ftp://ftp.suse.com/pub/SuSE-Linux/suse_update [/linux/RDF/redhat-labs] name=RedHat Labs subdir=redhat-labs ftp=ftp://ftp.labs.redhat.com/pub color=#ffd683 mirror=ftp://rpmfind.net/linux/redhat-labs mirror=ftp://ftp.labs.redhat.com/pub [/linux/RDF/linuxPPC] name=Linux/PPC subdir=linuxPPC ftp=ftp://ftp.linuxppc.org/linuxppc/redhat/RPMS/ppc/ ftpsrc=ftp://ftp.linuxppc.org/linuxppc/redhat/SRPMS/ color=#9aeef6 mirror=ftp://rpmfind.net/linux/linuxPPC mirror=ftp://ftp.linuxppc.org/linuxppc/redhat/RPMS/ppc/ [/linux/RDF/openlinux/lite/1.2.0] name=OpenLinux 1.2.0 subdir=openlinux/lite/1.2.0 ftp=ftp://ftp.caldera.com/pub/OpenLinux/lite/1.2.0 ftpsrc=ftp://ftp.caldera.com/pub/OpenLinux/lite/1.2.0/col/sources/SRPMS color=#97a4bc mirror=ftp://rpmfind.net/linux/openlinux/lite/1.2.0 mirror=ftp://ftp.caldera.com/pub/OpenLinux/lite/1.2.0 [/linux/RDF/turbolinux-1.2] name=TurboLinux 1.2 subdir=turbolinux-1.2 ftp=ftp://ftp.turbolinux.com/linux/turbolinux-1.2/TurboLinux ftpsrc=ftp://ftp.turbolinux.com/linux/turbolinux-1.2/SRPMS/ color=#d2e6ad mirror=ftp://rpmfind.net/linux/TurboLinux/turbolinux-1.2 mirror=ftp://ftp.turbolinux.com/linux/turbolinux-1.2/TurboLinux [/linux/RDF/ultrapenguin/1.0.9] name=UltraPenguin 1.0.9 subdir=ultrapenguin/1.0.9 ftp=ftp://ftp.cobaltmicro.com/pub/users/davem/mirrors/sunsite.ms.mff.cuni.cz/OS/Linux/Sparc/local/ultrapenguin-1.0.9 ftpsrc=ftp://ftp.cobaltmicro.com/pub/users/davem/mirrors/sunsite.ms.mff.cuni.cz/OS/Linux/Sparc/local/ultrapenguin-1.0.9/SRPMS/ color=#d0d0ff mirror=ftp://rpmfind.net/linux/ultrapenguin/1.0.9 mirror=ftp://ftp.cobaltmicro.com/pub/users/davem/mirrors/sunsite.ms.mff.cuni.cz/OS/Linux/Sparc/local/ultrapenguin-1.0.9/ [/linux/RDF/SGILinux/5.0/RPMS] name=SGIlinux 5.0 subdir=SGIlinux/5.0 ftp=ftp://ftp.linux.sgi.com/pub/RedHat/redhat-5.0/RPMS ftpsrc=ftp://ftp.linux.sgi.com/pub/RedHat/redhat-5.0/SRPMS color=#a0c0ff mirror=ftp://rpmfind.net/linux/SGILinux/redhat-5.0/RPMS mirror=ftp://ftp.linux.sgi.com/pub/RedHat/redhat-5.0/RPMS [/linux/RDF/freshmeat] name=Freshmeat subdir=freshmeat ftp=ftp://freshmeat.net/pub/freshmeat/rpms color=#c2cce4 mirror=ftp://rpmfind.net/linux/freshmeat mirror=ftp://freshmeat.net/pub/freshmeat/rpms [/linux/RDF/coda] name=Coda subdir=coda ftp=ftp://ftp.coda.cs.cmu.edu/pub/coda/linux color=#c2e4cc mirror=ftp://rpmfind.net/linux/coda mirror=ftp://ftp.coda.cs.cmu.edu/pub/coda/linux rpm2html-1.11.2/rpm2html-cdrom.config0000664000076400007640000000134207052476530016101 0ustar hanyhany; ; Sample test configuration file for rpm2html ; ; $Id: rpm2html-cdrom.config,v 1.3 2000/02/16 10:35:04 daniel Exp $ ; ; url=file:/mnt/cdrom/cdtree/rpm2html maint=Root mail=root@localhost dir=/mnt/cdrom/cdtree/rpm2html tree=true [/mnt/cdrom/binaries/stable/redhat] name=Gnome Stable packages for RedHat i386 ftp=file:/mnt/cdrom/binaries/stable/redhat subdir=binaries/stable/redhat color=#b0ffb0 [/mnt/cdrom/binaries/stable/linuxppc] name=Gnome Stable packages for Linux PowerPC ftp=file:/mnt/cdrom/binaries/stable/linuxppc subdir=binaries/stable/linuxppc color=#9aeef6 [/mnt/cdrom/binaries/unstable/redhat] name=Gnome Unstable packages for RedHat i386 ftp=file:/mnt/cdrom/binaries/unstable/redhat subdir=binaries/unstable/redhat rpm2html-1.11.2/rpm2html-en.config0000664000076400007640000014304611466343156015410 0ustar hanyhany; ; Configuration file for rpm2html-1.0 ; See http://rpmfind.net/linux/rpm2html/ ; ; Automatically generated by mirrors-0.10 ; See http://rpmfind.net/linux/rpm2html/mirrors.html ; ; Last updated : Sat Aug 29 20:13:04 1998 ; ; maintainer of the local rpm mirror maint=Daniel Veillard ; mail for the maintainer mail=veillard@w3.org ; Directory to store the HTML pages produced dir=/serveur/ftp/linux/RPM ; The relative URL for front pages url=/linux/RPM ; Export the local packages in HTML format html=true ; Export the local packages in RDF format rdf=true rdf_dir=/serveur/ftp/linux/RDF ; 20 is default value, set to 0 for no limit ;rdf_count_limit=20 ; Compile a list of resources in RDF format rdf_resources=true rdf_resources_dir=/serveur/ftp/linux/RDF/resources ; Protect e-mails from SPAM bots by mangling them in HTML output protectemails=true ; Disable adding hyperlinks to any CVE-xxxx-yyyy and CAN-xxxx-yyyy numbers occuring in the changelog ;cve_linking=false ; Enable check of modification timestamps for RPM file and the HTML file generated fot it - HTML is dumped only if RPM timestamp is newer ;dump_html_only_if_rpm_newer=false ; Extra headers in generated pages header=http://rpmfind.net/linux/rpm2html/mirrors.html Mirrors header=http://rpmfind.net/linux/rpm2html/help.html Help header=http://rpmfind.net/linux/rpm2html/search.php Search ; Build the tree for the distributions tree=true ; ; Metadata mirrors list ; [metadata] mirror=http://rpmfind.net/linux/RDF mirror=http://fr2.rpmfind.net/linux/RDF mirror=http://linux.inrialpes.fr/linux/RDF mirror=http://speakeasy.rpmfind.net/linux/RDF ; ; Configuration for an RPM directory ; ; [The name between brackets is the directory, NEEDED !] ; name=A significant name for this mirror, NEEDED ! ; ftp=The original FTP/HTTP url, NEEDED ! ; ftpsrc=Where the associated sources are stored ; subdir=subdirectory for generated pages ; color=Background color for pages ; url= relative URL for pages in this directory ; URL can be defined for mirrors the first one is the 'local' one ; [/serveur/ftp/linux/redhat/8.0/en/os/i386/SRPMS] name=RedHat-8.0 Sources html=true ftp=ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS subdir=redhat/8.0/src mirror=ftp://rpmfind.net/linux/redhat/8.0/en/os/i386/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/8.0/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/8.0/en/os/i386/RedHat/RPMS] name=RedHat-8.0 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS subdir=redhat/8.0/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/8.0/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/8.0/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/8.0/en/os/i386] name=RedHat-8.0 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/8.0/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/8.0/en/os/i386/SRPMS subdir=redhat/updates/8.0/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/8.0/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/8.0/en/os/i386 [/serveur/ftp/linux/redhat/8.0/en/os/ia64/RedHat/RPMS] name=RedHat-8.0 for ia64 ftp=ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/ia64/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/ia64/SRPMS subdir=redhat/8.0/ia64 color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/8.0/en/os/ia64/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/8.0/en/os/ia64/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/8.0/en/os/ia64] name=RedHat-8.0 Updates for ia64 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/8.0/en/os/ia64 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/8.0/en/os/ia64/SRPMS subdir=redhat/updates/8.0/ia64 color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/8.0/en/os/ia64 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/8.0/en/os/ia64 [/serveur/ftp/linux/redhat/7.3/en/os/i386/SRPMS] name=RedHat-7.3 Sources html=true ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.3/en/os/i386/SRPMS subdir=redhat/7.3/src mirror=ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.3/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/7.3/en/os/i386/RedHat/RPMS] name=RedHat-7.3 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.3/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.3/en/os/i386/SRPMS subdir=redhat/7.3/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.3/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.3/en/os/i386] name=RedHat-7.3 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/i386/SRPMS subdir=redhat/updates/7.3/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/7.3/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.3/en/os/i386 [/serveur/ftp/linux/redhat/7.3/en/os/ia64/RedHat/RPMS] name=RedHat-7.3 for ia64 ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.3/en/os/ia64/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.3/en/os/ia64/SRPMS subdir=redhat/7.3/ia64 color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/7.3/en/os/ia64/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.3/en/os/ia64/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.3/en/os/ia64] name=RedHat-7.3 Updates for ia64 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/ia64 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/ia64/SRPMS subdir=redhat/updates/7.3/ia64 color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/7.3/en/os/ia64 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.3/en/os/ia64 [/serveur/ftp/linux/redhat/7.2/en/os/i386/SRPMS] name=RedHat-7.2 Sources html=true ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/i386/SRPMS subdir=redhat/7.2/src mirror=ftp://rpmfind.net/linux/redhat/7.2/en/os/i386/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.2/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/7.2/en/os/i386/RedHat/RPMS] name=RedHat-7.2 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/i386/SRPMS subdir=redhat/7.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.2/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.2/en/os/i386] name=RedHat-7.2 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.2/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.2/en/os/i386/SRPMS subdir=redhat/updates/7.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/7.2/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.2/en/os/i386 [/serveur/ftp/linux/redhat/7.2/en/os/ia64/RedHat/RPMS] name=RedHat-7.2 for ia64 ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/ia64/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/ia64/SRPMS subdir=redhat/7.2/ia64 color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/7.2/en/os/ia64/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.2/en/os/ia64/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.2/en/os/ia64] name=RedHat-7.2 Updates for ia64 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.2/en/os/ia64 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.2/en/os/ia64/SRPMS subdir=redhat/updates/7.2/ia64 color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/7.2/en/os/ia64 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.2/en/os/ia64 [/serveur/ftp/linux/redhat/7.1/en/os/i386/SRPMS] name=RedHat-7.1 Sources html=false ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/SRPMS subdir=redhat/7.1/src mirror=ftp://rpmfind.net/linux/redhat/7.1/en/os/i386/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.1/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/7.1/en/os/i386/RedHat/RPMS] name=RedHat-7.1 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/SRPMS subdir=redhat/7.1/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/7.1/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.1/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.1/en/os/i386] name=RedHat-7.1 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.1/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.1/en/os/i386/SRPMS subdir=redhat/updates/7.1/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/7.1/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.1/en/os/i386 [/serveur/ftp/linux/redhat/7.1/en/os/alpha/RedHat/RPMS] name=RedHat-7.1 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/alpha/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/alpha/SRPMS subdir=redhat/7.1/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/7.1/en/os/alpha/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.1/en/os/alpha/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.1/en/os/alpha] name=RedHat-7.1 Updates for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.1/en/os/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.1/en/os/alpha/SRPMS subdir=redhat/updates/7.1/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/updates/7.1/en/os/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.1/en/os/alpha [/serveur/ftp/linux/redhat/7.0/en/os/i386/SRPMS] name=RedHat-7.0 Sources html=false ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/os/i386/SRPMS subdir=redhat/7.0/src mirror=ftp://rpmfind.net/linux/redhat/7.0/en/os/i386/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.0/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/7.0/en/os/i386/RedHat/RPMS] name=RedHat-7.0 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/os/i386/SRPMS subdir=redhat/7.0/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/7.0/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.0/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.0/en/os/i386] name=RedHat-7.0 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.0/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.0/en/os/i386/SRPMS subdir=redhat/updates/7.0/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/7.0/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.0/en/os/i386 [/serveur/ftp/linux/redhat/7.0/alpha/en/os/RedHat/RPMS] name=RedHat-7.0 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.0/alpha/en/os/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/os/i386/SRPMS subdir=redhat/7.0/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/7.0/alpha/en/os/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.0/alpha/en/os/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/7.0/en/os/alpha] name=RedHat-7.0 Updates for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.0/en/os/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/7.0/en/os/i386/SRPMS subdir=redhat/updates/7.0/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/updates/7.0/en/os/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/7.0/en/os/alpha [/serveur/ftp/linux/redhat/6.2/en/os/i386/SRPMS] name=RedHat-6.2 Sources html=false ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/i386/SRPMS subdir=redhat/6.2/src mirror=ftp://rpmfind.net/linux/redhat/6.2/en/os/i386/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/6.2/en/os/i386/RedHat/RPMS] name=RedHat-6.2 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/i386/SRPMS subdir=redhat/6.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/6.2/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/6.2/en/os/i386] name=RedHat-6.2 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.2/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.2/en/os/i386/SRPMS subdir=redhat/updates/6.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/6.2/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.2/en/os/i386 [/serveur/ftp/linux/redhat/6.2/alpha/RedHat/RPMS] name=RedHat-6.2 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/alpha/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/i386/SRPMS subdir=redhat/6.2/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/6.2/en/os/alpha/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/os/alpha/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/6.2/en/os/alpha] name=RedHat-6.2 Updates for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.2/en/os/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.2/en/os/i386/SRPMS subdir=redhat/updates/6.2/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/updates/6.2/en/os/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.2/en/os/alpha [/serveur/ftp/linux/redhat/6.2/sparc/RedHat/RPMS] name=RedHat-6.2 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/sparc/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/i386/SRPMS subdir=redhat/6.2/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/6.2/en/os/sparc/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/os/sparc/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/6.2/en/os/sparc] name=RedHat-6.2 Updates for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.2/en/os/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.2/en/os/i386/SRPMS subdir=redhat/updates/6.2/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/6.2/en/os/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.2/en/os/sparc [/serveur/ftp/linux/redhat/6.1/en/os/i386/SRPMS] name=RedHat-6.1 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/os/i386/SRPMS subdir=redhat/6.1/src mirror=ftp://rpmfind.net/linux/redhat/6.1/en/os/i386/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/6.1/en/os/i386/RedHat/RPMS] name=RedHat-6.1 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/os/i386/SRPMS subdir=redhat/6.1/en/os/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/6.1/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/6.1/en/os/i386] name=RedHat-6.1 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.1/en/os/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.1/en/os/i386/SRPMS subdir=redhat/updates/6.1/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/6.1/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.1/en/os/i386 [/serveur/ftp/linux/redhat/6.1/alpha/RedHat/RPMS] name=RedHat-6.1 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/os/alpha/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/os/i386/SRPMS subdir=redhat/6.1/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/6.1/en/os/alpha/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/os/alpha/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/6.1/en/os/alpha] name=RedHat-6.1 Updates for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.1/en/os/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.1/en/os/i386/SRPMS subdir=redhat/updates/6.1/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/updates/6.1/en/os/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.1/en/os/alpha [/serveur/ftp/linux/redhat/6.1/sparc/RedHat/RPMS] name=RedHat-6.1 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/os/sparc/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/os/i386/SRPMS subdir=redhat/6.1/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/6.1/en/os/sparc/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/os/sparc/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/6.1/en/os/sparc] name=RedHat-6.1 Updates for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.1/en/os/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.1/en/os/i386/SRPMS subdir=redhat/updates/6.1/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/6.1/en/os/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.1/en/os/sparc [/serveur/ftp/linux/redhat/updates/6.0/en/os/i386] name=RedHat-6.0 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.0/en/os/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.0/en/os/i386/SRPMS subdir=redhat/updates/6.0/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/6.0/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.0/en/os/i386 [/serveur/ftp/linux/redhat/updates/6.0/en/os/alpha] name=RedHat-6.0 Updates for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.0/en/os/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.0/en/os/i386/SRPMS subdir=redhat/updates/6.0/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/updates/6.0/en/os/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.0/en/os/alpha [/serveur/ftp/linux/redhat/updates/6.0/en/os/sparc] name=RedHat-6.0 Updates for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.0/en/os/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/6.0/en/os/i386/SRPMS subdir=redhat/updates/6.0/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/6.0/en/os/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/6.0/en/os/sparc [/serveur/ftp/linux/redhat/5.2/en/os/i386/SRPMS] name=RedHat-5.2 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/os/i386/SRPMS subdir=redhat/5.2/src mirror=ftp://rpmfind.net/linux/redhat/5.2/en/os/i386/SRPMS [/serveur/ftp/linux/redhat/5.2/en/os/i386/RedHat/RPMS] name=RedHat-5.2 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/os/i386/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/os/i386/SRPMS subdir=redhat/5.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/5.2/en/os/i386/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/5.2/en/os/i386/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/5.2/en/os/i386] name=RedHat-5.2 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.2/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.2/en/os/i386/SRPMS subdir=redhat/updates/5.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/5.2/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/5.2/en/os/i386 [/serveur/ftp/linux/redhat/5.2/alpha/RedHat/RPMS] name=RedHat-5.2 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/os/alpha/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/os/i386/SRPMS subdir=redhat/5.2/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/5.2/en/os/alpha/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/5.2/en/os/alpha/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/5.2/en/os/alpha] name=RedHat-5.2 Updates for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.2/en/os/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.2/en/os/i386/SRPMS subdir=redhat/updates/5.2/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/updates/5.2/en/os/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/5.2/en/os/alpha [/serveur/ftp/linux/redhat/5.2/sparc/RedHat/RPMS] name=RedHat-5.2 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/os/sparc/RedHat/RPMS ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/os/i386/SRPMS subdir=redhat/5.2/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/5.2/en/os/sparc/RedHat/RPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/5.2/en/os/sparc/RedHat/RPMS [/serveur/ftp/linux/redhat/updates/5.2/en/os/sparc] name=RedHat-5.2 Updates for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.2/en/os/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.2/en/os/i386/SRPMS subdir=redhat/updates/5.2/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/5.2/en/os/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/5.2/en/os/sparc [/serveur/ftp/linux/redhat/7.0/en/powertools/SRPMS] name=PowerTools-7.0 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/powertools/i386/SRPMS subdir=powertools/7.0/src mirror=ftp://rpmfind.net/linux/redhat/7.0/en/powertools/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/7.0/en/powertools/SRPMS [/serveur/ftp/linux/redhat/7.0/en/powertools/i386] name=PowerTools-7.0 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/powertools/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/powertools/i386/SRPMS subdir=powertools/7.0/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/7.0/en/powertools/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/7.0/en/powertools/i386 [/serveur/ftp/linux/redhat/7.0/en/powertools/alpha] name=PowerTools-7.0 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/powertools/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/powertools/i386/SRPMS subdir=powertools/7.0/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/7.0/en/powertools/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/7.0/en/powertools/alpha [/serveur/ftp/linux/redhat/7.0/en/powertools/sparc] name=PowerTools-7.0 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/powertools/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/powertools/i386/SRPMS subdir=powertools/7.0/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/7.0/en/powertools/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/7.0/en/powertools/sparc [/serveur/ftp/linux/redhat/6.2/en/powertools/SRPMS] name=PowerTools-6.2 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/powertools/i386/SRPMS subdir=powertools/6.2/src mirror=ftp://rpmfind.net/linux/redhat/6.2/en/powertools/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/powertools/SRPMS [/serveur/ftp/linux/redhat/6.2/en/powertools/i386] name=PowerTools-6.2 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/powertools/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/powertools/i386/SRPMS subdir=powertools/6.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/6.2/en/powertools/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/powertools/i386 [/serveur/ftp/linux/redhat/6.2/en/powertools/alpha] name=PowerTools-6.2 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/powertools/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/powertools/i386/SRPMS subdir=powertools/6.2/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/6.2/en/powertools/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/powertools/alpha [/serveur/ftp/linux/redhat/6.2/en/powertools/sparc] name=PowerTools-6.2 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/powertools/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/powertools/i386/SRPMS subdir=powertools/6.2/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/6.2/en/powertools/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/6.2/en/powertools/sparc [/serveur/ftp/linux/redhat/6.1/en/powertools/SRPMS] name=PowerTools-6.1 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/powertools/i386/SRPMS subdir=powertools/6.1/src mirror=ftp://rpmfind.net/linux/redhat/6.1/en/powertools/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/powertools/SRPMS [/serveur/ftp/linux/redhat/6.1/en/powertools/i386] name=PowerTools-6.1 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/powertools/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/powertools/i386/SRPMS subdir=powertools/6.1/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/6.1/en/powertools/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/powertools/i386 [/serveur/ftp/linux/redhat/6.1/en/powertools/alpha] name=PowerTools-6.1 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/powertools/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/powertools/i386/SRPMS subdir=powertools/6.1/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/6.1/en/powertools/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/powertools/alpha [/serveur/ftp/linux/redhat/6.1/en/powertools/sparc] name=PowerTools-6.1 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/powertools/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.1/en/powertools/i386/SRPMS subdir=powertools/6.1/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/6.1/en/powertools/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/6.1/en/powertools/sparc [/serveur/ftp/linux/redhat/6.0/en/powertools/SRPMS] name=PowerTools-6.0 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.0/en/powertools/i386/SRPMS subdir=powertools/6.0/src mirror=ftp://rpmfind.net/linux/redhat/6.0/en/powertools/SRPMS mirror=ftp://linux.inrialpes.fr/linux/redhat/6.0/en/powertools/SRPMS [/serveur/ftp/linux/redhat/6.0/en/powertools/i386] name=PowerTools-6.0 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.0/en/powertools/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.0/en/powertools/i386/SRPMS subdir=powertools/6.0/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/6.0/en/powertools/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/6.0/en/powertools/i386 [/serveur/ftp/linux/redhat/6.0/en/powertools/alpha] name=PowerTools-6.0 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.0/en/powertools/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.0/en/powertools/i386/SRPMS subdir=powertools/6.0/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/6.0/en/powertools/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/6.0/en/powertools/alpha [/serveur/ftp/linux/redhat/6.0/en/powertools/sparc] name=PowerTools-6.0 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/6.0/en/powertools/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/6.0/en/powertools/i386/SRPMS subdir=powertools/6.0/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/6.0/en/powertools/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/6.0/en/powertools/sparc [/serveur/ftp/linux/redhat/5.2/en/powertools/SRPMS] name=PowerTools-5.2 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/powertools/i386/SRPMS subdir=powertools/5.2/src mirror=ftp://rpmfind.net/linux/redhat/5.2/en/powertools/SRPMS [/serveur/ftp/linux/redhat/5.2/en/powertools/i386] name=PowerTools-5.2 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/powertools/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/powertools/i386/SRPMS subdir=powertools/5.2/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/5.2/en/powertools/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/5.2/en/powertools/i386 [/serveur/ftp/linux/redhat/5.2/en/powertools/alpha] name=PowerTools-5.2 for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/powertools/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/powertools/i386/SRPMS subdir=powertools/5.2/alpha color=#ffb0ff mirror=ftp://rpmfind.net/linux/redhat/5.2/en/powertools/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/5.2/en/powertools/alpha [/serveur/ftp/linux/redhat/5.2/en/powertools/sparc] name=PowerTools-5.2 for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/powertools/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/5.2/en/powertools/i386/SRPMS subdir=powertools/5.2/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/5.2/en/powertools/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/5.2/en/powertools/sparc [/serveur/ftp/linux/rhcn/SRPMS] name=RedHat Contrib Net Sources ftp=ftp://rhcn.redhat.com/pub/rhcn/SRPMS subdir=rhcn/src mirror=ftp://rpmfind.net/linux/rhcn/RPMS/SRPMS [/serveur/ftp/linux/rhcn/RPMS/i386] name=RedHat Contrib Net for i386 ftp=ftp://rhcn.redhat.com/pub/rhcn/RPMS/i386 ftpsrc=ftp://rhcn.redhat.com/pub/rhcn/SRPMS subdir=rhcn/i386 mirror=ftp://rpmfind.net/linux/rhcn/RPMS/i386 mirror=ftp://linux.inrialpes.fr/linux/rhcn/RPMS/i386 [/serveur/ftp/linux/rhcn/RPMS/alpha] name=RedHat Contrib Net for alpha ftp=ftp://rhcn.redhat.com/pub/rhcn/RPMS/alpha ftpsrc=ftp://rhcn.redhat.com/pub/rhcn/SRPMS subdir=rhcn/alpha mirror=ftp://rpmfind.net/linux/rhcn/RPMS/alpha mirror=ftp://linux.inrialpes.fr/linux/rhcn/RPMS/alpha [/serveur/ftp/linux/rhcn/RPMS/sparc] name=RedHat Contrib Net for sparc ftp=ftp://rhcn.redhat.com/pub/rhcn/RPMS/sparc ftpsrc=ftp://rhcn.redhat.com/pub/rhcn/SRPMS subdir=rhcn/sparc mirror=ftp://rpmfind.net/linux/rhcn/RPMS/sparc mirror=ftp://linux.inrialpes.fr/linux/rhcn/RPMS/sparc [/serveur/ftp/linux/rhcn/RPMS/ppc] name=RedHat Contrib Net for PPC ftp=ftp://rhcn.redhat.com/pub/rhcn/RPMS/ppc ftpsrc=ftp://rhcn.redhat.com/pub/rhcn/SRPMS subdir=rhcn/ppc mirror=ftp://rpmfind.net/linux/rhcn/RPMS/ppc mirror=ftp://linux.inrialpes.fr/linux/rhcn/RPMS/ppc [/serveur/ftp/linux/rhcn/RPMS/m68k] name=RedHat Contrib Net for M68K ftp=ftp://rhcn.redhat.com/pub/rhcn/RPMS/m68k ftpsrc=ftp://rhcn.redhat.com/pub/rhcn/SRPMS subdir=rhcn/m68k mirror=ftp://rpmfind.net/linux/rhcn/RPMS/m68k mirror=ftp://linux.inrialpes.fr/linux/rhcn/RPMS/m68k [/serveur/ftp/linux/rhcn/RPMS/noarch] name=RedHat Contrib Net for NoArch ftp=ftp://rhcn.redhat.com/pub/rhcn/RPMS/noarch ftpsrc=ftp://rhcn.redhat.com/pub/rhcn/SRPMS subdir=rhcn/noarch mirror=ftp://rpmfind.net/linux/rhcn/RPMS/noarch mirror=ftp://linux.inrialpes.fr/linux/rhcn/RPMS/noarch [/serveur/ftp/linux/gnome.org] name=Gnome Desktop Environment ftp=ftp://ftp.gnome.org/pub subdir=gnome color=#FFE4B5 mirror=ftp://rpmfind.net/linux/gnome.org mirror=ftp://linux.inrialpes.fr/linux/gnome.org [/serveur/ftp/linux/gnomehide] name=GnomeHide ftp=ftp://people.redhat.com/hp/gnomehide subdir=gnomehide color=#FFE4B5 mirror=ftp://rpmfind.net/linux/gnomehide mirror=ftp://linux.inrialpes.fr/linux/gnomehide [/serveur/ftp/linux/KDE/stable] name=KDE Stable ftp=ftp://ftp.kde.org/pub/kde/stable subdir=kde/stable mirror=ftp://rpmfind.net/linux/KDE/stable mirror=ftp://linux.inrialpes.fr/linux/KDE/stable [/serveur/ftp/linux/KDE/unstable] name=KDE Unstable ftp=ftp://ftp.kde.org/pub/kde/unstable subdir=kde/unstable mirror=ftp://rpmfind.net/linux/KDE/unstable mirror=ftp://linux.inrialpes.fr/linux/KDE/unstable [/serveur/ftp/linux/redhat/updates/5.1/en/os/i386] name=RedHat-5.1 Updates for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.1/en/os/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.1/en/os/SRPMS subdir=redhat/updates/5.1/i386 color=#b0ffb0 mirror=ftp://rpmfind.net/linux/redhat/updates/5.1/en/os/i386 mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/5.1/en/os/i386 [/serveur/ftp/linux/redhat/updates/5.1/en/os/alpha] name=RedHat-5.1 Updates for alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.1/en/os/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.1/en/os/SRPMS subdir=redhat/updates/5.1/alpha color=#ffc0ff mirror=ftp://rpmfind.net/linux/redhat/updates/5.1/en/os/alpha mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/5.1/en/os/alpha [/serveur/ftp/linux/redhat/updates/5.1/en/os/sparc] name=RedHat-5.1 Updates for sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.1/en/os/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/updates/5.1/en/os/SRPMS subdir=redhat/updates/5.1/sparc color=#b0b0ff mirror=ftp://rpmfind.net/linux/redhat/updates/5.1/en/os/sparc mirror=ftp://linux.inrialpes.fr/linux/redhat/updates/5.1/en/os/sparc [/serveur/ftp/linux/contrib/libc6/SRPMS] name=Libc6 Contribs Sources ftp=ftp://contrib.redhat.com/pub/contrib/libc6/SRPMS subdir=contrib/libc6/src mirror=ftp://rpmfind.net/linux/contrib/libc6/SRPMS [/serveur/ftp/linux/contrib/libc6/i386] name=Libc6 Contribs for i386 ftp=ftp://contrib.redhat.com/pub/contrib/libc6/i386 ftpsrc=ftp://contrib.redhat.com/pub/contrib/libc6/SRPMS subdir=contrib/libc6/i386 color=#efffef mirror=ftp://rpmfind.net/linux/contrib/libc6/i386 mirror=ftp://linux.inrialpes.fr/linux/contrib/libc6/i386 mirror=ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.redhat.com/contrib/hurricane/i386 mirror=ftp://ftp.uni-bayreuth.de/pub/linux/ftp.redhat.com/contrib/hurricane/i386 [/serveur/ftp/linux/contrib/libc6/alpha] name=Libc6 Contribs for alpha ftp=ftp://contrib.redhat.com/pub/contrib/libc6/alpha ftpsrc=ftp://contrib.redhat.com/pub/contrib/libc6/SRPMS subdir=contrib/libc6/alpha color=#fff0ff mirror=ftp://rpmfind.net/linux/contrib/libc6/alpha mirror=ftp://linux.inrialpes.fr/linux/contrib/libc6/alpha mirror=ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.redhat.com/contrib/hurricane/alpha mirror=ftp://ftp.uni-bayreuth.de/pub/linux/ftp.redhat.com/contrib/hurricane/alpha [/serveur/ftp/linux/contrib/libc6/sparc] name=Libc6 Contribs for sparc ftp=ftp://contrib.redhat.com/pub/contrib/libc6/sparc ftpsrc=ftp://contrib.redhat.com/pub/contrib/libc6/SRPMS subdir=contrib/libc6/sparc mirror=ftp://rpmfind.net/linux/contrib/libc6/sparc mirror=ftp://linux.inrialpes.fr/linux/contrib/libc6/sparc [/serveur/ftp/linux/contrib/libc6/ppc] name=Libc6 Contribs for ppc ftp=ftp://contrib.redhat.com/pub/contrib/libc6/ppc ftpsrc=ftp://contrib.redhat.com/pub/contrib/libc6/SRPMS subdir=contrib/libc6/ppc mirror=ftp://rpmfind.net/linux/contrib/libc6/ppc mirror=ftp://linux.inrialpes.fr/linux/contrib/libc6/ppc [/serveur/ftp/linux/contrib/libc6/mipseb] name=Libc6 Contribs for Mips ftp=ftp://contrib.redhat.com/pub/contrib/libc6/mipseb ftpsrc=ftp://contrib.redhat.com/pub/contrib/libc6/SRPMS subdir=contrib/libc6/mipseb mirror=ftp://rpmfind.net/linux/contrib/libc6/mipseb mirror=ftp://linux.inrialpes.fr/linux/contrib/libc6/mipseb [/serveur/ftp/linux/contrib/openmotif] name=OpenMotif Contribs ftp=ftp://contrib.redhat.com/pub/contrib/openmotif subdir=contrib/libc6/mipseb mirror=ftp://rpmfind.net/linux/contrib/openmotif mirror=ftp://linux.inrialpes.fr/linux/contrib/openmotif [/serveur/ftp/linux/contrib/noarch] name=Arch Independent RedHat Contribs ftp=ftp://contrib.redhat.com/pub/contrib/noarch subdir=contrib/noarch color=#ffffff mirror=ftp://rpmfind.net/linux/contrib/noarch mirror=ftp://linux.inrialpes.fr/linux/contrib/noarch mirror=ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.redhat.com/contrib/noarch mirror=ftp://ftp.uni-bayreuth.de/pub/linux/ftp.redhat.com/contrib/noarch [/serveur/ftp/linux/contrib/nosrc] name=No Sources RedHat Contribs ftp=ftp://contrib.redhat.com/pub/contrib/nosrc subdir=contrib/nosrc color=#ffffff mirror=ftp://rpmfind.net/linux/contrib/nosrc mirror=ftp://linux.inrialpes.fr/linux/contrib/nosrc [/serveur/ftp/linux/rawhide/1.0/i386] name=RawHide 1.0 for i386 ftp=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/i386 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS subdir=rawhide/1.0/i386 mirror=ftp://rpmfind.net/linux/rawhide/1.0/i386 mirror=ftp://linux.inrialpes.fr/linux/rawhide/1.0/i386 mirror=ftp://sunsite.auc.dk/pub/os/linux/rawhide/i386 [/serveur/ftp/linux/rawhide/1.0/alpha] name=RawHide 1.0 for Alpha ftp=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/alpha ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS subdir=rawhide/1.0/alpha mirror=ftp://rpmfind.net/linux/rawhide/1.0/alpha mirror=ftp://linux.inrialpes.fr/linux/rawhide/1.0/alpha mirror=ftp://sunsite.auc.dk/pub/os/linux/rawhide/alpha [/serveur/ftp/linux/rawhide/1.0/ia64] name=RawHide 1.0 for IA64 ftp=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/ia64 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS subdir=rawhide/1.0/ia64 mirror=ftp://rpmfind.net/linux/rawhide/1.0/ia64 mirror=ftp://linux.inrialpes.fr/linux/rawhide/1.0/ia64 mirror=ftp://sunsite.auc.dk/pub/os/linux/rawhide/ia64 [/serveur/ftp/linux/rawhide/1.0/s390] name=RawHide 1.0 for S390 ftp=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/s390 ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS subdir=rawhide/1.0/s390 mirror=ftp://rpmfind.net/linux/rawhide/1.0/s390 mirror=ftp://linux.inrialpes.fr/linux/rawhide/1.0/s390 mirror=ftp://sunsite.auc.dk/pub/os/linux/rawhide/s390 [/serveur/ftp/linux/rawhide/1.0/sparc] name=RawHide 1.0 for Sparc ftp=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/sparc ftpsrc=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS subdir=rawhide/1.0/sparc mirror=ftp://rpmfind.net/linux/rawhide/1.0/sparc mirror=ftp://linux.inrialpes.fr/linux/rawhide/1.0/sparc mirror=ftp://sunsite.auc.dk/pub/os/linux/rawhide/sparc [/serveur/ftp/linux/rawhide/1.0/SRPMS] name=RawHide 1.0 Sources ftp=ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS subdir=rawhide/1.0/src mirror=ftp://rpmfind.net/linux/rawhide/1.0/SRPMS [/serveur/ftp/linux/redhatbeta] name=No Sources RedHat Contribs ftp=ftp://ftp.beta.redhat.com/pub subdir=redhat/redhatbeta mirror=ftp://rpmfind.net/linux/redhatbeta mirror=ftp://linux.inrialpes.fr/linux/redhatbeta [/serveur/ftp/linux/engarde] name=EnGarde ftp=ftp://ftp.engardelinux.org/pub/engarde subdir=engarde mirror=ftp://rpmfind.net/linux/engarde mirror=ftp://linux.inrialpes.fr/linux/engarde [/serveur/ftp/linux/conectiva] name=Conectiva Linux ftp=ftp://ftp.conectiva.com.br/pub/conectiva subdir=conectiva mirror=ftp://rpmfind.net/linux/conectiva mirror=ftp://linux.inrialpes.fr/linux/conectiva [/serveur/ftp/linux/Mandrake] name=Mandrake ftp=ftp://ftp.sunet.se/pub/Linux/distributions/mandrake subdir=mandrake mirror=ftp://rpmfind.net/linux/Mandrake mirror=ftp://linux.inrialpes.fr/linux/Mandrake [/serveur/ftp/linux/Mandrake-devel] name=Mandrake Cooker ftp=ftp://ftp.sunet.se/pub/Linux/distributions/mandrake-devel ftpsrc=ftp://ftp.sunet.se/pub/Linux/distributions/mandrake-devel/SRPMS/ subdir=cooker mirror=ftp://rpmfind.net/linux/Mandrake-devel mirror=ftp://linux.inrialpes.fr/linux/Mandrake-devel [/serveur/ftp/linux/Kondara/Kondara-1.2/SRPMS/SRPMS] name=Kondara 1.2 Sources ftp=ftp://ftp.kondara.org/pub/Kondara-1.2/SRPMS/SRPMS/ subdir=kondara/1.2/src mirror=ftp://rpmfind.net/linux/Kondara/Kondara-1.2/SRPMS/SRPMS mirror=ftp://linux.inrialpes.fr/linux/Kondara/Kondara-1.2/SRPMS/SRPMS [/serveur/ftp/linux/Kondara/Kondara-1.2/i586] name=Kondara 1.2 i586 ftp=ftp://ftp.kondara.org/pub/Kondara-1.2/i586 ftpsrc=ftp://ftp.kondara.org/pub/Kondara-1.2/SRPMS/SRPMS/ subdir=kondara/1.2/i586 mirror=ftp://rpmfind.net/linux/Kondara/Kondara-1.2/i586 mirror=ftp://linux.inrialpes.fr/linux/Kondara/Kondara-1.2/i586 [/serveur/ftp/linux/Kondara/Kondara-1.2/sparc] name=Kondara 1.2 sparc ftp=ftp://ftp.kondara.org/pub/Kondara-1.2/sparc ftpsrc=ftp://ftp.kondara.org/pub/Kondara-1.2/SRPMS/SRPMS/ subdir=kondara/1.2/sparc mirror=ftp://rpmfind.net/linux/Kondara/Kondara-1.2/sparc mirror=ftp://linux.inrialpes.fr/linux/Kondara/Kondara-1.2/sparc [/serveur/ftp/linux/Kondara/Kondara-1.2/alpha] name=Kondara 1.2 alpha ftp=ftp://ftp.kondara.org/pub/Kondara-1.2/alpha ftpsrc=ftp://ftp.kondara.org/pub/Kondara-1.2/SRPMS/SRPMS/ subdir=kondara/1.2/alpha mirror=ftp://rpmfind.net/linux/Kondara/Kondara-1.2/alpha mirror=ftp://linux.inrialpes.fr/linux/Kondara/Kondara-1.2/alpha [/serveur/ftp/linux/Kondara/Kondara-1.2/errata] name=Kondara 1.2 Errata ftp=ftp://ftp.kondara.org/pub/Kondara-1.2/errata ftpsrc=ftp://ftp.kondara.org/pub/Kondara-1.2/errata/updates/SRPMS/SRPMS/ subdir=kondara/1.2/errata mirror=ftp://rpmfind.net/linux/Kondara/Kondara-1.2/errata mirror=ftp://linux.inrialpes.fr/linux/Kondara/Kondara-1.2/errata [/serveur/ftp/linux/Kondara/Kondara-Nonfree-1.2] name=Kondara 1.2 Non Free ftp=ftp://ftp.kondara.org/pub/Kondara-Nonfree-1.2 ftpsrc=ftp://ftp.kondara.org/pub/Kondara-Nonfree-1.2/SRPMS subdir=kondara/1.2/nonfree mirror=ftp://rpmfind.net/linux/Kondara/Kondara-Nonfree-1.2 mirror=ftp://linux.inrialpes.fr/linux/Kondara/Kondara-Nonfree-1.2 [/serveur/ftp/linux/Kondara/Jirai/SRPMS/SRPMS] name=Kondara Jirai Sources ftp=ftp://ftp.kondara.org/pub/Jirai/SRPMS/SRPMS subdir=kondara/jirai/src mirror=ftp://rpmfind.net/linux/Kondara/Jirai/SRPMS/SRPMS [/serveur/ftp/linux/Kondara/Jirai/RPMS/i586] name=Kondara Jirai i586 ftp=ftp://ftp.kondara.org/pub/Jirai/RPMS/i586 ftpsrc=ftp://ftp.kondara.org/pub/Jirai/SRPMS/SRPMS subdir=kondara/jirai/i586 mirror=ftp://rpmfind.net/linux/Kondara/Jirai/RPMS/i586 mirror=ftp://linux.inrialpes.fr/linux/Kondara/Jirai/RPMS/i586 [/serveur/ftp/linux/Kondara/Jirai/RPMS/sparc] name=Kondara Jirai sparc ftp=ftp://ftp.kondara.org/pub/Jirai/RPMS/sparc ftpsrc=ftp://ftp.kondara.org/pub/Jirai/SRPMS/SRPMS subdir=kondara/jirai/sparc mirror=ftp://rpmfind.net/linux/Kondara/Jirai/RPMS/sparc mirror=ftp://linux.inrialpes.fr/linux/Kondara/Jirai/RPMS/sparc [/serveur/ftp/linux/Kondara/Jirai/RPMS/alpha] name=Kondara Jirai alpha ftp=ftp://ftp.kondara.org/pub/Jirai/RPMS/alpha ftpsrc=ftp://ftp.kondara.org/pub/Jirai/SRPMS/SRPMS subdir=kondara/jirai/alpha mirror=ftp://rpmfind.net/linux/Kondara/Jirai/RPMS/alpha mirror=ftp://linux.inrialpes.fr/linux/Kondara/Jirai/RPMS/alpha [/serveur/ftp/linux/Kondara/Jirai-NonFree] name=Kondara Jirai Non Free ftp=ftp://ftp.kondara.org/pub/Jirai-NonFree ftpsrc=ftp://ftp.kondara.org/pub/Jirai-NonFree/SRPMS subdir=kondara/jirai/nonfree mirror=ftp://rpmfind.net/linux/Kondara/Jirai-NonFree mirror=ftp://linux.inrialpes.fr/linux/Kondara/Jirai-NonFree [/serveur/ftp/linux/Trustix/] name=Trustix ftp=ftp://ftp.trustix.com/pub/Trustix subdir=trustix mirror=ftp://rpmfind.net/linux/Trustix mirror=ftp://linux.inrialpes.fr/linux/Trustix [/serveur/ftp/linux/PLD/current] name=PLD Linux Distribution ftp=ftp://ftp.pld.org.pl/PLD-1.0 subdir=PLD mirror=ftp://rpmfind.net/linux/PLD/current mirror=ftp://linux.inrialpes.fr/linux/PLD/current [/serveur/ftp/linux/PLD/test] name=PLD Linux Distribution Test ftp=ftp://ftp.pld.org.pl/test subdir=PLDtest mirror=ftp://rpmfind.net/linux/PLD/test mirror=ftp://linux.inrialpes.fr/linux/PLD/test [/serveur/ftp/linux/ASPLinux] name=ASPLinux ftp=ftp://ftp.asp-linux.com/pub/ subdir=ASP mirror=ftp://rpmfind.net/linux/ASPLinux mirror=ftp://linux.inrialpes.fr/linux/ASPLinux [/serveur/ftp/linux/helix] name=HelixCode Gnome distribs ftp=ftp://ftp.helixcode.com/pub/helix subdir=helix color=#908c78 mirror=ftp://rpmfind.net/linux/helix mirror=ftp://linux.inrialpes.fr/linux/helix [/serveur/ftp/linux/eazel] name=Eazel ftp=ftp://download.eazel.com/pub/ subdir=eazel color=#908c78 mirror=ftp://rpmfind.net/linux/eazel mirror=ftp://linux.inrialpes.fr/linux/eazel [/serveur/ftp/linux/MySQL] name=MySQL ftp=ftp://ftp.mysql.com/ subdir=mysql mirror=ftp://rpmfind.net/linux/MySQL mirror=ftp://linux.inrialpes.fr/linux/MySQL [/serveur/ftp/linux/XBF] name=XBF X-Windows servers ftp=ftp://ftp.redhat.com/pub/XBF subdir=XBF mirror=ftp://rpmfind.net/linux/XBF mirror=ftp://linux.inrialpes.fr/linux/XBF [/serveur/ftp/linux/SuSE-Linux/i386/6.4] name=SuSE 6.4 i386 ftp=ftp://ftp.suse.com/pub/suse/i386/6.4 subdir=suse/6.4/i386 color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/i386/6.4 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/i386/6.4 [/serveur/ftp/linux/SuSE-Linux/axp/6.4] name=SuSE 6.4 AXP ftp=ftp://ftp.suse.com/pub/suse/axp/6.4 subdir=suse/6.4/axp color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/axp/6.4 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/axp/6.4 [/serveur/ftp/linux/SuSE-Linux/i386/6.3] name=SuSE 6.3 i386 ftp=ftp://ftp.suse.com/pub/suse/i386/6.3 subdir=suse/6.3/i386 color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/i386/6.3 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/i386/6.3 [/serveur/ftp/linux/SuSE-Linux/axp/6.3] name=SuSE 6.3 AXP ftp=ftp://ftp.suse.com/pub/suse/axp/6.3 subdir=suse/6.3/axp color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/axp/6.3 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/axp/6.3 [/serveur/ftp/linux/SuSE-Linux/i386/6.2] name=SuSE 6.2 i386 ftp=ftp://ftp.suse.com/pub/suse/i386/6.2 subdir=suse/6.2/i386 color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/i386/6.2 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/i386/6.2 [/serveur/ftp/linux/SuSE-Linux/axp/6.2] name=SuSE 6.2 AXP ftp=ftp://ftp.suse.com/pub/suse/axp/6.2 subdir=suse/6.2/axp color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/axp/6.2 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/axp/6.2 [/serveur/ftp/linux/SuSE-Linux/i386/6.1] name=SuSE 6.1 i386 ftp=ftp://ftp.suse.com/pub/suse/i386/6.1 subdir=suse/6.1/i386 color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/i386/6.1 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/i386/6.1 [/serveur/ftp/linux/SuSE-Linux/axp/6.1] name=SuSE 6.1 AXP ftp=ftp://ftp.suse.com/pub/suse/axp/6.1 subdir=suse/6.1/axp color=#ffffd0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/axp/6.1 mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/axp/6.1 [/serveur/ftp/linux/SuSE-Linux/suse_update] name=SuSE Updates ftp=ftp://ftp.suse.com/pub/SuSE-Linux/suse_update subdir=suse/updates color=#ffffa0 mirror=ftp://rpmfind.net/linux/SuSE-Linux/suse_update mirror=ftp://linux.inrialpes.fr/linux/SuSE-Linux/suse_update [/serveur/ftp/linux/linuxPPC/linuxPPC-pre-R5] name=Linux/PPC R5 ftp=ftp://ftp.linuxppc.org/linuxppc-pre-R5 ftpsrc=ftp://ftp.linuxppc.org/linuxppc-pre-R5/SRPMS/ subdir=linuxPPC/R5 color=#9aeef6 mirror=ftp://rpmfind.net/linux/linuxPPC/linuxPPC-pre-R5 mirror=ftp://linux.inrialpes.fr/linux/linuxPPC/linuxPPC-pre-R5 [/serveur/ftp/linux/linuxPPC/linuxppc-dev-rel] name=Linux/PPC Devel ftp=ftp://ftp.linuxppc.org/linuxppc-dev-rel ftpsrc=ftp://ftp.linuxppc.org/linuxppc-dev-rel/SRPMS/ subdir=linuxPPC/devel color=#9aeef6 mirror=ftp://rpmfind.net/linux/linuxPPC/linuxppc-dev-rel mirror=ftp://linux.inrialpes.fr/linux/linuxPPC/linuxppc-dev-rel [/serveur/ftp/linux/linuxPPC/contrib] name=Linux/PPC Contribs ftp=ftp://ftp.linuxppc.org/contrib ftpsrc=ftp://ftp.linuxppc.org/contrib/SRPMS/ subdir=linuxPPC/contrib color=#9aeef6 mirror=ftp://rpmfind.net/linux/linuxPPC/contrib mirror=ftp://linux.inrialpes.fr/linux/linuxPPC/contrib [/serveur/ftp/linux/yellowdog] name=Yellow Dog PPC ftp=ftp://ftp.yellowdoglinux.com/pub/yellowdog ftpsrc=ftp://ftp.yellowdoglinux.com/pub/yellowdog/champion-1.0/SRPMS/SRPMS/ subdir=yellowdog/1.0 color=#9aeef6 mirror=ftp://rpmfind.net/linux/yellowdog mirror=ftp://linux.inrialpes.fr/linux/yellowdog [/serveur/ftp/linux/TurboLinux/turbolinux-3.0] name=TurboLinux 3.0 ftp=ftp://ftp.pht.com/pub/turbolinux-3.0comdex/TurboLinux ftpsrc=ftp://ftp.pht.com/pub/turbolinux-3.0comdex/SRPMS subdir=turbolinux/3.0 color=#d2e6ad mirror=ftp://rpmfind.net/linux/TurboLinux/turbolinux-3.0 mirror=ftp://linux.inrialpes.fr/linux/TurboLinux/turbolinux-3.0 [/serveur/ftp/linux/blinux] name=Archives for blind users ftp=ftp://ftp.leb.net/pub/blinux subdir=blinux mirror=ftp://rpmfind.net/linux/blinux/ mirror=ftp://linux.inrialpes.fr/linux/blinux/ [/serveur/ftp/linux/netwinder.org] name=Netwinder.Org ftp=ftp://ftp.netwinder.org/pub/ subdir=netwinder mirror=ftp://rpmfind.net/linux/netwinder.org/ mirror=ftp://linux.inrialpes.fr/linux/netwinder.org/ [/serveur/ftp/linux/dld/5.4/i386] name=DLD 5.4 ftp=ftp://ftp.archive.de.uu.net/pub/systems/Linux/Distributions/DLD-5.4/inetdist/delix subdir=dld/5.4/i386 mirror=ftp://rpmfind.net/linux/dld/5.4/i386 mirror=ftp://linux.inrialpes.fr/linux/dld/5.4/i386 [/serveur/ftp/linux/ultrapenguin/1.1.9] name=UltraPenguin 1.1.9 ftp=ftp://ultra.penguin.cz/pub/ultrapenguin-1.1.9 ftpsrc=ftp://ultra.penguin.cz/pub/ultrapenguin-1.1.9/SRPMS subdir=ultrapenguin/1.1.9 color=#d0d0ff mirror=ftp://rpmfind.net/linux/ultrapenguin/1.1.9 mirror=ftp://linux.inrialpes.fr/linux/ultrapenguin/1.1.9 [/serveur/ftp/linux/SGILinux/] name=SGI XFS ftp=ftp://ftp.linux.sgi.com/projects/xfs/download/ subdir=SGI/xfs color=#a0c0ff mirror=ftp://rpmfind.net/linux/SGILinux/ mirror=ftp://linux.inrialpes.fr/linux/SGILinux/ [/serveur/ftp/linux/Madeinlinux] name=Madeinlinux ftp=ftp://ftp.madeinlinux.com/ subdir=Madeinlinux mirror=ftp://rpmfind.net/linux/Madeinlinux/ mirror=ftp://linux.inrialpes.fr/linux/Madeinlinux/ [/serveur/ftp/linux/sourceforge] name=SourceForge ftp=ftp://ftp.sourceforge.net/pub/sourceforge subdir=sourceforge color=#818bbc mirror=ftp://rpmfind.net/linux/sourceforge mirror=ftp://linux.inrialpes.fr/linux/sourceforge [/serveur/ftp/linux/freshmeat] name=Freshmeat ftp=ftp://ftp.freshmeat.net/pub/rpms subdir=freshmeat color=#c2cce4 mirror=ftp://rpmfind.net/linux/freshmeat mirror=ftp://linux.inrialpes.fr/linux/freshmeat [/serveur/ftp/linux/falsehope] name=Falsehope ftp=ftp://ftp.falsehope.net/ subdir=falsehope color=#c2cce4 mirror=ftp://rpmfind.net/linux/falsehope mirror=ftp://linux.inrialpes.fr/linux/falsehope [/serveur/ftp/linux/rhcontrib] name=Red Hat Contib at Bero.Org ftp=http://rhcontrib.bero.org/ subdir=rhcontrib color=#c2cce4 mirror=ftp://rpmfind.net/linux/rhcontrib mirror=ftp://linux.inrialpes.fr/linux/rhcontrib [/serveur/ftp/linux/freshrpms] name=Freshrpms ftp=ftp://ftp.freshrpms.net/freshrpms/ subdir=freshrpms color=#e8ecf0 mirror=ftp://rpmfind.net/linux/freshrpms mirror=ftp://linux.inrialpes.fr/linux/freshrpms [/serveur/ftp/linux/OpenPKG] name=OpenPKG ftp=ftp://ftp.openpkg.org subdir=openpkg mirror=ftp://rpmfind.net/linux/OpenPKG mirror=ftp://linux.inrialpes.fr/linux/OpenPKG [/serveur/ftp/linux/coda] name=Coda ftp=ftp://ftp.coda.cs.cmu.edu/pub/coda/linux subdir=coda color=#c2e4cc mirror=ftp://rpmfind.net/linux/coda mirror=ftp://linux.inrialpes.fr/linux/coda [/serveur/ftp/linux/Beowulf] name=Beowulf ftp=ftp://www.beowulf.org/www.beowulf.org/software/RPMS ftpsrc=ftp://www.beowulf.org/www.beowulf.org/software/SRPMS subdir=beowulf color=#38f850 mirror=ftp://rpmfind.net/linux/Beowulf mirror=ftp://linux.inrialpes.fr/linux/Beowulf [/linux/replay/crypto] name=Crypto@Ftp.Zedz.com (Replay) ftp=ftp://ftp.zedz.net/pub/replay/linux subdir=replay/crypto ftp=ftp://ftp.funet.fi/pub/mirrors/utopia.hacktic.nl/linux [/serveur/ftp/linux/rpm.org] name=RPM.Org ftp=ftp://ftp.rpm.org/pub subdir=rpm.org mirror=ftp://rpmfind.net/linux/rpm.org mirror=ftp://linux.inrialpes.fr/linux/rpm.org [/serveur/ftp/pub] name=Stuff on Rufus.W3.Org ftp=ftp://rpmfind.net/pub subdir=rufus mirror=ftp://rpmfind.net/pub mirror=ftp://linux.inrialpes.fr/pub [/serveur/ftp/linux/solaris] name=Solaris packages on Real-Time.Com ftp=ftp://ftp.real-time.com/pub/real-time ftpsrc=ftp://ftp.real-time.com/pub/real-time/SRPMS/ subdir=solaris mirror=ftp://rpmfind.net/linux/solaris mirror=ftp://linux.inrialpes.fr/linux/solaris [/serveur/ftp/linux/Cygwin32] name=RPMs for Cygwin32/Windows ftp=ftp://pipeline.ucsd.edu/pub/dsf/cygwin32 ftpsrc=ftp://pipeline.ucsd.edu/pub/dsf/cygwin32/SRPMS/ subdir=windows/cygwin32 mirror=ftp://rpmfind.net/linux/Cygwin32 mirror=ftp://linux.inrialpes.fr/linux/Cygwin32 rpm2html-1.11.2/cleanup.c0000664000076400007640000003217011452634006013632 0ustar hanyhany/* * cleanup.c : Cleanup the RDF and HTML trees to remove files related to * older packages. * * The RDF output tree looks like this: * * root ----- distrib1 ---- package1.rdf * - package2.rdf * - ... * - distrib2 ---- packagen.rdf * - ... * - distribm ... * - resources --- resource1.rdf * - resource2.rdf * - ... * - distribs ------ distrib1.rdf * - distrib2.rdf * - distribn.rdf * * See Copyright for the status of this software. * * $Id: cleanup.c,v 1.10 2010/10/05 14:36:54 hany Exp $ */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include "rpm2html.h" #include "rpmdata.h" #include "html.h" #include "rdf.h" #include "rdf_api.h" #include "language.h" #ifndef HAVE_SNPRINTF #error You really need snprintf ... #endif static int nb_removed_files = 0; /* * Cleanup the global varibales of this module */ void cleanupCleanup(void) { nb_removed_files = 0; } /* * Check an RPM RDF file for obsolescence. */ static void rpmOneFileCleanup(char *file) { rdfSchema rdf; rdfNamespace rpmNs; rdfNamespace rdfNs; rdfDescription desc; char *name; char *version; char *release; char *arch; char *URL; int aboutRPM = 0; int isOk = 0; rpmDataPtr found; rdf = rdfRead(file); if (rdf == NULL) { unlink(file); nb_removed_files++; return; } /* * Start the analyze, check that's an RDF for RPM packages. */ rdfNs = rdfGetNamespace(rdf, "http://www.w3.org/TR/WD-rdf-syntax#"); if (rdfNs == NULL) { if (rpm2htmlVerbose) printf("%s is not an RDF schema\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } rpmNs = rdfGetNamespace(rdf, "http://www.rpm.org/"); if (rdfNs == NULL) { if (rpm2htmlVerbose) printf("%s is not an RPM specific RDF schema\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } desc = rdfFirstDescription(rdf); if (rdfNs == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema seems empty\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } /* * We are pretty sure that it will be a valid schema, * Walk the tree and collect the packages descriptions. */ if (desc != NULL) { /* * Get the resource URL ... */ URL = rdfGetDescriptionHref(rdf, desc); if (URL == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : Desc without href\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } /* * Now extract all the metadata information from the RDF tree */ rdfGetValue(desc, "Name", rpmNs, &name, NULL); if (name == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Name\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } rdfGetValue(desc, "Version", rpmNs, &version, NULL); if (version == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Version\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } rdfGetValue(desc, "Release", rpmNs, &release, NULL); if (release == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Release\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } rdfGetValue(desc, "Arch", rpmNs, &arch, NULL); if (arch == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Arch\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } /********************* rdfGetValue(desc, "Os", rpmNs, &os, NULL); if (os == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Os\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } **********************/ aboutRPM = 1; /* * Now that we have gathered name,version,release,arch and os * Check that this is in the package list. */ found = rpmSearchSoftware(name, version, release, arch); if (found) { isOk = 1; } if (URL != NULL) free(URL); /* * Skip to next Description in the RDf file. */ desc = rdfNextDescription(desc); } if ((aboutRPM) && (!isOk)) { /* if (rpm2htmlVerbose) */ printf("Removing outdated %s RDF description\n", file); unlink(file); nb_removed_files++; } /* * Cleanup. */ rdfDestroySchema(rdf); } /* * Scan a distribution directory for RDF files */ static void rpmOneDirCleanup(char *dir) { char *filename; char path[2000]; struct stat buf; int len; DIR *d; struct dirent *file; d = opendir(dir); if (d == NULL) { fprintf(stderr, "rpmOneDirCleanup: Listing of %s failed: %s\n", dir, strerror(errno)); return; } else { while ((file = readdir(d)) != NULL) { filename = file->d_name; len = strlen(filename); /* * Compute the full path */ snprintf(path, sizeof(path), "%s/%s", dir, filename); /* * Stat() the file to detect directory and symlimks */ if (lstat(path, &buf) != 0) { fprintf(stderr, "rpmOneDirCleanup: Couldn't stat(%s)\n", path); continue; } /* * Don't follow of analyze symlinks, remove them */ if (S_ISLNK(buf.st_mode)) { if (rpm2htmlVerbose) fprintf(stderr, "Cleaning: removing symlink %s\n", path); unlink(path); nb_removed_files++; continue; } /* * Check for RDF files by looking at the suffix */ else if ((len >= 5) && (!strcasecmp(&filename[len - 4], ".rdf"))) { rpmOneFileCleanup(path); } /* * Else if this is a directory, recurse ! */ else if (S_ISDIR(buf.st_mode)) { if (filename[0] != '.') { rpmOneDirCleanup(path); } } } } closedir(d); } /* * Check a resource RDF file for obsolescence. */ static void rpmOneResourceCleanup(char *file) { rdfSchema rdf; rdfNamespace rpmNs; rdfNamespace rdfNs; rdfDescription desc; char *name; char *version; char *release; char *arch; char *URL; int aboutRPM = 0; int isOk = 0; rpmDataPtr found; rdf = rdfRead(file); if (rdf == NULL) { unlink(file); nb_removed_files++; return; } /* * Start the analyze, check that's an RDF for RPM resource. */ rdfNs = rdfGetNamespace(rdf, "http://www.w3.org/TR/WD-rdf-syntax#"); if (rdfNs == NULL) { if (rpm2htmlVerbose) printf("%s is not an RDF schema\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } rpmNs = rdfGetNamespace(rdf, "http://www.rpm.org/"); if (rdfNs == NULL) { if (rpm2htmlVerbose) printf("%s is not an RPM specific RDF schema\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } desc = rdfFirstDescription(rdf); if (rdfNs == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema seems empty\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } /* * We are pretty sure that it will be a valid schema, * Walk the tree and collect the packages descriptions. */ if (desc != NULL) { /* * Get the resource URL ... */ URL = rdfGetDescriptionHref(rdf, desc); if (URL == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : Desc without href\n", file); rdfDestroySchema(rdf); unlink(file); nb_removed_files++; return; } /* * Now extract all the metadata information from the RDF tree */ rdfGetValue(desc, "Name", rpmNs, &name, NULL); if (name == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Name\n", file); rdfDestroySchema(rdf); return; } rdfGetValue(desc, "Version", rpmNs, &version, NULL); if (version == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Version\n", file); rdfDestroySchema(rdf); return; } rdfGetValue(desc, "Release", rpmNs, &release, NULL); if (release == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Release\n", file); rdfDestroySchema(rdf); return; } rdfGetValue(desc, "Arch", rpmNs, &arch, NULL); if (arch == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Arch\n", file); rdfDestroySchema(rdf); return; } /*********** rdfGetValue(desc, "Os", rpmNs, &os, NULL); if (os == NULL) { if (rpm2htmlVerbose) printf("%s RDF schema invalid : no Os\n", file); rdfDestroySchema(rdf); return; } *************/ aboutRPM = 1; /* * Now that we have gathered name,version,release,arch and os * Check that this is in the package list. */ found = rpmSearchSoftware(name, version, release, arch); if (found) { isOk = 1; } /* * Skip to next Description in the RDf file. */ desc = rdfNextDescription(desc); } if ((aboutRPM) && (!isOk)) { /* if (rpm2htmlVerbose) */ printf("Removing outdated %s RDF resource\n", file); unlink(file); nb_removed_files++; } /* * Cleanup. */ rdfDestroySchema(rdf); } /* * Check the resources directory. */ static void rpmResourcesCleanup(char *dir) { char *filename; char path[2000]; struct stat buf; int len; DIR *d; struct dirent *file; d = opendir(dir); if (d == NULL) { fprintf(stderr, "rpmResourcesCleanup: Listing of %s failed: %s\n", dir, strerror(errno)); return; } else { while ((file = readdir(d)) != NULL) { filename = file->d_name; len = strlen(filename); /* * Compute the full path */ snprintf(path, sizeof(path), "%s/%s", dir, filename); /* * Stat() the file to detect directory and symlimks */ if (lstat(path, &buf) != 0) { fprintf(stderr, "Couldn't stat(%s)\n", path); unlink(path); nb_removed_files++; continue; } /* * Don't follow of analyze symlinks, remove them */ if (S_ISLNK(buf.st_mode)) { if (rpm2htmlVerbose) fprintf(stderr, "Cleaning: removing symlink %s\n", path); unlink(path); nb_removed_files++; continue; } /* * Check for RDF files by looking at the suffix */ else if ((len >= 5) && (!strcasecmp(&filename[len - 4], ".rdf"))) { rpmOneResourceCleanup(path); } /* * Else if this is a directory, recurse ! */ else if (S_ISDIR(buf.st_mode)) { if (filename[0] != '.') { if (!strcmp(filename, "distribs")) { /* TOTO : explore the distrib too ! */ } else { if (rpm2htmlVerbose) fprintf(stderr, "Cleaning: directory resources/%s should not exist\n", filename); } } } } } closedir(d); } /* * Cleanup the whole RDF repository */ void rpmDirCleanupAll(void) { char *filename; char path[2000]; struct stat buf; int len; DIR *d; struct dirent *file; int start_time; int end_time; if (!rpm2html_dump_rdf) return; if (!rpm2html_rdf_dir) return; nb_removed_files = 0; start_time = time(NULL); d = opendir(rpm2html_rdf_dir); if (d == NULL) { fprintf(stderr, "Listing of %s failed: %s\n", rpm2html_rdf_dir, strerror(errno)); return; } else { while ((file = readdir(d)) != NULL) { filename = file->d_name; len = strlen(filename); /* * Compute the full path */ snprintf(path, sizeof(path), "%s/%s", rpm2html_rdf_dir, filename); /* * Stat() the file to detect directory and symlimks */ if (lstat(path, &buf) != 0) { fprintf(stderr, "rpmDirCleanupAll: Couldn't stat(%s)\n", path); continue; } /* * Don't follow of analyze symlinks, */ if (S_ISLNK(buf.st_mode)) { if (rpm2htmlVerbose) fprintf(stderr, "Cleaning: removing symlink %s\n", path); unlink(path); nb_removed_files++; continue; } /* * We shouldn't get any non-rdf file here */ else if ((len >= 5) && (!strcasecmp(&filename[len - 4], ".rdf"))) { rpmOneFileCleanup(filename); } /* * Else if this is a directory, handle it */ else if (S_ISDIR(buf.st_mode)) { if (!strcmp(filename, "resources")) { rpmResourcesCleanup(path); } else if (filename[0] != '.') { rpmOneDirCleanup(path); } } /* * Else, remove that file it shouldn't be here ! */ else { if (rpm2htmlVerbose) fprintf(stderr, "Cleaning: removing file %s\n", path); unlink(path); nb_removed_files++; continue; } } } closedir(d); end_time = time(NULL); /* if (rpm2htmlVerbose) */ printf("Cleanup took %d second, %d files removed\n", end_time - start_time, nb_removed_files); } rpm2html-1.11.2/compressor.c0000664000076400007640000001162206532402606014400 0ustar hanyhany/* * Compressor.c : read an input file and store it compressed in * a C source file containing a char array containing * the compressed file. * * See Copyright for the status of this software. * * $Id: compressor.c,v 1.5 1998/05/25 23:57:58 veillard Exp $ */ #include #include #include #include #include #include #include #include #include #define MAX_PATH_LENGHT 512 char *data_name; char *data_file = NULL; int main_argc; char **main_argv; char pwd[MAX_PATH_LENGHT]; void create_gz_source(char *filename) { char outputfile[MAX_PATH_LENGHT]; Bytef *input; int size; Bytef *output; uLongf outsize; int res; struct stat st; int fd; FILE *result; int i; /* * open and read the input file in a buffer. */ fd = open(filename, O_RDONLY); if (fd < 0) { perror("mkdep: open"); return; } fstat(fd, &st); size = st.st_size; input = malloc(size); if (input == NULL) { perror("malloc failed"); exit(1); } res = read(fd, input, size); if (res < size) { perror("read didn't complete"); exit(1); } close(fd); /* * allocate an output buffer for the compressed result. */ outsize = size + (size / 8) + 12; output = malloc(outsize); if (output == NULL) { perror("malloc failed"); exit(1); } /* * compress the whole stuff in one pass. */ if (compress(output, (uLongf *) &outsize, input, size) != Z_OK) { fprintf(stderr, "compress failed\n"); exit(1); } /* * save the whole stuff as a C source file. */ if (data_file == NULL) { sprintf(outputfile, "%s.h", filename); data_file = &outputfile[0]; } result = fopen(data_file, "w"); if (result == NULL) { fprintf(stderr, "fopen(%s)", data_file); perror("failed"); exit(1); } fprintf(result, "/* output from compressor, need #include \" */\n"); fprintf(result, "#define %s_size %d\n", data_name, size); fprintf(result, "unsigned char %s[%d] = {", data_name, (int) outsize); for (i = 0;i < (outsize - 1);i++) { if (!(i % 15)) fprintf(result, "\n"); fprintf(result, "0x%02x,", output[i]); } fprintf(result, "0x%02x\n};\n\n", output[outsize - 1]); fprintf(result, "char *read_%s(void) {\n", data_name); fprintf(result, " uLongf size = %d;\n", size + 20); fprintf(result, " Bytef *buffer = malloc(%d);\n\n", size + 20); fprintf(result, " if (buffer == NULL) return(NULL);\n"); fprintf(result, " if (uncompress(buffer, &size, %s, %d) != Z_OK) {\n", data_name, (int) outsize); fprintf(result, " fprintf(stderr, \"uncompress failed\");\n"); fprintf(result, " free(buffer);\n"); fprintf(result, " return(NULL);\n"); fprintf(result, " }\n"); fprintf(result, " if (size != %d) {\n", size); fprintf(result, " fprintf(stderr, \"uncompress failed\");\n"); fprintf(result, " free(buffer);\n"); fprintf(result, " return(NULL);\n"); fprintf(result, " }\n"); fprintf(result, " buffer[%d] = '\\0';\n", size); fprintf(result, " return(buffer);\n}\n"); fclose(result); } void message(char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); } char *get_data_name(char *filename) { char *res; char *cur; res = (char *) malloc((strlen(filename) + 20) * sizeof(char)); sprintf(res, "data_buffer_%s", filename); cur = res; while (*cur != '\0') { if (*cur == '.') *cur = '_'; else if (*cur == ' ') *cur = '_'; else if (*cur == '/') *cur = '_'; else if (*cur == '\t') *cur = '_'; cur++; } return(res); } int main(int argc, char **argv) { char fullname[MAX_PATH_LENGHT]; main_argc = argc; main_argv = argv; getcwd(pwd, sizeof(pwd)); while (--argc > 0) { char *name = *++argv; if (name[0] == '-') { switch (name[1]) { case 'n': data_name = *++argv; argc--; continue; case 'o': data_file = *++argv; argc--; continue; default: /* * NOTE : dump_h has to be modified accordingly * if new options are added ! */ fprintf(stderr,"%s [options] includes ...\n", argv[0]); fprintf(stderr,"Options :\n"); fprintf(stderr,"\t-n data_name\n"); fprintf(stderr,"\t-o file_name\n"); exit(1); } continue; } if (name[0] != '/') { strcpy(fullname, pwd); strcat(fullname, "/"); strcat(fullname, name); } else { strcpy(fullname, name); } /* * do the work ! */ data_name = get_data_name(name); create_gz_source(fullname); } return 0; } rpm2html-1.11.2/config.c0000664000076400007640000005321611466344075013465 0ustar hanyhany/* * config.c : handle the configuration file. * * See Copyright for the status of this software. * * $Id: config.c,v 1.52 2010/11/09 22:16:29 hany Exp $ */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include "rpm2html.h" #include "rpmdata.h" #ifdef WITH_SQL #include "sql.h" #endif /* * configuration variables for rpm2html */ char *rpm2html_rpm2html_name = RPM2HTML_NAME; char *rpm2html_rpm2html_ver = RPM2HTML_VER; char *rpm2html_rpm2html_url = RPM2HTML_URL; char *rpm2html_rpm2html_thishost= NULL; char *rpm2html_maint = RPM2HTML_MAINT; char *rpm2html_mail = RPM2HTML_MAIL; char *rpm2html_help = NULL; char *rpm2html_dir = NULL; char *rpm2html_name = NULL; char *rpm2html_url = NULL; #ifdef WITH_SQL char *rpm2html_search = "/linux/rpm2html/search.php"; #endif char *rpm2html_ftp = NULL; char *rpm2html_ftpsrc = NULL; char *rpm2html_host = NULL; int rpm2html_build_tree = 0; int rpm2html_cve_linking = 1; #ifdef HAVE_LIBTEMPLATE char *rpm2html_html_template = "rpm2html.tpl"; #endif int rpm2html_dump_html = 1; int rpm2html_dump_html_only_if_rpm_newer = 0; int rpm2html_dump_rdf = 0; int rpm2html_dump_rdf_resources= 0; char *rpm2html_rdf_dir = NULL; char *rpm2html_rdf_resources_dir= NULL; int rpm2html_rdf_count_limit = DEFAULT_RDF_COUNT_LIMIT; int rpm2html_files = 0; int rpm2html_size = 0; int rpm2html_no_sql = 0; int rpm2html_install_files = 0; int rpm2html_install_size = 0; int rpm2html_protect_emails = 0; char *rpm2html_headers_name[MAX_EXTRA_HEADERS]; char *rpm2html_headers_url[MAX_EXTRA_HEADERS]; int rpm2html_nb_extra_headers = 0; int nb_metadata_mirrors = 0; int max_metadata_mirrors = 0; char **metadata_mirrors = NULL; void addHeader(char *value); #ifdef HAVE_STRNDUP extern char *strndup (const char *source, size_t len); #else /* ! HAVE_STRNDUP */ /* * */ char *strndup (const char *source, size_t len) { char* tmp = NULL; if ((source == NULL) || (len < 0)) return(NULL); if (len <= strlen(source)) return xmlStrdup(source); tmp = xmlMalloc(len+1); strncpy(tmp, source, len); tmp[len] = '\0'; return(tmp); } #endif /* HAVE_STRNDUP */ /* * free a directory structure. */ void rpmDirFree(rpmDirPtr dir) { int i; if (dir->color) xmlFree(dir->color); if (dir->dir != NULL) xmlFree(dir->dir); if (dir->ftp != NULL) xmlFree(dir->ftp); if (dir->ftpsrc != NULL) xmlFree(dir->ftpsrc); if (dir->host != NULL) xmlFree(dir->host); if (dir->mail != NULL) xmlFree(dir->mail); if (dir->maint != NULL) xmlFree(dir->maint); if (dir->name != NULL) xmlFree(dir->name); if (dir->url != NULL) xmlFree(dir->url); if (dir->subdir != NULL) xmlFree(dir->subdir); for (i = 0;i < dir->nb_mirrors ; i++) if (dir->mirrors[i] != NULL) xmlFree(dir->mirrors[i]); if (dir->mirrors != NULL) xmlFree(dir->mirrors); if (dir->trust != NULL) xmlFree(dir->trust); if (dir->rpmdir != NULL) xmlFree(dir->rpmdir); if (dir->dbpath != NULL) xmlFree(dir->dbpath); /* Added by A. Gibert */ dir->next = NULL; memset(dir, 0, sizeof(rpmDir)); xmlFree(dir); } /* * free a directory list. */ void rpmDirListFree(rpmDirPtr *base) { rpmDirPtr dir = *base, next; while (dir != NULL) { next = dir->next; rpmDirFree(dir); dir = next; } *base = NULL; } /* * free an RPM structure. */ void rpmDataFree(rpmDataPtr rpm) { if (rpm->filename) xmlFree(rpm->filename); if (rpm->name != NULL) stringFree(rpm->name); if (rpm->version != NULL) stringFree(rpm->version); if (rpm->release != NULL) stringFree(rpm->release); if (rpm->url != NULL) xmlFree(rpm->url); if (rpm->arch != NULL) stringFree(rpm->arch); if (rpm->os != NULL) stringFree(rpm->os); if (rpm->distribution != NULL) stringFree(rpm->distribution); if (rpm->vendor != NULL) stringFree(rpm->vendor); if (rpm->group != NULL) stringFree(rpm->group); if (rpm->summary != NULL) xmlFree(rpm->summary); if (rpm->subdir != NULL) stringFree(rpm->subdir); rpmDataListFree(&(rpm->nextArch)); memset(rpm, 0, sizeof(rpmData)); xmlFree(rpm); } /* * free an RPM list. */ void rpmDataListFree(rpmDataPtr *base) { rpmDataPtr rpm = *base, next; while (rpm != NULL) { next = rpm->nextSoft; rpmDataFree(rpm); rpm = next; } *base = NULL; } /* * free a resource structure. */ void rpmRessFree(rpmRessPtr res) { if (res->name != NULL) xmlFree(res->name); if (res->version != NULL) xmlFree(res->version); if (res->provider != NULL) xmlFree(res->provider); memset(res, 0, sizeof(rpmRess)); xmlFree(res); } /* * free a resource list. */ void rpmRessListFree(rpmRessPtr *base) { rpmRessPtr res = *base, next; while (res != NULL) { next = res->next; rpmRessFree(res); res = next; } *base = NULL; } /* * Search a directory in the list. If not found, create a new one. */ rpmDirPtr rpmDirSearch(char *dirname) { rpmDirPtr cur = dirList; while (cur != NULL) { if (!strcmp(dirname, cur->rpmdir)) return(cur); cur = cur->next; } cur = (rpmDirPtr) xmlMalloc(sizeof(rpmDir)); if (cur == NULL) { fprintf(stderr, "rpmDirSearch : ran out of memory!\n"); exit(1); } memset(cur, 0, sizeof(rpmDir)); cur->max_mirrors = 5; cur->mirrors = (char **) xmlMalloc(cur->max_mirrors * sizeof(char *)); cur->color = xmlStrdup("#ffffff"); cur->dir = NULL; cur->files = 0; cur->html = 1; cur->ftp = NULL; cur->ftpsrc = NULL; cur->host = NULL; cur->mail = NULL; cur->maint = NULL; cur->name = NULL; cur->nb_mirrors = 0; cur->mirrors[0] = NULL; cur->rpmdir = xmlStrdup(dirname); cur->size = 0; cur->trust = "1.0"; cur->trust = NULL; cur->url = NULL; cur->build_tree = rpm2html_build_tree; cur->follow_symlinks = 0; cur->rpm_symlinks = 0; if (strncmp(dirname, "localbase", 9)) /* Added by A. Gibert */ cur->installbase = 0; else cur->installbase = 1; cur->next = dirList; dirList = cur; return(cur); } /* * addConfigEntry : an entry in the config file has just been read. */ void addConfigEntry(char *rpmdir, char *name, char *value) { rpmDirPtr cur; char *temp; if (rpm2htmlVerbose > 1) printf("addConfigEntry(\"%s\", \"%s\", \"%s\")\n", rpmdir, name, value); /* * case of global option for rpm2html. */ if (!strcasecmp(rpmdir, RPM2HTML_NAME)) { if (!strcasecmp(name, "url")) { rpm2html_url = xmlStrdup(value); } else if (!strcasecmp(name, "maint")) { rpm2html_maint = xmlStrdup(value); } else if (!strcasecmp(name, "help")) { rpm2html_help = xmlStrdup(value); } else if (!strcasecmp(name, "mail")) { rpm2html_mail = xmlStrdup(value); } else if (!strcasecmp(name, "dir")) { rpm2html_dir = xmlStrdup(value); } else if (!strcasecmp(name, "ftp")) { rpm2html_ftp = xmlStrdup(value); } else if (!strcasecmp(name, "ftpsrc")) { rpm2html_ftpsrc = xmlStrdup(value); } else if (!strcasecmp(name, "name")) { rpm2html_name = xmlStrdup(value); } else if (!strcasecmp(name, "host")) { rpm2html_host = xmlStrdup(value); } else if (!strcasecmp(name, "tree")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { rpm2html_build_tree = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { rpm2html_build_tree = 0; } else { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"tree=true\" or \"tree=false\"\n"); } } else if (!strcasecmp(name, "rdf")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { rpm2html_dump_rdf = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { rpm2html_dump_rdf = 0; } else { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"rdf=true\" or \"rdf=false\"\n"); } } else if (!strcasecmp(name, "rdf_dir")) { rpm2html_rdf_dir = xmlStrdup(value); } else if (!strcasecmp(name, "rdf_resources")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { rpm2html_dump_rdf_resources = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { rpm2html_dump_rdf_resources = 0; } else { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"rdf_resources=true\" or \"rdf_resources=false\"\n"); } } else if (!strcasecmp(name, "rdf_resources_dir")) { rpm2html_rdf_resources_dir = xmlStrdup(value); } else if (!strcasecmp(name, "rdf_count_limit")) { rpm2html_rdf_count_limit = strtol(value, &temp, 10); if ((*value == '\0') || (*temp != '\0')) { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"rdf_count_limit=\"\n"); rpm2html_rdf_count_limit = DEFAULT_RDF_COUNT_LIMIT; } } else if (!strcasecmp(name, "html")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { rpm2html_dump_html = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { rpm2html_dump_html = 0; } else { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"html=true\" or \"html=false\"\n"); } #ifdef HAVE_LIBTEMPLATE } else if (!strcasecmp(name, "html_template")) { rpm2html_html_template = xmlStrdup(value); #endif } else if (!strcasecmp(name, "protectemails")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { rpm2html_protect_emails = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { rpm2html_protect_emails = 0; } else { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"protectemails=true\" or \"protectemails=false\"\n"); } } else if (!strcasecmp(name, "cve_linking")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { rpm2html_cve_linking = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { rpm2html_cve_linking = 0; } else { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"cve_linking=true\" or \"cve_linking=false\"\n"); } } else if (!strcasecmp(name, "header")) { addHeader(value); } else if (!strcasecmp(name, "dump_html_only_if_rpm_newer")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { rpm2html_dump_html_only_if_rpm_newer = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { rpm2html_dump_html_only_if_rpm_newer = 0; } else { printf("Config file : %s global entry ignored,\n", name); printf("\tuse \"dump_html_only_if_rpm_newer=true\" or \"dump_html_only_if_rpm_newer=false\"\n"); } } else { printf("Config file : %s global entry ignored\n", name); } return; } /* * Options for the metadata mirrors. */ if (!strcasecmp(rpmdir, "metadata")) { if (!strcasecmp(name, "mirror")) { /* * all "mirrors" values are collected in the metadata_mirrors array. */ if (metadata_mirrors == NULL) { max_metadata_mirrors = 10; nb_metadata_mirrors = 0; metadata_mirrors = (char **) xmlMalloc(max_metadata_mirrors * sizeof(char *)); if (metadata_mirrors == NULL) { fprintf(stderr, "addConfigEntry : ran out of memory!\n"); exit(1); } } if (nb_metadata_mirrors >= max_metadata_mirrors) { max_metadata_mirrors *= 2; metadata_mirrors = (char **) xmlRealloc(metadata_mirrors, max_metadata_mirrors * sizeof(char *)); if (metadata_mirrors == NULL) { fprintf(stderr, "addConfigEntry : ran out of memory!\n"); exit(1); } } metadata_mirrors[nb_metadata_mirrors++] = xmlStrdup(value); } else { printf("Config file : %s entry for [metadata] ignored\n", name); } return; } /* * option for a directory. */ cur = rpmDirSearch(rpmdir); if (!strcasecmp(name, "name")) { cur->name = xmlStrdup(value); } else if (!strcasecmp(name, "dir")) { cur->dir = xmlStrdup(value); } else if (!strcasecmp(name, "subdir")) { cur->subdir = xmlStrdup(value); } else if (!strcasecmp(name, "dbpath")) { /* Added by A. Gibert */ cur->dbpath = xmlStrdup(value); /* Added by A. Gibert */ } else if (!strcasecmp(name, "url")) { cur->url = xmlStrdup(value); } else if (!strcasecmp(name, "ftp")) { cur->ftp = xmlStrdup(value); } else if (!strcasecmp(name, "ftpsrc")) { cur->ftpsrc = xmlStrdup(value); } else if (!strcasecmp(name, "color")) { if (cur->color != NULL) xmlFree(cur->color); cur->color = xmlStrdup(value); } else if (!strcasecmp(name, "trust")) { if (cur->trust != NULL) xmlFree(cur->color); cur->trust = xmlStrdup(value); } else if (!strcasecmp(name, "host")) { rpm2html_host = xmlStrdup(value); } else if (!strcasecmp(name, "rdf_dir")) { rpm2html_rdf_dir = xmlStrdup(value); } else if (!strcasecmp(name, "html")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { cur->html = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { cur->html = 0; } else { printf("Config file : %s directory entry ignored,\n", name); printf("\tuse \"html=true\" or \"html=false\"\n"); } } else if (!strcasecmp(name, "tree")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { cur->build_tree = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { cur->build_tree = 0; } else { printf("Config file : %s directory entry ignored,\n", name); printf("\tuse \"tree=true\" or \"tree=false\"\n"); } } else if (!strcasecmp(name, "followsymlinks")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { cur->follow_symlinks = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { cur->follow_symlinks = 0; } else { printf("Config file : %s directory entry ignored,\n", name); printf("\tuse \"tree=true\" or \"tree=false\"\n"); } } else if (!strcasecmp(name, "rpmsymlinks")) { if ((!strcasecmp(value, "true")) || (!strcasecmp(value, "yes"))) { cur->rpm_symlinks = 1; } else if ((!strcasecmp(value, "false")) || (!strcasecmp(value, "no"))) { cur->rpm_symlinks = 0; } else { printf("Config file : %s directory entry ignored,\n", name); printf("\tuse \"tree=true\" or \"tree=false\"\n"); } } else if (!strcasecmp(name, "mirror")) { /* * all "mirrors" values are collected in the mirrors array. */ if (cur->nb_mirrors >= cur->max_mirrors) { cur->max_mirrors *= 2; cur->mirrors = (char **) xmlRealloc(cur->mirrors, cur->max_mirrors * sizeof(char *)); if (cur->mirrors == NULL) { fprintf(stderr, "addConfigEntry : ran out of memory!\n"); exit(1); } } cur->mirrors[cur->nb_mirrors++] = xmlStrdup(value); } else { printf("Config file : %s entry for [%s] ignored\n", name, rpmdir); } } /**************************************************************** * * * The configuration file parser * * * ****************************************************************/ /* * A few macro needed to help building the parser */ #define IS_BLANK(ptr) \ (((*(ptr)) == ' ') || ((*(ptr)) == '\b') || \ ((*(ptr)) == '\n') || ((*(ptr)) == '\r')) #define SKIP_BLANK(ptr) \ { while (((*(ptr)) == ' ') || ((*(ptr)) == '\b') || \ ((*(ptr)) == '\n') || ((*(ptr)) == '\r')) ptr++; } #define GOTO_EQL(ptr) \ { while (((*(ptr)) != '\0') && ((*(ptr)) != '=') && \ ((*(ptr)) != '\n') && ((*(ptr)) != '\r')) ptr++; } #define GOTO_EOL(ptr) \ { while (((*(ptr)) != '\0') && \ ((*(ptr)) != '\n') && ((*(ptr)) != '\r')) ptr++; } /* * addHeader : parse an Header entry, we expect the first * part to be an URL and the end of the line is the name. * * e.g: "help.html Get Help" */ void addHeader(char *value) { char *url; char *name; char save; /* * Check for more room in the header arrays. * Yes I'm lazy ... */ if (rpm2html_nb_extra_headers >= MAX_EXTRA_HEADERS) { fprintf(stderr, "Too many headers, increase MAX_EXTRA_HEADERS\n"); return; } /* * Check the url, parse until finding a blank. */ name = value; while (!IS_BLANK(name)) name++; save = *name; *name = 0; url = xmlStrdup(value); *name = save; if (url == NULL) { fprintf(stderr, "strndup \"%s\" failed\n", value); exit(1); } SKIP_BLANK(name); if (*name == '\0') { fprintf(stderr, "Config file : expecting \"header URL description\"\n"); fprintf(stderr, "\tfound \"header: %s\", ignored\n", value); xmlFree(url); return; } /* * Store the values in global variables. */ rpm2html_headers_name[rpm2html_nb_extra_headers] = xmlStrdup(name); rpm2html_headers_url[rpm2html_nb_extra_headers] = url; rpm2html_nb_extra_headers++; } /* * read config file: parse a configuration file. */ int readConfigFile(char *filename) { FILE *input; char *str, *base; char string[1000]; char rpmdir[1000] = "rpm2html"; char *name; char *value; int errors = 0; rpm2html_host = rpm2html_rpm2html_thishost; input = fopen (filename, "r"); if (input == NULL) { fprintf (stderr, "Cannot read config from %s :\n", filename); perror ("fopen failed"); return -1; } while (1) { /* * read one line in string buffer. */ if (fgets (&string[0], sizeof (string) - 1, input) == NULL) break; str = &string[0]; SKIP_BLANK (str) string[sizeof (string) - 1] = '\0'; /* * Comment starts with a semicolumn. */ if (*str == ';') continue; if (*str == '\0') continue; /* * sections are indicated between brackets, e.g. [amaya] */ if (*str == '[') { str++; SKIP_BLANK (str) base = str; while ((*str != '\0') && (*str != ']')) str++; if (*str == '\0') { fprintf (stderr, "config file %s corrupted :\n\t\"%s\"\n", filename, string); break; } *str = '\0'; strcpy (&rpmdir[0], base); if (strcasecmp(rpmdir, "metadata")) rpmDirSearch(rpmdir); if (rpm2htmlVerbose > 1) fprintf (stderr, "readConfigFile section [%s]\n", rpmdir); continue; } /* * entries have the following form : * name=value */ name = str; GOTO_EQL (str) if (*str != '=') { errors++; if (errors >= 30) { fprintf (stderr, "config file %s seems invalid\n", filename); exit(1); } continue; } *str++ = '\0'; SKIP_BLANK (str) value = str; GOTO_EOL (str) *str = '\0'; addConfigEntry(rpmdir, name, value); #ifdef WITH_SQL /* * Duplicate the info in the SQL base */ sqlConfigEntry(rpmdir, name, value); #endif } fclose (input); return(0); } /* * reinitialize the base setup. */ void reinitialize(void) { if (rpm2html_dir) { xmlFree(rpm2html_dir); rpm2html_dir = NULL; } if (rpm2html_name) { xmlFree(rpm2html_name); rpm2html_name = NULL; } if (rpm2html_url) { xmlFree(rpm2html_url); rpm2html_url = NULL; } if (rpm2html_ftp) { xmlFree(rpm2html_ftp); rpm2html_ftp = NULL; } if (rpm2html_ftpsrc) { xmlFree(rpm2html_ftpsrc); rpm2html_ftpsrc = NULL; } if ((rpm2html_rpm2html_name != NULL) && (strcmp(rpm2html_rpm2html_name, RPM2HTML_NAME))) { xmlFree(rpm2html_rpm2html_name); } rpm2html_rpm2html_name = RPM2HTML_NAME; if ((rpm2html_rpm2html_ver != NULL) && (strcmp(rpm2html_rpm2html_ver, RPM2HTML_VER))) { xmlFree(rpm2html_rpm2html_ver); } rpm2html_rpm2html_ver = RPM2HTML_VER; if ((rpm2html_rpm2html_url != NULL) && (strcmp(rpm2html_rpm2html_url, RPM2HTML_URL))) { xmlFree(rpm2html_rpm2html_url); } rpm2html_rpm2html_url = RPM2HTML_URL; if ((rpm2html_maint != NULL) && (strcmp(rpm2html_maint, RPM2HTML_MAINT))) { xmlFree(rpm2html_maint); } rpm2html_maint = RPM2HTML_MAINT; if ((rpm2html_mail != NULL) && (strcmp(rpm2html_mail, RPM2HTML_MAIL))) { xmlFree(rpm2html_mail); } rpm2html_mail = RPM2HTML_MAIL; rpm2html_dir = NULL; rpm2html_name = NULL; rpm2html_url = NULL; rpm2html_ftp = NULL; rpm2html_ftpsrc = NULL; if (rpm2html_host != NULL && rpm2html_host != rpm2html_rpm2html_thishost) xmlFree(rpm2html_host); rpm2html_host = rpm2html_rpm2html_thishost; rpm2html_build_tree = 0; rpm2html_dump_rdf = 0; rpm2html_dump_rdf_resources = 0; rpm2html_dump_html = 1; #ifdef HAVE_LIBTEMPLATE if (rpm2html_html_template != NULL) xmlFree(rpm2html_html_template); rpm2html_html_template = "rpm2html.tpl"; #endif if (rpm2html_rdf_dir != NULL) xmlFree(rpm2html_rdf_dir); rpm2html_rdf_dir = NULL; if (rpm2html_rdf_resources_dir != NULL) xmlFree(rpm2html_rdf_resources_dir); rpm2html_rdf_resources_dir = NULL; for (;rpm2html_nb_extra_headers > 0;) { rpm2html_nb_extra_headers--; xmlFree(rpm2html_headers_name[rpm2html_nb_extra_headers]); rpm2html_headers_name[rpm2html_nb_extra_headers] = NULL; xmlFree(rpm2html_headers_url[rpm2html_nb_extra_headers]); rpm2html_headers_url[rpm2html_nb_extra_headers] = NULL; } rpm2html_nb_extra_headers = 0; /* * Cleanup of other modules. */ rpmdataCleanup(); htmlCleanup(); rpmopenCleanup(); #ifdef HAVE_LIBTEMPLATE destroyTemplateEngine(); #endif } rpm2html-1.11.2/html.c0000664000076400007640000043216211466344075013165 0ustar hanyhany/* * html.c: code concerning the dump as an HTML base. * * See Copyright for the status of this software. * * $Id: html.c,v 1.127 2010/11/09 22:16:29 hany Exp $ */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include "rpm2html.h" #include "rpmdata.h" #include "html.h" #include "language.h" #ifdef HAVE_LIBTEMPLATE #include "template.h" #endif #ifndef HAVE_SNPRINTF #error You really need snprintf ... #endif /* * Global variables concerning the dump environment */ static char buf[500]; /* * The entities list for the extended ASCII charset. */ static char *html_flags[] = { "", "<", "<=", ">", ">=", "=" }; /* * The entities list for the extended ASCII charset. */ static char *entities[256] = { NULL, /* 000 */ NULL, /* 001 */ NULL, /* 002 */ NULL, /* 003 */ NULL, /* 004 */ NULL, /* 005 */ NULL, /* 006 */ NULL, /* 007 */ NULL, /* 008 */ NULL, /* 009 */ NULL, /* 010 */ NULL, /* 011 */ NULL, /* 012 */ NULL, /* 013 */ NULL, /* 014 */ NULL, /* 015 */ NULL, /* 016 */ NULL, /* 017 */ NULL, /* 018 */ NULL, /* 019 */ NULL, /* 020 */ NULL, /* 021 */ NULL, /* 022 */ NULL, /* 023 */ NULL, /* 024 */ NULL, /* 025 */ NULL, /* 026 */ NULL, /* 027 */ NULL, /* 028 */ NULL, /* 029 */ NULL, /* 030 */ NULL, /* 031 */ NULL, /* 032 */ NULL, /* 033 */ """, /* 034 */ NULL, /* 035 */ NULL, /* 036 */ NULL, /* 037 */ "&", /* 038 */ NULL, /* 039 */ NULL, /* 040 */ NULL, /* 041 */ NULL, /* 042 */ NULL, /* 043 */ NULL, /* 044 */ NULL, /* 045 */ NULL, /* 046 */ NULL, /* 047 */ NULL, /* 048 */ NULL, /* 049 */ NULL, /* 050 */ NULL, /* 051 */ NULL, /* 052 */ NULL, /* 053 */ NULL, /* 054 */ NULL, /* 055 */ NULL, /* 056 */ NULL, /* 057 */ NULL, /* 058 */ NULL, /* 059 */ "<", /* 060 */ NULL, /* 061 */ ">", /* 062 */ NULL, /* 063 */ NULL, /* 064 */ NULL, /* 065 */ NULL, /* 066 */ NULL, /* 067 */ NULL, /* 068 */ NULL, /* 069 */ NULL, /* 070 */ NULL, /* 071 */ NULL, /* 072 */ NULL, /* 073 */ NULL, /* 074 */ NULL, /* 075 */ NULL, /* 076 */ NULL, /* 077 */ NULL, /* 078 */ NULL, /* 079 */ NULL, /* 080 */ NULL, /* 081 */ NULL, /* 082 */ NULL, /* 083 */ NULL, /* 084 */ NULL, /* 085 */ NULL, /* 086 */ NULL, /* 087 */ NULL, /* 088 */ NULL, /* 089 */ NULL, /* 090 */ NULL, /* 091 */ NULL, /* 092 */ NULL, /* 093 */ NULL, /* 094 */ NULL, /* 095 */ NULL, /* 096 */ NULL, /* 097 */ NULL, /* 098 */ NULL, /* 099 */ NULL, /* 100 */ NULL, /* 101 */ NULL, /* 102 */ NULL, /* 103 */ NULL, /* 104 */ NULL, /* 105 */ NULL, /* 106 */ NULL, /* 107 */ NULL, /* 108 */ NULL, /* 109 */ NULL, /* 110 */ NULL, /* 111 */ NULL, /* 112 */ NULL, /* 113 */ NULL, /* 114 */ NULL, /* 115 */ NULL, /* 116 */ NULL, /* 117 */ NULL, /* 118 */ NULL, /* 119 */ NULL, /* 120 */ NULL, /* 121 */ NULL, /* 122 */ NULL, /* 123 */ NULL, /* 124 */ NULL, /* 125 */ NULL, /* 126 */ NULL, /* 127 */ NULL, /* 128 */ NULL, /* 129 */ NULL, /* 130 */ NULL, /* 131 */ NULL, /* 132 */ NULL, /* 133 */ NULL, /* 134 */ NULL, /* 135 */ NULL, /* 136 */ NULL, /* 137 */ NULL, /* 138 */ NULL, /* 139 */ NULL, /* 140 */ NULL, /* 141 */ NULL, /* 142 */ NULL, /* 143 */ NULL, /* 144 */ NULL, /* 145 */ NULL, /* 146 */ NULL, /* 147 */ NULL, /* 148 */ NULL, /* 149 */ NULL, /* 150 */ NULL, /* 151 */ NULL, /* 152 */ NULL, /* 153 */ NULL, /* 154 */ NULL, /* 155 */ NULL, /* 156 */ NULL, /* 157 */ NULL, /* 158 */ NULL, /* 159 */ " ", /* 160 */ "¡", /* 161 */ "¢", /* 162 */ "£", /* 163 */ "¤", /* 164 */ "¥", /* 165 */ "¦", /* 166 */ "§", /* 167 */ "¨", /* 168 */ "©", /* 169 */ "ª", /* 170 */ "«", /* 171 */ "¬", /* 172 */ "­", /* 173 */ "®", /* 174 */ "¯", /* 175 */ "°", /* 176 */ "±", /* 177 */ "⊃", /* 178 */ "⊃", /* 179 */ "´", /* 180 */ "µ", /* 181 */ "¶", /* 182 */ "·", /* 183 */ "¸", /* 184 */ "⊃", /* 185 */ "º", /* 186 */ "»", /* 187 */ "&frac;", /* 188 */ "&frac;", /* 189 */ "&frac;", /* 190 */ "¿", /* 191 */ "À", /* 192 */ "Á", /* 193 */ "Â", /* 194 */ "Ã", /* 195 */ "Ä", /* 196 */ "Å", /* 197 */ "Æ", /* 198 */ "Ç", /* 199 */ "È", /* 200 */ "É", /* 201 */ "Ê", /* 202 */ "Ë", /* 203 */ "Ì", /* 204 */ "Í", /* 205 */ "Î", /* 206 */ "Ï", /* 207 */ "Ð", /* 208 */ "Ñ", /* 209 */ "Ò", /* 210 */ "Ó", /* 211 */ "Ô", /* 212 */ "Õ", /* 213 */ "Ö", /* 214 */ "×", /* 215 */ "Ø", /* 216 */ "Ù", /* 217 */ "Ú", /* 218 */ "Û", /* 219 */ "Ü", /* 220 */ "Ý", /* 221 */ "Þ", /* 222 */ "ß", /* 223 */ "à", /* 224 */ "á", /* 225 */ "â", /* 226 */ "ã", /* 227 */ "ä", /* 228 */ "å", /* 229 */ "æ", /* 230 */ "ç", /* 231 */ "è", /* 232 */ "é", /* 233 */ "ê", /* 234 */ "ë", /* 235 */ "ì", /* 236 */ "í", /* 237 */ "î", /* 238 */ "ï", /* 239 */ "ð", /* 240 */ "ñ", /* 241 */ "ò", /* 242 */ "ó", /* 243 */ "ô", /* 244 */ "õ", /* 245 */ "ö", /* 246 */ "÷", /* 247 */ "ø", /* 248 */ "ù", /* 249 */ "ú", /* 250 */ "û", /* 251 */ "ü", /* 252 */ "ý", /* 253 */ "þ", /* 254 */ "ÿ" /* 255 */ }; #ifdef HAVE_LIBTEMPLATE /* * Template engine used to produce HTML output */ struct tpl_engine* engine = NULL; void templateError(enum tpl_error tplerrno) { switch (tplerrno) { case tpl_not_found: fprintf(stderr, "template not found\n"); break; case tpl_empty: fprintf(stderr, "template is empty\n"); break; case tpl_element_not_found: fprintf(stderr, "template element not found\n"); break; case tpl_element_empty: fprintf(stderr, "template element empty\n"); break; case tpl_error_external: fprintf(stderr, "external template error\n"); break; default: fprintf(stderr, "unknown template error\n"); break; } perror("template engine error"); exit(1); } void initTemplateEngine(const char *templateFile) { if (rpm2htmlVerbose) printf("Using HTML template: %s\n", templateFile); engine = tpl_engine_new(); tpl_file_load(engine, templateFile); if (engine->tplerrno) templateError(engine->tplerrno); } void destroyTemplateEngine() { tpl_engine_delete(engine); } #endif /* * Converting extended ASCII charset to valid HTML text. * The string returned is a shared location. */ static unsigned char *buffer = NULL; static int buffer_size = 2000; char *convertHTML(const char *str) { unsigned char *cur, *end; unsigned char c; if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } } cur = &buffer[0]; end = &buffer[buffer_size - 20]; while (*str != '\0') { if (cur >= end) { int delta = cur - buffer; buffer_size *= 2; buffer = (char *) xmlRealloc(buffer, buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlRealloc failed"); exit(1); } end = &buffer[buffer_size - 20]; cur = &buffer[delta]; } c = (unsigned char) *(str++); if (entities[(unsigned int) c] == NULL) { *(cur++) = c; } else { strcpy(cur, entities[(unsigned int) c]); cur += strlen(entities[(unsigned int) c]); } } *cur = '\0'; return(buffer); } /* * Converting extended ASCII charset to valid XML text. * The string returned is a shared location. */ char *convertXML(const char *str) { unsigned char *cur, *end; unsigned char c; if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } } cur = &buffer[0]; end = &buffer[buffer_size - 20]; while (*str != '\0') { if (cur >= end) { int delta = cur - buffer; buffer_size *= 2; buffer = (char *) xmlRealloc(buffer, buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlRealloc failed"); exit(1); } end = &buffer[buffer_size - 20]; cur = &buffer[delta]; } c = (unsigned char) *(str++); if (((c) == 0x09) || ((c) == 0x0A) || ((c) == 0x0D) || (((c) >= 0x20) && ((c) <= 0x8F))) { if (entities[(unsigned int) c] == NULL) { *(cur++) = c; } else { strcpy(cur, entities[(unsigned int) c]); cur += strlen(entities[(unsigned int) c]); } } } *cur = '\0'; return(buffer); } /* * Convert CAN-yyyy-nnnn and CVE-yyyy-nnnn to hyperlinks * The string returned is a shared location. */ static unsigned char *buffer2 = NULL; static int buffer2_size = 2000; enum STATE { C = 1, CV = 2, CVE = 3, CA = 4, CAN = 5, DIGIT1 = 6, DIGIT2 = 7 }; char *convertCVE(const char *str) { unsigned char *cur, *end; unsigned char c; int state = 0; int count = 0; unsigned char parse[14]; /* "CVE-yyyy-nnnn" */ unsigned char *p = parse; if (rpm2html_cve_linking == 0) return str; if (buffer2 == NULL) { buffer2 = (char *) xmlMalloc(buffer2_size * sizeof(char)); if (buffer2 == NULL) { perror("xmlMalloc failed"); exit(1); } } cur = &buffer2[0]; end = &buffer2[buffer2_size - 100]; while (*str != '\0') { if (cur >= end) { int delta = cur - buffer2; buffer2_size *= 2; buffer2 = (char *) xmlRealloc(buffer2, buffer2_size * sizeof(char)); if (buffer2 == NULL) { perror("xmlRealloc failed"); exit(1); } end = &buffer2[buffer2_size - 100]; cur = &buffer2[delta]; } c = (unsigned char) *(str++); switch (c) { case 'C': if (state == 0) { *p++ = c; state = C; continue; } break; case 'V': if (state == C) { *p++ = c; state = CV; continue; } break; case 'E': if (state == CV) { *p++ = c; state = CVE; continue; } break; case 'A': if (state == C) { *p++ = c; state = CA; continue; } break; case 'N': if (state == CA) { *p++ = c; state = CAN; continue; } break; case '-': if (state == CVE || state == CAN) { *p++ = c; state = DIGIT1; count = 0; continue; } else if (state == DIGIT1 && count == 4) { *p++ = c; state = DIGIT2; count = 0; continue; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (state == DIGIT1 || state == DIGIT2) { count++; if (count == 4) { *p++ = c; if (state == DIGIT2) { unsigned char url[90]; *p = '\0'; sprintf(url, "%s", parse, parse); strcpy(cur, url); cur += strlen(url); p = parse; state = 0; } continue; } else if (count < 4) { *p++ = c; continue; } } break; default: break; } if (p != parse) { memcpy(cur, parse, p - parse); cur += p - parse; p = parse; } state = 0; *(cur++) = c; } *cur = '\0'; return(buffer2); } /* * Generates signature info (extended ASCII charset) * The string returned is a shared location. */ #define X(_x) (unsigned)((_x) & 0xff) static unsigned char *sigInfoMD5 = "internal MD5: "; #if defined(WITH_GPG) static unsigned char *sigInfoGPG = "GPG:\n"; static unsigned char *sigInfoPGP = "PGP:\n"; #else static unsigned char *sigInfoGPG = "GPG"; static unsigned char *sigInfoPGP = "PGP"; #endif static unsigned char *sigInfoU = "unknown"; static unsigned char *sbuffer = NULL; static int sbuffer_size = 2000; static unsigned char *sbuffer2 = NULL; static int sbuffer2_size = 3; char *convertSIG(rpmSigPtr sig) { int n1; unsigned char *md5sum = (unsigned char *) sig->sig; if (sbuffer == NULL) { sbuffer = (char *) xmlMalloc(sbuffer_size * sizeof(char)); if (sbuffer == NULL) { perror("xmlMalloc failed"); exit(1); } } if (sbuffer2 == NULL) { sbuffer2 = (char *) xmlMalloc(sbuffer2_size * sizeof(char)); if (sbuffer2 == NULL) { perror("xmlMalloc failed"); exit(1); } } switch(sig->tag) { case RPMSIGTAG_MD5: strncpy(sbuffer, sigInfoMD5, sbuffer_size); for(n1 = 0; n1 < sig->size; n1++) { snprintf(sbuffer2, sbuffer2_size, "%02x", X(md5sum[n1])); strncat(sbuffer, sbuffer2, sbuffer_size); } return(sbuffer); case RPMSIGTAG_GPG: #if defined(WITH_GPG) strncpy(sbuffer, sigInfoGPG, sbuffer_size); if (sig->resolve != NULL) strncat(sbuffer, sig->resolve, sbuffer_size); return(sbuffer); #else return(sigInfoGPG); #endif case RPMSIGTAG_PGP: #if defined(WITH_GPG) strncpy(sbuffer, sigInfoPGP, sbuffer_size); if (sig->resolve != NULL) strncat(sbuffer, sig->resolve, sbuffer_size); return(sbuffer); #else return(sigInfoPGP); #endif default: return(sigInfoU); } } /* * Determine whether given HTML output file is older than given timestamp and thus needs updating. * * Returned 0 means that no update is needed for HTML, non-zero means update is needed. * * TODO: Make it used also by "resource pages": Resource page gets the timestamp of newest RPM file which contributes * to its content and that is used for compare. */ int needsDump(char *htmlFileName, time_t rpmFileTimestamp) { struct stat buf; if (!rpm2html_dump_html_only_if_rpm_newer) // option turned off => update needed always return 1; // determine the last modification time of the HTML file if (stat(htmlFileName, &buf) != 0) // well, something bad happened so we err in the direction of caution and tell the caller update is needed return 1; // compare time stamps if (rpmFileTimestamp < buf.st_mtime) return 0; return 1; } /* * Cleanup the global varibales of this module */ void htmlCleanup(void) { if (buffer != NULL) xmlFree(buffer); if (buffer2 != NULL) xmlFree(buffer2); if (sbuffer != NULL) xmlFree(sbuffer); if (sbuffer2 != NULL) xmlFree(sbuffer2); buffer = NULL; buffer_size = 2000; buffer2 = NULL; buffer2_size = 2000; sbuffer = NULL; sbuffer_size = 2000; sbuffer2 = NULL; sbuffer2_size = 3; } /* * Converting extended ASCII charset to valid HTML text. * A new memory area is allocated for the returned value. */ char *xmlStrdupHTML(const char *str) { return(xmlStrdup(convertHTML(str))); } /* * createDirectory : create a directory. It does recurse and create the * father dir if needed. */ void createDirectory(const char *dirname) { static char last_dir[2000] = ""; /* * avoid costly syscalls. */ if (!strcmp(last_dir, dirname)) return; if (mkdir(dirname, 0777) != 0) { switch (errno) { #ifdef EEXIST case EEXIST: if (rpm2htmlVerbose > 1) fprintf(stderr, "Directory \"%s\" already exists\n", dirname); return; #endif case ENOENT: { char *father = xmlStrdup(dirname); char *cur = &father[strlen(father)]; while (cur > father) { if (*cur == '/') { *cur = '\0'; break; } cur--; } if (cur > father) { createDirectory(father); if (mkdir(dirname, 0777) != 0) { fprintf(stderr, "createDirectory \"%s\" failed\n", dirname); perror("mkdir failed:"); return; } } xmlFree(father); break; } default: fprintf(stderr, "createDirectory \"%s\" failed\n", dirname); perror("mkdir failed:"); return; } } else if (rpm2htmlVerbose) fprintf(stderr, "Created directory \"%s\"\n", dirname); } /* * Stuff needed for the icon creation. */ #include #include "dir.png.h" #include "new.png.h" void dumpDirIcon(void) { char path[500]; char *content; int fd; /* struct stat *buf; !!!!!! */ if (!rpm2html_dump_html) return; createDirectory(rpm2html_dir); snprintf(path, sizeof(path), "%s/dir.png", rpm2html_dir); content = read_data_buffer_dir_png(); if ((fd = creat(path, 0644)) < 0) { fprintf(stderr, "creat() failed on %s\n", path); return; } write(fd, content, data_buffer_dir_png_size); close(fd); snprintf(path, sizeof(path), "%s/new.png", rpm2html_dir); content = read_data_buffer_new_png(); if ((fd = creat(path, 0644)) < 0) { fprintf(stderr, "creat() failed on %s\n", path); return; } write(fd, content, data_buffer_new_png_size); close(fd); } /* * checkDate : check whether the last modification time of a file * is anterior to a given time */ int checkDate(const char *filename, time_t stamp) { struct stat buf; if (force) return(0); if ((stat(filename, &buf)) != 0) { return(0); } if (buf.st_size < 10) { return(0); } return(buf.st_mtime > stamp); } /* * checkDirectory : check if this directory exist */ int checkDirectory(const char *filename) { struct stat buf; if (force) return(0); if ((stat(filename, &buf)) != 0) { return(0); } if ((S_ISDIR(buf.st_mode)) || (S_ISLNK(buf.st_mode))) return(1); return(0); } /* * checkFile : check if this file exist */ int checkFile(const char *filename) { struct stat buf; if (force) return(0); if ((stat(filename, &buf)) != 0) { return(0); } return(1); } /* * Transformation function from rpm to filename. */ const char *rpmName(rpmDataPtr cur) { static char rbuf[500]; if (cur->arch != NULL) snprintf(rbuf, sizeof(rbuf), "%s-%s-%s.%s", cur->name, cur->version, cur->release, cur->arch); else snprintf(rbuf, sizeof(rbuf), "%s-%s-%s", cur->name, cur->version, cur->release); return(rbuf); } /* * Transformation function from rpm to Software name. */ const char *rpmSoftwareName(rpmDataPtr cur) { static char rbuf[500]; snprintf(rbuf, sizeof(rbuf), "%s-%s-%s", cur->name, cur->version, cur->release); return(rbuf); } /* * remove symbols that we do not want in filenames.. */ const char *cleanName (const char *name) { static char cbuf[500]; char *cur = cbuf; while (*name != '\0') { if ((*name == '/') || (*name == ' ') || (*name == '/') || (*name == '"') || (*name == '<') || (*name == '>') || (*name == ':') || (*name == '|') || (*name == '@') || (*name == '\t') || (*name == '\r') || (*name == '\n')) { *cur++ = '_'; name++; } else *cur++ = *name++; } *cur = '\0'; return (cbuf); } /* * do the URI escaping needed for that name. */ const char *escapeName (const char *name) { static char cbuf[500]; char *cur = cbuf, *end = &cbuf[495]; char tmp; while ((*name != '\0') && (cur < end)) { tmp = *name++; if (((tmp >= 'a') && (tmp <= 'z')) || ((tmp >= 'A') && (tmp <= 'Z')) || ((tmp >= '0') && (tmp <= '9')) || (tmp == '-') || (tmp == '_') || (tmp == '.') || (tmp == '!') || (tmp == '~') || (tmp == '*') || (tmp == '\'') || (tmp == '(') || (tmp == ')')) { *cur++ = tmp; } else { int val = (unsigned char)tmp; int hi = val / 0x10, lo = val % 0x10; *cur++ = '%'; *cur++ = hi + (hi > 9? 'A'-10 : '0'); *cur++ = lo + (lo > 9? 'A'-10 : '0'); } } *cur = '\0'; return (cbuf); } /* * Transformation function from group to filename. */ const char *groupName(const char *group) { static char gbuf[500]; strncpy(gbuf, cleanName (group), 500); strncat(gbuf, localizedStrings[LANG_HTML_SUFFIX], 500); return(gbuf); } /* * Transformation function from group to filename. */ const char *distribName(const char *distrib) { static char dbuf[500]; strncpy(dbuf, cleanName (distrib), 500); strncat(dbuf, localizedStrings[LANG_HTML_SUFFIX], 500); return(dbuf); } /* * Generate a full URL */ void fullURL(char *buf, int len, rpmDirPtr dir, const char *subdir, const char *filename) { if (dir == NULL) { snprintf(buf, len, "http://%s%s", rpm2html_host, rpm2html_url); } else { if (subdir == NULL) snprintf(buf, len, "http://%s%s/%s", rpm2html_host, rpm2html_url, filename); else snprintf(buf, len, "http://%s%s/%s/%s", rpm2html_host, rpm2html_url, subdir, filename); } } /* * Generate a full directory path. */ void fullPathName(char *buf, int len, rpmDirPtr dir, const char *subdir, const char *filename) { if (dir == NULL) { snprintf(buf, len, "%s/%s", rpm2html_dir, filename); } else { if (subdir == NULL) snprintf(buf, len, "%s/%s", dir->dir, filename); else snprintf(buf, len, "%s/%s/%s", dir->dir, subdir, filename); } } /* * Generate a full directory path plus ditinguish with a letter. */ void fullPathNameLr(char *buf, int len, rpmDirPtr dir, char *subdir, char *filename, char letter) { if (dir == NULL) { snprintf(buf, len, "%s/%c%s", rpm2html_dir, letter, filename); } else { if (subdir == NULL) snprintf(buf, len, "%s/%c%s", dir->dir, letter, filename); else snprintf(buf, len, "%s/%s/%c%s", dir->dir, subdir, letter, filename); } } /* * Generate a full directory path plus ditinguish with a number. */ void fullPathNameNr(char *buf, int len, rpmDirPtr dir, char *subdir, char *filename, int number) { if (dir == NULL) { snprintf(buf, len, "%s/%d%s", rpm2html_dir, number, filename); } else { if (subdir == NULL) snprintf(buf, len, "%s/%d%s", dir->dir, number, filename); else snprintf(buf, len, "%s/%s/%d%s", dir->dir, subdir, number, filename); } } /* * Transformation function from vendor to filename. */ const char *vendorName(const char *vendor) { static char vbuf[500]; strncpy(vbuf, cleanName (vendor), 500); strncat(vbuf, localizedStrings[LANG_HTML_SUFFIX], 500); return(vbuf); } /* * Transformation function from resource to filename. */ const char *resourceName(const char *resource) { static char rbuf[500]; strncpy(rbuf, cleanName (resource), 500); strncat(rbuf, localizedStrings[LANG_HTML_SUFFIX], 500); return(rbuf); } #ifdef HAVE_LIBTEMPLATE /* * Parse template item and write the result to file */ void parseNwriteTemplate(FILE *html, struct tpl_engine *engine, char *template_name) { char* result = NULL; tpl_parse(engine, template_name, "parse_result", 0); result = tpl_element_get(engine, "parse_result"); if (result) fprintf(html, "%s", result); else { perror("template item parsing failed"); exit(1); } } /* * Parse meaningfull value into 'p_new_item' element */ void fillNewItemElement(struct tpl_engine *engine) { tpl_element_set(engine, "url", rpm2html_url); tpl_parse(engine, "new_item", "p_new_item", 0); // XXX maybe not necessary to call this more than once? => optimize to call just once tpl_element_set(engine, "new", tpl_element_get(engine, "p_new_item")); } /* * Clear 'p_new_item' element */ void clearNewItemElement(struct tpl_engine *engine) { tpl_element_set(engine, "new", ""); } #endif /* * Generate an HTML header */ void generateHtmlHeader(FILE *html, char *title, char *color) { #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "generator_name", rpm2html_rpm2html_name); tpl_element_set(engine, "generator_version", rpm2html_rpm2html_ver); tpl_parse(engine, title, "p_title", 0); tpl_element_set(engine, "title", tpl_element_get(engine, "p_title")); parseNwriteTemplate(html, engine, "header"); #else // ifdef HAVE_LIBTEMPLATE fprintf(html, "\n"); fprintf(html, "\n\n%s\n", title); fprintf(html, "\n", rpm2html_rpm2html_name, rpm2html_rpm2html_ver); if (color == NULL) fprintf(html, "\n\n"); else fprintf(html, "\n\n", color); #endif // ifdef HAVE_LIBTEMPLATE } /* * Generate an HTML footer */ void generateHtmlFooter(FILE *html) { struct tm * tstruct; tstruct = localtime(¤tTime); #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "generator_name", rpm2html_rpm2html_name); tpl_element_set(engine, "generator_version", rpm2html_rpm2html_ver); tpl_element_set(engine, "generator_url", rpm2html_rpm2html_url); tpl_element_set(engine, "maintainer_mail", rpm2html_mail); tpl_element_set(engine, "maintainer_name", rpm2html_maint); tpl_element_set(engine, "time", asctime(tstruct)); parseNwriteTemplate(html, engine, "footer"); #else // ifdef HAVE_LIBTEMPLATE fprintf(html, "
\n"); fprintf(html, "

%s %s %s\n", localizedStrings[LANG_GENERATED], rpm2html_rpm2html_url, rpm2html_rpm2html_name, rpm2html_rpm2html_ver); if (rpm2html_help != NULL) { fprintf(html, "

%s, %s\n", rpm2html_help, rpm2html_maint, asctime(tstruct)); } else { fprintf(html, "

%s, %s\n", rpm2html_mail, rpm2html_maint, asctime(tstruct)); } fprintf(html, "\n\n"); #endif // ifdef HAVE_LIBTEMPLATE } /* * Generate a the opening anchor tag for a package */ #ifdef HAVE_LIBTEMPLATE /* note: we diverge here from "ussual templatization" while we do not want to have just '' in the template - too small item; instead, this function will return just URI and caller function will do the rest */ char *generateHtmlRpmAnchor(rpmDataPtr cur) { if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } } /* carefull: initial value for buffer_size is 2000 so if URI generated here is longer, it'll be truncated thus very likely invalid */ if (cur->dir == NULL) { buffer[0] = '\0'; return buffer; } if ((cur->dir->subdir != NULL) && (cur->dir->subdir[0] != '\0')) { /* * More than one mirror, there is an HTML subdir */ if ((cur->subdir != NULL) && (cur->subdir[0] != '\0')) { if (cur->dir->url) snprintf(buffer, buffer_size, "%s/%s/%s/%s.html", cur->dir->url, cur->dir->subdir, cur->subdir, rpmName(cur)); else snprintf(buffer, buffer_size, "%s/%s/%s.html", cur->subdir, cur->dir->subdir, rpmName(cur)); } else { if (cur->dir->url) snprintf(buffer, buffer_size, "%s/%s/%s.html", cur->dir->url, cur->dir->subdir, rpmName(cur)); else snprintf(buffer, buffer_size, "%s/%s.html", cur->dir->subdir, rpmName(cur)); } } else { /* * Only one mirror, no HTML subdir */ if ((cur->subdir != NULL) && (cur->subdir[0] != '\0')) { if (cur->dir->url) snprintf(buffer, buffer_size, "%s/%s/%s.html", cur->dir->url, cur->subdir, rpmName(cur)); else snprintf(buffer, buffer_size, "%s/%s.html", cur->subdir, rpmName(cur)); } else { if (cur->dir->url) snprintf(buffer, buffer_size, "%s/%s.html", cur->dir->url, rpmName(cur)); else snprintf(buffer, buffer_size, "%s.html", rpmName(cur)); } } return buffer; } #else // ifdef HAVE_LIBTEMPLATE void generateHtmlRpmAnchor(FILE *html, rpmDataPtr cur) { if (cur->dir == NULL) { fprintf(html, ""); return; } if ((cur->dir->subdir != NULL) && (cur->dir->subdir[0] != '\0')) { /* * More than one mirror, there is an HTML subdir */ if ((cur->subdir != NULL) && (cur->subdir[0] != '\0')) { if (cur->dir->url) fprintf(html, "", cur->dir->url, cur->dir->subdir, cur->subdir, rpmName(cur)); else fprintf(html, "", cur->subdir, cur->dir->subdir, rpmName(cur)); } else { if (cur->dir->url) fprintf(html, "", cur->dir->url, cur->dir->subdir, rpmName(cur)); else fprintf(html, "", cur->dir->subdir, rpmName(cur)); } } else { /* * Only one mirror, no HTML subdir */ if ((cur->subdir != NULL) && (cur->subdir[0] != '\0')) { if (cur->dir->url) fprintf(html, "", cur->dir->url, cur->subdir, rpmName(cur)); else fprintf(html, "", cur->subdir, rpmName(cur)); } else { if (cur->dir->url) fprintf(html, "", cur->dir->url, rpmName(cur)); else fprintf(html, "", rpmName(cur)); } } } #endif // ifdef HAVE_LIBTEMPLATE /* * Generate an RSS link element for a package */ void generateRSSLink(FILE *RSS, rpmDataPtr cur) { fprintf(RSS, " http://%s", rpm2html_host); if ((cur->dir->subdir != NULL) && (cur->dir->subdir[0] != '\0')) { /* * More than one mirror, there is an HTML subdir */ if ((cur->subdir != NULL) && (cur->subdir[0] != '\0')) { if (cur->dir->url) fprintf(RSS, "%s/%s/%s/%s.html", cur->dir->url, cur->dir->subdir, cur->subdir, rpmName(cur)); else fprintf(RSS, "%s/%s/%s.html", cur->subdir, cur->dir->subdir, rpmName(cur)); } else { if (cur->dir->url) fprintf(RSS, "%s/%s/%s.html", cur->dir->url, cur->dir->subdir, rpmName(cur)); else fprintf(RSS, "%s/%s.html", cur->dir->subdir, rpmName(cur)); } } else { /* * Only one mirror, no HTML subdir */ if ((cur->subdir != NULL) && (cur->subdir[0] != '\0')) { if (cur->dir->url) fprintf(RSS, "%s/%s/%s.html", cur->dir->url, cur->subdir, rpmName(cur)); else fprintf(RSS, "%s/%s.html", cur->subdir, rpmName(cur)); } else { if (cur->dir->url) fprintf(RSS, "%s/%s.html", cur->dir->url, rpmName(cur)); else fprintf(RSS, "%s.html", rpmName(cur)); } } fprintf(RSS, "\n"); } /* * Generate a line in a table for a RPM. * Don't list the source RPMs */ void generateHtmlRpmRow(FILE *html, rpmDataPtr cur, int shownew) { #ifdef SHOW_DATE static char buf[500]; struct tm * tstruct; #endif if (!strcmp(cur->arch, "src")) return; #ifdef SHOW_DATE tstruct = localtime(&(cur->date)); #ifdef HAVE_STRFTIME strftime(buf, sizeof(buf) - 1, "%c", tstruct); #else #error "no strftime, please check !" #endif #endif #ifdef HAVE_LIBTEMPLATE if (cur->dir != NULL) tpl_element_set(engine, "bgcolor", cur->dir->color); tpl_element_set(engine, "uri", generateHtmlRpmAnchor(cur)); tpl_element_set(engine, "name", rpmName(cur)); if ((shownew) && (cur->date > 0) && ((currentTime - cur->date) < (24 * 60 * 60 * 15))) fillNewItemElement(engine); else clearNewItemElement(engine); tpl_element_set(engine, "summary", convertHTML(cur->summary)); #ifdef SHOW_DATE tpl_element_set(engine, "system", buf); #else if ((cur->dir != NULL) && (cur->dir->name != NULL)) tpl_element_set(engine, "system", cur->dir->name); else tpl_element_set(engine, "system", ""); #endif parseNwriteTemplate(html, engine, "rpm_row"); #else // ifdef HAVE_LIBTEMPLATE if (cur->dir != NULL) { fprintf(html, "", cur->dir->color, PACKAGE_FIELD_WIDTH); } else { fprintf(html, "", PACKAGE_FIELD_WIDTH); } generateHtmlRpmAnchor(html, cur); fprintf(html, "%s", rpmName(cur)); if ((shownew) && (cur->date > 0) && ((currentTime - cur->date) < (24 * 60 * 60 * 15))) fprintf(html, "\"New\"", rpm2html_url); fprintf(html, "\n%s\n", DESCRIPTION_FIELD_WIDTH, convertHTML(cur->summary)); #ifdef SHOW_DATE fprintf(html, "%s\n", buf); #else if ((cur->dir != NULL) && (cur->dir->name != NULL)) fprintf(html, "%s\n", cur->dir->name); #endif #endif // ifdef HAVE_LIBTEMPLATE } /* * Generate an entry in an RSS channel for an RPM. */ void generateRSSItem(FILE *RSS, rpmDataPtr cur) { fprintf(RSS, " \n"); fprintf(RSS, " %s\n", rpmName(cur)); if (cur->summary != NULL) fprintf(RSS, " %s\n", convertHTML(cur->summary)); generateRSSLink(RSS, cur); fprintf(RSS, " \n"); } /* * Generate a line in a table for an RPM software and all it's architectures. */ void generateHtmlRpmArchRow(FILE *html, rpmDataPtr cur) { rpmDataPtr tmp; #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "name", rpmSoftwareName(cur)); tpl_element_set(engine, "summary", convertHTML(cur->summary)); parseNwriteTemplate(html, engine, "arch_row"); /* dump the archs list */ tmp = cur; while (tmp != NULL) { if (strcmp(tmp->arch, "src")) { tpl_element_set(engine, "uri", generateHtmlRpmAnchor(tmp)); tpl_element_set(engine, "os", tmp->os); tpl_element_set(engine, "arch", tmp->arch); if ((currentTime - tmp->date) < (24 * 60 * 60 * 15)) fillNewItemElement(engine); else clearNewItemElement(engine); if (tmp->dir != NULL) { tpl_element_set(engine, "bgcolor", tmp->dir->color); parseNwriteTemplate(html, engine, "arch_row_item_dir"); } else parseNwriteTemplate(html, engine, "arch_row_item"); } tmp = tmp->nextArch; } parseNwriteTemplate(html, engine, "arch_row_end"); #else // ifdef HAVE_LIBTEMPLATE fprintf(html, "", PACKAGE_FIELD_WIDTH); fprintf(html, "%s\n", rpmSoftwareName(cur)); fprintf(html, "%s\n", DESCRIPTION_FIELD_WIDTH, convertHTML(cur->summary)); /* dump the archs list */ tmp = cur; while (tmp != NULL) { if (strcmp(tmp->arch, "src")) { if (tmp->dir != NULL) fprintf(html, "", tmp->dir->color, SYSTEM_FIELD_WIDTH); else fprintf(html, "", SYSTEM_FIELD_WIDTH); generateHtmlRpmAnchor(html, tmp); fprintf(html, "%s/%s", tmp->os, tmp->arch); if ((currentTime - tmp->date) < (24 * 60 * 60 * 15)) fprintf(html, "\"New\"", rpm2html_url); fprintf(html, ""); } tmp = tmp->nextArch; } fprintf(html, "\n\n"); #endif // ifdef HAVE_LIBTEMPLATE } /* * Generate the Links for the main pages */ void generateLinks(FILE *html, int installed) { int i; #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "url", rpm2html_url); parseNwriteTemplate(html, engine, "main_header"); #else // ifdef HAVE_LIBTEMPLATE fprintf(html, "\n"); fprintf(html, "\n\n"); fprintf(html, "\n", rpm2html_url, localizedStrings[LANG_INDEX_HTML], localizedStrings[LANG_INDEX]); fprintf(html, "\n", rpm2html_url, localizedStrings[LANG_GROUP_HTML], localizedStrings[LANG_SORTED_BY_GROUP]); fprintf(html, "\n", rpm2html_url, localizedStrings[LANG_DISTRIB_HTML], localizedStrings[LANG_SORTED_BY_DISTRIB]); fprintf(html, "\n", rpm2html_url, localizedStrings[LANG_VENDOR_HTML], localizedStrings[LANG_SORTED_BY_VENDOR]); if (installed) fprintf(html, "\n", rpm2html_url, localizedStrings[LANG_BYDATE_HTML], localizedStrings[LANG_SORTED_BY_IDATE]); else fprintf(html, "\n", rpm2html_url, localizedStrings[LANG_BYDATE_HTML], localizedStrings[LANG_SORTED_BY_CDATE]); fprintf(html, "\n", rpm2html_url, localizedStrings[LANG_BYNAME_HTML], localizedStrings[LANG_SORTED_BY_NAME]); #endif // ifdef HAVE_LIBTEMPLATE #ifdef HAVE_LIBTEMPLATE if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } } #endif for (i = 0;i < rpm2html_nb_extra_headers;i++) { #ifdef HAVE_LIBTEMPLATE if ((*rpm2html_headers_url[i] == '/') || (!strncmp(rpm2html_headers_url[i], "http://", 7)) || (!strncmp(rpm2html_headers_url[i], "ftp://", 6)) || (!strncmp(rpm2html_headers_url[i], "mailto", 6))) tpl_element_set(engine, "url", rpm2html_headers_url[i]); else { /* carefull: initial value for buffer_size is 2000 so if URI generated here is longer, it'll be truncated thus very likely invalid */ snprintf(buffer, buffer_size, "%s/%s", rpm2html_url, rpm2html_headers_url[i]); tpl_element_set(engine, "url", buffer); } tpl_element_set(engine, "name", rpm2html_headers_name[i]); parseNwriteTemplate(html, engine, "main_item"); #else // ifdef HAVE_LIBTEMPLATE if ((*rpm2html_headers_url[i] == '/') || (!strncmp(rpm2html_headers_url[i], "http://", 7)) || (!strncmp(rpm2html_headers_url[i], "ftp://", 6)) || (!strncmp(rpm2html_headers_url[i], "mailto", 6))) fprintf(html, "\n", rpm2html_headers_url[i], rpm2html_headers_name[i]); else fprintf(html, "\n", rpm2html_url, rpm2html_headers_url[i], rpm2html_headers_name[i]); #endif // ifdef HAVE_LIBTEMPLATE } #ifdef HAVE_LIBTEMPLATE parseNwriteTemplate(html, engine, "main_footer"); #else // ifdef HAVE_LIBTEMPLATE fprintf(html, "\n
%s%s%s%s%s%s%s%s%s
\n"); #endif // ifdef HAVE_LIBTEMPLATE } /* * Generate a color indicator */ void generateColorIndicator(FILE *html) { #ifdef SHOW_DATE int nb = 0; rpmDirPtr dir = dirList; #ifdef HAVE_LIBTEMPLATE parseNwriteTemplate(html, engine, "color_indicator_header"); while (dir != NULL) { if (strcasecmp(dir->color, "#ffffff")) { if ((nb > 0) && ((nb % MAX_COLOR_PER_LINE) == 0)) parseNwriteTemplate(html, engine, "color_indicator_eol"); tpl_element_set(engine, "color", dir->color); if (dir->name != NULL) tpl_element_set(engine, "item", dir->name); else if (dir->mirrors[0] != NULL) tpl_element_set(engine, "item", dir->mirrors[0]); else tpl_element_set(engine, "item", dir->ftp)); parseNwriteTemplate(html, engine, "color_indicator_item"); nb++; } dir = dir->next; } parseNwriteTemplate(html, engine, "color_indicator_footer"); #else // ifdef HAVE_LIBTEMPLATE fprintf(html, "\n\n"); while (dir != NULL) { if (strcasecmp(dir->color, "#ffffff")) { if ((nb > 0) && ((nb % MAX_COLOR_PER_LINE) == 0)) fprintf(html, "\n"); fprintf(html, "", dir->name); else if (dir->mirrors[0] != NULL) fprintf(html, "%s", dir->mirrors[0]); else fprintf(html, "%s", dir->ftp); nb++; } dir = dir->next; } fprintf(html, "\n
", dir->color); if (dir->name != NULL) fprintf(html, "%s
\n"); #endif // ifdef HAVE_LIBTEMPLATE #endif } /* * Dump a subtree in an HTML page with all the links */ void generateHtmlTree(FILE *html, rpmSubdirPtr tree, int level, int full) { int i; if (tree->html == 0) return; #ifdef HAVE_LIBTEMPLATE if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } } /* carefull: initial value for buffer_size is 2000 so if URI generated here is longer, it'll be truncated thus very likely invalid */ if ((tree->nb_subdirs > 0) || (tree->parent != NULL)) { if (level == 0) { parseNwriteTemplate(html, engine, "html_tree_sublevel_header"); } if (tree->color) { tpl_element_set(engine, "color", tree->color); tpl_parse(engine, "html_tree_header_color", "p_html_tree_header_color", 0); // XXX maybe not necessary to call this more than once? => optimize to call just once tpl_element_set(engine, "color", tpl_element_get(engine, "p_html_tree_header_color")); } else tpl_element_set(engine, "color", ""); parseNwriteTemplate(html, engine, "html_tree_color"); if ((level == 0) && (tree->parent != NULL)) { if (tree->parent->htmlpath[0] != '\0') { snprintf(buffer, buffer_size, "%s/%s", rpm2html_url, tree->parent->htmlpath); tpl_element_set(engine, "url", buffer); } else { tpl_element_set(engine, "url", rpm2html_url); } tpl_element_set(engine, "rpm2html_url", rpm2html_url); parseNwriteTemplate(html, engine, "html_tree_header"); } for (i = 0;i < tree->nb_subdirs;i++) { if (tree->subdirs[i]->html == 0) continue; tpl_element_set(engine, "url", rpm2html_url); tpl_element_set(engine, "suburi", tree->subdirs[i]->htmlpath); tpl_element_set(engine, "name", tree->subdirs[i]->name); parseNwriteTemplate(html, engine, "html_tree_item"); if (full) generateHtmlTree(html, tree->subdirs[i], level + 1, full); } parseNwriteTemplate(html, engine, "html_tree_footer"); } #else // ifdef HAVE_LIBTEMPLATE if ((tree->nb_subdirs > 0) || (tree->parent != NULL)) { if (level == 0) fprintf(html, "

%s

\n", localizedStrings[LANG_SUBDIRS]); if (tree->color) fprintf(html, "
\n", tree->color); else fprintf(html, "
\n"); if ((level == 0) && (tree->parent != NULL)) { if (tree->parent->htmlpath[0] != '\0') { fprintf(html, "

", rpm2html_url, tree->parent->htmlpath, localizedStrings[LANG_INDEX_HTML]); } else { fprintf(html, "

", rpm2html_url, localizedStrings[LANG_INDEX_HTML]); } fprintf(html, "\"parent-directory\"", rpm2html_url); fprintf(html, " ..

\n"); } for (i = 0;i < tree->nb_subdirs;i++) { if (tree->subdirs[i]->html == 0) continue; fprintf(html, "

", rpm2html_url, tree->subdirs[i]->htmlpath, localizedStrings[LANG_INDEX_HTML]); fprintf(html, "\"sub-directory\"", rpm2html_url); fprintf(html, " %s

\n", tree->subdirs[i]->name); if (full) generateHtmlTree(html, tree->subdirs[i], level + 1, full); } fprintf(html, "
\n"); } #endif // ifdef HAVE_LIBTEMPLATE } /* * Dump the parent names in an HTML page with all the links */ void generateHtmlParentsNames(FILE *html, rpmSubdirPtr tree) { int i, j, k; rpmSubdirPtr parent; if (tree->parent == NULL) return; /* * get the tree depth. */ i = 0; parent = tree->parent; while ((parent != NULL) && (parent->parent != NULL)) { i++; parent = parent->parent; } /* * Dump each level in the parent tree. */ #ifdef HAVE_LIBTEMPLATE if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } } /* carefull: initial value for buffer_size is 2000 so if URI generated here is longer, it'll be truncated thus very likely invalid */ for (j = i; j >= 0;j--) { parent = tree; for (k = 0;k < j;k++) parent = parent->parent; if (parent->htmlpath[0] != '\0') { snprintf(buffer, buffer_size, "%s/%s", rpm2html_url, parent->htmlpath); tpl_element_set(engine, "url", buffer); } else { tpl_element_set(engine, "url", rpm2html_url); } tpl_element_set(engine, "name", parent->name); if (j != 0) { tpl_parse(engine, "parent_names_separator", "p_parent_names_separator", 0); // XXX maybe not necessary to call this more than once? => optimize to call just once tpl_element_set(engine, "separator", tpl_element_get(engine, "p_parent_names_separator")); } else tpl_element_set(engine, "separator", ""); parseNwriteTemplate(html, engine, "parent_names"); } #else // ifdef HAVE_LIBTEMPLATE for (j = i; j >= 0;j--) { parent = tree; for (k = 0;k < j;k++) parent = parent->parent; if (parent->htmlpath[0] != '\0') { fprintf(html, "", rpm2html_url, parent->htmlpath, localizedStrings[LANG_INDEX_HTML]); } else { fprintf(html, "", rpm2html_url, localizedStrings[LANG_INDEX_HTML]); } fprintf(html, "%s\n", parent->name); if (j != 0) fprintf(html, " / "); } #endif // ifdef HAVE_LIBTEMPLATE } /* * Dump the whole index for a full complete config file. */ void dumpIndex(time_t start_time, int installed) { FILE *html; if (!rpm2html_dump_html) return; if (rpm2htmlVerbose > 1) { printf("Dumping %s/%s\n", rpm2html_dir, localizedStrings[LANG_INDEX_HTML]); } snprintf(buf, sizeof(buf), "%s/%s", rpm2html_dir, localizedStrings[LANG_INDEX_HTML]); html = fopen(buf, "w"); if (html == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "host", rpm2html_host); if (installed) { generateHtmlHeader(html, "header_title_install", NULL); generateLinks(html, installed); } else { generateHtmlHeader(html, "header_title_repository", NULL); generateLinks(html, installed); } #ifdef WITH_SQL tpl_element_set(engine, "search_host", rpm2html_host); #else tpl_element_set(engine, "search_host", "rpmfind.net"); #endif if (rpm2html_install_files != 0) { snprintf(buf, sizeof(buf), "%d", rpm2html_install_files); tpl_element_set(engine, "count", buf); snprintf(buf, sizeof(buf), "%d", rpm2html_install_size / 1024); tpl_element_set(engine, "size", buf); tpl_parse(engine, "index_header_stats_installed", "p_stats", 0); } if (rpm2html_files != 0) { snprintf(buf, sizeof(buf), "%d", rpm2html_files); tpl_element_set(engine, "count", buf); snprintf(buf, sizeof(buf), "%d", rpm2html_size / 1024); tpl_element_set(engine, "size", buf); tpl_parse(engine, "index_header_stats_repository", "p_stats", 0); } tpl_element_set(engine, "stats", tpl_element_get(engine, "p_stats")); parseNwriteTemplate(html, engine, "index_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsider usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary generateHtmlTree(html, dirTree, 0, 0); snprintf(buf, sizeof(buf), "%d", (int) (time(NULL) - start_time)); tpl_element_set(engine, "generation_time", buf); parseNwriteTemplate(html, engine, "index_footer"); #else // ifdef HAVE_LIBTEMPLATE if (installed) { snprintf(buf, sizeof(buf), "%s %s", localizedStrings[LANG_WELCOME_INSTALL], rpm2html_host); generateHtmlHeader(html, buf, NULL); generateLinks(html, installed); fprintf(html, "

%s %s

\n", localizedStrings[LANG_WELCOME_INSTALL], rpm2html_host); } else { snprintf(buf, sizeof(buf), "%s %s", localizedStrings[LANG_WELCOME_REPOSITORY], rpm2html_host); generateHtmlHeader(html, buf, NULL); generateLinks(html, installed); fprintf(html, "

%s %s

\n", localizedStrings[LANG_WELCOME_REPOSITORY], rpm2html_host); } fprintf(html, "%s\n", localizedStrings[LANG_RPM2HTML_INTRO]); #ifdef WITH_SQL snprintf(buf, sizeof(buf), "http://%s/linux/rpm2html", rpm2html_host); fprintf(html, localizedStrings[LANG_SEARCH_FORM], buf); #else fprintf(html, localizedStrings[LANG_SEARCH_FORM], "http://rpmfind.net/linux/rpm2html"); #endif if (rpm2html_install_files != 0) { fprintf(html, "

"); fprintf(html, localizedStrings[LANG_INSTALLED_STATS], rpm2html_install_files, rpm2html_install_size / 1024); fprintf(html, "

\n"); } if (rpm2html_files != 0) { fprintf(html, "

"); fprintf(html, localizedStrings[LANG_STATS], rpm2html_files, rpm2html_size / 1024); fprintf(html, "

\n"); } fprintf(html, "
    \n"); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_GROUP_HTML], localizedStrings[LANG_INDEX_GROUP]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_BYDATE_HTML], localizedStrings[LANG_INDEX_CREATION]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_BYNAME_HTML], localizedStrings[LANG_INDEX_NAME]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_VENDOR_HTML], localizedStrings[LANG_INDEX_VENDOR]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_DISTRIB_HTML], localizedStrings[LANG_INDEX_DISTRIB]); fprintf(html, "
\n"); generateHtmlTree(html, dirTree, 0, 0); fprintf(html, "

%s %d %s

\n", localizedStrings[LANG_GENERATION_TIME], (int) (time(NULL) - start_time), localizedStrings[LANG_SECONDS]); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(html); fclose(html); } /* * Dump the whole index for a full complete config file. */ void dumpTopIndex(rpmDirPtr *sqlDirList) { FILE *html; int i; if (!rpm2html_dump_html) return; if (rpm2htmlVerbose > 1) { printf("Dumping %s/%s\n", rpm2html_dir, localizedStrings[LANG_INDEX_HTML]); } snprintf(buf, sizeof(buf), "%s/%s", rpm2html_dir, localizedStrings[LANG_INDEX_HTML]); html = fopen(buf, "w"); if (html == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "host", rpm2html_host); generateHtmlHeader(html, "header_title_repository", NULL); generateLinks(html, 0); #ifdef WITH_SQL tpl_element_set(engine, "search_host", rpm2html_host); #else tpl_element_set(engine, "search_host", "rpmfind.net"); #endif if (rpm2html_install_files != 0) { snprintf(buf, sizeof(buf), "%d", rpm2html_install_files); tpl_element_set(engine, "count", buf); snprintf(buf, sizeof(buf), "%d", rpm2html_install_size / 1024); tpl_element_set(engine, "size", buf); tpl_parse(engine, "index_header_stats_installed", "p_stats", 0); } if (rpm2html_files != 0) { snprintf(buf, sizeof(buf), "%d", rpm2html_files); tpl_element_set(engine, "count", buf); snprintf(buf, sizeof(buf), "%d", rpm2html_size / 1024); tpl_element_set(engine, "size", buf); tpl_parse(engine, "index_header_stats_repository", "p_stats", 0); } tpl_element_set(engine, "stats", tpl_element_get(engine, "p_stats")); parseNwriteTemplate(html, engine, "index_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary if (sqlDirList != NULL) { for (i = 0; i < 500;i++) if (sqlDirList[i] != NULL) { /* * Check first that the distro is still active and that * the index has been generated */ if (!checkDirectory(sqlDirList[i]->rpmdir)) continue; snprintf(buf, sizeof(buf), "%s/%s/index.html", sqlDirList[i]->dir, sqlDirList[i]->subdir); if (!checkFile(buf)) continue; tpl_element_set(engine, "url", sqlDirList[i]->url); tpl_element_set(engine, "suburl", sqlDirList[i]->subdir); tpl_element_set(engine, "name", sqlDirList[i]->name); parseNwriteTemplate(html, engine, "index_sql_dirlist"); } } #else // ifdef HAVE_LIBTEMPLATE snprintf(buf, sizeof(buf), "%s %s", localizedStrings[LANG_WELCOME_REPOSITORY], rpm2html_host); generateHtmlHeader(html, buf, NULL); generateLinks(html, 0); fprintf(html, "

%s %s

\n", localizedStrings[LANG_WELCOME_REPOSITORY], rpm2html_host); fprintf(html, "%s\n", localizedStrings[LANG_RPM2HTML_INTRO]); #ifdef WITH_SQL snprintf(buf, sizeof(buf), "http://%s/linux/rpm2html", rpm2html_host); fprintf(html, localizedStrings[LANG_SEARCH_FORM], buf); #else fprintf(html, localizedStrings[LANG_SEARCH_FORM], "http://rpmfind.net/linux/rpm2html"); #endif if (rpm2html_install_files != 0) { fprintf(html, "

"); fprintf(html, localizedStrings[LANG_INSTALLED_STATS], rpm2html_install_files, rpm2html_install_size / 1024); fprintf(html, "

\n"); } if (rpm2html_files != 0) { fprintf(html, "

"); fprintf(html, localizedStrings[LANG_STATS], rpm2html_files, rpm2html_size / 1024); fprintf(html, "

\n"); } fprintf(html, "
    \n"); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_GROUP_HTML], localizedStrings[LANG_INDEX_GROUP]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_BYDATE_HTML], localizedStrings[LANG_INDEX_CREATION]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_BYNAME_HTML], localizedStrings[LANG_INDEX_NAME]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_VENDOR_HTML], localizedStrings[LANG_INDEX_VENDOR]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_DISTRIB_HTML], localizedStrings[LANG_INDEX_DISTRIB]); fprintf(html, "
\n"); if (sqlDirList != NULL) { for (i = 0; i < 500;i++) if (sqlDirList[i] != NULL) { /* * Check first that the distro is still active and that * the index has been generated */ if (!checkDirectory(sqlDirList[i]->rpmdir)) continue; snprintf(buf, sizeof(buf), "%s/%s/index.html", sqlDirList[i]->dir, sqlDirList[i]->subdir); if (!checkFile(buf)) continue; fprintf(html, "

\"sub-directory\"%s

\n", sqlDirList[i]->url, sqlDirList[i]->subdir, sqlDirList[i]->name); } } #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(html); fclose(html); } /* * Dump an RPM block as an HTML file. */ void dumpRpmHtml(rpmDataPtr rpm, rpmSubdirPtr tree) { struct tm * tstruct; rpmDirPtr dir = rpm->dir; int installed = dir->installbase; FILE *html; int i; if (!rpm2html_dump_html) return; /* * create the directory on the fly if needed. */ if ((dir->subdir != NULL) && (dir->subdir[0] != '\0')) { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "%s/%s/%s", dir->dir, dir->subdir, rpm->subdir); else snprintf(buf, sizeof(buf), "%s/%s", dir->dir, dir->subdir); } else { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "%s/%s", dir->dir, rpm->subdir); else snprintf(buf, sizeof(buf), "%s", dir->dir); } createDirectory(buf); strcat(buf, "/"); strcat(buf, rpmName(rpm)); strcat(buf, ".html"); if (!needsDump(buf, rpm->extra->stamp)) return; if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } html = fopen(buf, "w"); if (html == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "name", rpmName(rpm)); generateHtmlHeader(html, "rpm_title", NULL); generateLinks(html, installed); if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s/%s", dir->mirrors[0], rpm->subdir, rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s/%s", dir->ftp, rpm->subdir, rpm->filename); } else { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s", dir->mirrors[0], rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s", dir->ftp, rpm->filename); } tpl_element_set(engine, "url", buf); tpl_element_set(engine, "name", rpm->name); tpl_element_set(engine, "version", rpm->version); tpl_element_set(engine, "release", rpm->release); if (rpm->arch) { if (!strcmp(rpm->arch, "src")) tpl_parse(engine, "rpm_subtitle_src", "p_subtitle", 0); else { tpl_element_set(engine, "arch", rpm->arch); tpl_parse(engine, "rpm_subtitle_arch", "p_subtitle", 0); } } else tpl_parse(engine, "rpm_subtitle_arch_unknown", "p_subtitle", 0); tpl_element_set(engine, "subtitle", tpl_element_get(engine, "p_subtitle")); parseNwriteTemplate(html, engine, "rpm_subtitle"); parseNwriteTemplate(html, engine, "rpm_subsubtitle_begin"); if ((tree != NULL) && (tree->parent != NULL)) { generateHtmlParentsNames(html, tree); } else if (dir->name) { tpl_element_set(engine, "name", dir->name); if (dir->ftp) { tpl_element_set(engine, "url", dir->ftp); parseNwriteTemplate(html, engine, "rpm_subsubtitle_body"); } else parseNwriteTemplate(html, engine, "rpm_subsubtitle_body_nourl"); } parseNwriteTemplate(html, engine, "rpm_subsubtitle_end"); tpl_element_set(engine, "color", dir->color); tpl_element_set(engine, "name", rpm->name); tpl_element_set(engine, "url", rpm2html_url); tpl_element_set(engine, "distrib_url", distribName(rpm->distribution)); tpl_element_set(engine, "distribution", convertHTML(rpm->distribution)); tpl_element_set(engine, "version", rpm->version); tpl_element_set(engine, "vendor_url", vendorName(rpm->vendor)); tpl_element_set(engine, "vendor", convertHTML(rpm->vendor)); tstruct = localtime(&(rpm->date)); #ifdef HAVE_STRFTIME strftime(buf, sizeof(buf) - 1, "%c", tstruct); #else #error "no strftime, please check !" #endif tpl_element_set(engine, "release", rpm->release); tpl_element_set(engine, "date", buf); if (installed) tpl_parse(engine, "rpm_body_date_install", "p_date_title", 0); else tpl_parse(engine, "rpm_body_date_build", "p_date_title", 0); tpl_element_set(engine, "date_title", tpl_element_get(engine, "p_date_title")); if (rpm2html_url != NULL) { snprintf(buf, sizeof(buf), "%s/%s", rpm2html_url, groupName(rpm->group)); tpl_element_set(engine, "group_url", buf); } else tpl_element_set(engine, "group_url", groupName(rpm->group)); tpl_element_set(engine, "group_url", buf); tpl_element_set(engine, "group", convertHTML(rpm->group)); tpl_element_set(engine, "build_host", rpm->extra->host); snprintf(buf, sizeof(buf), "%d", rpm->size); tpl_element_set(engine, "size", buf); tpl_element_set(engine, "srcrpm_name", rpm->extra->srcrpm); if (dir->ftpsrc) { snprintf(buf, sizeof(buf), "%s/%s", dir->ftpsrc, rpm->extra->srcrpm); tpl_element_set(engine, "srcrpm_url", buf); tpl_parse(engine, "rpm_body_src_rpm_name_and_url", "p_source_rpm", 0); } else { tpl_parse(engine, "rpm_body_src_rpm_name", "p_source_rpm", 0); } tpl_element_set(engine, "source_rpm", tpl_element_get(engine, "p_source_rpm")); if (rpm->extra->packager) { tpl_element_set(engine, "packager", convertHTML(rpm->extra->packager)); char *email = extractEMail(rpm->extra->packager); if (email == NULL) tpl_parse(engine, "rpm_body_packager_without_email", "p_packager", 0); else { tpl_element_set(engine, "packager_email", email); tpl_parse(engine, "rpm_body_packager_with_email", "p_packager", 0); } tpl_element_set(engine, "packager", tpl_element_get(engine, "p_packager")); } else tpl_element_set(engine, "packager", ""); if (rpm->url) tpl_element_set(engine, "home_url", rpm->url); else tpl_element_set(engine, "home_url", ""); tpl_element_set(engine, "summary", convertHTML(rpm->summary)); tpl_element_set(engine, "description", convertHTML(rpm->extra->description)); parseNwriteTemplate(html, engine, "rpm_body"); if ((rpm->extra->nb_resources + rpm->extra->nb_requires < 2) && (!strstr(rpm->name, "lib")) && (!strcmp(rpm->arch, "src"))) { if (rpm2htmlVerbose > 1) fprintf(stderr, "Resource lists problem : %s\n", rpmName(rpm)); tpl_element_set(engine, "url", rpm2html_url); tpl_element_set(engine, "suburl", resourceName(rpm->name)); parseNwriteTemplate(html, engine, "rpm_resource_list_problem"); } if (rpm->extra->nb_resources > 0) { parseNwriteTemplate(html, engine, "rpm_provides_header"); for (i = 0;i < rpm->extra->nb_resources;i++) { #ifdef WITH_SQL if (rpm2html_search != NULL) snprintf(buf, sizeof(buf), "%s?query=%s", rpm2html_search, escapeName(rpm->extra->resources[i]->name)); else #endif if (rpm2html_url != NULL) snprintf(buf, sizeof(buf), "%s/%s", rpm2html_url, resourceName(rpm->extra->resources[i]->name)); else snprintf(buf, sizeof(buf), "%s", resourceName(rpm->extra->resources[i]->name)); tpl_element_set(engine, "url", buf); tpl_element_set(engine, "name", rpm->extra->resources[i]->name); parseNwriteTemplate(html, engine, "rpm_provides_item"); } parseNwriteTemplate(html, engine, "rpm_provides_footer"); } if (rpm->extra->nb_requires > 0) { parseNwriteTemplate(html, engine, "rpm_requires_header"); for (i = 0;i < rpm->extra->nb_requires;i++) { if ((rpm->extra->requires[i]->flag != RPM2HTML_REQ_NONE) && (rpm->extra->requires[i]->version != NULL)) { snprintf(buf, sizeof(buf), " %s %s", html_flags[rpm->extra->requires[i]->flag], rpm->extra->requires[i]->version); tpl_element_set(engine, "version", buf); } else tpl_element_set(engine, "version", ""); #ifdef WITH_SQL if (rpm2html_search != NULL) { snprintf(buf, sizeof(buf), "%s?query=%s", rpm2html_search, escapeName(rpm->extra->requires[i]->name)); tpl_element_set(engine, "url", buf); } else #endif if (rpm2html_url != NULL) { snprintf(buf, sizeof(buf), "%s/%s", rpm2html_url, resourceName(rpm->extra->requires[i]->name)); tpl_element_set(engine, "url", buf); } else { tpl_element_set(engine, "url", resourceName(rpm->extra->requires[i]->name)); } tpl_element_set(engine, "name", rpm->extra->requires[i]->name); parseNwriteTemplate(html, engine, "rpm_requires_item"); } parseNwriteTemplate(html, engine, "rpm_requires_footer"); } if (rpm->extra->copyright) { tpl_element_set(engine, "copyright", convertHTML(rpm->extra->copyright)); parseNwriteTemplate(html, engine, "rpm_copyright"); } if (rpm->extra->sigs != NULL) { parseNwriteTemplate(html, engine, "rpm_signatures_header"); for(i = 0; i < rpm->extra->nb_sigs; i++) { tpl_element_set(engine, "signature", convertHTML(convertSIG(rpm->extra->sigs[i]))); parseNwriteTemplate(html, engine, "rpm_signatures_item"); } } if (rpm->extra->changelog) { tpl_element_set(engine, "changelog", convertCVE(convertHTML(rpm->extra->changelog))); parseNwriteTemplate(html, engine, "rpm_changelog"); } parseNwriteTemplate(html, engine, "rpm_files_header"); if (rpm->extra->filelist == NULL) parseNwriteTemplate(html, engine, "rpm_files_body_no_files"); else { tpl_element_set(engine, "files", rpm->extra->filelist); parseNwriteTemplate(html, engine, "rpm_files_body"); } #else // ifdef HAVE_LIBTEMPLATE snprintf(buf, sizeof(buf), "%s RPM", rpmName(rpm)); generateHtmlHeader(html, buf, NULL); generateLinks(html, installed); if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) { if (dir->mirrors[0] != NULL) fprintf(html, "

\n", dir->mirrors[0], rpm->subdir, rpm->filename); else fprintf(html, "

\n", dir->ftp, rpm->subdir, rpm->filename); } else { if (dir->mirrors[0] != NULL) fprintf(html, "

\n", dir->mirrors[0], rpm->filename); else fprintf(html, "

\n", dir->ftp, rpm->filename); } if (rpm->arch) { if (!strcmp(rpm->arch, "src")) fprintf(html, "%s-%s-%s Source RPM

\n", rpm->name, rpm->version, rpm->release); else fprintf(html, "%s-%s-%s RPM for %s

\n", rpm->name, rpm->version, rpm->release, rpm->arch); } else { fprintf(html, "%s-%s-%s RPM

\n", rpm->name, rpm->version, rpm->release); } if ((tree != NULL) && (tree->parent != NULL)) { fprintf(html, "

%s ", localizedStrings[LANG_FROM]); generateHtmlParentsNames(html, tree); fprintf(html, "

\n"); } else if (dir->name) { fprintf(html, "

%s %s

\n", localizedStrings[LANG_FROM], dir->ftp, dir->name); } fprintf(html, "", dir->color); fprintf(html, "\n"); fprintf(html, "\n", localizedStrings[LANG_NAME], rpm->name); fprintf(html, "\n", localizedStrings[LANG_DISTRIBUTION], rpm2html_url, distribName(rpm->distribution), convertHTML(rpm->distribution)); fprintf(html, "\n", localizedStrings[LANG_VERSION], rpm->version); fprintf(html, "\n", localizedStrings[LANG_VENDOR], rpm2html_url, vendorName(rpm->vendor), convertHTML(rpm->vendor)); tstruct = localtime(&(rpm->date)); #ifdef HAVE_STRFTIME strftime(buf, sizeof(buf) - 1, "%c", tstruct); #else #error "no strftime, please check !" #endif if (installed) { fprintf(html, "\n\n", localizedStrings[LANG_RELEASE], rpm->release, localizedStrings[LANG_INSTALL_DATE], buf); } else { fprintf(html, "\n\n", localizedStrings[LANG_RELEASE], rpm->release, localizedStrings[LANG_BUILD_DATE], buf); } if (rpm2html_url != NULL) fprintf(html, "\n", localizedStrings[LANG_GROUP], rpm2html_url, groupName(rpm->group), convertHTML(rpm->group)); else fprintf(html, "\n", localizedStrings[LANG_GROUP], groupName(rpm->group), convertHTML(rpm->group)); fprintf(html, "\n", localizedStrings[LANG_BUILD_HOST], rpm->extra->host); fprintf(html, "\n", localizedStrings[LANG_SIZE], rpm->size); if (dir->ftpsrc) { fprintf(html, "\n", localizedStrings[LANG_RPM_SRC], dir->ftpsrc, rpm->extra->srcrpm, rpm->extra->srcrpm); } else { fprintf(html, "\n", localizedStrings[LANG_RPM_SRC], rpm->extra->srcrpm); } if (rpm->extra->packager) { char *email = extractEMail(rpm->extra->packager); if (email == NULL) fprintf(html, "\n", localizedStrings[LANG_PACKAGER], convertHTML(rpm->extra->packager)); else fprintf(html, "\n", localizedStrings[LANG_PACKAGER], email, convertHTML(rpm->extra->packager)); } if (rpm->url) fprintf(html, "\n", localizedStrings[LANG_URL], rpm->url, rpm->url); fprintf(html, "\n", localizedStrings[LANG_SUMMARY], convertHTML(rpm->summary)); fprintf(html, "\n
%s: %s%s: %s
%s: %s%s: %s
%s: %s%s: %s
%s: %s%s: %s
%s: %s
%s: %s%s: %s
%s: %d%s: %s
%s: %s
%s: %s
%s: %s
%s: %s
%s: %s
\n"); fprintf(html, "
%s\n
\n", convertHTML(rpm->extra->description)); if ((rpm->extra->nb_resources + rpm->extra->nb_requires < 2) && (!strstr(rpm->name, "lib")) && (!strcmp(rpm->arch, "src"))) { if (rpm2htmlVerbose > 1) fprintf(stderr, "Resource lists problem : %s\n", rpmName(rpm)); fprintf(html, "

%s

\n", localizedStrings[LANG_WARNING_RESOURCES]); fprintf(html, "

%s

\n", rpm2html_url, resourceName(rpm->name), localizedStrings[LANG_CHOOSE_ANOTHER]); } if (rpm->extra->nb_resources > 0) { fprintf(html, "

%s

\n", localizedStrings[LANG_PROVIDE]); fprintf(html, "
    \n"); for (i = 0;i < rpm->extra->nb_resources;i++) { #ifdef WITH_SQL if (rpm2html_search != NULL) fprintf(html, "
  • %s\n", rpm2html_search, escapeName(rpm->extra->resources[i]->name), rpm->extra->resources[i]->name); else #endif if (rpm2html_url != NULL) fprintf(html, "
  • %s\n", rpm2html_url, resourceName(rpm->extra->resources[i]->name), rpm->extra->resources[i]->name); else fprintf(html, "
  • %s\n", resourceName(rpm->extra->resources[i]->name), rpm->extra->resources[i]->name); } fprintf(html, "
\n"); } if (rpm->extra->nb_requires > 0) { fprintf(html, "

%s

\n", localizedStrings[LANG_REQUIRE]); fprintf(html, "
    \n"); for (i = 0;i < rpm->extra->nb_requires;i++) { #ifdef WITH_SQL if (rpm2html_search != NULL) { if ((rpm->extra->requires[i]->flag != RPM2HTML_REQ_NONE) && (rpm->extra->requires[i]->version != NULL)) { fprintf(html, "
  • %s %s %s\n", rpm2html_search, escapeName(rpm->extra->requires[i]->name), rpm->extra->requires[i]->name, html_flags[rpm->extra->requires[i]->flag], rpm->extra->requires[i]->version); } else { fprintf(html, "
  • %s\n", rpm2html_search, escapeName(rpm->extra->requires[i]->name), rpm->extra->requires[i]->name); } } else #endif if (rpm2html_url != NULL) { if ((rpm->extra->requires[i]->flag != RPM2HTML_REQ_NONE) && (rpm->extra->requires[i]->version != NULL)) { fprintf(html, "
  • %s %s %s\n", rpm2html_url, resourceName(rpm->extra->requires[i]->name), rpm->extra->requires[i]->name, html_flags[rpm->extra->requires[i]->flag], rpm->extra->requires[i]->version); } else { fprintf(html, "
  • %s\n", rpm2html_url, resourceName(rpm->extra->requires[i]->name), rpm->extra->requires[i]->name); } } else { if ((rpm->extra->requires[i]->flag != RPM2HTML_REQ_NONE) && (rpm->extra->requires[i]->version != NULL)) { fprintf(html, "
  • %s %s %s\n", resourceName(rpm->extra->requires[i]->name), rpm->extra->requires[i]->name, html_flags[rpm->extra->requires[i]->flag], rpm->extra->requires[i]->version); } else { fprintf(html, "
  • %s\n", resourceName(rpm->extra->requires[i]->name), rpm->extra->requires[i]->name); } } } fprintf(html, "
\n"); } if (rpm->extra->copyright) { fprintf(html, "

%s

\n", localizedStrings[LANG_COPYRIGHT]); fprintf(html, "
%s\n
\n", convertHTML(rpm->extra->copyright)); } if (rpm->extra->sigs != NULL) { fprintf(html, "

%s

\n", localizedStrings[LANG_SIGNATURES]); for(i = 0; i < rpm->extra->nb_sigs; i++) fprintf(html, "
%s\n
\n", convertHTML(convertSIG(rpm->extra->sigs[i]))); } if (rpm->extra->changelog) { fprintf(html, "

%s

\n", localizedStrings[LANG_CHANGELOG]); fprintf(html, "
%s\n
\n", convertCVE(convertHTML(rpm->extra->changelog))); } fprintf(html, "

%s

\n", localizedStrings[LANG_FILES]); if (rpm->extra->filelist == NULL) fprintf(html, "%s\n", localizedStrings[LANG_NO_FILES]); else fprintf(html, "
%s\n
\n", rpm->extra->filelist); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(html); fclose(html); } #ifdef WITH_SQL /* * Dump a resource HTML file redirecting to the search engine. */ void dumpRessRedirHtml(const char *name) { FILE *html; if (!rpm2html_dump_html) return; /* * Guess why ??? index.html gets ovewritten ! */ if (!strcmp(name, "index")) return; snprintf(buf, sizeof(buf), "%s/%s", rpm2html_dir, resourceName(name)); if (rpm2htmlVerbose > 1) { printf("Dumping %s/%s\n", rpm2html_dir, resourceName(name)); } html = fopen(buf, "w"); if (html == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } snprintf(buf, sizeof(buf), "%s %s", localizedStrings[LANG_RPM_RESOURCE], name); fprintf(html, "\n"); fprintf(html, "\n\n%s\n", buf); fprintf(html, "\n", rpm2html_rpm2html_name, rpm2html_rpm2html_ver); if (rpm2html_search != NULL) fprintf(html, "\n", rpm2html_search, escapeName(name)); else fprintf(html, "\n", escapeName(name)); fprintf(html, "\n\n"); generateLinks(html, 0); fprintf(html, "

%s %s

\n", localizedStrings[LANG_RPM_RESOURCE], name); fprintf(html, "

This static page has been replaced\n"); if (rpm2html_search != NULL) fprintf(html, "", rpm2html_search, escapeName(name)); else fprintf(html, "", escapeName(name)); fprintf(html, "by a dynamic one

\n"); fprintf(html, "

Thank you for updating your bookmarks

\n"); generateHtmlFooter(html); fclose(html); } #endif /* * Dump a resource block as an HTML file. */ void dumpRessHtml(rpmRessPtr ress, int installed) { rpmDataPtr rpm; FILE *html; int i; const char *name = NULL; if (!rpm2html_dump_html) return; #ifdef WITH_SQL if (rpm2html_search != NULL) { dumpRessRedirHtml(ress->name); return; } #endif /* * Guess why ??? index.html gets ovewritten ! */ if (!strcmp(ress->name, "index")) return; rpmRessSort(ress); snprintf(buf, sizeof(buf), "%s/%s", rpm2html_dir, resourceName(ress->name)); /* * !!!!! * if (checkDate(buf, ress->stamp)) return; */ if (rpm2htmlVerbose > 1) { printf("Dumping %s/%s\n", rpm2html_dir, resourceName(ress->name)); } html = fopen(buf, "w"); if (html == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "name", ress->name); generateHtmlHeader(html, "resource_title", NULL); generateLinks(html, installed); generateColorIndicator(html); parseNwriteTemplate(html, engine, "resource_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary parseNwriteTemplate(html, engine, "resource_body_begin"); for (i = 0;i < ress->nb_provider;i++) { rpm = ress->provider[i]; if ((name != NULL) && (strcmp(rpm->name, name))) { parseNwriteTemplate(html, engine, "resource_body_end"); parseNwriteTemplate(html, engine, "resource_body_begin"); } name = rpm->name; generateHtmlRpmRow(html, rpm, 1); } parseNwriteTemplate(html, engine, "resource_body_end"); #else // ifdef HAVE_LIBTEMPLATE snprintf(buf, sizeof(buf), "%s %s", localizedStrings[LANG_RPM_RESOURCE], ress->name); generateHtmlHeader(html, buf, NULL); generateLinks(html, installed); generateColorIndicator(html); fprintf(html, "

%s %s

\n", localizedStrings[LANG_RPM_RESOURCE], ress->name); fprintf(html, "

%s

\n", localizedStrings[LANG_PROVIDED_BY]); fprintf(html, "\n"); for (i = 0;i < ress->nb_provider;i++) { rpm = ress->provider[i]; if ((name != NULL) && (strcmp(rpm->name, name))) fprintf(html, "
\n
\n\n"); name = rpm->name; generateHtmlRpmRow(html, rpm, 1); } fprintf(html, "
\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(html); fclose(html); } /* * Dump all RPM blocks in the HTML files. */ void dumpAllRessHtml(int installed) { rpmRessPtr cur; if (!rpm2html_dump_html) return; if (rpm2htmlVerbose) printf("Dumping resource HTML pages\n"); if (installed) cur = ressInstalledList; else cur = ressList; while (cur != NULL) { dumpRessHtml(cur, installed); cur = cur->next; } } /* * Dump the Groups of all HTML files. * One expect that the RPM files have been sorted by group. */ void dumpDirRpmByGroups(rpmDataPtr list, rpmDirPtr dir, char *subdir, int installed) { FILE *Groups; FILE *currentGroup = NULL; rpmDataPtr cur, prev = NULL; int count = 0; int pcount = 0; if (!rpm2html_dump_html) return; if ((dir != NULL) && (!dir->html)) return; cur = list; fullPathName(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_GROUP_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } Groups = fopen(buf, "w"); if (Groups == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE generateHtmlHeader(Groups, "groups_title", NULL); generateLinks(Groups, installed); parseNwriteTemplate(Groups, engine, "groups_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary rpmDataPtr lastCur = NULL; while (cur != NULL) { if ((cur->group != NULL) && (strlen(cur->group) > 0)) { if ((prev == NULL) || (strcasecmp(prev->group, cur->group))) { if (pcount != 0) { /* Add the current group in the Group list */ tpl_element_set(engine, "url", groupName(lastCur->group)); tpl_element_set(engine, "name", convertHTML(lastCur->group)); snprintf(buf, sizeof(buf), "%d", pcount); tpl_element_set(engine, "count", buf); parseNwriteTemplate(Groups, engine, "groups_item"); } pcount = 0; if (currentGroup != NULL) { /* one need to close the current group list */ parseNwriteTemplate(currentGroup, engine, "group_end"); generateHtmlFooter(currentGroup); fclose(currentGroup); } lastCur = cur; /* open the new HTML group file */ fullPathName(buf, sizeof(buf), dir, subdir, groupName(cur->group)); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } currentGroup = fopen(buf, "w"); if (currentGroup == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } tpl_element_set(engine, "name", convertHTML(cur->group)); generateHtmlHeader(currentGroup, "group_title", NULL); generateLinks(currentGroup, installed); parseNwriteTemplate(currentGroup, engine, "group_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsider usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary generateColorIndicator(currentGroup); parseNwriteTemplate(currentGroup, engine, "group_begin"); count = 0; } generateHtmlRpmArchRow(currentGroup, cur); count++; pcount++; if ((count % MAX_TABLE_LENGHT) == 0) { parseNwriteTemplate(currentGroup, engine, "group_end"); parseNwriteTemplate(currentGroup, engine, "group_begin"); } } prev = cur; if ((dir == NULL) && (subdir == NULL)) cur = cur->nextSoft; else cur = cur->next; } /* Add the last group in the Group list */ if (pcount != 0) { tpl_element_set(engine, "url", groupName(lastCur->group)); tpl_element_set(engine, "name", convertHTML(lastCur->group)); snprintf(buf, sizeof(buf), "%d", pcount); tpl_element_set(engine, "count", buf); parseNwriteTemplate(Groups, engine, "groups_item"); } if (currentGroup != NULL) { /* one need to close the current group list */ parseNwriteTemplate(currentGroup, engine, "group_end"); generateHtmlFooter(currentGroup); fclose(currentGroup); } parseNwriteTemplate(Groups, engine, "groups_footer"); #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(Groups, localizedStrings[LANG_SORTED_BY_GROUP], NULL); generateLinks(Groups, installed); fprintf(Groups, "

%s

\n", localizedStrings[LANG_SORTED_BY_GROUP]); fprintf(Groups, "\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(Groups); fclose(Groups); } /* * Dump the full set of RPM by Group HTML file. * One expect that the RPM files have been sorted by groups. */ void dumpRpmByGroups(rpmDataPtr list, int installed) { if (!rpm2html_dump_html) return; if (rpm2htmlVerbose) printf("Dumping \"by group\" HTML pages\n"); dumpDirRpmByGroups(list, NULL, NULL, installed); } /* * Dump the Distribs HTML files. * One expect that the RPM files have been sorted by distribution. */ void dumpDirRpmByDistribs(rpmDataPtr list, rpmDirPtr dir, char *subdir, int installed) { FILE *Distribs; FILE *currentDistrib = NULL; rpmDataPtr cur, prev = NULL; int count = 0; int pcount = 0; if (!rpm2html_dump_html) return; if ((dir != NULL) && (!dir->html)) return; cur = list; fullPathName(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_DISTRIB_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } Distribs = fopen(buf, "w"); if (Distribs == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE generateHtmlHeader(Distribs, "distribs_title", NULL); generateLinks(Distribs, installed); parseNwriteTemplate(Distribs, engine, "distribs_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary rpmDataPtr lastCur = NULL; while (cur != NULL) { if ((cur->distribution != NULL) && (strlen(cur->distribution) > 0)) { if ((prev == NULL) || (strcasecmp(prev->distribution, cur->distribution))) { if (pcount != 0) { /* Add the current distribution in the Distrib list */ tpl_element_set(engine, "url", distribName(lastCur->distribution)); tpl_element_set(engine, "name", convertHTML(lastCur->distribution)); snprintf(buf, sizeof(buf), "%d", pcount); tpl_element_set(engine, "count", buf); parseNwriteTemplate(Distribs, engine, "distribs_item"); } pcount = 0; if (currentDistrib != NULL) { /* one need to close the current distribution list */ parseNwriteTemplate(currentDistrib, engine, "distrib_end"); generateHtmlFooter(currentDistrib); fclose(currentDistrib); } lastCur = cur; /* open the new HTML distribution file */ fullPathName(buf, sizeof(buf), dir, subdir, distribName(cur->distribution)); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } currentDistrib = fopen(buf, "w"); if (currentDistrib == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } tpl_element_set(engine, "name", convertHTML(cur->distribution)); generateHtmlHeader(currentDistrib, "distrib_title", NULL); generateLinks(currentDistrib, installed); parseNwriteTemplate(currentDistrib, engine, "distrib_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsider usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary if (!installed) generateColorIndicator(currentDistrib); parseNwriteTemplate(currentDistrib, engine, "distrib_begin"); count = 0; } generateHtmlRpmRow(currentDistrib, cur, 1); count++; pcount++; if ((count % MAX_TABLE_LENGHT) == 0) { parseNwriteTemplate(currentDistrib, engine, "distrib_end"); parseNwriteTemplate(currentDistrib, engine, "distrib_begin"); } } prev = cur; cur = cur->next; } /* Add the last distribution in the Distrib list */ if (pcount != 0) { tpl_element_set(engine, "url", distribName(lastCur->distribution)); tpl_element_set(engine, "name", convertHTML(lastCur->distribution)); snprintf(buf, sizeof(buf), "%d", pcount); tpl_element_set(engine, "count", buf); parseNwriteTemplate(Distribs, engine, "distribs_item"); } if (currentDistrib != NULL) { /* one need to close the current distribution list */ parseNwriteTemplate(currentDistrib, engine, "distrib_end"); generateHtmlFooter(currentDistrib); fclose(currentDistrib); } parseNwriteTemplate(Distribs, engine, "distribs_footer"); #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(Distribs, localizedStrings[LANG_SORTED_BY_DISTRIB], NULL); generateLinks(Distribs, installed); fprintf(Distribs, "

%s

\n", localizedStrings[LANG_SORTED_BY_DISTRIB]); fprintf(Distribs, "
\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(Distribs); fclose(Distribs); } /* * Dump the full set of RPM by Distribution HTML file. * One expect that the RPM files have been sorted by distributions. */ void dumpRpmByDistribs(rpmDataPtr list, int installed) { if (!rpm2html_dump_html) return; if (rpm2htmlVerbose) printf("Dumping \"by distribution\" HTML pages\n"); dumpDirRpmByDistribs(list, NULL, NULL, installed); } /* * Dump the Vendors HTML files. * One expect that the RPM files have been sorted by vendors. */ void dumpDirRpmByVendors(rpmDataPtr list, rpmDirPtr dir, char *subdir, int installed) { FILE *Vendors; FILE *currentVendor = NULL; rpmDataPtr cur, prev = NULL; int count = 0; int pcount = 0; if (!rpm2html_dump_html) return; cur = list; fullPathName(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_VENDOR_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } Vendors = fopen(buf, "w"); if (Vendors == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE generateHtmlHeader(Vendors, "vendors_title", NULL); generateLinks(Vendors, installed); parseNwriteTemplate(Vendors, engine, "vendors_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary rpmDataPtr lastCur = NULL; while (cur != NULL) { if ((cur->vendor != NULL) && (strlen(cur->vendor) > 0)) { if ((prev == NULL) || (strcasecmp(prev->vendor, cur->vendor))) { if (pcount != 0) { /* Add the current vendor in the Vendor list */ tpl_element_set(engine, "url", vendorName(lastCur->vendor)); tpl_element_set(engine, "name", convertHTML(lastCur->vendor)); snprintf(buf, sizeof(buf), "%d", pcount); tpl_element_set(engine, "count", buf); parseNwriteTemplate(Vendors, engine, "vendors_item"); } pcount = 0; if (currentVendor != NULL) { /* one need to close the current vendor list */ parseNwriteTemplate(currentVendor, engine, "vendor_end"); generateHtmlFooter(currentVendor); fclose(currentVendor); } lastCur = cur; /* open the new HTML vendor file */ fullPathName(buf, sizeof(buf), dir, subdir, vendorName(cur->vendor)); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } currentVendor = fopen(buf, "w"); if (currentVendor == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } tpl_element_set(engine, "name", convertHTML(cur->vendor)); generateHtmlHeader(currentVendor, "vendor_title", NULL); generateLinks(currentVendor, installed); parseNwriteTemplate(currentVendor, engine, "vendor_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsider usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary if (!installed) generateColorIndicator(currentVendor); parseNwriteTemplate(currentVendor, engine, "vendor_begin"); count = 0; } generateHtmlRpmRow(currentVendor, cur, 1); count++; pcount++; if ((count % MAX_TABLE_LENGHT) == 0) { parseNwriteTemplate(currentVendor, engine, "vendor_end"); parseNwriteTemplate(currentVendor, engine, "vendor_begin"); } } prev = cur; cur = cur->next; } /* Add the last vendor in the Vendor list */ if (pcount != 0) { tpl_element_set(engine, "url", vendorName(lastCur->vendor)); tpl_element_set(engine, "name", convertHTML(lastCur->vendor)); snprintf(buf, sizeof(buf), "%d", pcount); tpl_element_set(engine, "count", buf); parseNwriteTemplate(Vendors, engine, "vendors_item"); } if (currentVendor != NULL) { /* one need to close the current vendor list */ parseNwriteTemplate(currentVendor, engine, "vendor_end"); generateHtmlFooter(currentVendor); fclose(currentVendor); } parseNwriteTemplate(Vendors, engine, "vendors_footer"); #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(Vendors, localizedStrings[LANG_SORTED_BY_VENDOR], NULL); generateLinks(Vendors, installed); fprintf(Vendors, "

%s

\n", localizedStrings[LANG_SORTED_BY_VENDOR]); fprintf(Vendors, "
\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(Vendors); fclose(Vendors); } /* * Dump the full set of RPM by Vendor HTML file. * One expect that the RPM files have been sorted by vendors. */ void dumpRpmByVendors(rpmDataPtr list, int installed) { if (!rpm2html_dump_html) return; if (rpm2htmlVerbose) printf("Dumping \"by vendor\" HTML pages\n"); dumpDirRpmByVendors(list, NULL, NULL, installed); } #ifdef HAVE_LIBTEMPLATE /* * Helper function for dumpDirRpmByDate(): it performs subdumps for given package age. * Returns actualised page counter. */ int subdumpDirRpmByDate(rpmDataPtr list, rpmDirPtr dir, char *subdir, int installed, FILE **html, FILE *RSS, int *rdfcount, char *title, int maxAge, rpmDataPtr *cur, int *page, int *count) { tpl_parse(engine, title, "p_title", 0); tpl_element_set(engine, "title", tpl_element_get(engine, "p_title")); parseNwriteTemplate((*html), engine, "dates_subheader"); parseNwriteTemplate((*html), engine, "dates_begin"); while (((*cur) != NULL) && (((currentTime - (*cur)->date) < maxAge) || (maxAge < 0))) { generateHtmlRpmRow((*html), (*cur), 0); if ((RSS != NULL) && ((*rdfcount)++ < rpm2html_rdf_count_limit)) { generateRSSItem(RSS, (*cur)); } (*cur) = (*cur)->next; (*count)++; if (((*count) % MAX_TABLE_LENGHT) == 0) { parseNwriteTemplate((*html), engine, "dates_end"); parseNwriteTemplate((*html), engine, "dates_begin"); } if ((*count) > MAX_PAGE_LENGHT) { (*count) = 0; parseNwriteTemplate((*html), engine, "dates_end"); snprintf(buf, sizeof(buf), "%d", (*page)); tpl_element_set(engine, "next_page", buf); parseNwriteTemplate((*html), engine, "dates_next_page"); generateHtmlFooter((*html)); fclose((*html)); fullPathNameNr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYDATE_HTML], (*page)++); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } (*html) = fopen(buf, "w"); if ((*html) == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); if (RSS) { fprintf(RSS, " \n"); fprintf(RSS, "\n"); fclose(RSS); } return; } if (installed) { generateHtmlHeader((*html), "idates_title", NULL); generateLinks((*html), installed); parseNwriteTemplate((*html), engine, "dates_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary } else { generateHtmlHeader((*html), "cdates_title", NULL); generateLinks((*html), installed); parseNwriteTemplate((*html), engine, "dates_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary } //tpl_parse(engine, title, "p_title", 0); //tpl_element_set(engine, "title", tpl_element_get(engine, "p_title")); - I hope it is still preserved from the begining of the function? parseNwriteTemplate((*html), engine, "dates_subheader"); parseNwriteTemplate((*html), engine, "dates_begin"); } } parseNwriteTemplate((*html), engine, "dates_end"); return (*page); } #endif /* * Dump the RPM by Date HTML file. * One expect that the RPM files have been sorted by date. */ void dumpDirRpmByDate(rpmDataPtr list, rpmDirPtr dir, char *subdir, int installed) { FILE *ByDate; FILE *RSS; rpmDataPtr cur; int count = 0; int rdfcount = 0; int page = 1; if (!rpm2html_dump_html) return; if ((dir != NULL) && (!dir->html)) return; cur = list; fullPathName(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYDATE_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByDate = fopen(buf, "w"); if (ByDate == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } fullPathName(buf, sizeof(buf), dir, subdir, "rdf"); if (rpm2htmlVerbose > 1) { printf("Dumping RSS channel %s\n", buf); } RSS = fopen(buf, "w"); if (RSS == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); fclose(ByDate); return; } #ifdef HAVE_LIBTEMPLATE if (installed) { generateHtmlHeader(ByDate, "idates_title", NULL); generateLinks(ByDate, installed); parseNwriteTemplate(ByDate, engine, "dates_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary } else { generateHtmlHeader(ByDate, "cdates_title", NULL); generateLinks(ByDate, installed); parseNwriteTemplate(ByDate, engine, "dates_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary } #else // ifdef HAVE_LIBTEMPLATE if (installed) { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_IDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_IDATE]); } else { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_CDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_CDATE]); } #endif // ifdef HAVE_LIBTEMPLATE if (RSS) { fprintf(RSS, "\n"); fprintf(RSS, "\n"); fprintf(RSS, "\n"); fprintf(RSS, " \n"); if (dir != NULL) { fprintf(RSS, " Rpmfind %s index on %s\n", dir->name, rpm2html_host); fullURL(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_INDEX_HTML]); fprintf(RSS, " %s\n", buf); fprintf(RSS, " Rpmfind %s News on %s\n", rpm2html_host, dir->name); } else { fprintf(RSS, " Rpmfind index on %s\n", rpm2html_host); fullURL(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_INDEX_HTML]); fprintf(RSS, " %s\n", buf); fprintf(RSS, " Rpmfind News on %s\n", rpm2html_host); } #ifdef HAVE_LIBTEMPLATE parseNwriteTemplate(ByDate, engine, "dates_rdf"); #else fprintf(ByDate, localizedStrings[LANG_RDF_CHANNEL], "rdf"); #endif } /* * Skip all the RPMs with date in the futur :-( */ while ((cur != NULL) && ((cur->date < 0) || (currentTime < cur->date))) { if (rpm2htmlVerbose > 1) { fprintf(stderr, "dropping %s, date %d > current time %d\n", rpmSoftwareName(cur), (int) cur->date, (int) currentTime); } cur = cur->next; } #ifdef HAVE_LIBTEMPLATE #define MAX_AGE_LESS_3D (3 * 24 * 60 * 60) #define MAX_AGE_LESS_1W (7 * 24 * 60 * 60) #define MAX_AGE_LESS_2W (14 * 24 * 60 * 60) #define MAX_AGE_LESS_1M (30 * 24 * 60 * 60) #define MAX_AGE_MORE_1M -1 /* * First dump RPMs less than 3 days old. */ if (!installed) generateColorIndicator(ByDate); if (installed) subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "idates_title_less_3d_old", MAX_AGE_LESS_3D, &cur, &page, &count); else subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "cdates_title_less_3d_old", MAX_AGE_LESS_3D, &cur, &page, &count); /* * Then dump RPMs less than one week old. */ if (installed) subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "idates_title_less_1w_old", MAX_AGE_LESS_1W, &cur, &page, &count); else subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "cdates_title_less_1w_old", MAX_AGE_LESS_1W, &cur, &page, &count); /* * Then dump RPMs less than two weeks old. */ if (installed) subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "idates_title_less_2w_old", MAX_AGE_LESS_2W, &cur, &page, &count); else subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "cdates_title_less_2w_old", MAX_AGE_LESS_2W, &cur, &page, &count); /* * Then dump RPMs less than one month old. */ if (installed) subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "idates_title_less_1m_old", MAX_AGE_LESS_1M, &cur, &page, &count); else subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "cdates_title_less_1m_old", MAX_AGE_LESS_1M, &cur, &page, &count); /* * Then dump RPMs more than one month old. */ if (installed) subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "idates_title_more_1m_old", MAX_AGE_MORE_1M, &cur, &page, &count); else subdumpDirRpmByDate(list, dir, subdir, installed, &ByDate, RSS, &rdfcount, "cdates_title_more_1m_old", MAX_AGE_MORE_1M, &cur, &page, &count); #else // ifdef HAVE_LIBTEMPLATE /* * First dump RPMs less than 3 days old. */ if (!installed) generateColorIndicator(ByDate); if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_3D_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_3D_OLD]); fprintf(ByDate, "\n"); while ((cur != NULL) && ((currentTime - cur->date) < (3 * 24 * 60 * 60))) { generateHtmlRpmRow(ByDate, cur, 0); if ((RSS != NULL) && (rdfcount++ < rpm2html_rdf_count_limit)) { generateRSSItem(RSS, cur); } cur = cur->next; count++; if ((count % MAX_TABLE_LENGHT) == 0) fprintf(ByDate, "
\n\n"); if (count > MAX_PAGE_LENGHT) { count = 0; fprintf(ByDate, "
\n"); fprintf(ByDate, "
...\n", page, localizedStrings[LANG_BYDATE_HTML]); generateHtmlFooter(ByDate); fclose(ByDate); fullPathNameNr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYDATE_HTML], page++); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByDate = fopen(buf, "w"); if (ByDate == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); if (RSS) { fprintf(RSS, " \n"); fprintf(RSS, "\n"); fclose(RSS); } return; } if (installed) { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_IDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_IDATE]); } else { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_CDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_CDATE]); } if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_3D_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_3D_OLD]); fprintf(ByDate, "\n"); } } fprintf(ByDate, "
\n"); /* * Then dump RPMs less than one week old. */ if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_1W_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_1W_OLD]); fprintf(ByDate, "\n"); while ((cur != NULL) && ((currentTime - cur->date) < (7 * 24 * 60 * 60))) { generateHtmlRpmRow(ByDate, cur, 0); if ((RSS != NULL) && (rdfcount++ < rpm2html_rdf_count_limit)) { generateRSSItem(RSS, cur); } cur = cur->next; count++; if ((count % MAX_TABLE_LENGHT) == 0) fprintf(ByDate, "
\n\n"); if (count > MAX_PAGE_LENGHT) { count = 0; fprintf(ByDate, "
\n"); fprintf(ByDate, "...\n", page, localizedStrings[LANG_BYDATE_HTML]); generateHtmlFooter(ByDate); fclose(ByDate); fullPathNameNr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYDATE_HTML], page++); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByDate = fopen(buf, "w"); if (ByDate == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); if (RSS) { fprintf(RSS, " \n"); fprintf(RSS, "\n"); fclose(RSS); } return; } if (installed) { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_IDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_IDATE]); } else { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_CDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_CDATE]); } if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_1W_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_1W_OLD]); fprintf(ByDate, "\n"); } } fprintf(ByDate, "
\n"); /* * Then dump RPMs less than two weeks old. */ if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_2W_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_2W_OLD]); fprintf(ByDate, "\n"); while ((cur != NULL) && ((currentTime - cur->date) < (14 * 24 * 60 * 60))) { generateHtmlRpmRow(ByDate, cur, 0); if ((RSS != NULL) && (rdfcount++ < rpm2html_rdf_count_limit)) { generateRSSItem(RSS, cur); } cur = cur->next; count++; if ((count % MAX_TABLE_LENGHT) == 0) fprintf(ByDate, "
\n\n"); if (count > MAX_PAGE_LENGHT) { count = 0; fprintf(ByDate, "
\n"); fprintf(ByDate, "...\n", page, localizedStrings[LANG_BYDATE_HTML]); generateHtmlFooter(ByDate); fclose(ByDate); fullPathNameNr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYDATE_HTML], page++); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByDate = fopen(buf, "w"); if (ByDate == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); if (RSS) { fprintf(RSS, " \n"); fprintf(RSS, "\n"); fclose(RSS); } return; } if (installed) { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_IDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_IDATE]); } else { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_CDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_CDATE]); } if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_2W_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_2W_OLD]); fprintf(ByDate, "\n"); } } fprintf(ByDate, "
\n"); /* * Then dump RPMs less than one month old. */ if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_1M_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_1M_OLD]); fprintf(ByDate, "\n"); while ((cur != NULL) && ((currentTime - cur->date) < (30 * 24 * 60 * 60))) { generateHtmlRpmRow(ByDate, cur, 0); if ((RSS != NULL) && (rdfcount++ < rpm2html_rdf_count_limit)) { generateRSSItem(RSS, cur); } cur = cur->next; count++; if ((count % MAX_TABLE_LENGHT) == 0) fprintf(ByDate, "
\n\n"); if (count > MAX_PAGE_LENGHT) { count = 0; fprintf(ByDate, "
\n"); fprintf(ByDate, "...\n", page, localizedStrings[LANG_BYDATE_HTML]); generateHtmlFooter(ByDate); fclose(ByDate); fullPathNameNr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYDATE_HTML], page++); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByDate = fopen(buf, "w"); if (ByDate == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); if (RSS) { fprintf(RSS, " \n"); fprintf(RSS, "\n"); fclose(RSS); } return; } if (installed) { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_IDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_IDATE]); } else { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_CDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_CDATE]); } if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_LESS_1M_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_LESS_1M_OLD]); fprintf(ByDate, "\n"); } } fprintf(ByDate, "
\n"); /* * Then dump RPMs more than one month old. */ if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_MORE_1M_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_MORE_1M_OLD]); fprintf(ByDate, "\n"); while (cur != NULL) { generateHtmlRpmRow(ByDate, cur, 0); if ((RSS != NULL) && (rdfcount++ < rpm2html_rdf_count_limit)) { generateRSSItem(RSS, cur); } cur = cur->next; count++; if ((count % MAX_TABLE_LENGHT) == 0) fprintf(ByDate, "
\n\n"); if (count > MAX_PAGE_LENGHT) { count = 0; fprintf(ByDate, "
\n"); fprintf(ByDate, "...\n", page, localizedStrings[LANG_BYDATE_HTML]); generateHtmlFooter(ByDate); fclose(ByDate); fullPathNameNr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYDATE_HTML], page++); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByDate = fopen(buf, "w"); if (ByDate == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); if (RSS) { fprintf(RSS, " \n"); fprintf(RSS, "\n"); fclose(RSS); } return; } if (installed) { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_IDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_IDATE]); } else { generateHtmlHeader(ByDate, localizedStrings[LANG_SORTED_BY_CDATE], NULL); generateLinks(ByDate, installed); fprintf(ByDate, "

%s

\n", localizedStrings[LANG_SORTED_BY_CDATE]); } if (installed) fprintf(ByDate, "

%s

\n", localizedStrings[LANG_I_MORE_1M_OLD]); else fprintf(ByDate, "

%s

\n", localizedStrings[LANG_MORE_1M_OLD]); fprintf(ByDate, "\n"); } } fprintf(ByDate, "
\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(ByDate); fclose(ByDate); if (RSS) { fprintf(RSS, " \n"); fprintf(RSS, "\n"); fclose(RSS); } } /* * Dump the full set of RPM by Date HTML file. * One expect that the RPM files have been sorted by date. */ void dumpRpmByDate(rpmDataPtr list, int installed) { if (!rpm2html_dump_html) return; if (rpm2htmlVerbose) printf("Dumping \"by date\" HTML pages\n"); dumpDirRpmByDate(list, NULL, NULL, installed); } /* * Dump the RPM in a flat list sorted by Name. * One expect that the RPM files have been sorted by name. */ void dumpDirRpmByNameFlat(rpmDataPtr list, rpmDirPtr dir, char *subdir, int installed) { FILE *ByName; rpmDataPtr cur; if (!rpm2html_dump_html) return; cur = list; fullPathName(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYNAME_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByName = fopen(buf, "w"); if (ByName == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE generateHtmlHeader(ByName, "names_title", NULL); generateLinks(ByName, installed); if (!installed) generateColorIndicator(ByName); parseNwriteTemplate(ByName, engine, "names_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary while (cur != NULL) { generateHtmlRpmArchRow(ByName, cur); if ((dir == NULL) && (subdir == NULL)) cur = cur->nextSoft; else cur = cur->next; } parseNwriteTemplate(ByName, engine, "name_end"); #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(ByName, localizedStrings[LANG_SORTED_BY_NAME], NULL); generateLinks(ByName, installed); fprintf(ByName, "

%s

\n", localizedStrings[LANG_SORTED_BY_NAME]); if (!installed) generateColorIndicator(ByName); fprintf(ByName, "\n"); while (cur != NULL) { generateHtmlRpmArchRow(ByName, cur); if ((dir == NULL) && (subdir == NULL)) cur = cur->nextSoft; else cur = cur->next; } fprintf(ByName, "
\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(ByName); fclose(ByName); } /* * Dump the RPM in a subtree by Name HTML file. * One expect that the RPM files have been sorted by name. */ void dumpDirRpmByName(rpmDataPtr list, rpmDirPtr dir, char *subdir, int installed) { FILE *ByName; FILE *CurrName = NULL; rpmDataPtr cur; int i = 0; char last_letter = '\0', letter; if (!rpm2html_dump_html) return; if ((dir == NULL) && (subdir == NULL)) for (cur = list; cur != NULL; cur = cur->nextSoft) i++; else for (cur = list; cur != NULL; cur = cur->next) i++; if (i < MAX_NAME_LIST_LENGHT) { dumpDirRpmByNameFlat(list, dir, subdir, installed); return; } i = 0; cur = list; fullPathName(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYNAME_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } ByName = fopen(buf, "w"); if (ByName == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE generateHtmlHeader(ByName, "names_title", NULL); generateLinks(ByName, installed); parseNwriteTemplate(ByName, engine, "names_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary while (cur != NULL) { letter = toupper(cur->name[0]); if (letter != last_letter) { if (CurrName != NULL) { /* * Finish the previous file. */ parseNwriteTemplate(CurrName, engine, "name_end"); generateHtmlFooter(CurrName); fclose(CurrName); } if (i != 0) { snprintf(buf, sizeof(buf), "%c", last_letter); tpl_element_set(engine, "letter", buf); snprintf(buf, sizeof(buf), "%d", i); tpl_element_set(engine, "count", buf); parseNwriteTemplate(ByName, engine, "names_item"); } fullPathNameLr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYNAME_HTML], letter); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } CurrName = fopen(buf, "w"); if (CurrName == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } snprintf(buf, sizeof(buf), "%c", letter); tpl_element_set(engine, "letter", buf); generateHtmlHeader(CurrName, "name_title", NULL); generateLinks(CurrName, installed); parseNwriteTemplate(CurrName, engine, "name_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsider usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary if (!installed) generateColorIndicator(CurrName); parseNwriteTemplate(CurrName, engine, "name_begin"); i = 0; } i++; if ((i % MAX_TABLE_LENGHT) == 0) { parseNwriteTemplate(CurrName, engine, "name_end"); parseNwriteTemplate(CurrName, engine, "name_begin"); } last_letter = letter; generateHtmlRpmArchRow(CurrName, cur); if ((dir == NULL) && (subdir == NULL)) cur = cur->nextSoft; else cur = cur->next; } if (i != 0) { snprintf(buf, sizeof(buf), "%c", last_letter); tpl_element_set(engine, "letter", buf); snprintf(buf, sizeof(buf), "%d", i); tpl_element_set(engine, "count", buf); parseNwriteTemplate(ByName, engine, "names_item"); } if (CurrName != NULL) { /* * Finish the previous file. */ parseNwriteTemplate(CurrName, engine, "name_end"); generateHtmlFooter(CurrName); fclose(CurrName); } #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(ByName, localizedStrings[LANG_SORTED_BY_NAME], NULL); generateLinks(ByName, installed); fprintf(ByName, "

%s

\n", localizedStrings[LANG_SORTED_BY_NAME]); while (cur != NULL) { letter = toupper(cur->name[0]); if (letter != last_letter) { if (CurrName != NULL) { /* * Finish the previous file. */ fprintf(CurrName, "\n"); generateHtmlFooter(CurrName); fclose(CurrName); } if (i != 0) fprintf(ByName, "

%d %s %c

\n", last_letter, localizedStrings[LANG_BYNAME_HTML], i, localizedStrings[LANG_BEGINNING_LETTER], last_letter); fullPathNameLr(buf, sizeof(buf), dir, subdir, localizedStrings[LANG_BYNAME_HTML], letter); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } CurrName = fopen(buf, "w"); if (CurrName == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } snprintf(buf, sizeof(buf), "%s %c", localizedStrings[LANG_BEGINNING_LETTER], letter); generateHtmlHeader(CurrName, buf, NULL); generateLinks(CurrName, installed); fprintf(CurrName, "

%s

\n", buf); if (!installed) generateColorIndicator(CurrName); fprintf(CurrName, "\n"); i = 0; } i++; if ((i % MAX_TABLE_LENGHT) == 0) fprintf(CurrName, "
\n\n"); last_letter = letter; generateHtmlRpmArchRow(CurrName, cur); if ((dir == NULL) && (subdir == NULL)) cur = cur->nextSoft; else cur = cur->next; } if (i != 0) fprintf(ByName, "

%d %s %c

\n", last_letter, localizedStrings[LANG_BYNAME_HTML], i, localizedStrings[LANG_BEGINNING_LETTER], last_letter); if (CurrName != NULL) { /* * Finish the previous file. */ fprintf(CurrName, "
\n"); generateHtmlFooter(CurrName); fclose(CurrName); } #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(ByName); fclose(ByName); } /* * Dump the full set of RPM by Name HTML file. * One expect that the RPM files have been sorted by name. */ void dumpRpmByName(rpmDataPtr list, int installed) { if (!rpm2html_dump_html) return; if (rpm2htmlVerbose) printf("Dumping \"by name\" HTML pages\n"); dumpDirRpmByName(list, NULL, NULL, installed); } /* * Dump the index for a directory and its subdirectories. */ rpmDataPtr dumpDirIndex(rpmDirPtr dir, rpmSubdirPtr tree, rpmDataPtr list) { FILE *html; int i; if (!rpm2html_dump_html) return(list); if ((dir != NULL) && (!dir->html)) return(list); if (tree->htmlpath[0] != '\0') snprintf(buf, sizeof(buf), "%s/%s/%s", rpm2html_dir, tree->htmlpath, localizedStrings[LANG_INDEX_HTML]); else snprintf(buf, sizeof(buf), "%s/%s", rpm2html_dir, localizedStrings[LANG_INDEX_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } html = fopen(buf, "w"); if (html == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return(list); } if (tree->htmlpath[0] != '\0') snprintf(buf, sizeof(buf), "%s : %s", dir->name, tree->htmlpath); else snprintf(buf, sizeof(buf), "%s", dir->name); #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "dir", buf); generateHtmlHeader(html, "dirs_title", NULL); generateLinks(html, 0); if (((tree->rpmpath == NULL) || (tree->rpmpath[0] == '\0')) && (dir->build_tree)) { tpl_parse(engine, "dirs_parent", "p_title", 0); tpl_element_set(engine, "title", tpl_element_get(engine, "p_title")); } else tpl_element_set(engine, "title", ""); parseNwriteTemplate(html, engine, "dirs_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary if (((tree->rpmpath == NULL) || (tree->rpmpath[0] == '\0')) && (dir->build_tree)) { if (tree->color) { tpl_element_set(engine, "color", tree->color); tpl_parse(engine, "dirs_tree_color", "p_html_tree_header_color", 0); // XXX maybe not necessary to call this more than once? => optimize to call just once tpl_element_set(engine, "color", tpl_element_get(engine, "p_html_tree_header_color")); } else tpl_element_set(engine, "color", ""); tpl_element_set(engine, "url", rpm2html_url); parseNwriteTemplate(html, engine, "dirs_tree"); } generateHtmlTree(html, tree, 0, 1); tpl_element_set(engine, "color", dir->color); tpl_element_set(engine, "url", dir->ftp); if (dir->name == NULL) tpl_element_set(engine, "name", dir->ftp); else tpl_element_set(engine, "name", dir->name); parseNwriteTemplate(html, engine, "dir_begin"); if ((dir->ftpsrc != NULL) && (strcmp(dir->ftp, dir->ftpsrc))) { tpl_element_set(engine, "color", dir->color); tpl_element_set(engine, "url", dir->ftpsrc); tpl_element_set(engine, "name", dir->ftpsrc); parseNwriteTemplate(html, engine, "dir_src"); } if (dir->nb_mirrors > 0) { tpl_element_set(engine, "color", dir->color); tpl_element_set(engine, "url", dir->mirrors[0]); tpl_element_set(engine, "name", dir->mirrors[0]); parseNwriteTemplate(html, engine, "dir_mirrors"); } if (dir->nb_mirrors > 1) { tpl_element_set(engine, "color", dir->color); parseNwriteTemplate(html, engine, "dir_mirrors_list_begin"); for (i = 1;i < dir->nb_mirrors;i++) { //tpl_element_set(engine, "color", dir->color); - we've still got it tpl_element_set(engine, "url", dir->mirrors[i]); tpl_element_set(engine, "name", dir->mirrors[i]); parseNwriteTemplate(html, engine, "dir_mirrors_list_item"); } } parseNwriteTemplate(html, engine, "dir_mirrors_list_end"); #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(html, buf, NULL); generateLinks(html, 0); if (((tree->rpmpath == NULL) || (tree->rpmpath[0] == '\0')) && (dir->build_tree)) snprintf(buf, sizeof(buf), "%s", localizedStrings[LANG_TREE_HTML], localizedStrings[LANG_INDEX_HTML]); fprintf(html, "

%s

\n", buf); fprintf(html, "
    \n"); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_GROUP_HTML], localizedStrings[LANG_INDEX_GROUP]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_BYDATE_HTML], localizedStrings[LANG_INDEX_CREATION]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_BYNAME_HTML], localizedStrings[LANG_INDEX_NAME]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_VENDOR_HTML], localizedStrings[LANG_INDEX_VENDOR]); fprintf(html, "
  • \n%s %s\n", localizedStrings[LANG_LIST], localizedStrings[LANG_DISTRIB_HTML], localizedStrings[LANG_INDEX_DISTRIB]); fprintf(html, "
\n\n"); if (((tree->rpmpath == NULL) || (tree->rpmpath[0] == '\0')) && (dir->build_tree)) { fprintf(html, "

%s

\n", localizedStrings[LANG_BROWSE_TREE]); if (tree->color) fprintf(html, "
\n", tree->color); else fprintf(html, "
\n"); fprintf(html, "

", localizedStrings[LANG_TREE_HTML]); fprintf(html, "\"Directory\"", rpm2html_url); fprintf(html, " ..

\n"); } generateHtmlTree(html, tree, 0, 1); fprintf(html, "\n\n", dir->color); if (dir->name == NULL) fprintf(html, "\n", dir->color, dir->ftp, dir->ftp); else fprintf(html, "\n", dir->color, dir->ftp, dir->name); fprintf(html, "\n"); if ((dir->ftpsrc != NULL) && (strcmp(dir->ftp, dir->ftpsrc))) fprintf(html, "\n", dir->color, localizedStrings[LANG_SOURCES_REPOSITORY], dir->color, dir->ftpsrc, dir->ftpsrc); if (dir->nb_mirrors > 0) fprintf(html, "\n", dir->color, localizedStrings[LANG_LOCAL_MIRROR], dir->color, dir->mirrors[0], dir->mirrors[0]); if (dir->nb_mirrors > 1) { fprintf(html, "\n", dir->color, localizedStrings[LANG_MIRRORS]); for (i = 1;i < dir->nb_mirrors;i++) { fprintf(html, "\n", dir->color, dir->mirrors[i], dir->mirrors[i]); } } fprintf(html, "
%s%s
%s:%s
%s:%s
%s
%s
\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(html); fclose(html); rpmDistribSort(&list, 0); dumpDirRpmByDistribs(list, dir, tree->htmlpath, 0); rpmGroupSort(&list, 0); dumpDirRpmByGroups(list, dir, tree->htmlpath, 0); rpmVendorSort(&list, 0); dumpDirRpmByVendors(list, dir, tree->htmlpath, 0); rpmDateSort(&list, 0); dumpDirRpmByDate(list, dir, tree->htmlpath, 0); rpmNameSort(&list, 0); dumpDirRpmByName(list, dir, tree->htmlpath, 0); return(list); } /* * Dump a real tree subdir title with links to parents and whole tree. */ void rpmDumpHtmlRealTreeTitle(FILE *subdir, rpmDirPtr dir, char *buffer) { #ifndef HAVE_LIBTEMPLATE char buf[3000]; #endif char tmp[1000]; char path[1000]; char loc[200]; int i = 0, j = 0, k = 0; /* indexes for buffer, loc and path resp. */ int l = 0; /* index for directory depth */ /* link for the root */ #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "name", dir->name); parseNwriteTemplate(subdir, engine, "realtree_title_header"); while (buffer[i] != '\0') { if (buffer[i] == '_') { loc[j] = '\0'; path[k++] = '_'; path[k] = '\0'; tpl_element_set(engine, "path", path); if (l++) { snprintf(tmp, sizeof(tmp), "/%s", loc); tpl_element_set(engine, "name", tmp); } else tpl_element_set(engine, "name", loc); parseNwriteTemplate(subdir, engine, "realtree_title_link"); j = 0; } else { loc[j++] = buffer[i]; path[k++] = buffer[i]; } i++; } parseNwriteTemplate(subdir, engine, "realtree_title_footer"); #else // ifdef HAVE_LIBTEMPLATE snprintf(buf, sizeof(buf), "/", localizedStrings[LANG_TREE_HTML]); while (buffer[i] != '\0') { if (buffer[i] == '_') { loc[j] = '\0'; path[k++] = '_'; path[k] = '\0'; if (l++) snprintf(tmp, sizeof(tmp), " /%s", path, localizedStrings[LANG_TREE_HTML], loc); else snprintf(tmp, sizeof(tmp), " %s", path, localizedStrings[LANG_TREE_HTML], loc); strcat(buf, tmp); j = 0; } else { loc[j++] = buffer[i]; path[k++] = buffer[i]; } i++; } fprintf(subdir, "

%s : %s

\n", localizedStrings[LANG_TREE_HTML], dir->name, buf); #endif // ifdef HAVE_LIBTEMPLATE } /* * Dump a real tree subdir. */ void rpmDumpHtmlRealTree(FILE *html, rpmDirPtr dir, rpmRealDirPtr tree, char *buffer, int index) { FILE *subdir; char buf[1000]; int has_subdir = 0; int has_file = 0; int i; if (!rpm2html_dump_html) return; if ((dir != NULL) && (!dir->html)) return; if (dir->subdir) snprintf(buf, sizeof(buf), "%s/%s/%s%s", rpm2html_dir, dir->subdir, buffer, localizedStrings[LANG_TREE_HTML]); else snprintf(buf, sizeof(buf), "%s/%s%s", rpm2html_dir, buffer, localizedStrings[LANG_TREE_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } subdir = fopen(buf, "w"); if (subdir == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "dir", buffer); // XXX maybe use a nices title than 'usr_share_xyz_' etc. generateHtmlHeader(subdir, "realtree_title", NULL); generateLinks(subdir, 1); rpmDumpHtmlRealTreeTitle(subdir, dir, buffer); for (i = 0;i < tree->nb_elem;i++) { if (tree->flags[i] & RPM_ELEM_DIRECTORY) { if (!has_subdir) parseNwriteTemplate(html, engine, "realtree_item_begin"); has_subdir++; tpl_element_set(engine, "url", buffer); tpl_element_set(engine, "suburl", tree->names[i]); tpl_element_set(engine, "name", tree->names[i]); parseNwriteTemplate(html, engine, "realtree_item_item"); snprintf(&buffer[index], 500, "%s_", tree->names[i]); rpmDumpHtmlRealTree(html, dir, tree->elems[i], buffer, strlen(buffer)); buffer[index] = '\0'; if (!has_file) parseNwriteTemplate(subdir, engine, "realtree_subitem_begin"); has_file++; tpl_element_set(engine, "url", buffer); tpl_element_set(engine, "suburl", tree->names[i]); tpl_element_set(engine, "rpm2html_url", rpm2html_url); tpl_element_set(engine, "name", tree->names[i]); parseNwriteTemplate(subdir, engine, "realtree_subitem_dir"); } else { if (!has_file) parseNwriteTemplate(subdir, engine, "realtree_subitem_begin"); has_file++; tpl_element_set(engine, "url", generateHtmlRpmAnchor(tree->elems[i])); tpl_element_set(engine, "name", tree->names[i]); parseNwriteTemplate(subdir, engine, "realtree_subitem_file"); } } if (has_subdir) parseNwriteTemplate(html, engine, "realtree_item_end"); if (has_file) parseNwriteTemplate(subdir, engine, "realtree_subitem_end"); #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(subdir, buffer, NULL); // XXX maybe use a nices title than 'usr_share_xyz_' etc. generateLinks(subdir, 1); rpmDumpHtmlRealTreeTitle(subdir, dir, buffer); for (i = 0;i < tree->nb_elem;i++) { if (tree->flags[i] & RPM_ELEM_DIRECTORY) { if (!has_subdir) fprintf(html, "
    \n"); has_subdir++; fprintf(html, "
  • %s\n", buffer, tree->names[i], localizedStrings[LANG_TREE_HTML], tree->names[i]); snprintf(&buffer[index], 500, "%s_", tree->names[i]); rpmDumpHtmlRealTree(html, dir, tree->elems[i], buffer, strlen(buffer)); buffer[index] = '\0'; if (!has_file) fprintf(subdir, "\n"); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(subdir); fclose(subdir); } /* * Dump a real tree root. */ void rpmDumpHtmlRealRoot(rpmDirPtr dir) { FILE *html; char buf[1000]; rpmRealDirPtr tree; if (!rpm2html_dump_html) return; if ((dir != NULL) && (!dir->html)) return; if (dir == NULL) return; tree = dir->root; if (tree == NULL) return; if (dir->subdir) snprintf(buf, sizeof(buf), "%s/%s/Root%s", rpm2html_dir, dir->subdir, localizedStrings[LANG_TREE_HTML]); else snprintf(buf, sizeof(buf), "%s/Root%s", rpm2html_dir, localizedStrings[LANG_TREE_HTML]); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", buf); } html = fopen(buf, "w"); if (html == NULL) { fprintf(stderr, "Couldn't save to file %s: %s\n", buf, strerror(errno)); return; } snprintf(buf, sizeof(buf), "%s", dir->name); #ifdef HAVE_LIBTEMPLATE tpl_element_set(engine, "dir", buf); generateHtmlHeader(html, "realroot_title", NULL); generateLinks(html, 1); parseNwriteTemplate(html, engine, "realroot_header"); // XXX ugly hack: here we assume that generateHtmlHeader() alredy filled proper value into "title" element of engine // later reconsicer usage of rpm2html only with libtemplate and then a) remove all those ifdefs and b) restructure html.c so as this ugy hack is not necessary buf[0] = 0; rpmDumpHtmlRealTree(html, dir, tree, buf, 0); #else // ifdef HAVE_LIBTEMPLATE generateHtmlHeader(html, buf, NULL); generateLinks(html, 1); fprintf(html, "

    %s

    \n", buf); buf[0] = 0; rpmDumpHtmlRealTree(html, dir, tree, buf, 0); #endif // ifdef HAVE_LIBTEMPLATE generateHtmlFooter(html); fclose(html); } rpm2html-1.11.2/language.c0000664000076400007640000001633711452634006013775 0ustar hanyhany/* * language.c: code for the Localization support. * * See Copyright for the status of this software. * * $Id: language.c,v 1.31 2010/10/05 14:36:54 hany Exp $ */ #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include "rpm2html.h" #include "rpmdata.h" #include "html.h" char *localizedStrings[] = { ".html", /* HTML files suffix */ "Generated by", "index.html", "Groups.html", "ByDate.html", "ByName.html", "Vendors.html", "Distribs.html", "Welcome to the RPM repository on", "

    \n\ rpm2html automatically generates Web pages describing a set of\n\ RPM packages.

    \n\

    \n\ \n\ The Rpmfind tool allows automate the search of packages from\n\ the RPM Database or maintain your system up-to-date in a more automated way.\n\

    \n\ The goals of rpm2html are also to identify the dependencies between\n\ various packages and to find the package(s) providing the resources\n\ needed to install a given package. Every package is analyzed to\n\ retrieve its dependencies and the resources it offers. These\n\ relationships are expressed using hyperlinks in the generated\n\ pages. Finding the package providing the resource you need is just a\n\ matter of a few clicks!

    \n\

    Check the FAQ\n\ in case of problems with rpm2html or rpmfind.\n\

    \n\ The proper working of the rpm2html tools requires the package maintainer\n\ to properly comment their RPM(s), if you maintain packages, make sure\n\ that the information are provided adequately (URL, email, ...).

    \n\

    Learn how to \n\ build your own mirror of this site. \n\ Do not try to mirror it with a Web copy tool\n\

    \n", "This archive hosts %d RPMs representing %d MBytes of data", "On this machine %d RPMs are installed representing %d MBytes of data", "The list of ", "RPM indexed by category", "RPM indexed by date of creation", "RPM indexed by name", "RPM indexed by maintainer", "RPM indexed by distribution", "RPM indexed by date of installation", "Repository for sources", "Local mirror", "Mirrors", "Generation took", "seconds", "Welcome to the RPM description of", "From", "Name", "Distribution", "Version", "Vendor", "Release", "Build date", "Install date", "Group", "Build host", "Size", "Source RPM", "Packager", "Url", "Summary", "Provides", "Requires", "Copyright", "Files", "No Filelist in the Package !", "No summary !", "RPM resource", "Provided by", "index by Group", "RPM of Group", "index by Distribution", "RPM of Distribution", "index by Vendor", "RPM shipped by", "index by creation date", "index by installation date", "RPMs less than three days old", "RPMs less than one week old", "RPMs less than two weeks old", "RPMs less than one month old", "RPMs more than 1 months old", "RPMs installed less than three days ago", "RPMs installed less than one week ago", "RPMs installed less than two weeks ago", "RPMs installed less than one month ago", "RPMs installed more than 1 months ago", "index by Name", "No description !", "Unknown", "None", "unknown/group", "unknown.host", "Index", "Packages beginning with letter", "Warning: this package does not export valid resources lists", "Try to pick another", "More", "Changelog", "Sub Directories", "Tree.html", "Browse the distribution tree", "
    \n\ \n\ \n\
    \n", "Signatures", "

    Available as an rdf channel

    \n" }; #define NB_STRINGS (sizeof(localizedStrings)/sizeof(char *)) /**************************************************************** * * * The language file parser * * * ****************************************************************/ /* * A few macro needed to help building the parser */ #define IS_BLANK(ptr) \ (((*(ptr)) == ' ') || ((*(ptr)) == '\b') || \ ((*(ptr)) == '\n') || ((*(ptr)) == '\r')) #define SKIP_BLANK(ptr) \ { while (((*(ptr)) == ' ') || ((*(ptr)) == '\b') || \ ((*(ptr)) == '\n') || ((*(ptr)) == '\r')) ptr++; } #define GOTO_EQL(ptr) \ { while (((*(ptr)) != '\0') && ((*(ptr)) != '=') && \ ((*(ptr)) != '\n') && ((*(ptr)) != '\r')) ptr++; } #define GOTO_EOL(ptr) \ { while (((*(ptr)) != '\0') && \ ((*(ptr)) != '\n') && ((*(ptr)) != '\r')) ptr++; } /* * parse a language file */ int readLanguageFile(char *filename) { FILE *input; char *str; char line[1000]; char buffer[50000]; int currentString; int len; input = fopen(filename, "r"); if (input == NULL) { fprintf(stderr, "Cannot read language from %s :\n", filename); perror("fopen failed"); return -1; } /* * all the localized strings are filled in one after the other. */ buffer[0] = '\0'; currentString = 0; while (1) { /* * read one line */ if (fgets(&line[0], sizeof(line) - 1, input) == NULL) break; str = &line[0]; line[sizeof(line) - 1] = '\0'; len = strlen(line); if ((len > 0) && (line[len - 1] == '\n')) line[len - 1] = '\0'; SKIP_BLANK(str) /* * Comment starts with a semicolumn. */ if (*str == ';') continue; /* * an empty line is a field separator. */ if (*str == '\0') { if (buffer[0] != '\0') { /* * Check for localizedStrings overflow. */ if (currentString >= NB_STRINGS) { fprintf(stderr, "File %s contains too many localized messages (%d expected)\n", filename, NB_STRINGS); break; } /* * the last paragraph correspond to the new localized * string. Replace the old one and reset the buffer. */ localizedStrings[currentString] = xmlStrdup(buffer); currentString++; buffer[0] = '\0'; } continue; } /* * Aggregate the current line to the buffer. */ if (buffer[0] == '\0') strcpy(buffer, line); else { /* * this is a multiline text field */ strcat(buffer, "\n"); strcat(buffer, line); } } fclose(input); return (0); } /* * dump the internal set of string to an external language file. */ int writeLanguageFile(char *filename) { FILE *output; int currentString; output = fopen(filename, "w"); if (output == NULL) { fprintf(stderr, "Cannot write language to %s :\n", filename); perror("fopen failed"); return -1; } fprintf(output, ";\n; Automatically generated %s %s language file\n;\n", RPM2HTML_NAME, RPM2HTML_VER); for (currentString = 0; currentString < NB_STRINGS; currentString++) { fprintf(output, "%s\n\n", localizedStrings[currentString]); } fclose(output); return (0); } rpm2html-1.11.2/memory.c0000664000076400007640000002407411452634006013517 0ustar hanyhany/* * memory.c: a memory allocator wrapper. * * daniel@veillard.com */ #include #include #include #include #include #include "memory.h" #ifndef NO_DEBUG_MEMORY #ifdef debugMalloc #undef debugMalloc #endif #ifdef debugRealloc #undef debugRealloc #endif #ifdef debugStrdup #undef debugStrdup #endif extern void debugMemoryDump(void); extern int debugInitMemory(void); /* * Each of the blocks allocated begin with a header containing information */ #define MEMTAG 0x5aa5 #define MALLOC_TYPE 1 #define REALLOC_TYPE 2 #define STRDUP_TYPE 3 typedef struct memnod { unsigned int mh_tag; unsigned int mh_type; unsigned long mh_number; size_t mh_size; #ifdef MEM_LIST struct memnod *mh_next; struct memnod *mh_prev; #endif const char *mh_file; unsigned int mh_line; } MEMHDR; #ifdef SUN4 #define ALIGN_SIZE 16 #else #define ALIGN_SIZE sizeof(double) #endif #define HDR_SIZE sizeof(MEMHDR) #define RESERVE_SIZE (((HDR_SIZE + (ALIGN_SIZE-1)) \ / ALIGN_SIZE ) * ALIGN_SIZE) #define CLIENT_2_HDR(a) ((MEMHDR *) (((char *) (a)) - RESERVE_SIZE)) #define HDR_2_CLIENT(a) ((void *) (((char *) (a)) + RESERVE_SIZE)) static int initialized = 0; static unsigned long debugMemSize = 0; static unsigned long debugMemSizeMeg = 0; static int block=0; #ifdef MEM_LIST static MEMHDR *memlist = NULL; #endif void mem_tag_error(void *addr); #ifdef MEM_LIST void debugmem_list_add(MEMHDR *); void debugmem_list_delete(MEMHDR *); #endif #define Mem_Tag_Err(a) mem_tag_error(a); /****************************** #define TEST_POINT { \ unsigned long meg = debugMemSize >> 20; \ if (meg != debugMemSizeMeg) debugMemoryDump(); \ debugMemSizeMeg = meg; \ } ******************************/ #ifndef TEST_POINT #define TEST_POINT #endif /* * FUNCTION : debugMalloc * PURPOSE : a malloc() equivalent supporting multi-thread access. * INPUT : an int specifying the size in byte to allocate. * OUTPUT : none * RESULT : a pointer to the allocated area or NULL in case of * lack of memory space. * HISTORY : */ void * debugMallocLoc(int size, const char * file, int line) { MEMHDR *p; if (!initialized) debugInitMemory(); #ifdef DEBUG_MEMORY fprintf(stderr, "Malloc(%d)\n",size); #endif TEST_POINT p = (MEMHDR *) malloc(RESERVE_SIZE+size); if (!p) { fprintf(stderr, "debugMalloc : Out of free space\n"); debugMemoryDump(); } p->mh_tag = MEMTAG; p->mh_number = ++block; p->mh_size = size; p->mh_type = MALLOC_TYPE; p->mh_file = file; p->mh_line = line; debugMemSize += size; #ifdef MEM_LIST debugmem_list_add(p); #endif #ifdef DEBUG_MEMORY fprintf(stderr, "Malloc(%d) Ok\n",size); #endif TEST_POINT return(HDR_2_CLIENT(p)); } void * debugMalloc(int size) { return(debugMallocLoc(size, "none", 0)); } /* * debugRealloc : realloc() equivalent. */ /* * FUNCTION : debugRealloc * PURPOSE : a realloc() equivalent supporting multi-thread access. * INPUT : the initial memory block pointer, and the new size. * OUTPUT : none * RESULT : a pointer to the new area or NULL in case of allocation * error. * HISTORY : */ void * debugReallocLoc(void *ptr,int size, const char * file, int line) { MEMHDR *p; unsigned long number; if (!initialized) debugInitMemory(); TEST_POINT p = CLIENT_2_HDR(ptr); number = p->mh_number; if (p->mh_tag != MEMTAG) { Mem_Tag_Err(p); goto error; } p->mh_tag = ~MEMTAG; debugMemSize -= p->mh_size; #ifdef MEM_LIST debugmem_list_delete(p); #endif p = (MEMHDR *) realloc(p,RESERVE_SIZE+size); if (!p) { goto error; } p->mh_tag = MEMTAG; p->mh_number = number; p->mh_type = REALLOC_TYPE; p->mh_size = size; p->mh_file = file; p->mh_line = line; debugMemSize += size; #ifdef MEM_LIST debugmem_list_add(p); #endif TEST_POINT return(HDR_2_CLIENT(p)); error: return(NULL); } void * debugRealloc(void *ptr,int size) { return(debugReallocLoc(ptr, size, "none", 0)); } /* * debugFree : free() equivalent with error code ! */ /* * FUNCTION : debugFree * PURPOSE : an equivalent of free() allowing multi-thread access. * INPUT : the pointer to the memory block allocated using the * debugMalloc or debugRealloc functions. * OUTPUT : none * RESULT : * 0 : normal result * EMACHINTER_INVALID_POINTER : the pointer wasn't previously * allocated by debugMalloc or debugRealloc. * or initialization or internal error. * HISTORY : */ int debugFree(void *ptr) { MEMHDR *p; int ret; if (!initialized) debugInitMemory(); TEST_POINT p = CLIENT_2_HDR(ptr); if (p->mh_tag != MEMTAG) { Mem_Tag_Err(p); ret = -1; goto error; } p->mh_tag = ~MEMTAG; debugMemSize -= p->mh_size; #ifdef MEM_LIST debugmem_list_delete(p); #endif free(p); TEST_POINT ret = 0; return(ret); error: return(ret); } /* * debugStrdup : strdup() equivalent. */ /* * FUNCTION : debugStrdup * PURPOSE : a strdup() equivalent supporting multi-thread access. * INPUT : the null terminated string to duplicate. * OUTPUT : none * RESULT : a T_Char pointer referencing the new string or NULL * if allocation error occurs. * HISTORY : */ char * debugStrdupLoc(const char *str, const char *file, int line) { char *s; size_t size = strlen(str) + 1; MEMHDR *p; if (!initialized) debugInitMemory(); TEST_POINT p = (MEMHDR *) malloc(RESERVE_SIZE+size); if (!p) { goto error; } p->mh_tag = MEMTAG; p->mh_number = ++block; p->mh_size = size; p->mh_type = STRDUP_TYPE; p->mh_file = file; p->mh_line = line; debugMemSize += size; #ifdef MEM_LIST debugmem_list_add(p); #endif s = HDR_2_CLIENT(p); if (s != NULL) strcpy(s,str); else goto error; TEST_POINT return(s); error: return(NULL); } char * debugStrdup(const char *str) { return(debugStrdupLoc(str, "none", 0)); } /* * FUNCTION : debugMemUsed * PURPOSE : returns the amount of memory currenly allocated using * debugMalloc, debugRealloc and debugStrdup. * INPUT : none * OUTPUT : none * RESULT : a 32 bits integer representing the amount of memory allocated. * HISTORY : */ int debugMemUsed(void) { if (!initialized) debugInitMemory(); return(debugMemSize); } /* * FUNCTION : debugMemDisplay * PURPOSE : show in-extenso the memory allocated using * debugMalloc, debugRealloc and debugStrdup. * INPUT : a FILE descriptor used as the output file, if NULL * the result is written to the file .memorylist ... * OUTPUT : * RESULT : * 0 : normal result * HISTORY : */ void debugMemDisplay(FILE *fp) { if (!initialized) debugInitMemory(); #ifdef MEM_LIST MEMHDR *p; int idx; fprintf(fp," MEMORY ALLOCATED : %lu\n",debugMemSize); fprintf(fp,"BLOCK NUMBER SIZE TYPE\n"); idx = 0; p = memlist; while (p) { fprintf(fp,"%-5u %6lu %6u ",idx++,p->mh_number,p->mh_size); switch (p->mh_type) { case STRDUP_TYPE:fprintf(fp,"strdup() in ");break; case MALLOC_TYPE:fprintf(fp,"malloc() in ");break; case REALLOC_TYPE:fprintf(fp,"realloc() in ");break; default:fprintf(fp," ??? in ");break; } if (p->mh_file != NULL) fprintf(fp,"%s(%d)", p->mh_file, p->mh_line); if (p->mh_tag != MEMTAG) fprintf(fp," INVALID"); fprintf(fp,"\n"); p = p->mh_next; } #else fprintf(fp,"Memory list not compiled (MEM_LIST not defined !)\n"); #endif } #ifdef MEM_LIST void debugmem_list_add(MEMHDR *p) { p->mh_next = memlist; p->mh_prev = NULL; if (memlist) memlist->mh_prev = p; memlist = p; #ifdef MEM_LIST_DEBUG if (stderr) Mem_Display(stderr); #endif } void debugmem_list_delete(MEMHDR *p) { if (p->mh_next) p->mh_next->mh_prev = p->mh_prev; if (p->mh_prev) p->mh_prev->mh_next = p->mh_next; else memlist = p->mh_next; #ifdef MEM_LIST_DEBUG if (stderr) Mem_Display(stderr); #endif } #endif /* * mem_tag_error : internal error function. */ void mem_tag_error(void *p) { if (!initialized) debugInitMemory(); fprintf(stderr, "Memory tag error occurs :%p \n\t bye\n", p); #ifdef MEM_LIST if (stderr) debugMemDisplay(stderr); #endif } FILE *debugMemoryDumpFile = NULL; /* * FUNCTION : debugMemoryDump * PURPOSE : saves information concerning memory allocation * in a ".memdump" file. * INPUT : none * OUTPUT : none * RESULT : none * HISTORY : */ void debugMemoryDump(void) { FILE *dump; if (!initialized) debugInitMemory(); dump = fopen(".memdump", "w"); if (dump == NULL) debugMemoryDumpFile = stdout; else debugMemoryDumpFile = dump; debugMemDisplay(debugMemoryDumpFile); if (dump != NULL) fclose(dump); } /**************************************************************** * * * Initialization Routines * * * ****************************************************************/ /* * debugInitMemory : initialize the memory allocator. */ /* * FUNCTION : debugInitMemory * PURPOSE : initialize the memory allocator. * INPUT : none * OUTPUT : none * RESULT : * 0 : normal result * HISTORY : */ int debugInitMemory(void) { int ret; xmlFreeFunc freeFunc; xmlMallocFunc mallocFunc; xmlReallocFunc reallocFunc; xmlStrdupFunc strdupFunc; #ifdef DEBUG_MEMORY fprintf(stderr, "debugInitMemory() Ok\n"); #endif xmlMemSetup(debugFree, debugMalloc, debugRealloc, debugStrdup); xmlMemGet(&freeFunc, &mallocFunc, &reallocFunc, &strdupFunc); if ((freeFunc != debugFree) || (mallocFunc != debugMalloc) || (reallocFunc != debugRealloc) || (strdupFunc != debugStrdup)) { fprintf(stderr, "debugInitMemory: xml memory allocator problem\n"); exit(1); } initialized = 1; ret = 0; return(ret); } #endif /* ! NO_DEBUG_MEMORY */ rpm2html-1.11.2/rdf_api.c0000664000076400007640000003622111452634006013610 0ustar hanyhany/* * rdf_api.h : implementation of methods to read and write RDF schemas * * See Copyright for the status of this software. * * $Id: rdf_api.c,v 1.30 2010/10/05 14:36:54 hany Exp $ */ #include "config.h" #include #include #include #include "rpm2html.h" #include "rpmdata.h" #include "rdf_api.h" /* * this module has been converted to libxml2, you need libxml2-devel or * older to compile it. */ #include #include #include #include /* * Reading an RDF schema stored in a file, this just build the * document tree, and check that it's an RDF:RDf element. */ rdfSchema rdfRead(const char *filename) { xmlDocPtr res = NULL; int ret; xmlParserCtxtPtr ctxt; xmlSAXHandler silent, *old; xmlNodePtr root; /* * Do a silent call to the XML parser. */ ctxt = xmlCreateFileParserCtxt(filename); if (ctxt == NULL) return(NULL); memcpy(&silent, ctxt->sax, sizeof(silent)); old = ctxt->sax; silent.error = NULL; silent.warning = NULL; silent.fatalError = NULL; ctxt->sax = &silent; xmlParseDocument(ctxt); ret = ctxt->wellFormed; res = ctxt->myDoc; ctxt->sax = old; xmlFreeParserCtxt(ctxt); /* * This is not well formed. */ if (!ret) { xmlFreeDoc(res); fprintf(stderr, "rdfRead %s: resource is not wellformed XML\n", filename); return(NULL); } root = xmlDocGetRootElement(res); if (root == NULL) { fprintf(stderr, "rdfRead %s: tree is empty\n", filename); xmlFreeDoc(res); return(NULL); } if (strcmp(root->name, "RDF")) { fprintf(stderr, "rdfRead %s: not an RDF file\n", filename); xmlFreeDoc(res); return(NULL); } return((rdfSchema) res); } /* * Writing an RDF schema to a file, this just save the * document tree as an XML document. */ void rdfWrite(rdfSchema rdf, const char *filename) { FILE *output; output = fopen(filename, "w"); if (output == NULL) { fprintf(stderr, "rdfWrite : couldn't save to file %s: %s\n", filename, strerror(errno)); return; } xmlDocFormatDump(output, (xmlDocPtr) rdf, 1); fclose(output); } /* * Writing an RDF schema to a memory buffer, this just save the * document tree as an XML document. */ void rdfWriteMemory(rdfSchema rdf, char **buffer, int *size) { xmlDocDumpMemory((xmlDocPtr) rdf, (xmlChar **) buffer, size); } /* * Creating an RDF schema tree in memory. */ rdfSchema rdfNewSchema() { xmlDocPtr res; xmlNsPtr rdf; res = xmlNewDoc("1.0"); res->xmlRootNode = xmlNewDocNode(res, NULL, "RDF", NULL); rdf = xmlNewNs(res->xmlRootNode, "http://www.w3.org/TR/WD-rdf-syntax#", "RDF"); rdf = xmlNewNs(res->xmlRootNode, "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf"); xmlSetNs(res->xmlRootNode, rdf); return((rdfSchema) res); } /* * Adding a new namespace to an RDF schema. */ rdfNamespace rdfNewNamespace(rdfSchema rdf, const char *url, const char *namespace) { xmlNodePtr root; xmlNsPtr ns = NULL; root = xmlDocGetRootElement(rdf); if (root != NULL) ns = xmlNewNs(root, url, namespace); return((rdfNamespace) ns); } /* * Get a namespace associated to an RDF schema. * Should be stored either as an old NS on the document or as local * namespace stored on the root element. */ rdfNamespace rdfGetNamespace(rdfSchema rdf, const char *href) { xmlNodePtr root; root = xmlDocGetRootElement(rdf); return((rdfNamespace) xmlSearchNsByHref(rdf, root, href)); } /* * Get the RDF namespace associated to an RDF schema. */ rdfNamespace rdfGetRdfNamespace(rdfSchema rdf) { rdfNamespace ns; ns = rdfGetNamespace(rdf, "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); if (ns != NULL) return((rdfNamespace) ns); ns = rdfGetNamespace(rdf, "http://www.w3.org/TR/WD-rdf-syntax#"); if (ns != NULL) return((rdfNamespace) ns); /* create it ! */ return(rdfNewNamespace(rdf, "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf")); } /* * Destroying an RDF schema in memory. */ void rdfDestroySchema(rdfSchema rdf) { xmlFreeDoc((xmlDocPtr) rdf); } /** ** An RDF schema is a collection of RDF descriptions. ** The following are used to browse the list. **/ /* First item */ rdfDescription rdfFirstDescription(rdfSchema schema) { xmlNodePtr tree; rdfNamespace rdfNs; rdfNs = rdfGetRdfNamespace(schema); tree = xmlDocGetRootElement(schema); if (tree == NULL) return(NULL); tree = tree->xmlChildrenNode; while (tree != NULL) { if ((tree->ns == rdfNs) && (!strcmp(tree->name, "Description"))) return(tree); tree = tree->next; } return(NULL); } /* Iteration : next item */ rdfDescription rdfNextDescription(rdfDescription desc) { rdfNamespace rdfNs; if (desc == NULL) return(NULL); rdfNs = desc->ns; desc = desc->next; while (desc != NULL) { if ((desc->ns == rdfNs) && (!strcmp(desc->name, "Description"))) return(desc); desc = desc->next; } return(NULL); } /* * Add an RDF description to an RDF schema, it just link it * the top level node of the description and requires further * action to fill it with the pertinent information. */ rdfDescription rdfAddDescription(rdfSchema schema, const char *id, const char *about) { xmlNodePtr tree; xmlNodePtr root; root = xmlDocGetRootElement(schema); tree = xmlNewChild(root, NULL, "Description", NULL); if (id != NULL) { xmlNewProp(tree, "ID", id); } if (about != NULL) { if (oldXMLWDcompatibility) { rdfNamespace ns; char *buf; ns = rdfGetRdfNamespace(schema); buf = (char *) xmlMalloc(strlen(ns->prefix) + 10); sprintf(buf, "%s:HREF", ns->prefix); xmlNewProp(tree, buf, about); xmlFree(buf); } else { xmlNewProp(tree, "about", about); } } return((rdfDescription) tree); } /* * Read the attributes of a Description node. */ char *rdfGetDescriptionId(rdfSchema schema, rdfDescription desc) { char *res; res = (char *) xmlGetProp(desc, "ID"); return(res); } char *rdfGetDescriptionAbout(rdfSchema schema, rdfDescription desc) { char *res; rdfNamespace ns; char *buf; res = (char *) xmlGetProp(desc, "about"); if (res != NULL) return(res); /* * Maintain compatibility with old "RDF:HREF" */ res = (char *) xmlGetProp(desc, "HREF"); if (res != NULL) return(res); ns = rdfGetRdfNamespace(schema); buf = (char *) xmlMalloc(strlen(ns->prefix) + 10); sprintf(buf, "%s:HREF", ns->prefix); res = (char *) xmlGetProp(desc, buf); xmlFree(buf); return(res); } /* * Read any resource associated to an element. */ char *rdfGetElementResource(rdfSchema schema, rdfElement elem) { char *res; res = (char *) xmlGetProp(elem, "resource"); return(res); } void rdfSetElementResource(rdfSchema schema, rdfElement elem, const char *URI) { xmlSetProp(elem, "resource", URI); } /** ** Routines to read/write final values. **/ /* * browse the various property pertaining to this description, * and return the value which can be either a text (RDF_LEAF) * or an rdfElement (RDF_BAG, RDF_SEQ, RDF_ALT, RDF_DESC). * Having both reflect an invalid RDF document (while valid from * XML point of view). * This routine tries to ajust in case a request is done with or * or without a ns present or not on the node, and if the names * matches. * e.g. a request for Name may return BIB:Name * or a request for BIB:Name may return Name * if the exact match is not found. * * Return -1 if not found * 0 if a single value is found * RDF_xxx if a node is found. */ int rdfGetValue(rdfDescription desc, const char *property, rdfNamespace ns, char **value, rdfElement *elem){ rdfElement list = desc->xmlChildrenNode; rdfElement best = NULL; int approx = 0; if (value != NULL) *value = NULL; if (elem != NULL) *elem = NULL; while (list != NULL) { if ((list->ns == ns) && (!strcmp(list->name, property))) { /* * Found a perfect match, return it ! */ if (value != NULL) { *value = xmlNodeListGetString(desc->doc, list->xmlChildrenNode, 1); } if (elem != NULL) { *elem = list->xmlChildrenNode; while ((*elem != NULL) && (xmlIsBlankNode(*elem))) *elem = (*elem)->next; } if (!strcmp(list->name, "Bag")) return(RDF_BAG); if (!strcmp(list->name, "Seq")) return(RDF_SEQ); if (!strcmp(list->name, "Alt")) return(RDF_ALT); if (!strcmp(list->name, "Description")) return(RDF_DESC); return(0); } else if (((list->ns == NULL) || (ns == NULL)) && (!strcmp(list->name, property))) { /* * If more than one "best" match exists, ignore them ! */ if (approx) { best = NULL; } else { best = list; approx = 1; } } list = list->next; } if (best != NULL) { if (value != NULL) { *value = xmlNodeListGetString(desc->doc, best->xmlChildrenNode, 1); } if (elem != NULL) *elem = best->xmlChildrenNode; if (!strcmp(best->name, "Bag")) return(RDF_BAG); if (!strcmp(best->name, "Seq")) return(RDF_SEQ); if (!strcmp(best->name, "Alt")) return(RDF_ALT); if (!strcmp(best->name, "Description")) return(RDF_DESC); return(0); } return(-1); } /* * browse the various property pertaining to this description, * update the value if found on a text mode, otherwise append * a new property at the end of the list. * Note that contrary to GetValue, the check is absolute ! */ void rdfSetValue(rdfDescription desc, const char *property, rdfNamespace ns, const char *value) { xmlChar *tmp; rdfElement list = desc->xmlChildrenNode; /* * Search the property. */ while (list != NULL) { if ((list->ns == ns) && (!strcmp(list->name, property))) { /* * Property was found, update it ! */ if (list->xmlChildrenNode != NULL) xmlFreeNodeList(list->xmlChildrenNode); tmp = xmlEncodeEntitiesReentrant(desc->doc, value); list->xmlChildrenNode = xmlStringGetNodeList(desc->doc, tmp); xmlFree(tmp); return; } list = list->next; } /* * Create a new property. */ tmp = xmlEncodeEntitiesReentrant(desc->doc, value); xmlNewChild(desc, ns, property, tmp); xmlFree(tmp); } /* * browse the various property pertaining to this description, * and if found remove and destroy the subtree. */ void rdfRemoveProperty(rdfDescription desc, const char *property, rdfNamespace ns) { rdfElement list = desc->xmlChildrenNode; rdfElement prev = NULL; /* * Search the property. */ while (list != NULL) { if ((list->ns == ns) && (!strcmp(list->name, property))) { /* * Property was found, delete it ! */ if (prev == NULL) desc->xmlChildrenNode = list->next; else prev->next = list->next; list->next = NULL; xmlFreeNode(list); return; } prev = list; list = list->next; } } /** ** Routines to read/write bags **/ /* * Create a new Bag. */ rdfBag rdfBagCreate(rdfSchema schema, rdfDescription desc, const char *property, rdfNamespace ns) { rdfElement cur; rdfNamespace rdf; rdf = rdfGetRdfNamespace(schema); cur = xmlNewChild(desc, ns, property, NULL); cur = xmlNewChild(cur, rdf, "Bag", NULL); return(cur); } /* * Add an element to a bag. */ rdfElement rdfBagAddValue(rdfBag bag, const char *property, rdfNamespace ns, const char *value, rdfElement elem) { rdfElement cur; if (value != NULL) cur = xmlNewChild(bag, ns, property, (char *) value); else { cur = xmlNewDocNode(bag->doc, ns, property, NULL); if (elem != NULL) xmlAddChild(cur, elem); xmlAddChild(bag, cur); } return(cur); } /** ** Routines to walk bags and sequences. **/ rdfElement rdfFirstChild(rdfElement bag) { rdfElement elem = bag->xmlChildrenNode; while ((elem != NULL) && (xmlIsBlankNode(elem))) elem = elem->next; return(elem); } rdfElement rdfNextElem(rdfElement desc) { rdfElement elem = desc->next; while ((elem != NULL) && (xmlIsBlankNode(elem))) elem = elem->next; return(elem); } /** ** Direct access to Element values. **/ int rdfElemGetType(rdfElement elem) { if (!strcmp(elem->name, "Bag")) return(RDF_BAG); if (!strcmp(elem->name, "Seq")) return(RDF_SEQ); if (!strcmp(elem->name, "Alt")) return(RDF_ALT); if (!strcmp(elem->name, "Description")) return(RDF_DESC); return(0); } char *rdfElemGetValue(rdfElement elem) { return(xmlNodeListGetString(elem->doc, elem->xmlChildrenNode, 1)); } char *rdfElemGetPropertyName(rdfElement elem) { return(strdup(elem->name)); } rdfNamespace rdfElemGetNamespace(rdfElement elem) { return(elem->ns); } void rdfElemSetValue(rdfElement elem, const char *value) { xmlChar *tmp; if (elem->xmlChildrenNode != NULL) { fprintf(stderr, "rdfElemSetValue : elem %s has xmlChildrenNode\n", elem->name); return; } if (elem->xmlChildrenNode != NULL) xmlFreeNodeList(elem->xmlChildrenNode); tmp = xmlEncodeEntitiesReentrant(elem->doc, value); elem->xmlChildrenNode = xmlStringGetNodeList(elem->doc, tmp); xmlFree(tmp); } /************************************************************************ * * * Debug * * * ************************************************************************/ #ifdef DEBUG_RDF int main(void) { rdfSchema rdf; rdfNamespace rpm; rdfDescription desc; rdfBag bag; char *value; /* * build a fake RDF document */ rdf = rdfNewSchema(); rpm = rdfNewNamespace(rdf, "http://www.rpm.org/", "RPM"); desc = rdfAddDescription(rdf, NULL, "ftp://ftp.redhat.com/pub/contrib/i386/rpm2html-0.90-1.i386.rpm"); rdfSetValue(desc, "Description", rpm, ""); rdfSetValue(desc, "Name", rpm, "rpm2html"); rdfSetValue(desc, "Version", rpm, "0.90"); rdfSetValue(desc, "Release", rpm, "1"); bag = rdfBagCreate(rdf, desc, "Provides", rpm); rdfBagAddValue(bag, "Resource", rpm, "rpm2html", NULL); bag = rdfBagCreate(rdf, desc, "Requires", rpm); rdfBagAddValue(bag, "Resource", rpm, "libz.so.1", NULL); rdfBagAddValue(bag, "Resource", rpm, "libdb.so.2", NULL); rdfBagAddValue(bag, "Resource", rpm, "libc.so.6", NULL); rdfBagAddValue(bag, "Resource", rpm, "ld-linux.so.2", NULL); /* * Save it. */ rdfWrite(rdf, "test.rdf"); rdfDestroySchema(rdf); /* * Read it. */ rdf = rdfRead("test.rdf"); /* * print it. */ rpm = rdfGetNamespace(rdf, "http://www.rpm.org/"); if (rpm == NULL) fprintf(stderr, "RPM namespace not found !\n"); desc = rdfFirstDescription(rdf); rdfGetValue(desc, "Name", rpm, &value, NULL); printf("Name : %s\n", value); xmlFree(value); rdfGetValue(desc, "Name", NULL, &value, NULL); printf("Name : %s\n", value); xmlFree(value); printf("\n---\n"); xmlDocDump(stdout, rdf); /* * free it. */ rdfDestroySchema(rdf); return(0); } #endif rpm2html-1.11.2/rdf.c0000664000076400007640000011217611452634006012763 0ustar hanyhany/* * rdf.c : implementation for the RDF encoding/decoding of RPM information. * * See Copyright for the status of this software. * * $Id: rdf.c,v 1.50 2010/10/05 14:36:54 hany Exp $ */ #include "config.h" #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include "rpm2html.h" #include "rpmdata.h" #include "html.h" #include "language.h" #include "rdf_api.h" #include "rdf.h" #ifdef WITH_SQL #include "sql.h" #endif #ifndef HAVE_SNPRINTF #error Sorry you really need snprintf for basic security reasons #endif /* * Open and process an RDF file in the incoming tree of an rpm2html mirror. */ rpmDataPtr rpmOpenRdf(char *nameRdf, rpmDirPtr dir, rpmSubdirPtr tree) { char file[1000]; rpmDataPtr rpm; #ifdef WITH_SQL int id; int i; #endif /* * create path */ if (tree->htmlpath[0] != '\0') snprintf(file, sizeof(file), "%s/%s/%s", dir->rpmdir, tree->rpmpath, nameRdf); else snprintf(file, sizeof(file), "%s/%s", dir->rpmdir, nameRdf); rpm = rpmOpenRdfFile(file); if (rpm != NULL) { /* setup tree and subdir information */ rpm->dir = dir; if (tree) { if ((tree->rpmpath != NULL) && (tree->rpmpath[0] != '\0')) rpm->subdir = stringAdd(tree->rpmpath); else rpm->subdir = NULL; } else rpm->subdir = NULL; #ifdef WITH_SQL id = sql_add_package(file, rpm->name, rpm->version, rpm->release, rpm->arch, dir->no, rpm->url, rpm->extra->srcrpm, dir->vendor, rpm->extra->packager, rpm->group, rpm->summary, rpm->extra->description, rpm->extra->copyright, rpm->date, rpm->size, rpm->os, rpm->distribution, rpm->vendor); if (id > 0) { for (i = 0;i < rpm->extra->nb_resources;i++) sql_add_provides(id, rpm->extra->resources[i]->name); for (i = 0;i < rpm->extra->nb_requires;i++) sql_add_requires(id, rpm->extra->requires[i]->name, rpm->extra->requires[i]->flag, rpm->extra->requires[i]->version); } #endif /* Add the package files to the real filesystem tree if asked for */ #ifdef WITH_SQL if ((rpm->extra->filelist != NULL) && ((dir->build_tree != 0) || (id > 0))) { #else if ((dir->build_tree != 0) && (rpm->extra->filelist != NULL)) { #endif char *cur, *filename; cur = rpm->extra->filelist; while ((*cur != '\0') && (*cur != '/')) cur++; filename = cur; while (*cur != '\0') { if ((*cur == '\n') || (*cur == '\r')) { if (cur != filename) { #ifdef WITH_SQL if (dir->build_tree != 0) rpmAddRealFile(dir->root, filename, rpm); if (id > 0) { *cur = 0; sql_add_file(filename,id); *cur = '\n'; } #else rpmAddRealFile(dir->root, filename, rpm); #endif } while ((*cur != '\0') && (*cur != '/')) cur++; filename = cur; } else cur++; } if (cur != filename) rpmAddRealFile(dir->root, filename, rpm); } /* Register this package */ rpmAddSoftware(rpm); /* dump the HTML related to this package */ if (rpm2html_dump_html) dumpRpmHtml(rpm, tree); if (rpm2html_dump_rdf) dumpRpmRdf(rpm, tree); /* free large amount of data not used later */ rpmFreeExtraData(rpm); /* increment the counters */ rpm2html_files++; rpm2html_size += rpm->size / 1024; } return(rpm); } /* * Open an RDF file call the parser to create a XML tree * Then walk the tree and build an rpmData structure for * the corresponding package. */ rpmDataPtr rpmOpenRdfFile(char *file) { char nameBuffer[200]; rdfSchema rdf; rdfNamespace rpmNs; rdfNamespace rdfNs; rdfDescription desc; rdfBag bag; rdfElement elem; char *value; rpmDataPtr rpm; struct stat buf; int i; rdf = rdfRead(file); if (rdf == NULL) return(NULL); /* * Start the analyze, check that's an RDf for RPM packages. */ rdfNs = rdfGetNamespace(rdf, "http://www.w3.org/TR/WD-rdf-syntax#"); if (rdfNs == NULL) { fprintf(stderr, "%s is not an RDF schema\n", file); rdfDestroySchema(rdf); return(NULL); } rpmNs = rdfGetNamespace(rdf, "http://www.rpm.org/"); if (rdfNs == NULL) { fprintf(stderr, "%s is not an RPM specific RDF schema\n", file); rdfDestroySchema(rdf); return(NULL); } desc = rdfFirstDescription(rdf); if (rdfNs == NULL) { fprintf(stderr, "%s RDF schema seems empty\n", file); rdfDestroySchema(rdf); return(NULL); } /* * We are pretty sure that it will be a valid schema, * allocate a new rpmData block, and an rpmExtraData block fill them */ rpm = (rpmDataPtr) xmlMalloc(sizeof(rpmData)); if (rpm == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", sizeof(rpmData), strerror(errno)); return(NULL); } memset(rpm, 0, sizeof(rpmData)); rpm->extra = (rpmExtraDataPtr) xmlMalloc(sizeof(rpmExtraData)); if (rpm == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", sizeof(rpmExtraData), strerror(errno)); return(NULL); } memset(rpm->extra, 0, sizeof(rpmExtraData)); stat(file, &buf); rpm->extra->stamp = buf.st_mtime; /* * Now extract all the metadata information from the RDF tree */ rdfGetValue(desc, "Name", rpmNs, &value, NULL); if (value != NULL) { rpm->name = stringAdd(value); xmlFree(value); } else { fprintf(stderr, "%s RDF schema invalid : no Name\n", file); rdfDestroySchema(rdf); return(NULL); } rdfGetValue(desc, "Version", rpmNs, &value, NULL); if (value != NULL) { rpm->version = stringAdd(value); xmlFree(value); } else { fprintf(stderr, "%s RDF schema invalid : no Version\n", file); rdfDestroySchema(rdf); return(NULL); } rdfGetValue(desc, "Release", rpmNs, &value, NULL); if (value != NULL) { rpm->release = stringAdd(value); xmlFree(value); } else { fprintf(stderr, "%s RDF schema invalid : no Release\n", file); rdfDestroySchema(rdf); return(NULL); } rdfGetValue(desc, "URL", rpmNs, &value, NULL); if (value != NULL) rpm->url = value; else rpm->url = NULL; rdfGetValue(desc, "Arch", rpmNs, &value, NULL); if (value != NULL) { rpm->arch = stringAdd(value); xmlFree(value); } else rpm->arch = xmlStrdup("noarch"); rdfGetValue(desc, "Os", rpmNs, &value, NULL); if (value != NULL) { rpm->os = stringAdd(value); xmlFree(value); } else rpm->os = xmlStrdup("linux"); rdfGetValue(desc, "Distribution", rpmNs, &value, NULL); if (value != NULL) { rpm->distribution = stringAdd(value); xmlFree(value); } else rpm->distribution = stringAdd(localizedStrings[LANG_UNKNOWN]); rdfGetValue(desc, "Vendor", rpmNs, &value, NULL); if (value != NULL) { rpm->vendor = stringAdd(value); xmlFree(value); } else rpm->vendor = xmlStrdup(localizedStrings[LANG_UNKNOWN]); rdfGetValue(desc, "Packager", rpmNs, &value, NULL); if (value != NULL) rpm->extra->packager = value; else rpm->extra->packager = NULL; rdfGetValue(desc, "Group", rpmNs, &value, NULL); if (value != NULL) { rpm->group = stringAdd(value); xmlFree(value); } else rpm->group = xmlStrdup(localizedStrings[LANG_NO_GROUP]); rdfGetValue(desc, "Summary", rpmNs, &value, NULL); if (value != NULL) rpm->summary = value; else rpm->summary = xmlStrdup(localizedStrings[LANG_NO_SUMMARY]); rdfGetValue(desc, "Description", rpmNs, &value, NULL); if (value != NULL) rpm->extra->description = value; else rpm->extra->description = xmlStrdup(localizedStrings[LANG_NO_DESCRIPTION]); rdfGetValue(desc, "Copyright", rpmNs, &value, NULL); if (value != NULL) rpm->extra->copyright = value; else rpm->extra->copyright = NULL; rdfGetValue(desc, "Changelog", rpmNs, &value, NULL); if (value != NULL) rpm->extra->changelog = value; else rpm->extra->changelog = NULL; rdfGetValue(desc, "Sources", rpmNs, &value, NULL); if (value != NULL) { rpm->extra->srcrpm = value; } else rpm->extra->srcrpm = xmlStrdup(""); rdfGetValue(desc, "Size", rpmNs, &value, NULL); if (value != NULL) { if (sscanf(value, "%d", &(rpm->size)) != 1) rpm->size = 0; xmlFree(value); } else rpm->size = 0; rdfGetValue(desc, "Date", rpmNs, &value, NULL); if (value != NULL) { if (sscanf(value, "%d", &i) != 1) rpm->date = 0; else rpm->date = i; xmlFree(value); } else rpm->date = 0; rdfGetValue(desc, "BuildHost", rpmNs, &value, NULL); if (value != NULL) rpm->extra->host = value; else rpm->extra->host = xmlStrdup(localizedStrings[LANG_NO_HOST]); rdfGetValue(desc, "Files", rpmNs, &value, NULL); if (value != NULL) rpm->extra->filelist = value; else rpm->extra->filelist = NULL; /* * Fetching packages provided is a bit more tricky, one have to * find the RDF Bag, and scan it's values. */ rpm->extra->nb_resources = 0; rdfGetValue(desc, "Provides", rpmNs, NULL, &bag); if (bag != NULL) { elem = rdfFirstChild(bag); rpm->extra->max_resources = 5; rpm->extra->resources = (rpmRessPtr *) xmlMalloc(rpm->extra->max_resources * sizeof(rpmRessPtr)); if (rpm->extra->resources == NULL) { fprintf(stderr, "rpmOpenRdf : ran out of memory\n"); exit(1); } i = 0; while (elem != NULL) { char *name; if (i >= rpm->extra->max_resources) { rpm->extra->max_resources *= 2; rpm->extra->resources = (rpmRessPtr *) xmlRealloc(rpm->extra->resources, rpm->extra->max_resources * sizeof(rpmRessPtr)); if (rpm->extra->resources == NULL) { fprintf(stderr, "rpmOpenRdf : ran out of memory\n"); exit(1); } } /* * Check that we are scanning an RPM Resource. */ name = rdfElemGetPropertyName(elem); if ((name != NULL) && (!strcmp(name, "Resource")) && (rdfElemGetNamespace(elem) == rpmNs)) { value = rdfElemGetValue(elem); if (value != NULL) { rpm->extra->resources[i] = rpmRessAdd(value, rpm, 0); i++; rpm->extra->nb_resources++; xmlFree(value); } else if (rpm2htmlVerbose > 1) { fprintf(stderr, "%s : malformed Resource element !\n", file); } } else if (rpm2htmlVerbose > 1) { fprintf(stderr, "%s : malformed Provides bag !\n", file); } if (name != NULL) xmlFree(name); elem = rdfNextElem(elem); } } else if (rpm2htmlVerbose > 1) { fprintf(stderr, "%s doesn't export any resource\n", file); } /* * idem for the dependencies. */ rpm->extra->nb_requires = 0; rdfGetValue(desc, "Requires", rpmNs, NULL, &bag); if (bag != NULL) { elem = rdfFirstChild(bag); rpm->extra->max_requires = 5; rpm->extra->requires = (rpmRessPtr *) xmlMalloc(rpm->extra->max_requires * sizeof(rpmRessPtr)); if (rpm->extra->requires == NULL) { fprintf(stderr, "rpmOpenRdf : ran out of memory\n"); exit(1); } i = 0; while (elem != NULL) { char *name; if (i >= rpm->extra->max_requires) { rpm->extra->max_requires *= 2; rpm->extra->requires = (rpmRessPtr *) xmlRealloc(rpm->extra->requires, rpm->extra->max_requires * sizeof(rpmRessPtr)); if (rpm->extra->requires == NULL) { fprintf(stderr, "rpmOpenRdf : ran out of memory\n"); exit(1); } } /* * Check that we are scanning an RPM Resource. */ name = rdfElemGetPropertyName(elem); if ((name != NULL) && (!strcmp(name, "Resource")) && (rdfElemGetNamespace(elem) == rpmNs)) { value = rdfElemGetValue(elem); if (value != NULL) { rpm_dep_flag dep = RPM2HTML_REQ_NONE; xmlChar *reqval = NULL; if ((reqval = xmlGetProp(elem, "gt")) != NULL) { dep = RPM2HTML_REQ_GT; } else if ((reqval = xmlGetProp(elem, "geq")) != NULL) { dep = RPM2HTML_REQ_GEQ; } else if ((reqval = xmlGetProp(elem, "lt")) != NULL) { dep = RPM2HTML_REQ_LT; } else if ((reqval = xmlGetProp(elem, "leq")) != NULL) { dep = RPM2HTML_REQ_LEQ; } else if ((reqval = xmlGetProp(elem, "equ")) != NULL) { dep = RPM2HTML_REQ_EQU; } /* * TODO: fix to import RDF dept to a specific version */ rpm->extra->requires[i] = rpmRequAdd(value, reqval, dep, rpm, 0); i++; rpm->extra->nb_requires++; xmlFree(value); if (reqval != NULL) xmlFree(reqval); } else if (rpm2htmlVerbose > 1) { fprintf(stderr, "%s : malformed Resource element !\n", file); } } else if (rpm2htmlVerbose > 1) { fprintf(stderr, "%s : malformed Provides bag !\n", file); } if (name != NULL) xmlFree(name); elem = rdfNextElem(elem); } } /* * Finish filling the rpmData structure. */ value = rdfGetDescriptionAbout(rdf, desc); if (value != NULL) { char *filename = &value[strlen(value)]; while ((filename > value) && (*filename != '/')) filename --; rpm->filename = xmlStrdup(filename); xmlFree(value); } else { snprintf(nameBuffer, 200, "%s-%s-%s.%s.rpm", rpm->name, rpm->version, rpm->release, rpm->arch); rpm->filename = xmlStrdup(nameBuffer); } /* * Cleanup. */ rdfDestroySchema(rdf); return(rpm); } /* * Create and RDF file containing the description for the given RPM data. */ void dumpRpmRdf(rpmDataPtr rpm, rpmSubdirPtr tree) { FILE *output; struct stat stat_buf; struct tm * tstruct; rpmDirPtr dir = rpm->dir; char *base = dir->dir; int i; char buf[10000]; char file[1000]; char dotdot[50]; char *buffer; int size; int stat_res = 0; rdfSchema rdf; rdfNamespace rpmNs; rdfDescription desc; rdfElement elem; rdfBag bag; int deep; const char *ptr; if (!rpm2html_dump_rdf) return; if (rpm2html_rdf_dir != NULL) base = rpm2html_rdf_dir; deep = 0; if (rpm->subdir != NULL) for (ptr = rpm->subdir, deep++;*ptr != 0;ptr++) if (*ptr == '/') deep++; if (dir->subdir != NULL) for (ptr = dir->subdir, deep++;*ptr != 0;ptr++) if (*ptr == '/') deep++; if ((dir->subdir != NULL) && (dir->subdir[0] != '\0')) { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(file, sizeof(file), "%s/%s/%s/%s.rdf", base, dir->subdir, rpm->subdir, rpmName(rpm)); else snprintf(file, sizeof(file), "%s/%s/%s.rdf", base, dir->subdir, rpmName(rpm)); } else { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(file, sizeof(file), "%s/%s/%s.rdf", base, rpm->subdir, rpmName(rpm)); else snprintf(file, sizeof(file), "%s/%s.rdf", base, rpmName(rpm)); } dotdot[0] = '\0'; for (;deep > 0;deep --) strcat(dotdot, "../"); /* * Check wether the RPM timestamp is older than the filestamp. if ((stat_res = stat(file, &stat_buf)) == 0) { if (stat_buf.st_mtime > rpm->stamp) return; } */ stat_res = stat(file, &stat_buf); /* * Create the directory if needed */ if ((dir->subdir != NULL) && (dir->subdir[0] != '\0')) { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "%s/%s/%s", base, dir->subdir, rpm->subdir); else snprintf(buf, sizeof(buf), "%s/%s", base, dir->subdir); } else { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "%s/%s", base, rpm->subdir); else snprintf(buf, sizeof(buf), "%s", base); } createDirectory(buf); /* * build the RDF document tree * Note : the order is not important but following the rpmData * structure order is easier to check. */ rdf = rdfNewSchema(); rpmNs = rdfNewNamespace(rdf, "http://www.rpm.org/", "RPM"); if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s/%s", dir->mirrors[0], rpm->subdir, rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s/%s", dir->ftp, rpm->subdir, rpm->filename); } else { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s", dir->mirrors[0], rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s", dir->ftp, rpm->filename); } desc = rdfAddDescription(rdf, NULL, buf); rdfSetValue(desc, "Name", rpmNs, rpm->name); rdfSetValue(desc, "Version", rpmNs, rpm->version); rdfSetValue(desc, "Release", rpmNs, rpm->release); if (rpm->url) rdfSetValue(desc, "URL", rpmNs, rpm->url); if (rpm->arch) rdfSetValue(desc, "Arch", rpmNs, rpm->arch); if (rpm->os) rdfSetValue(desc, "Os", rpmNs, rpm->os); if (rpm->distribution) rdfSetValue(desc, "Distribution", rpmNs, rpm->distribution); if (rpm->vendor) rdfSetValue(desc, "Vendor", rpmNs, rpm->vendor); if (rpm->extra->packager) rdfSetValue(desc, "Packager", rpmNs, rpm->extra->packager); if (rpm->group) rdfSetValue(desc, "Group", rpmNs, rpm->group); if (rpm->summary) rdfSetValue(desc, "Summary", rpmNs, rpm->summary); if (rpm->extra->description) rdfSetValue(desc, "Description", rpmNs, rpm->extra->description); if (rpm->extra->copyright) rdfSetValue(desc, "Copyright", rpmNs, rpm->extra->copyright); if (rpm->extra->changelog) rdfSetValue(desc, "Changelog", rpmNs, rpm->extra->changelog); if (rpm->extra->srcrpm) { rdfSetValue(desc, "Sources", rpmNs, rpm->extra->srcrpm); if (dir->ftpsrc) { rdfSetValue(desc, "SourcesFtp", rpmNs, dir->ftpsrc); } } tstruct = localtime(&(rpm->date)); #ifdef HAVE_STRFTIME strftime(buf, sizeof(buf) - 1, "%c", tstruct); #else #error "no strftime, please check !" #endif rdfSetValue(desc, "BuildDate", rpmNs, buf); snprintf(buf, sizeof(buf), "%d", (int) rpm->date); rdfSetValue(desc, "Date", rpmNs, buf); snprintf(buf, sizeof(buf), "%d", rpm->size); rdfSetValue(desc, "Size", rpmNs, buf); if (rpm->extra->host) rdfSetValue(desc, "BuildHost", rpmNs, rpm->extra->host); if (rpm->extra->nb_resources > 0) { bag = rdfBagCreate(rdf, desc, "Provides", rpmNs); for (i = 0;i < rpm->extra->nb_resources;i++) { elem = rdfBagAddValue(bag, "Resource", rpmNs, rpm->extra->resources[i]->name, NULL); if (rpm->extra->resources[i]->name[0] != '/') { snprintf(buf, sizeof(buf) - 1, "%sresources/%s.rdf", dotdot, rpm->extra->resources[i]->name); xmlSetProp(elem, "href", buf); } } } if (rpm->extra->nb_requires > 0) { bag = rdfBagCreate(rdf, desc, "Requires", rpmNs); for (i = 0;i < rpm->extra->nb_requires;i++) { elem = rdfBagAddValue(bag, "Resource", rpmNs, rpm->extra->requires[i]->name, NULL); if (rpm->extra->requires[i]->name[0] != '/') { snprintf(buf, sizeof(buf) - 1, "%sresources/%s.rdf", dotdot, rpm->extra->requires[i]->name); xmlSetProp(elem, "href", buf); } if (rpm->extra->requires[i]->version != NULL) { switch (rpm->extra->requires[i]->flag) { case RPM2HTML_REQ_LT: xmlSetProp(elem, "lt", rpm->extra->requires[i]->version); break; case RPM2HTML_REQ_LEQ: xmlSetProp(elem, "leq", rpm->extra->requires[i]->version); break; case RPM2HTML_REQ_GT: xmlSetProp(elem, "gt", rpm->extra->requires[i]->version); break; case RPM2HTML_REQ_GEQ: xmlSetProp(elem, "geq", rpm->extra->requires[i]->version); break; case RPM2HTML_REQ_EQU: xmlSetProp(elem, "equ", rpm->extra->requires[i]->version); break; case RPM2HTML_REQ_NONE: break; } } } } if (rpm->extra->filelist) rdfSetValue(desc, "Files", rpmNs, rpm->extra->filelist); /* * Save the RDF to a buffer, remove the tree. */ rdfWriteMemory(rdf, &buffer, &size); rdfDestroySchema(rdf); if (buffer == NULL) return; /* * if the file already exists avoid to overwrite it if the content * didn't change. */ if ((stat_res == 0) && (stat_buf.st_size == size)) { char *buffer2 = xmlMalloc(size * sizeof(char)); if (buffer2 == NULL) { fprintf(stderr, " : running out of memory\n"); xmlFree(buffer); return; } output = fopen(file, "r"); if (output == NULL) { fprintf(stderr, "couldn't open %s for reading !\n", file); xmlFree(buffer2); xmlFree(buffer); return; } if (fread(buffer2, size, 1, output) != 1) { fprintf(stderr, "Problem reading from %s !\n", file); xmlFree(buffer); xmlFree(buffer2); } fclose(output); /* * Now compare the content ! */ if (!memcmp(buffer, buffer2, size)) { xmlFree(buffer2); xmlFree(buffer); if (rpm2htmlVerbose > 1) fprintf(stderr, "File %s : Content identical !\n", file); return; } xmlFree(buffer2); } /* * Dump the file. */ if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", file); } output = fopen(file, "w"); if (output == NULL) { fprintf(stderr, "couldn't open %s for writing !\n", file); return; } if (fwrite(buffer, size, 1, output) != 1) { fprintf(stderr, "Problem writing to %s !\n", file); } xmlFree(buffer); fclose(output); } /* * Create and RDF file containing information about a resource. */ void dumpResRdf(rpmRessPtr res) { FILE *output; struct stat stat_buf; char *base; int i; char buf[10000]; char file[1000]; char *buffer; int size; int stat_res; rpmDataPtr rpm; rpmDirPtr dir; rdfSchema rdf; rdfNamespace rpmNs; rdfDescription desc; static int initialized = 0; if (!rpm2html_dump_rdf_resources) return; if (rpm2html_rdf_resources_dir != NULL) base = rpm2html_rdf_resources_dir; else return; if (res->nb_provider == 0) return; if (res->name[0] != '/') snprintf(file, sizeof(file), "%s/%s.rdf", base, res->name); else { // replace all '/' with '_' to avoid "couldn't open //usr/bin/mailq.rdf for writing !" snprintf(buf, sizeof(buf), "%s", res->name); // we reuse 'buffer' as cursor here buffer = &buf[0]; while (*buffer != '\0') { if (*buffer == '/') *buffer = '_'; buffer++; } snprintf(file, sizeof(file), "%s/%s.rdf", base, buf); if (rpm2htmlVerbose > 1) fprintf(stdout, "warning: '/' in resource name converted into '_': %s\n", buf); } /* * Create the directory if needed */ if (!initialized) { snprintf(buf, sizeof(buf), "%s", base); createDirectory(buf); initialized = 1; } /* * build the RDF document tree * Note : the order is not important but following the rpmData * structure order is easier to check. */ rdf = rdfNewSchema(); rpmNs = rdfNewNamespace(rdf, "http://www.rpm.org/", "RPM"); for (i = 0;i < res->nb_provider;i++) { rpm = res->provider[i]; dir = rpm->dir; if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s/%s", dir->mirrors[0], rpm->subdir, rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s/%s", dir->ftp, rpm->subdir, rpm->filename); } else { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s", dir->mirrors[0], rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s", dir->ftp, rpm->filename); } desc = rdfAddDescription(rdf, NULL, buf); if ((dir->subdir != NULL) && (dir->subdir[0] != '\0')) { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "../%s/%s/%s.rdf", dir->subdir, rpm->subdir, rpmName(rpm)); else snprintf(buf, sizeof(buf), "../%s/%s.rdf", dir->subdir, rpmName(rpm)); } else { if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "../%s/%s.rdf", rpm->subdir, rpmName(rpm)); else snprintf(buf, sizeof(buf), "../%s.rdf", rpmName(rpm)); } xmlSetProp(desc, "href", buf); rdfSetValue(desc, "Name", rpmNs, rpm->name); rdfSetValue(desc, "Version", rpmNs, rpm->version); rdfSetValue(desc, "Release", rpmNs, rpm->release); if (rpm->arch) rdfSetValue(desc, "Arch", rpmNs, rpm->arch); if (rpm->os) rdfSetValue(desc, "Os", rpmNs, rpm->os); if (rpm->distribution) rdfSetValue(desc, "Distribution", rpmNs, rpm->distribution); if (rpm->vendor) rdfSetValue(desc, "Vendor", rpmNs, rpm->vendor); snprintf(buf, sizeof(buf), "%d", (int) rpm->date); rdfSetValue(desc, "Date", rpmNs, buf); snprintf(buf, sizeof(buf), "%d", (int) rpm->size); rdfSetValue(desc, "Size", rpmNs, buf); if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) { if ((dir->subdir != NULL) && (dir->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "%s/%s", dir->subdir, rpm->subdir); else snprintf(buf, sizeof(buf), "%s", rpm->subdir); } else { if ((dir->subdir != NULL) && (dir->subdir[0] != '\0')) snprintf(buf, sizeof(buf), "%s", dir->subdir); else buf[0] = '\0'; } if (buf[0] != '\0') rdfSetValue(desc, "Subdir", rpmNs, buf); } /* * Save the RDF to a buffer, remove the tree. */ rdfWriteMemory(rdf, &buffer, &size); rdfDestroySchema(rdf); if (buffer == NULL) return; /* * if the file already exists avoid to overwrite it if the content * didn't change. */ stat_res = stat(file, &stat_buf); if ((stat_res == 0) && (stat_buf.st_size == size)) { char *buffer2 = xmlMalloc(size * sizeof(char)); if (buffer2 == NULL) { fprintf(stderr, " : running out of memory\n"); xmlFree(buffer); return; } output = fopen(file, "r"); if (output == NULL) { fprintf(stderr, "couldn't open %s for reading !\n", file); xmlFree(buffer); xmlFree(buffer2); return; } if (fread(buffer2, size, 1, output) != 1) { fprintf(stderr, "Problem reading from %s !\n", file); } fclose(output); /* * Now compare the content ! */ if (!memcmp(buffer, buffer2, size)) { xmlFree(buffer2); xmlFree(buffer); if (rpm2htmlVerbose > 1) fprintf(stderr, "File %s : Content identical !\n", file); return; } xmlFree(buffer2); } /* * Dump the file. */ if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", file); } output = fopen(file, "w"); if (output == NULL) { fprintf(stderr, "couldn't open %s for writing !\n", file); xmlFree(buffer); return; } if (fwrite(buffer, size, 1, output) != 1) { fprintf(stderr, "Problem writing to %s !\n", file); xmlFree(buffer); } fclose(output); xmlFree(buffer); } /* * Dump all the RDf files about known resources. */ void dumpAllResRdf(void) { rpmRessPtr cur; if (!rpm2html_dump_rdf_resources) return; if (rpm2htmlVerbose) printf("Dumping resource RDF\n"); cur = ressList; while (cur != NULL) { dumpResRdf(cur); cur = cur->next; } } /* * Dump an apropos RDF file for all packages. * Since the file is really too big to be kept as-if, it is compressed */ void dumpAproposRdf(void) { rpmDataPtr rpm; char file[1000]; char buf[1000]; rdfSchema rdf; rdfNamespace rpmNs; rdfDescription desc; rpmDirPtr dir; char *base; char *buffer; int size; gzFile output; int res; if (!rpm2html_dump_rdf_resources) return; if (rpm2html_rdf_resources_dir != NULL) base = rpm2html_rdf_resources_dir; else return; if (rpm2htmlVerbose) printf("Dumping apropos RDF\n"); snprintf(file, sizeof(file), "%s/fullIndex.rdf.gz", base); if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", file); } /* * build the RDF document tree, one only dump the minimum needed * for searching. */ rdf = rdfNewSchema(); rpmNs = rdfNewNamespace(rdf, "http://www.rpm.org/", "RPM"); rpm = rpmSoftwareList; while (rpm != NULL) { dir = rpm->dir; if ((rpm->subdir != NULL) && (rpm->subdir[0] != '\0')) { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s/%s", dir->mirrors[0], rpm->subdir, rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s/%s", dir->ftp, rpm->subdir, rpm->filename); } else { if (dir->mirrors[0] != NULL) snprintf(buf, sizeof(buf), "%s/%s", dir->mirrors[0], rpm->filename); else snprintf(buf, sizeof(buf), "%s/%s", dir->ftp, rpm->filename); } desc = rdfAddDescription(rdf, NULL, buf); rdfSetValue(desc, "Name", rpmNs, rpm->name); rdfSetValue(desc, "Summary", rpmNs, rpm->summary); rpm = rpm->nextSoft; } /* * Dump the RDF tree, and cleanup. */ rdfWriteMemory(rdf, &buffer, &size); rdfDestroySchema(rdf); if (buffer == NULL) return; /* * Write the compressed version of the RDF base. */ output = gzopen(file, "w9"); if (output == NULL) { fprintf(stderr, "Could not write %s : gzopen failed\n", file); xmlFree(buffer); return; } res = gzwrite(output, buffer, size); if (res <= 0) { fprintf(stderr, "Could not write %s : gzwrite failed\n", file); xmlFree(buffer); return; } gzclose(output); xmlFree(buffer); } /* * Dump the distribs/xxx.rdf file giving information about a * specific distribution */ void dumpDistRdf(rpmDirPtr dir) { char buf[101] = ""; char file[1000]; rdfSchema rdf; rdfNamespace rpmNs; rdfDescription desc; rdfBag mirrors; rdfElement mirror; struct stat stat_buf; int stat_res; char *base, *ptr; char *buffer; int size; FILE *output; int i; if (!rpm2html_dump_rdf_resources) return; if (rpm2html_rdf_resources_dir != NULL) base = rpm2html_rdf_resources_dir; else return; if (dir->subdir) snprintf(buf, sizeof(buf), "%s", dir->subdir); for (ptr = &buf[0]; *ptr; ptr++) if (*ptr == '/') *ptr = '_'; snprintf(file, sizeof(file), "%s/distribs", base); createDirectory(file); snprintf(file, sizeof(file), "%s/distribs/%s.rdf", base, buf); /* * build the RDF document tree, one only dump the minimum needed * for searching distributions information. */ rdf = rdfNewSchema(); rpmNs = rdfNewNamespace(rdf, "http://www.rpm.org/", "RPM"); desc = rdfAddDescription(rdf, NULL, dir->ftp); rdfSetValue(desc, "ID", rpmNs, dir->subdir); rdfSetValue(desc, "Name", rpmNs, dir->name); rdfSetValue(desc, "Origin", rpmNs, dir->ftp); rdfSetValue(desc, "Sources", rpmNs, dir->ftpsrc); snprintf(buf, sizeof(buf), "%d", dir->files); mirrors = rdfBagCreate(rdf, desc, "Mirrors", rpmNs); for (i = 0;i < dir->nb_mirrors;i++) { mirror = rdfBagAddValue(mirrors, "Mirror", rpmNs, NULL, NULL); rdfSetElementResource(rdf, mirror, dir->mirrors[i]); } /* * Dump the RDF tree, and cleanup. */ rdfWriteMemory(rdf, &buffer, &size); rdfDestroySchema(rdf); if (buffer == NULL) return; /* * if the file already exists avoid to overwrite it if the content * didn't change. */ stat_res = stat(file, &stat_buf); if ((stat_res == 0) && (stat_buf.st_size == size)) { char *buffer2 = xmlMalloc(size * sizeof(char)); if (buffer2 == NULL) { fprintf(stderr, " : running out of memory\n"); xmlFree(buffer); return; } output = fopen(file, "r"); if (output == NULL) { fprintf(stderr, "couldn't open %s for reading !\n", file); xmlFree(buffer2); xmlFree(buffer); return; } if (fread(buffer2, size, 1, output) != 1) { fprintf(stderr, "Problem reading from %s !\n", file); } fclose(output); /* * Now compare the content ! */ if (!memcmp(buffer, buffer2, size)) { xmlFree(buffer2); xmlFree(buffer); if (rpm2htmlVerbose > 1) fprintf(stderr, "File %s : Content identical !\n", file); return; } xmlFree(buffer2); } /* * Dump the file. */ if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", file); } output = fopen(file, "w"); if (output == NULL) { fprintf(stderr, "couldn't open %s for writing !\n", file); xmlFree(buffer); return; } if (fwrite(buffer, size, 1, output) != 1) { fprintf(stderr, "Problem writing to %s !\n", file); xmlFree(buffer); } fclose(output); xmlFree(buffer); } /* * Dump the distribs/metadata.rdf file listing all the recognized * metadata mirrors sites. */ void dumpMetadataListRdf(void) { char file[1000]; rdfSchema rdf; rdfNamespace rpmNs; rdfDescription desc; struct stat stat_buf; int stat_res; char *base; char *buffer; int size; FILE *output; int i; if (!rpm2html_dump_rdf_resources) return; if (rpm2html_rdf_resources_dir != NULL) base = rpm2html_rdf_resources_dir; else return; snprintf(file, sizeof(file), "%s/distribs", base); createDirectory(file); snprintf(file, sizeof(file), "%s/distribs/metadata.rdf", base); /* * build the RDF document tree, one only dump the minimum needed * for searching distributions information. */ rdf = rdfNewSchema(); rpmNs = rdfNewNamespace(rdf, "http://www.rpm.org/", "RPM"); for (i = 0;i < nb_metadata_mirrors;i++){ desc = rdfAddDescription(rdf, NULL, metadata_mirrors[i]); rdfSetValue(desc, "URI", rpmNs, metadata_mirrors[i]); } /* * Dump the RDF tree, and cleanup. */ rdfWriteMemory(rdf, &buffer, &size); rdfDestroySchema(rdf); if (buffer == NULL) return; /* * if the file already exists avoid to overwrite it if the content * didn't change. */ stat_res = stat(file, &stat_buf); if ((stat_res == 0) && (stat_buf.st_size == size)) { char *buffer2 = xmlMalloc(size * sizeof(char)); if (buffer2 == NULL) { fprintf(stderr, " : running out of memory\n"); xmlFree(buffer); return; } output = fopen(file, "r"); if (output == NULL) { fprintf(stderr, "couldn't open %s for reading !\n", file); xmlFree(buffer); xmlFree(buffer2); return; } if (fread(buffer2, size, 1, output) != 1) { fprintf(stderr, "Problem reading from %s !\n", file); } fclose(output); /* * Now compare the content ! */ if (!memcmp(buffer, buffer2, size)) { xmlFree(buffer2); xmlFree(buffer); if (rpm2htmlVerbose > 1) fprintf(stderr, "File %s : Content identical !\n", file); return; } xmlFree(buffer2); } /* * Dump the file. */ if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", file); } output = fopen(file, "w"); if (output == NULL) { fprintf(stderr, "couldn't open %s for writing !\n", file); return; } if (fwrite(buffer, size, 1, output) != 1) { fprintf(stderr, "Problem writing to %s !\n", file); } fclose(output); xmlFree(buffer); } /* * Dump the distribs/list.rdf file listing all the recognized distributions * as well as the metadata mirrors list. */ void dumpDistListRdf(void) { rpmDirPtr dir; char file[1000]; rdfSchema rdf; rdfNamespace rpmNs; rdfDescription desc; struct stat stat_buf; int stat_res; char *base; char *buffer; int size; FILE *output; if (!rpm2html_dump_rdf_resources) return; if (rpm2html_rdf_resources_dir != NULL) base = rpm2html_rdf_resources_dir; else return; if (rpm2htmlVerbose) printf("Dumping distribution RDF\n"); dumpMetadataListRdf(); snprintf(file, sizeof(file), "%s/distribs", base); createDirectory(file); snprintf(file, sizeof(file), "%s/distribs/list.rdf", base); /* * build the RDF document tree, one only dump the minimum needed * for searching distributions information. */ rdf = rdfNewSchema(); rpmNs = rdfNewNamespace(rdf, "http://www.rpm.org/", "RPM"); dir = dirList; while (dir != NULL) { desc = rdfAddDescription(rdf, NULL, dir->ftp); rdfSetValue(desc, "ID", rpmNs, dir->subdir); dumpDistRdf(dir); dir = dir->next; } /* * Dump the RDF tree, and cleanup. */ rdfWriteMemory(rdf, &buffer, &size); rdfDestroySchema(rdf); if (buffer == NULL) return; /* * if the file already exists avoid to overwrite it if the content * didn't change. */ stat_res = stat(file, &stat_buf); if ((stat_res == 0) && (stat_buf.st_size == size)) { char *buffer2 = xmlMalloc(size * sizeof(char)); if (buffer2 == NULL) { fprintf(stderr, " : running out of memory\n"); xmlFree(buffer); return; } output = fopen(file, "r"); if (output == NULL) { fprintf(stderr, "couldn't open %s for reading !\n", file); xmlFree(buffer); xmlFree(buffer2); return; } if (fread(buffer2, size, 1, output) != 1) { fprintf(stderr, "Problem reading from %s !\n", file); } fclose(output); /* * Now compare the content ! */ if (!memcmp(buffer, buffer2, size)) { xmlFree(buffer2); xmlFree(buffer); if (rpm2htmlVerbose > 1) fprintf(stderr, "File %s : Content identical !\n", file); return; } xmlFree(buffer2); } /* * Dump the file. */ if (rpm2htmlVerbose > 1) { printf("Dumping %s\n", file); } output = fopen(file, "w"); if (output == NULL) { fprintf(stderr, "couldn't open %s for writing !\n", file); return; } if (fwrite(buffer, size, 1, output) != 1) { fprintf(stderr, "Problem writing to %s !\n", file); } fclose(output); xmlFree(buffer); } rpm2html-1.11.2/rpm2html.c0000664000076400007640000001563011466341352013756 0ustar hanyhany/* * rpm2html.c : Application to generate an HTML view of an ensemble * of RPM packages. * * See Copyright for the status of this software. * * $Id: rpm2html.c,v 1.49 2007/04/01 13:37:34 hany Exp $ */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include "rpm2html.h" #include "rpmdata.h" #include "html.h" #include "rdf.h" #include #include "language.h" #ifdef WITH_SQL #include "sql.h" #endif void usage(const char *argv0) { fprintf(stderr, "%s %s : Web page generator for RPM packages\n", RPM2HTML_NAME, RPM2HTML_VER); fprintf(stderr, "usage : %s [-q/-v] [--nosql] [-force] [-lang msgfile] configfile1 [configfile2 ...]\n", argv0); fprintf(stderr, " or %s [-dumplang msgfile]\n", argv0); exit(1); } int main(int argc, char *argv[]) { rpmDataPtr list = NULL; int i; time_t start_time; int nb_config_files = 0; char host[200]; int mask; const char *dist = NULL; const char *dir = NULL; start_time = time(NULL); gethostname(host, sizeof(host)); currentTime = time(NULL); rpm2html_rpm2html_thishost = &host[0]; xmlKeepBlanksDefault(0); rpmReadConfigFiles(NULL, NULL); /* * Ensure that all files and directories created a world readable ! */ mask = umask(022); for (i = 1; i < argc ; i++) { if (argv[i][0] == '-') { char *ptr = argv[i]; while (*ptr == '-') ptr++; if (!strcmp(ptr, "lang")) { i++; if (i >= argc) break; readLanguageFile(argv[i]); } else if (!strcmp(ptr, "dumplang")) { i++; if (i >= argc) break; writeLanguageFile(ptr); return(0); } else if (!strcmp(ptr, "nosql")) { rpm2html_no_sql++; } else if (!strcmp(ptr, "force")) { force++; } else if (!strcmp(ptr, "cleanup")) { #ifdef WITH_SQL if (init_sql(NULL, "rpmfind", NULL, NULL) < 0) { exit(1); } sql_check_packages(); #endif exit(0); } else if (!strcmp(ptr, "dir")) { i++; if (i >= argc) break; dir = argv[i]; } else if (!strcmp(ptr, "dist")) { i++; if (i >= argc) break; dist = argv[i]; } else if (!strcmp(ptr, "v")) { rpm2htmlVerbose++; } else if (!strcmp(ptr, "q")) { rpm2htmlVerbose = 0; } else { fprintf(stderr, "Unknown option: %s\n", argv[i]); usage(argv[0]); } } else { #ifdef WITH_SQL if (init_sql(NULL, "rpmfind", NULL, NULL) < 0) { exit(1); } #else rpm2html_no_sql = 1; #endif if (readConfigFile(argv[i]) >= 0) { if (rpm2html_dump_html != 0) { dumpDirIcon(); #ifdef HAVE_LIBTEMPLATE initTemplateEngine(rpm2html_html_template); #endif } /* * A config file has been found and parsed. * Scan the directories, dump the results * and reinitialize. */ nb_config_files++; if ((dist == NULL) && (dir == NULL)) { /* * Full reindex and regeneration of the cross-index * pages. */ list = rpmDirScanAll(); if (rpm2html_dump_html != 0) { if (rpm2html_files != 0) { dumpAllRessHtml(0); rpmNameSort(&list, 0); dumpRpmByName(rpmSoftwareList, 0); rpmDistribSort(&list, 0); dumpRpmByDistribs(list, 0); rpmGroupSort(&list, 0); dumpRpmByGroups(rpmSoftwareList, 0); rpmVendorSort(&list, 0); dumpRpmByVendors(list, 0); rpmDateSort(&list, 0); dumpRpmByDate(list, 0); dumpIndex(start_time, 0); } if (rpm2html_install_files != 0) { dumpAllRessHtml(1); rpmNameSort(&list, 1); dumpRpmByName(rpmSoftwareList, 1); rpmDistribSort(&list, 1); dumpRpmByDistribs(list, 1); rpmGroupSort(&list, 1); dumpRpmByGroups(rpmSoftwareList, 1); rpmVendorSort(&list, 1); dumpRpmByVendors(list, 1); rpmDateSort(&list, 1); dumpRpmByDate(list, 1); dumpIndex(start_time, 1); } } if (rpm2html_no_sql) { if (rpm2html_dump_rdf_resources) { dumpAllResRdf(); dumpAproposRdf(); dumpDistListRdf(); rpmDirCleanupAll(); } } #ifdef WITH_SQL else sql_check_packages(); #endif } else if (dir != NULL) { printf("rpm2html: indexing %s\n", dir); rpmDirScanOneDir(dir); } else { rpmDirScanOneDist(dist); } if (rpm2htmlVerbose) { printf( "To see the result of the indexing point your Web browser to:\n"); if (rpm2html_rpm2html_thishost == NULL) printf("\thttp://localhost%s/\n", rpm2html_url); else printf("\thttp://%s%s/\n", rpm2html_rpm2html_thishost, rpm2html_url); } reinitialize(); } } } /* * reset the umask */ umask(mask); #ifdef WITH_SQL if ((!rpm2html_no_sql) && (nb_config_files == 0)) { if (readConfigSql() >= 0) { if (rpm2html_dump_html != 0) { dumpDirIcon(); #ifdef HAVE_LIBTEMPLATE initTemplateEngine(rpm2html_html_template); #endif } /* * A config file has been found and parsed. * Scan the directories, dump the results * and reinitialize. */ nb_config_files++; if (dist == NULL) { list = rpmDirScanAll(); if (rpm2html_dump_html != 0) { if (rpm2html_files != 0) { dumpAllRessHtml(0); rpmNameSort(&list, 0); dumpRpmByName(rpmSoftwareList, 0); /* Modif. by A. Gibert */ rpmDistribSort(&list, 0); dumpRpmByDistribs(list, 0); rpmGroupSort(&list, 0); dumpRpmByGroups(rpmSoftwareList, 0); /* Modif. by A. Gibert */ rpmVendorSort(&list, 0); dumpRpmByVendors(list, 0); rpmDateSort(&list, 0); dumpRpmByDate(list, 0); dumpIndex(start_time, 0); } if (rpm2html_install_files != 0) { dumpAllRessHtml(1); rpmNameSort(&list, 1); dumpRpmByName(rpmSoftwareList, 1); /* Modif. by A. Gibert */ rpmDistribSort(&list, 1); dumpRpmByDistribs(list, 1); rpmGroupSort(&list, 1); dumpRpmByGroups(rpmSoftwareList, 1); /* Modif. by A. Gibert */ rpmVendorSort(&list, 1); dumpRpmByVendors(list, 1); rpmDateSort(&list, 1); dumpRpmByDate(list, 1); dumpIndex(start_time, 1); } } sql_check_packages(); } else { rpmDirScanOneDist(dist); } if (rpm2htmlVerbose) { printf( "To see the result of the indexing point your Web browser to:\n"); if (rpm2html_rpm2html_thishost == NULL) printf("\thttp://localhost%s/\n", rpm2html_url); else printf("\thttp://%s%s/\n", rpm2html_rpm2html_thishost, rpm2html_url); } reinitialize(); } } #endif if ((rpm2html_no_sql) && (nb_config_files == 0)) usage(argv[0]); xmlMemoryDump(); #ifdef WITH_SQL if (!rpm2html_no_sql) { close_sql(); sqlListsCleanup(); } #endif return(0); } rpm2html-1.11.2/rpmdata.c0000664000076400007640000010252411107137245013634 0ustar hanyhany/* * rpmdata.c : handle the data in the RPM database. * * See Copyright for the status of this software. * * $Id: rpmdata.c,v 1.54 2008/11/13 23:56:21 hany Exp $ */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include "rpm2html.h" #include "rpmdata.h" int rpmNameCmp(const rpmData *a, const rpmData *b); /* * An hash table for the RPM list */ #define HASH_SIZE 4096 rpmDataPtr rpmHashTable[HASH_SIZE]; /* * An hash table for the Resources list */ rpmRessPtr rpmRessHashTable[HASH_SIZE]; /* * global variables shared by rpm2htm code */ int rpm2htmlVerbose = 1; int force = 0; time_t currentTime; /* * the lists of RPM and resources collected so far. */ rpmDataPtr rpmSoftwareList = NULL; rpmRessPtr ressList = NULL; rpmRessPtr ressInstalledList = NULL; rpmArchPtr archList = NULL; rpmDirPtr dirList = NULL; rpmSubdirPtr dirTree = NULL; rpmRealDirPtr treeRoot = NULL; /* * Hash table initialization. */ static int rpmHashInitialized = 0; void rpmHashInitialize(void) { int i; for (i = 0; i < HASH_SIZE; i++) { rpmHashTable[i] = NULL; rpmRessHashTable[i] = NULL; } rpmHashInitialized = 1; } /* * Compute an RPM hash key */ int rpmGetHash(const char *name, const char *version, const char *release) { unsigned short res = 0; while (*name != 0) res += *(name++); while (*version != 0) res += *(version++); while (*release != 0) res += *(release++); return((int) (res % HASH_SIZE)); } /* * Compute a Resource hash key */ int rpmGetRessHash(const char *name) { unsigned short res = 0; while (*name != 0) res += *(name++); return((int) (res % HASH_SIZE)); } /* * Search wether an RPM is available. */ rpmDataPtr rpmSearchSoftware(const char *name, const char *version, const char *release, const char *arch) { rpmDataPtr cur; int hash; if (!rpmHashInitialized) rpmHashInitialize(); hash = rpmGetHash(name, version, release); cur = rpmHashTable[hash]; while (cur != NULL) { if (!strcmp(name, cur->name) && !strcmp(version, cur->version) && !strcmp(release, cur->release)) { /* * this is already in the sofware list, link in as * a new arch support. */ while (cur != NULL) { if (!strcmp(arch, cur->arch)) return(cur); cur = cur->nextArch; } return(NULL); } cur = cur->nextHash; } return(NULL); } /* * Insert a new RPM, managing the list of various software. */ void rpmAddSoftware(rpmDataPtr rpm) { rpmDataPtr cur; int hash; if (!rpmHashInitialized) rpmHashInitialize(); hash = rpmGetHash(rpm->name, rpm->version, rpm->release); cur = rpmHashTable[hash]; while (cur != NULL) { if (!strcmp(rpm->name, cur->name) && !strcmp(rpm->version, cur->version) && !strcmp(rpm->release, cur->release)) { /* * this is already in the sofware list, link in as * a new arch support. */ #ifdef DEBUG_HASH fprintf(stderr, "clash : (%d) %s-%s-%s.%s and %s-%s-%s.%s\n", hash, rpm->name, rpm->version, rpm->release, rpm->arch, cur->name, cur->version, cur->release, cur->arch); #endif rpm->nextArch = cur->nextArch; cur->nextArch = rpm; rpm->nextSoft = NULL; /* this one is not in the software list */ return; } cur = cur->nextHash; } /* * this wasn't found in the software list ! */ #ifdef DEBUG_HASH fprintf(stderr, "new : (%d) %s-%s-%s.%s\n", hash, rpm->name, rpm->version, rpm->release, rpm->arch); #endif rpm->nextHash = rpmHashTable[hash]; rpmHashTable[hash] = rpm; rpm->nextArch = NULL; rpm->nextSoft = rpmSoftwareList; rpmSoftwareList = rpm; } /* * Add a resource to the list if it doesn't exists and add the * corresponding RPM as a provider. */ rpmRessPtr rpmRessAdd(char *ress, rpmDataPtr rpm, int installed) { rpmRessPtr cur; int hash; if (!rpmHashInitialized) rpmHashInitialize(); hash = rpmGetRessHash(ress); cur = rpmRessHashTable[hash]; /* search for the resource */ while (cur != NULL) { if (!strcmp(ress, cur->name)) goto found; cur = cur->nextHash; } /* not found allocate a new resource block and fill it */ cur = (rpmRessPtr) xmlMalloc(sizeof(rpmRess)); if (cur == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", sizeof(rpmRess), strerror(errno)); return(NULL); } memset(cur, 0, sizeof(rpmRess)); cur->max_provider = 8; cur->provider = (rpmDataPtr *) xmlMalloc(cur->max_provider * sizeof(rpmDataPtr)); if (cur->provider == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", cur->max_provider * sizeof(rpmDataPtr), strerror(errno)); return(NULL); } cur->name = xmlStrdup(ress); cur->nb_provider = 0; cur->stamp = rpm->extra->stamp; if (installed) { cur->next = ressInstalledList; ressInstalledList = cur; } else { cur->next = ressList; ressList = cur; } cur->nextHash = rpmRessHashTable[hash]; rpmRessHashTable[hash] = cur; found: /* add the provider to the array */ if (cur->nb_provider >= cur->max_provider) { cur->max_provider *= 2; cur->provider = (rpmDataPtr *) xmlRealloc(cur->provider, cur->max_provider * sizeof(rpmDataPtr)); if (cur->provider == NULL) { fprintf(stderr, "rpmRessAdd : ran out of memory !\n"); exit(1); } } cur->provider[cur->nb_provider++] = rpm; if (rpm->extra->stamp > cur->stamp) cur->stamp = rpm->extra->stamp; return(cur); } /* * Add a resource to the list if it doesn't exists and add the * corresponding RPM as a requester. */ rpmRessPtr rpmRequAdd(char *requ, char * requv, rpm_dep_flag requf, rpmDataPtr rpm, int installed) { rpmRessPtr cur; int hash; if (!rpmHashInitialized) rpmHashInitialize(); hash = rpmGetRessHash(requ); cur = rpmRessHashTable[hash]; /* search for the resource */ while (cur != NULL) { if (!strcmp(requ, cur->name)){ goto found; } cur = cur->nextHash; } /* not found allocate a new resource block and fill it */ cur = (rpmRessPtr) xmlMalloc(sizeof(rpmRess)); if (cur == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", sizeof(rpmRess), strerror(errno)); return(NULL); } memset(cur, 0, sizeof(rpmRess)); cur->max_provider = 8; cur->provider = (rpmDataPtr *) xmlMalloc(cur->max_provider * sizeof(rpmDataPtr)); if (cur->provider == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", cur->max_provider * sizeof(rpmDataPtr), strerror(errno)); return(NULL); } cur->name = xmlStrdup(requ); if (requv != NULL) cur->version = xmlStrdup(requv); cur->flag = requf; cur->nb_provider = 0; cur->stamp = rpm->extra->stamp; if (installed) { cur->next = ressInstalledList; ressInstalledList = cur; } else { cur->next = ressList; ressList = cur; } cur->nextHash = rpmRessHashTable[hash]; rpmRessHashTable[hash] = cur; found: if (rpm->extra->stamp > cur->stamp) cur->stamp = rpm->extra->stamp; return(cur); } /* * print an RPM data block */ void rpmDataPrint(rpmDataPtr rpm) { int i; printf("%s\n", rpm->filename); printf("%s-%s-%s\n", rpm->name, rpm->version, rpm->release); if (rpm->summary) printf(" %s\n", rpm->summary); if (rpm->extra) { for (i = 0; i < rpm->extra->nb_resources ;i++) printf("-> %s\n", rpm->extra->resources[i]->name); } } /* * Add two RPM lists */ rpmDataPtr rpmAddList(rpmDataPtr ret, rpmDataPtr cur) { rpmDataPtr tmp; if (ret == NULL) return (cur); if (cur == NULL) return (ret); if (cur->next == NULL) { cur->next = ret; return(cur); } if (ret->next == NULL) { ret->next = cur; return(ret); } tmp = ret; while (tmp->next != NULL) tmp = tmp->next; tmp->next = cur; return(ret); } /* * A generic sort function for an RPM list. * NOTE : since doing a fast sort on a linked list is a pain, * we allocate an array, copy the rpmDataPtr in the array * and use the standard qsort() for decent performances on * large databases. */ typedef int (*rpmCmpFunc)(const rpmData *a, const rpmData *b); typedef int (*qsortCmpFunc)(const void * a, const void * b); static rpmCmpFunc currentCmpFunc = NULL; int rpmPtrCmpFunc(const rpmData **a, const rpmData **b) { return(currentCmpFunc(*a, *b)); } void rpmGenericSort(rpmCmpFunc rpmCmp, rpmDataPtr *base, int installed) { int i, nb_elems = 0; rpmDataPtr list; rpmDataPtr *array = NULL; int max_elems = 1024; if (base == NULL) return; if (*base == NULL) return; list = *base; array = (rpmDataPtr *) xmlMalloc(max_elems * sizeof(rpmDataPtr)); if (array == NULL) { fprintf(stderr, "rpmGenericSort : array alloc error\n"); exit(1); } /* * Step 1 : copy the list in the Array */ while (list != NULL) { if (nb_elems == max_elems) { max_elems *= 2; array = (rpmDataPtr *) xmlRealloc(array, max_elems * sizeof(rpmDataPtr)); if (array == NULL) { fprintf(stderr, "rpmGenericSort : array alloc error\n"); exit(1); } } array[nb_elems++] = list; list = list->next; } /* * Step 2 : qsort() the Array */ currentCmpFunc = rpmCmp; qsort(array, nb_elems, sizeof(rpmDataPtr), (qsortCmpFunc) rpmPtrCmpFunc); /* * Step 3 : rebuild the list. */ for (i = 0;i < nb_elems - 1; i++) array[i]->next = array[i + 1]; array[nb_elems - 1]->next = NULL; list = array[0]; *base = list; xmlFree(array); } /* * A generic sort function for the software list. */ void rpmGenericSortSoftware(rpmCmpFunc rpmCmp, int installed) { rpmDataPtr list; int i, nb_elems = 0; rpmDataPtr *array = NULL; int max_elems = 1024; list = rpmSoftwareList; if (list == NULL) return; array = (rpmDataPtr *) xmlMalloc(max_elems * sizeof(rpmDataPtr)); if (array == NULL) { fprintf(stderr, "rpmGenericSort : array alloc error\n"); exit(1); } /* * Step 1 : copy the list in the Array */ while (list != NULL) { if (nb_elems == max_elems) { max_elems *= 2; array = (rpmDataPtr *) xmlRealloc(array, max_elems * sizeof(rpmDataPtr)); if (array == NULL) { fprintf(stderr, "rpmGenericSort : array alloc error\n"); exit(1); } } array[nb_elems++] = list; list = list->nextSoft; } /* * Step 2 : qsort() the Array */ currentCmpFunc = rpmCmp; qsort(array, nb_elems, sizeof(rpmDataPtr), (qsortCmpFunc) rpmPtrCmpFunc); /* * Step 3 : rebuild the list. */ for (i = 0;i < nb_elems - 1; i++) array[i]->nextSoft = array[i + 1]; array[nb_elems - 1]->nextSoft = NULL; rpmSoftwareList = array[0]; xmlFree(array); } /* * rpmGroupCmp : comparison of groupe values, if equal, compare * the names. */ int rpmGroupCmp(const rpmData *a, const rpmData *b) { int res = strcmp(a->group, b->group); if (res) return(res); res = rpmNameCmp(a, b); return(res); } /* * sort all the RPMs by Group. */ void rpmGroupSort(rpmDataPtr *list, int installed) { rpmGenericSort(rpmGroupCmp, list, installed); rpmGenericSortSoftware(rpmGroupCmp, installed); } /* * rpmDistribCmp : comparison of distributions values, if equal, compare * the names. */ int rpmDistribCmp(const rpmData *a, const rpmData *b) { int res = strcmp(a->distribution, b->distribution); if (res) return(res); res = rpmNameCmp(a, b); return(res); } /* * sort all the RPMs by Distribution. */ void rpmDistribSort(rpmDataPtr *list, int installed) { rpmGenericSort(rpmDistribCmp, list, installed); } /* * rpmVendorCmp : comparison of vendor values, if equal, compare * distributions, then compares the names. */ int rpmVendorCmp(const rpmData *a, const rpmData *b) { int res = strcmp(a->vendor, b->vendor); if (res) return(res); res = strcmp(a->distribution, b->distribution); if (res) return(res); res = rpmNameCmp(a, b); return(res); } /* * sort all the RPMs by Vendor. */ void rpmVendorSort(rpmDataPtr *list, int installed) { rpmGenericSort(rpmVendorCmp, list, installed); } /* * rpmDateCmp : comparison of date values, if equal, compare * distributions, then compares the names. */ int rpmDateCmp(const rpmData *a, const rpmData *b) { int res = (b->date - a->date) / (60 * 60 * 12); if (res) return(res); res = rpmNameCmp(a, b); return(res); } /* * sort all the RPMs by Date. */ void rpmDateSort(rpmDataPtr *list, int installed) { rpmGenericSort(rpmDateCmp, list, installed); } /* Compare two version or release numbers. If there are leading digits convert them to an integer and compare those. If they are equal and a "." follows, skip the "." and repeat. Compare any remaining non-digits using strcasecmp. Note that the numerical sense of this comparison is reversed, so that higher version numbers (and thus more recent packages) appear first. */ static int vercmp(const char *a, const char *b) { while (1) { /* If we're at the end of both they are equal */ if (!*a && !*b) return 0; /* If we're at the end of a then b is more recent */ else if (!*a) return -1; /* If we're at the end of b then a is more recent */ else if (!*b) return 1; /* If we see non-digits compare lexically */ else if (!isdigit(*a) || !isdigit(*b)) return strcasecmp(a, b); else { /* compare the integers at the beginning. The larger number is more recent. */ int diff = atoi(a) - atoi(b); if (diff != 0) return diff; /* If they are equal, skip past them */ else { while (isdigit(*a)) a++; while (isdigit(*b)) b++; } } /* If we don't see any version number separators compare lexically */ if (*a != '.' && *b != '.') return strcasecmp(a, b); /* If a's version number ended and b continues, b is more recent. */ else if (*a != '.') return -1; /* Conversely, here a is more recent */ else if (*b != '.') return 1; /* Skip past the periods and comparison the next version element */ else {a += 1; b += 1;} } } /* * rpmNameCmp : comparison of names. */ int rpmNameCmp(const rpmData *a, const rpmData *b) { int res; const char *ap = a->name; const char *bp = b->name; /* This algorithm for locating the subpackage name is flawed, as it is possible for either the main package name or the sub package name to contain a dash. */ #if 1 /* Here we scan from the right, assuming that the sub-package name contains no dashes. */ const char *asp = &ap[strlen(ap)-1]; const char *bsp = &bp[strlen(bp)-1]; while (asp > ap && *asp != '-') asp -= 1; /* scan to subpackage name */ while (bsp > bp && *bsp != '-') bsp -= 1; /* (if any.) */ if (asp == ap) asp = &ap[strlen(ap)]; /* No subpackage, go to nul */ if (bsp == bp) bsp = &bp[strlen(bp)]; /* at end of string */ #else /* Here we scan from the left, assuming that the main package name contains no dashes. */ const char *asp = ap; const char *bsp = bp; while (*asp && *asp != '-') asp += 1; /* scan to subpackage name */ while (*bsp && *bsp != '-') bsp += 1; /* (if any.) */ #endif /* Primary sort key is the package name, then the version number, then the release number, and only then the subpackage name. */ #define min(a,b) (((a)<(b))?(a):(b)) res = strncasecmp(ap, bp, min(asp - ap, bsp - bp)); /* A shorter name is lexically less. */ if (res == 0) res = (asp - ap) - (bsp - bp); /* Later version numbers should appear first. */ if (res == 0) res = vercmp(b->version, a->version); /* Same for release numbers. */ if (res == 0) res = vercmp(b->release, a->release); /* Sort on sub-package name */ if (res == 0) res = strcasecmp(asp, bsp); return(res); } /* * sort all the RPMs by Name. */ void rpmNameSort(rpmDataPtr *list, int installed) { rpmGenericSort(rpmNameCmp, list, installed); rpmGenericSortSoftware(rpmNameCmp, installed); } /* * rpmVersionCmp : comparison of version */ int rpmVersionCmp(const rpmDataPtr *a, const rpmDataPtr *b) { int res = strcmp((*a)->name, (*b)->name); if (res) return(res); res = strcmp((*b)->version, (*a)->version); if (res) return(res); res = strcmp((*b)->release, (*a)->release); return(res); } /* * sort all RPM providing a resource by version number */ void rpmRessSort(rpmRessPtr ress) { if (ress == NULL) return; if (ress->provider == NULL) return; if (ress->nb_provider <= 1) return; qsort(ress->provider, ress->nb_provider, sizeof(rpmDataPtr), (qsortCmpFunc) rpmVersionCmp); } /* * Create a subdirectory of a given directory */ rpmSubdirPtr rpmNewSubdir(rpmSubdirPtr dir, const char *name, const char *htmlpath, const char *rpmpath, const char *color, int html) { rpmSubdirPtr res; res = (rpmSubdirPtr) xmlMalloc(sizeof(rpmSubdir)); if (res == NULL) { fprintf(stderr, "rpmNewSubdir : running out of memory !\n"); exit(1); } res->max_subdirs = 8; res->subdirs = (rpmSubdirPtr *) xmlMalloc(res->max_subdirs * sizeof(rpmSubdirPtr)); if (res->subdirs == NULL) { fprintf(stderr, "rpmNewSubdir : running out of memory !\n"); exit(1); } res->name = xmlStrdup(name); res->nb_subdirs = 0; if (color) res->color = xmlStrdup(color); else res->color = NULL; res->html = html; memset(res->subdirs, 0, sizeof(res->subdirs)); if (dir == NULL) { res->htmlpath = xmlStrdup(name); res->parent = NULL; } else { res->parent = dir; if (dir->parent != NULL) /* top level dir has alway html = 1 */ res->html = dir->html; if (htmlpath == NULL) { if (dir->htmlpath[0] != '\0') { char buf[500]; snprintf(buf, sizeof(buf), "%s/%s", dir->htmlpath, name); res->htmlpath = xmlStrdup(buf); } else res->htmlpath = xmlStrdup(name); } else res->htmlpath = xmlStrdup(htmlpath); if (rpmpath == NULL) { if (dir->rpmpath[0] != '\0') { char buf[500]; snprintf(buf, sizeof(buf), "%s/%s", dir->rpmpath, name); res->rpmpath = xmlStrdup(buf); } else res->rpmpath = xmlStrdup(name); } else res->rpmpath = xmlStrdup(rpmpath); if (dir->nb_subdirs >= dir->max_subdirs) { dir->max_subdirs *= 2; dir->subdirs = (rpmSubdirPtr *) xmlRealloc(dir->subdirs, dir->max_subdirs * sizeof(rpmSubdirPtr)); if (dir->subdirs == NULL) { fprintf(stderr, "rpmNewSubdir : running out of memory !\n"); exit(1); } } dir->subdirs[dir->nb_subdirs++] = res; } return(res); } /* * Remove one subdirectory from it's parent. */ void rpmRemoveSubdir(rpmSubdirPtr tree) { int i; rpmSubdirPtr cur = tree->parent; if (cur == NULL) return; /* * search the child in the parent list. */ for (i = 0;i < cur->nb_subdirs;i++) if (cur->subdirs[i] == tree) break; if (i >= cur->nb_subdirs) { fprintf(stderr, "rpmRemoveSubdir : child not referenced by parent\n"); return; } /* * Decrement the parent count, and shift the end of the array. */ cur->nb_subdirs--; for (;i < cur->nb_subdirs;i++) cur->subdirs[i] = cur->subdirs[i + 1]; cur->subdirs[i] = NULL; } /* * Free a full directory tree. */ void rpmFreeSubdir(rpmSubdirPtr tree) { int i; for (i = 0;i < tree->nb_subdirs; i++) rpmFreeSubdir(tree->subdirs[i]); if (tree->name != NULL) xmlFree(tree->name); if (tree->htmlpath != NULL) xmlFree(tree->htmlpath); if (tree->rpmpath != NULL) xmlFree(tree->rpmpath); if (tree->color != NULL) xmlFree(tree->color); tree->parent = NULL; xmlFree(tree->subdirs); xmlFree(tree); } /* * print all RPM data blocks */ void rpmDataPrintAll(void) { rpmDataPtr cur = rpmSoftwareList; while (cur != NULL) { rpmDataPrint(cur); cur = cur->next; } } /* * Try to extract an E-mail address from a string. * The string is truncated to the beginning of the E-Mail. * e.g. "Joe Average " should be truncated * to "Joe Average" */ char *extractEMail(char *string) { static char buf[200]; char *start; char *end; start = strchr(string, '@'); if (start == NULL) return(NULL); end = start; do { start--; if ((!isprint(*start)) || (*start == ' ') || (*start == '\t') || (*start == '\n') || (*start == '\r') || (*start == '@') || (*start == '<') || (*start == '>') || (*start == '(') || (*start == ')') || (*start == '[') || (*start == ']') || (*start == ';') || (*start == ',') || (*start == ',')) { start++; break; } } while (start != string); do { end++; if ((!isprint(*end)) || (*start == ' ') || (*start == '\t') || (*start == '\n') || (*start == '\r') || (*end == '@') || (*end == '<') || (*end == '>') || (*end == '(') || (*end == ')') || (*end == '[') || (*end == ']') || (*end == ';') || (*end == ',') || (*end == ',')) { break; } } while (*end != '\0'); strncpy(buf, start, end - start); buf[end - start] = '\0'; return(buf); } /* * Try to extract an URL address from a string. * The string is truncated to the beginning of the URL * e.g. "Nifty Project http://www.nifty.org/project/" * to "Nifty Project" */ char *extractURL(char *string) { static char buf[500]; char *start; char *end; start = strstr(string, "http://"); if (start == NULL) start = strstr(string, "ftp://"); if (start == NULL) return(NULL); end = start; do { start--; if ((!isprint(*start)) || (*start == ' ') || (*start == '\t') || (*start == '\n') || (*start == '\r') || (*start == '@') || (*start == '<') || (*start == '>') || (*start == '(') || (*start == ')') || (*start == '[') || (*start == ']') || (*start == ';') || (*start == ',') || (*start == ',')) { start++; break; } } while (start != string); do { end++; if ((!isprint(*end)) || (*start == ' ') || (*start == '\t') || (*start == '\n') || (*start == '\r') || (*end == '@') || (*end == '<') || (*end == '>') || (*end == '(') || (*end == ')') || (*end == '[') || (*end == ']') || (*end == ';') || (*end == ',') || (*end == ',')) { break; } } while (*end != '\0'); strncpy(buf, start, end - start); buf[end - start] = '\0'; return(buf); } /* * Try to protect an e-mail address from a spam bot. * The "" is replaced * with "". */ static unsigned char *buffer = NULL; static int buffer_size = 2000; static char *at = "(at)"; char *protectEmail(char *string) { if (rpm2html_protect_emails == 0 || string == NULL) return string; unsigned char *cur, *end; unsigned char c; if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } } cur = &buffer[0]; end = &buffer[buffer_size - 20]; while (*string != '\0') { if (cur >= end) { int delta = cur - buffer; buffer_size *= 2; buffer = (char *) xmlRealloc(buffer, buffer_size * sizeof(char)); if (buffer == NULL) { perror("xmlMalloc failed"); exit(1); } end = &buffer[buffer_size - 20]; cur = &buffer[delta]; } c = (unsigned char) *(string++); if (c == '@') { strcpy(cur, at); cur += strlen(at); } else { *(cur++) = c; } } *cur = '\0'; return(buffer); } /* * Create a root directory for the installation space, i.e. the * filesystem that would be created if the packages were installed * on a real system * Basic array allocation is 16 items. */ rpmRealDirPtr rpmCreateRealRoot(void) { rpmRealDirPtr res; res = (rpmRealDirPtr) xmlMalloc(sizeof(rpmRealDir)); if (res == NULL) { fprintf(stderr, "rpmCreateRealRoot : out of memory !\n"); exit(1); } res->parent = NULL; res->name = xmlStrdup("/"); res->nb_elem = 0; res->elems = (void *) xmlMalloc(16 * sizeof(void *)); res->names = (void *) xmlMalloc(16 * sizeof(char *)); res->flags = (char *) xmlMalloc(16 * sizeof(char)); if ((res->elems == NULL) || (res->flags == NULL) || (res->names == NULL)) { fprintf(stderr, "rpmCreateRealRoot : out of memory !\n"); exit(1); } res->max_elem = 16; return(res); } /* * Add a given file to a directory. */ int rpmGetRealFile(rpmRealDirPtr parent, const char *file, void *elem) { int i, min, max; int res; /* * Search the index for the new file. */ min = i = 0; if (parent->nb_elem == 0) goto add_first_elem; max = parent->nb_elem - 1; while (min < max) { i = min + max; i /= 2; res = strcmp(file, parent->names[i]); if (res < 0) max = i - 1; else if (res > 0) min = i + 1; else { return(i); } } i = min; res = strcmp(file, parent->names[i]); if (res == 0) { return(i); } else if (res > 0) i++; /* * If more space is needed grow the arrays. */ if (parent->nb_elem >= parent->max_elem) { parent->max_elem *= 2; parent->elems = (void *) xmlRealloc(parent->elems, parent->max_elem * sizeof(void *)); parent->names = (void *) xmlRealloc(parent->names, parent->max_elem * sizeof(char *)); parent->flags = (void *) xmlRealloc(parent->flags, parent->max_elem * sizeof(char)); if ((parent->elems == NULL) || (parent->flags == NULL) || (parent->names == NULL)) { fprintf(stderr, "rpmAddRealFile : out of memory !\n"); exit(1); } } /* * Shift the end of the arrays. */ if (i < parent->nb_elem) { memmove(&parent->elems[i + 1], &parent->elems[i], (parent->nb_elem - i) * sizeof(void *)); memmove(&parent->names[i + 1], &parent->names[i], (parent->nb_elem - i) * sizeof(char *)); memmove(&parent->flags[i + 1], &parent->flags[i], (parent->nb_elem - i) * sizeof(char)); } add_first_elem: parent->nb_elem++; /* * Create the new entry. */ parent->elems[i] = elem; parent->names[i] = xmlStrdup(file); parent->flags[i] = 0; return(i); } /* * Get a given subdirectory of a directory. If it doesn't exist, * the subdir is added. The filename may have been added as a file * in that case turn it into a directory. */ rpmRealDirPtr rpmGetRealSubdir(rpmRealDirPtr parent, const char *subdir) { rpmRealDirPtr res; int i = rpmGetRealFile(parent, subdir, NULL); /* * Check if such a directory already exists. */ if (parent->flags[i] & RPM_ELEM_DIRECTORY) { return((rpmRealDirPtr) parent->elems[i]); } /* * Allocate a new rpmRealDir block and link it in. */ res = (rpmRealDirPtr) xmlMalloc(sizeof(rpmRealDir)); if (res == NULL) { fprintf(stderr, "rpmCreateRealRoot : out of memory !\n"); exit(1); } res->parent = parent; res->name = xmlStrdup(subdir); res->nb_elem = 0; res->elems = (void *) xmlMalloc(16 * sizeof(void *)); res->names = (void *) xmlMalloc(16 * sizeof(char *)); res->flags = (char *) xmlMalloc(16 * sizeof(char)); if ((res->elems == NULL) || (res->flags == NULL) || (res->names == NULL)) { fprintf(stderr, "rpmCreateRealRoot : out of memory !\n"); exit(1); } res->max_elem = 16; parent->elems[i] = res; parent->flags[i] = RPM_ELEM_DIRECTORY; return(res); } /* * Add a file to the real filesystem tree, and all memorize which * RPM provided it */ void rpmAddRealFile(rpmRealDirPtr root, const char *file, rpmDataPtr rpm) { static char path[2000]; char *filename; char *cur, save; rpmRealDirPtr curDir = root; if (root == NULL) return; if (file == NULL) return; if (rpm == NULL) return; strncpy(path, file, sizeof(path)); filename = &path[0]; if (*filename != '/') { if (rpm2htmlVerbose > 1) fprintf(stderr, "rpmAddRealFile : %s invalid\n", file); return; } cur = ++filename; while (*cur != '\0') { if (*cur == '/') { *cur = '\0'; curDir = rpmGetRealSubdir(curDir, filename); *cur = '/'; cur++; while (*cur == '/') cur++; filename = cur; } else if ((*cur == ' ') || (*cur == '\t') || (*cur == '\n') || (*cur == '\r')) { break; } else cur++; } if (*filename == '\0') return; save = *cur; *cur = '\0'; rpmGetRealFile(curDir, filename, rpm); *cur = save; } /* * Merge two real tree, this is somewhat messy since * we keep references to only one source package even if * two different distributions carries the same file (which * have a high probability). * * NOTE : the old trees are destoyed !!! */ rpmRealDirPtr rpmMergeRealRoots(rpmRealDirPtr root1, rpmRealDirPtr root2) { rpmRealDirPtr base, add; int j; if (root1 == NULL) return(root2); if (root2 == NULL) return(root1); /* * We keep the bigger one as-is and add-in the smaller one. */ if (root1->nb_elem > root2->nb_elem) { base = root1; add = root2; } else { base = root2; add = root1; } /* * For every element in add, search for the same entry in base. * If both exists, keep only the directories, if both are directories, * recurse ! */ for (j = 0;j < add->nb_elem;j++) { int i, min, max; int res; /* * Search the index for the new file. */ min = i = 0; max = base->nb_elem - 1; while (min < max) { i = min + max; i /= 2; res = strcmp(add->names[j], base->names[i]); if (res < 0) max = i - 1; else if (res > 0) min = i + 1; else goto entry_found; } i = min; res = strcmp(add->names[j], base->names[i]); if (res == 0) { goto entry_found; } else if (res > 0) i++; /* * The name was not found in base, add it ! * If more space is needed grow the arrays. */ if (base->nb_elem >= base->max_elem) { base->max_elem *= 2; base->elems = (void *) xmlRealloc(base->elems, base->max_elem * sizeof(void *)); base->names = (void *) xmlRealloc(base->names, base->max_elem * sizeof(char *)); base->flags = (void *) xmlRealloc(base->flags, base->max_elem * sizeof(char)); if ((base->elems == NULL) || (base->flags == NULL) || (base->names == NULL)) { fprintf(stderr, "rpmMergeRealRoots : out of memory !\n"); exit(1); } } /* * Shift the end of the arrays. */ if (i < base->nb_elem) { memmove(&base->elems[i + 1], &base->elems[i], (base->nb_elem - i) * sizeof(void *)); memmove(&base->names[i + 1], &base->names[i], (base->nb_elem - i) * sizeof(char *)); memmove(&base->flags[i + 1], &base->flags[i], (base->nb_elem - i) * sizeof(char)); } base->nb_elem++; /* * Create the new entry. */ base->elems[i] = add->elems[j]; base->names[i] = add->names[j]; base->flags[i] = add->flags[j]; continue; entry_found: /* * the name is present in both directories. */ if ((base->flags[i] & RPM_ELEM_DIRECTORY) && (add->flags[j] & RPM_ELEM_DIRECTORY)) { /* Two subdirectories, merge them */ base->elems[i] = rpmMergeRealRoots(base->elems[i], add->elems[j]); /* -------------- } else if (base->flags[i] & RPM_ELEM_DIRECTORY) { Keep base directory -------------- */ } else if (add->flags[j] & RPM_ELEM_DIRECTORY) { void *ptr; int val; /* Keep add directory */ ptr = base->names[i] ; base->names[i] = add->names[j]; add->names[j] = ptr; ptr = base->elems[i]; base->elems[i] = add->elems[j]; add->elems[j] = ptr; val = base->flags[i]; base->flags[i] = add->flags[j]; add->flags[j] = val; /* -------------- } else { Two files, arbitrarily keep base one, this is simpler ! -------------- */ } } rpmDestroyRealRoot(add); return(base); } /* * Destroy a real tree root. */ void rpmDestroyRealRoot(rpmRealDirPtr dir) { int i; for (i = 0;i < dir->nb_elem;i++) { if (dir->flags[i] & RPM_ELEM_DIRECTORY) { rpmDestroyRealRoot(dir->elems[i]); } xmlFree(dir->names[i]); } if (dir->elems) xmlFree(dir->elems); if (dir->names) xmlFree(dir->names); if (dir->flags) xmlFree(dir->flags); if (dir->name) xmlFree(dir->name); xmlFree(dir); } /* * Cleanup of the packages lists */ void rpmlistCleanup(void) { int i; fprintf(stderr, "rpmlistCleanup\n"); rpmDataListFree(&rpmSoftwareList); rpmRessListFree(&ressList); rpmRessListFree(&ressInstalledList); for (i = 0; i < HASH_SIZE;i++) { rpmHashTable[i] = NULL; rpmRessHashTable[i] = NULL; } rpmHashInitialize(); } /* * Cleanup of this module global varibales. */ void rpmdataCleanup(void) { int i; rpmDirListFree(&dirList); rpmDataListFree(&rpmSoftwareList); rpmRessListFree(&ressList); rpmRessListFree(&ressInstalledList); for (i = 0; i < HASH_SIZE;i++) { rpmHashTable[i] = NULL; rpmRessHashTable[i] = NULL; } dirList = NULL; dirTree = NULL; treeRoot = NULL; rpmHashInitialize(); } rpm2html-1.11.2/rpmopen.c0000664000076400007640000014664311466341726013707 0ustar hanyhany/* * rpmopen.c : open an extract information from RPM files. * * See Copyright for the status of this software. * * $Id: rpmopen.c,v 1.124 2010/11/09 21:57:42 hany Exp $ */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #ifdef HAVE_RPM42 #include #endif #ifndef HAVE_RPM_RPMLEGACY_H int readLead(FD_t fd, /*@out@*/struct rpmlead *lead); #endif #ifdef HAVE_RPM42 typedef enum sigType_e { RPMSIGTYPE_HEADERSIG= 5 /*!< Header style signature */ } sigType; int rpmReadSignature(FD_t fd, Header *sighp, sigType sig_type, const char ** msg); #else int rpmReadSignature(FD_t fd, /*@out@*/ Header *header, short sig_type); #endif #if defined(WITH_GPG) #include #endif #include "rpm2html.h" #include "rpmdata.h" #include "html.h" #include "rdf.h" #include "language.h" #ifdef WITH_SQL #include "sql.h" #endif #ifdef USE_RPMIO #ifndef rpmdbNextIterator typedef struct headerTagTableEntry_s *headerTagTableEntryPtr; #else typedef struct headerTagTableEntry *headerTagTableEntryPtr; #endif #else typedef struct headerTagTableEntry *headerTagTableEntryPtr; #endif #ifndef HAVE_SNPRINTF #error You really need snprintf ... #endif /* * Get the internal number associated with an RPM tag. */ // removal of this possibly breaks compatibility with some ancient RPM but while // some tags are alredy used as macros directly, without 'getTagNumber()', removal // of this methond hopefully wont make in worser BUT it will help us compile this // against rpm.org's rpm-4.6 // XXX TODO: clean-up //static int //getTagNumber(char *tag) //{ // int i; // headerTagTableEntryPtr t; // // t = (headerTagTableEntryPtr) rpmTagTable; // for (i = 0; i < rpmTagTableSize; i++, t++) { // if (!strcasecmp(tag, t->name)) // return (t->val); // } // fprintf(stderr, "getTagNumber(%s) : unknown tag !\n", tag); // return (-1); //} /* * Free up the extra data not needed for the last stage processing. */ void rpmFreeExtraData(rpmDataPtr rpm) { rpmExtraDataPtr extra; int n1; if ((rpm == NULL) || (rpm->extra == NULL)) return; extra = rpm->extra; if (extra->packager != NULL) xmlFree(extra->packager); if (extra->description != NULL) xmlFree(extra->description); if (extra->copyright != NULL) xmlFree(extra->copyright); if (extra->changelog != NULL) xmlFree(extra->changelog); if (extra->srcrpm != NULL) xmlFree(extra->srcrpm); if (extra->host != NULL) xmlFree(extra->host); if (extra->resources != NULL) xmlFree(extra->resources); if (extra->requires != NULL) xmlFree(extra->requires); if (extra->filelist != NULL) xmlFree(extra->filelist); if (extra->sigs != NULL) { for (n1 = 0; n1 < extra->nb_sigs; n1++) if (extra->sigs[n1] != NULL) { if (extra->sigs[n1]->sig != NULL) xmlFree(extra->sigs[n1]->sig); #if defined(WITH_GPG) if (extra->sigs[n1]->resolve != NULL) xmlFree(extra->sigs[n1]->resolve); #endif xmlFree(extra->sigs[n1]); } xmlFree(extra->sigs); } xmlFree(extra); } /* * check a dependancy name to get rid of bad deps due to bad scripts * or spec files. */ int checkResourceName(const char *res) { int isname = 0; const char *base = res; if (*res == 0) return (0); /* * we only accept absolute pathnames. */ if (*res == '/') isname = 1; while (*res != 0) { if (((*res >= 'A') && (*res <= 'Z')) || ((*res >= 'a') && (*res <= 'z')) || ((*res >= '0') && (*res <= '9')) || (*res == '-') || (*res == '.') || (*res == '@') || (*res == '_') || (*res == '(') || (*res == ')') || (*res == '+') || ((*res == '/') && (isname == 1))) res++; else return (0); //if ((res - base) > 100) // return (0); } return (1); } /* * check a release name */ int checkReleaseName(const char *res) { const char *base = res; if (*res == 0) return (0); while (*res != 0) { if (((*res >= 'A') && (*res <= 'Z')) || ((*res >= 'a') && (*res <= 'z')) || ((*res >= '0') && (*res <= '9')) || (*res == '-') || (*res == '.') || (*res == '@') || (*res == '_') || (*res == '+')) res++; else return (0); if ((res - base) > 65) return (0); } return (1); } /* * check a group name */ int checkGroupName(const char *res) { const char *base = res; while (*res != 0) { if (((*res >= 'A') && (*res <= 'Z')) || ((*res >= 'a') && (*res <= 'z')) || ((*res >= '0') && (*res <= '9')) || (*res == ' ') || (*res == '.') || (*res == '(') || (*res == ')') || (*res == '+') || (*res == '/') || (*res == '-')) res++; else return (0); //if ((res - base) > 60) // return (0); } return (1); } /* * check a version name */ int checkVersionName(const char *res) { const char *base = res; if (*res == 0) return (0); while (*res != 0) { if (((*res >= 'A') && (*res <= 'Z')) || ((*res >= 'a') && (*res <= 'z')) || ((*res >= '0') && (*res <= '9')) || (*res == '-') || (*res == '.') || (*res == '@') || (*res == '_') || (*res == '+')) res++; else return (0); //if ((res - base) > 20) // return (0); } return (1); } #if defined(WITH_GPG) /* * rpmResolveGPGPSignatures : resolve GPG and PGP signatures found in package * code based on rpm-4.0-0.45 */ void rpmResolveGPGPSignature(const char *nameRpm, const char *sigtarget, const char *sigfile, rpmDataPtr rpm, int sign) { int pid, status, outpipe[2]; FILE *file; int rsize = 128, crsize; unsigned char buf[8192]; char *temp; /* Now run GPG */ outpipe[0] = outpipe[1] = 0; pipe(outpipe); if (!(pid = fork())) { close(outpipe[0]); /* gpg version 0.9 sends its output to stderr. */ dup2(outpipe[1], STDERR_FILENO); execlp(GPG_PROG, GPG_PROG, "--batch", "--no-verbose", "--verify", sigfile, sigtarget, NULL); fprintf(stderr, "%s exec failed!\n", GPG_PROG); exit(1); } close(outpipe[1]); file = fdopen(outpipe[0], "r"); rpm->extra->sigs[sign]->resolve = xmlMalloc(sizeof(char) * rsize); rpm->extra->sigs[sign]->resolve[0] = '\0'; while (fgets(buf, 1024, file)) { crsize = strlen(buf) + strlen(rpm->extra->sigs[sign]->resolve); if (crsize >= rsize) { rsize = crsize * 2; rpm->extra->sigs[sign]->resolve = xmlRealloc(rpm->extra->sigs[sign]->resolve, sizeof(char) * rsize); if (rpm->extra->sigs[sign]->resolve == NULL) { fprintf(stderr, "cannot re-allocate %d bytes: %s\n", rsize, strerror(errno)); exit(1); } } strcat(rpm->extra->sigs[sign]->resolve, buf); } fclose(file); temp = xmlStrdup(protectEmail(rpm->extra->sigs[sign]->resolve)); xmlFree(rpm->extra->sigs[sign]->resolve); rpm->extra->sigs[sign]->resolve = temp; (void) waitpid(pid, &status, 0); } /* * rpmResolveMD5Signatures : resolve MD5 signatures found in package * code based on rpm-4.0-0.45 * for now, we are not checking whether MD5 sums are OK */ /*void rpmResolveMD5Signature(const char *nameRpm, const char *sigtarget, const char *sigfile, rpmDataPtr rpm, int sign) { }*/ /* * rpmResolveSignatures : resolve signatures found in package * code based on rpm-4.0-0.45 */ void rpmResolveSignatures(const char *path, const char *nameRpm, const char *sigtarget, rpmDataPtr rpm) { int sign = 0; if (rpm == NULL || rpm->extra->nb_sigs == 0 || sigtarget == NULL) return; for (sign = 0; sign < rpm->extra->nb_sigs; sign++) { FD_t sfd; char *sigfile = NULL; if (rpm->extra->sigs[sign]->tag != RPMSIGTAG_PGP && rpm->extra->sigs[sign]->tag != RPMSIGTAG_GPG) continue; /* Write out the signature */ sigfile = xmlMalloc(30); strcpy(sigfile, "/tmp/rpm2html.sig.XXXXXX"); sigfile = mktemp(sigfile); sfd = Fopen(sigfile, "w.fdio"); (void) Fwrite(rpm->extra->sigs[sign]->sig, sizeof(char), rpm->extra->sigs[sign]->size, sfd); Fclose(sfd); switch (rpm->extra->sigs[sign]->tag) { case RPMSIGTAG_PGP: case RPMSIGTAG_GPG: rpmResolveGPGPSignature(nameRpm, sigtarget, sigfile, rpm, sign); break; /*case RPMSIGTAG_MD5: * rpmResolveMD5Signature(nameRpm, sigtarget, sigfile, rpm, sign); * break; */ default: break; } if (sigfile != NULL) { unlink(sigfile); xmlFree(sigfile); } } } #endif /* * rpmAnalyze : analyze an RPM record, read and parse the header and * fill the information in the database. */ #define ENTRY_CLEANUP(p) \ if ((type == RPM_STRING_ARRAY_TYPE || type == RPM_I18NSTRING_TYPE)&&\ (p != NULL)) { free((p)); p = NULL; } static char *buffer = NULL; static int buffer_size = 50 * 1024 * sizeof(char); rpmDataPtr rpmAnalyze(char *path, char *nameRpm, const char *sigtarget, Header h, Header s, rpmDirPtr dir, rpmSubdirPtr tree, time_t stamp, int isSource) { int installed = dir->installbase; char *name = NULL, *version = NULL, *release = NULL; int_32 count, type; void *p = NULL; int val, i, j; rpmDataPtr rpm = NULL; static char nameBuffer[500]; #ifdef WITH_SQL int id; #endif HeaderIterator sIter; if (buffer == NULL) { buffer = (char *) xmlMalloc(buffer_size); if (buffer == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", buffer_size, strerror(errno)); exit(1); } } /* extract information from the header */ headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &count); if (name == NULL) { fprintf(stderr, "Invalid package %s : no name\n", nameRpm); return (NULL); } if (!(((name[0] >= 'a') && (name[0] <= 'z')) || ((name[0] >= 'A') && (name[0] <= 'Z')) || ((name[0] >= '0') && (name[0] <= '9')))) { fprintf(stderr, "Invalid package %s : garbled name\n", nameRpm); ENTRY_CLEANUP(name) return (NULL); } if (!checkResourceName(name)) { fprintf(stderr, "Invalid package %s : garbled name\n", nameRpm); ENTRY_CLEANUP(name) return (NULL); } headerGetEntry(h, RPMTAG_VERSION, &type, (void **) &version, &count); if ((version == NULL) || (version[0] == 0)) { fprintf(stderr, "Invalid package %s : version invalid\n", nameRpm); ENTRY_CLEANUP(name) ENTRY_CLEANUP(version) return (NULL); } if (!checkVersionName(version)) { fprintf(stderr, "Invalid package %s : garbled version\n", nameRpm); ENTRY_CLEANUP(name) ENTRY_CLEANUP(version) return (NULL); } headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &count); if ((release == NULL) || (release[0] == 0)) { fprintf(stderr, "Invalid package %s : release invalid\n", nameRpm); ENTRY_CLEANUP(name) ENTRY_CLEANUP(version) ENTRY_CLEANUP(release) return (NULL); } if (!checkReleaseName(release)) { fprintf(stderr, "Invalid package %s : garbled release\n", nameRpm); ENTRY_CLEANUP(name) ENTRY_CLEANUP(version) ENTRY_CLEANUP(release) return (NULL); } /* allocate a new rpmData block, and an rpmExtraData block fill them */ rpm = (rpmDataPtr) xmlMalloc(sizeof(rpmData)); if (rpm == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", sizeof(rpmData), strerror(errno)); return (NULL); } memset(rpm, 0, sizeof(rpmData)); rpm->extra = (rpmExtraDataPtr) xmlMalloc(sizeof(rpmExtraData)); if (rpm == NULL) { fprintf(stderr, "cannot allocate %d bytes: %s\n", sizeof(rpmExtraData), strerror(errno)); return (NULL); } memset(rpm->extra, 0, sizeof(rpmExtraData)); rpm->dir = dir; if (tree) { if ((tree->rpmpath != NULL) && (tree->rpmpath[0] != '\0')) rpm->subdir = stringAdd(tree->rpmpath); else rpm->subdir = NULL; } else rpm->subdir = NULL; rpm->extra->stamp = stamp; rpm->name = stringAdd(name); ENTRY_CLEANUP(name); rpm->version = stringAdd(version); ENTRY_CLEANUP(version); rpm->release = stringAdd(release); ENTRY_CLEANUP(release); /* get all the resources provided by this RPM */ if (!headerGetEntry(h, RPMTAG_SUMMARY, &type, &p, &count) || !p) { rpm->summary = xmlStrdup(localizedStrings[LANG_NO_SUMMARY]); } else { rpm->summary = xmlStrdup((char *) p); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_DESCRIPTION, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->extra->description = xmlStrdup(localizedStrings[LANG_NO_DESCRIPTION]); } else { rpm->extra->description = xmlStrdup((char *) p); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_DISTRIBUTION, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->distribution = stringAdd(localizedStrings[LANG_UNKNOWN]); } else { rpm->distribution = stringAdd((char *) p); } ENTRY_CLEANUP(p); if (isSource) { rpm->arch = stringAdd("src"); if (nameRpm == NULL) { snprintf(nameBuffer, sizeof(nameBuffer), "%s-%s-%s.src.rpm", name, version, release); nameRpm = nameBuffer; } } else { if (!headerGetEntry(h, RPMTAG_ARCH, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { if (type == RPM_INT8_TYPE) { /* * Old packages. */ switch (*((char *) p)) { case 1: rpm->arch = stringAdd("i386"); break; default: rpm->arch = stringAdd("src"); break; } } else rpm->arch = stringAdd(localizedStrings[LANG_NONE]); if (nameRpm == NULL) { snprintf(nameBuffer, sizeof(nameBuffer), "%s-%s-%s.rpm", name, version, release); nameRpm = nameBuffer; } } else { rpm->arch = stringAdd((char *) p); if (nameRpm == NULL) { snprintf(nameBuffer, sizeof(nameBuffer), "%s-%s-%s.%s.rpm", name, version, release, (char *) p); nameRpm = nameBuffer; } } ENTRY_CLEANUP(p); } if (!headerGetEntry(h, RPMTAG_OS, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { if (type == RPM_INT8_TYPE) { /* * Old packages. */ switch (*((char *) p)) { case 1: rpm->os = stringAdd("linux"); break; default: rpm->os = stringAdd("linux"); break; } } else rpm->os = stringAdd(""); } else { rpm->os = stringAdd((char *) p); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_VENDOR, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->vendor = NULL; } else { rpm->vendor = stringAdd(protectEmail((char *) p)); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_GROUP, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->group = stringAdd(localizedStrings[LANG_NO_GROUP]); } else { rpm->group = stringAdd((char *) p); } ENTRY_CLEANUP(p); if (!checkGroupName(rpm->group)) { fprintf(stderr, "Invalid package %s : garbled group\n", nameRpm); if (rpm->name) stringFree(rpm->name); if (rpm->version) stringFree(rpm->version); if (rpm->release) stringFree(rpm->release); if (rpm->summary) xmlFree(rpm->summary); if (rpm->distribution) stringFree(rpm->distribution); if (rpm->arch) stringFree(rpm->arch); if (rpm->os) stringFree(rpm->os); if (rpm->vendor != NULL) stringFree(rpm->vendor); if (rpm->group != NULL) stringFree(rpm->group); xmlFree(rpm); return (NULL); } if (!headerGetEntry(h, RPMTAG_BUILDHOST, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->extra->host = xmlStrdup(localizedStrings[LANG_NO_HOST]); } else { rpm->extra->host = xmlStrdup((char *) p); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_SIZE, &type, &p, &count) || !p) { rpm->size = 0; } else { rpm->size = *((int *) p); } ENTRY_CLEANUP(p); if (installed) { if (!headerGetEntry(h, RPMTAG_INSTALLTIME, &type, &p, &count) || !p) { rpm->date = 0; } else { rpm->date = *((int_32 *) p); } ENTRY_CLEANUP(p); } else { if (!headerGetEntry(h, RPMTAG_BUILDTIME, &type, &p, &count) || !p) { rpm->date = 0; } else { rpm->date = *((int_32 *) p); } ENTRY_CLEANUP(p); } if (!headerGetEntry(h, RPMTAG_SOURCERPM, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->extra->srcrpm = xmlStrdup(""); } else { rpm->extra->srcrpm = xmlStrdup((char *) p); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_URL, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->url = NULL; } else { rpm->url = xmlStrdup((char *) p); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_PACKAGER, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->extra->packager = NULL; } else { rpm->extra->packager = xmlStrdup(protectEmail((char *) p)); } ENTRY_CLEANUP(p); if (!headerGetEntry(h, RPMTAG_LICENSE, &type, &p, &count) || !p || (type != RPM_STRING_TYPE)) { rpm->extra->copyright = NULL; } else { rpm->extra->copyright = xmlStrdup((char *) p); } ENTRY_CLEANUP(p); /* Pick up changelog entries */ if (!headerGetEntry(h, RPMTAG_CHANGELOGTEXT, &type, &p, &count) || !p) { rpm->extra->changelog = NULL; } else { int_32 *dates; /* necessary when sizeof(time_t) != sizeof(int_32) */ time_t date; char **names; char **holdp = (char **) p; char *cp; struct tm *tm_buf; int i, len, pos; char date_string[50]; char *res = buffer; *res = '\0'; headerGetEntry(h, RPMTAG_CHANGELOGTIME, &type, (void *) &dates, &count); headerGetEntry(h, RPMTAG_CHANGELOGNAME, &type, (void *) &names, &count); for (i = 0; i < count; i++) { if ((res - buffer) > (buffer_size - 1024)) { int delta = res - buffer; buffer_size *= 2; buffer = (char *) xmlRealloc(buffer, buffer_size); if (buffer == NULL) { fprintf(stderr, "cannot re-allocate %d bytes: %s\n", buffer_size, strerror(errno)); exit(1); } res = &buffer[delta]; } date = dates[i]; tm_buf = localtime(&date); strftime(date_string, sizeof(date_string) - 1, "%a %b %d %Y", tm_buf); len = snprintf(res, buffer_size, "* %s %s\n", date_string, names[i]); res += len; cp = holdp[i]; pos = 0; if ((res - buffer + strlen(holdp[i])) > buffer_size) { int delta = res - buffer; buffer_size *= 2; buffer = (char *) xmlRealloc(buffer, buffer_size); if (buffer == NULL) { fprintf(stderr, "cannot re-allocate %d bytes: %s\n", buffer_size, strerror(errno)); exit(1); } res = &buffer[delta]; } while (*cp) { if (pos++ == 0) { *res++ = ' '; *res++ = ' '; } *res++ = *cp; if (*cp++ == '\n') pos = 0; } *res++ = '\n'; } *res = '\0'; rpm->extra->changelog = xmlStrdup(protectEmail(buffer)); ENTRY_CLEANUP(names); } ENTRY_CLEANUP(p); if (rpm->vendor == NULL) { if (rpm->extra->packager != NULL) rpm->vendor = xmlStrdup(rpm->extra->packager); else rpm->vendor = xmlStrdup(localizedStrings[LANG_UNKNOWN]); } if (s == NULL) rpm->extra->sigs = NULL; else { int tag, type; rpm->extra->max_sigs = 1; rpm->extra->sigs = (rpmSigPtr *) xmlMalloc(sizeof(rpmSigPtr) * rpm->extra->max_sigs); rpm->extra->sigs[0] = NULL; rpm->extra->nb_sigs = 0; for (sIter = headerInitIterator(s); headerNextIterator(sIter, &tag, &type, (void *) &p, &count);) { if ((tag != RPMSIGTAG_MD5) && (tag != RPMSIGTAG_PGP) && (tag != RPMSIGTAG_GPG)) continue; if (rpm->extra->nb_sigs >= rpm->extra->max_sigs) { rpm->extra->max_sigs *= 2; rpm->extra->sigs = (rpmSigPtr *) xmlRealloc(rpm->extra->sigs, sizeof(rpmSigPtr) * rpm->extra->max_sigs); if (rpm->extra->sigs == NULL) { fprintf(stderr, "cannot re-allocate %d bytes: %s\n", rpm->extra->max_sigs, strerror(errno)); exit(1); } } rpm->extra->sigs[rpm->extra->nb_sigs] = (rpmSigPtr) xmlMalloc(sizeof(rpmSig)); rpm->extra->sigs[rpm->extra->nb_sigs]->tag = tag; rpm->extra->sigs[rpm->extra->nb_sigs]->type = type; rpm->extra->sigs[rpm->extra->nb_sigs]->size = count; rpm->extra->sigs[rpm->extra->nb_sigs]->sig = xmlMalloc(count); memcpy(rpm->extra->sigs[rpm->extra->nb_sigs]->sig, p, count); #if defined(WITH_GPG) rpm->extra->sigs[rpm->extra->nb_sigs]->resolve = NULL; #endif rpm->extra->nb_sigs++; ENTRY_CLEANUP(p); } } rpm->filename = xmlStrdup(nameRpm); /* package-xxx.rpm provides at least the resource "package" */ val = RPMTAG_PROVIDES; if (!headerGetEntry(h, val, &type, &p, &count) || !p) { rpm->extra->nb_resources = 1; rpm->extra->max_resources = 1; rpm->extra->resources = (rpmRessPtr *) xmlMalloc(sizeof(rpmRessPtr) * rpm->extra->max_resources); if (rpm->extra->resources == NULL) { fprintf(stderr, ": ran out of memory\n"); exit(1); } rpm->extra->resources[0] = rpmRessAdd(name, rpm, installed); } else { rpm->extra->max_resources = count + 1; rpm->extra->resources = (rpmRessPtr *) xmlMalloc(sizeof(rpmRessPtr) * rpm->extra->max_resources); if (rpm->extra->resources == NULL) { fprintf(stderr, ": ran out of memory\n"); exit(1); } rpm->extra->resources[0] = rpmRessAdd(name, rpm, installed); rpm->extra->nb_resources = 1; for (i = 0, j = rpm->extra->nb_resources; i < count; i++) { if (!checkResourceName(((char **) p)[i])) continue; if (!strcmp(((char **) p)[i], name)) continue; rpm->extra->resources[j++] = rpmRessAdd(((char **) p)[i], rpm, installed); } rpm->extra->nb_resources = j; } ENTRY_CLEANUP(p); val = RPMTAG_REQUIRENAME; if (!headerGetEntry(h, val, &type, &p, &count) || !p) { rpm->extra->nb_requires = 0; rpm->extra->requires = NULL; } else { int_32 count2, count3, type2, type3; void *q = NULL; void *r = NULL; int valv, valf; rpm->extra->max_requires = count; rpm->extra->requires = (rpmRessPtr *) xmlMalloc(sizeof(rpmRessPtr) * rpm->extra->max_requires); if (rpm->extra->requires == NULL) { fprintf(stderr, ": ran out of memory\n"); exit(1); } valv = RPMTAG_REQUIREVERSION; valf = RPMTAG_REQUIREFLAGS; headerGetEntry(h, valv, &type2, &q, &count2); headerGetEntry(h, valf, &type3, &r, &count3); rpm->extra->nb_requires = 0; for (i = 0, j = 0; (i < count2) && (i < count3); i++) { long anint = *(((long *) r) + i); rpm_dep_flag flag = RPM2HTML_REQ_NONE; if ((anint & RPMSENSE_LESS) && (anint & RPMSENSE_EQUAL)) flag = RPM2HTML_REQ_LEQ; else if (anint & RPMSENSE_LESS) flag = RPM2HTML_REQ_LT; if ((anint & RPMSENSE_GREATER) && (anint & RPMSENSE_EQUAL)) flag = RPM2HTML_REQ_GEQ; else if (anint & RPMSENSE_GREATER) flag = RPM2HTML_REQ_GT; else if (anint & RPMSENSE_EQUAL) flag = RPM2HTML_REQ_EQU; if (!checkResourceName(((char **) p)[i])) continue; rpm->extra->requires[j++] = rpmRequAdd(((char **) p)[i], ((char **) q)[i], flag, rpm, installed); } rpm->extra->nb_requires = j; if ((type2 == RPM_STRING_ARRAY_TYPE || type2 == RPM_I18NSTRING_TYPE) && (q != NULL)) { free((q)); q = NULL; } if ((type3 == RPM_STRING_ARRAY_TYPE || type3 == RPM_I18NSTRING_TYPE) && (r != NULL)) { free((r)); r = NULL; } for (; i < count; i++) rpmRequAdd(((char **) p)[i], NULL, RPM2HTML_REQ_NONE, rpm, installed); } ENTRY_CLEANUP(p); #ifdef HAVE_RPM42 const char *fname; rpmfi fi; fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, 0); if (rpmfiFC(fi) <= 0) rpm->extra->filelist = NULL; /* No filelist in the package ! */ else { fi = rpmfiInit(fi, 0); char *ptr = buffer; while (rpmfiNext(fi) >= 0) { fname = rpmfiFN(fi); #else #if defined(RPMTAG_FILENAMES) val = RPMTAG_FILENAMES; headerGetEntry(h, val, &type, &p, &count); #else rpmBuildFileList(h, (const char ***) &p, &count); #endif if (count == 0) { rpm->extra->filelist = NULL; /* No filelist in the package ! */ } else { char *ptr = buffer; for (i = 0; i < count; i++) { #endif if ((ptr - buffer) > (buffer_size - 1024)) { int delta = ptr - buffer; buffer_size *= 2; buffer = (char *) xmlRealloc(buffer, buffer_size); if (buffer == NULL) { fprintf(stderr, "cannot re-allocate %d bytes: %s\n", buffer_size, strerror(errno)); exit(1); } ptr = &buffer[delta]; } #ifdef HAVE_RPM42 ptr += snprintf(ptr, buffer_size, "%s\n", fname); #else ptr += snprintf(ptr, buffer_size, "%s\n", ((char **) p)[i]); #endif } #ifdef HAVE_RPM42 fi = rpmfiFree(fi); #endif rpm->extra->filelist = xmlStrdup(buffer); } #ifndef HAVE_RPM42 ENTRY_CLEANUP(p); #endif #ifdef WITH_GPG rpmResolveSignatures(path, nameRpm, sigtarget, rpm); #endif #ifdef WITH_SQL if ((path == NULL) || (!sql_get_package_id(path))) { id = sql_add_package(path, rpm->name, rpm->version, rpm->release, rpm->arch, dir->no, rpm->url, rpm->extra->srcrpm, dir->vendor, rpm->extra->packager, rpm->group, rpm->summary, rpm->extra->description, rpm->extra->copyright, rpm->date, rpm->size, rpm->os, rpm->distribution, rpm->vendor); if (id > 0) { for (i = 0; i < rpm->extra->nb_resources; i++) sql_add_provides(id, rpm->extra->resources[i]->name); for (i = 0; i < rpm->extra->nb_requires; i++) sql_add_requires(id, rpm->extra->requires[i]->name, rpm->extra->requires[i]->flag, rpm->extra->requires[i]->version); } } else id = 0; #endif /* Add the package files to the real filesystem tree if asked for */ #ifdef WITH_SQL if ((rpm->extra->filelist != NULL) && ((dir->build_tree != 0) || (id > 0))) { #else if ((dir->build_tree != 0) && (rpm->extra->filelist != NULL)) { #endif char *cur, *filename; cur = rpm->extra->filelist; while ((*cur != '\0') && (*cur != '/')) cur++; filename = cur; while (*cur != '\0') { if ((*cur == '\n') || (*cur == '\r')) { if (cur != filename) { #ifdef WITH_SQL if (dir->build_tree != 0) rpmAddRealFile(dir->root, filename, rpm); if (id > 0) { *cur = 0; sql_add_file(filename, id); *cur = '\n'; } #else rpmAddRealFile(dir->root, filename, rpm); #endif } while ((*cur != '\0') && (*cur != '/')) cur++; filename = cur; } else cur++; } if (cur != filename) rpmAddRealFile(dir->root, filename, rpm); } /* Register this package */ rpmAddSoftware(rpm); /* dump the HTML related to this package */ if ((rpm2html_dump_html) && (dir->html)) dumpRpmHtml(rpm, tree); if (rpm2html_dump_rdf) // TODO compare also last-modification-time of package on RDF (if existing) and dump RDF only if package is newer or RDF does not exists dumpRpmRdf(rpm, tree); /* free the extra data */ rpmFreeExtraData(rpm); /* increment the counters */ if (installed) { rpm2html_install_files++; rpm2html_install_size += rpm->size / 1024; } else { rpm2html_files++; rpm2html_size += rpm->size / 1024; } return (rpm); } /* * rpmOpen : open an RPM file, read and parse the header and * fill the information in the database. */ rpmDataPtr rpmOpen(char *nameRpm, rpmDirPtr dir, rpmSubdirPtr tree) { rpmDataPtr cur; FD_t fd; int rc; Header h = NULL; Header s = NULL; #ifndef HAVE_RPM_RPMLEGACY_H struct rpmlead lead; #endif int isSource; char buffer[500]; struct stat buf; #if defined(WITH_GPG) FD_t ofd = NULL; char *sigtarget = NULL; ssize_t count; unsigned char stbuffer[8192]; #endif /* open the file for reading */ if (tree->htmlpath[0] != '\0') snprintf(buffer, sizeof(buffer), "%s/%s/%s", dir->rpmdir, tree->rpmpath, nameRpm); else snprintf(buffer, sizeof(buffer), "%s/%s", dir->rpmdir, nameRpm); if (access(buffer, R_OK) < 0) { fprintf(stderr, "open of %s failed: %s\n", buffer, strerror(errno)); return (NULL); } fd = Fopen(buffer, "r.fdio"); if (fd == NULL || Ferror(fd)) { fprintf(stderr, "Fopen of %s failed: %s\n", buffer, Fstrerror(fd)); return (NULL); } stat(buffer, &buf); /* read the RPM header */ #if defined(_RPMVSF_NODIGESTS) { rpmts ts = rpmtsCreate(); /* do no verifications except the SHA1 header */ /* for performance reasons (see redhat bugzilla #83320) */ rpmtsSetVSFlags(ts, ~RPMVSF_NOSHA1HEADER); rc = rpmReadPackageFile(ts, fd, buffer, &h); ts = rpmtsFree(ts); } #else rc = rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL); #endif switch (rc) { case 0: if (!h) { fprintf(stderr, "old format source packages cannot be queried\n"); Fclose(fd); return (NULL); } isSource = (headerIsEntry(h, RPMTAG_SOURCEPACKAGE) ? 1 : 0); break; case 1: fprintf(stderr, "%s does not appear to be a RPM package\n", nameRpm); Fclose(fd); return (NULL); case 2: fprintf(stderr, "query of %s failed\n", nameRpm); Fclose(fd); return (NULL); case 4: fprintf(stderr, "%s: Error %d Found and Ignored\n", nameRpm, rc); if (!h) { fprintf(stderr, "packages cannot be queried\n"); Fclose(fd); return (NULL); } isSource = (headerIsEntry(h, RPMTAG_SOURCEPACKAGE) ? 1 : 0); break; default: fprintf(stderr, "rpmReadPackageHeader(%s): unknown error %d\n", nameRpm, rc); Fclose(fd); return (NULL); } #ifdef HAVE_RPM_RPMLEGACY_H // XXX phanecak: for now I do not know how to read signatures with rpm.org 4.6 or later #else // ifdef HAVE_RPM_RPMLEGACY_H /* read the RPM signature */ if (readLead(fd, &lead)) { fprintf(stderr, "readLead failed\n"); fdClose(fd); return (NULL); } switch (lead.major) { case 1: fprintf(stderr, "no signature available (v1.0 RPM) in %s\n", nameRpm); break; default: #ifdef HAVE_RPM42 if (rpmReadSignature(fd, &s, lead.signature_type, NULL)) { #else if (rpmReadSignature(fd, &s, lead.signature_type)) { #endif fprintf(stderr, "rpmReadSignature failed\n"); fdClose(fd); return (NULL); } if (!s) { fprintf(stderr, "no signature available in %s\n", nameRpm); fdClose(fd); return (NULL); } #if defined(WITH_GPG) /* open temp file for writing */ sigtarget = xmlMalloc(30); strcpy(sigtarget, "/tmp/rpm2html.date.XXXXXX"); sigtarget = mktemp(sigtarget); ofd = Fopen(sigtarget, "w.ufdio"); if (ofd == NULL || Ferror(ofd)) { fprintf(stderr, "Fopen of %s failed: %s\n", sigtarget, Fstrerror(ofd)); xmlFree(sigtarget); sigtarget = NULL; } /* write the header and archive to a temp file */ while ((count = Fread(stbuffer, sizeof(stbuffer[0]), sizeof(stbuffer), fd)) > 0) { if (Fwrite(stbuffer, sizeof(stbuffer[0]), count, ofd) < 0) { fprintf(stderr, "%s: Fwrite failed: %s\n", sigtarget, Fstrerror(ofd)); xmlFree(sigtarget); sigtarget = NULL; } } if (count < 0) { fprintf(stderr, "%s: Fread failed: %s\n", buffer, Fstrerror(fd)); xmlFree(sigtarget); sigtarget = NULL; } Fclose(ofd); #endif break; } #endif // ifdef HAVE_RPM_RPMLEGACY_H /* close the descriptor */ Fclose(fd); #if defined(WITH_GPG) cur = rpmAnalyze(buffer, nameRpm, sigtarget, h, s, dir, tree, buf.st_mtime, isSource); #else cur = rpmAnalyze(buffer, nameRpm, NULL, h, s, dir, tree, buf.st_mtime, isSource); #endif /* free the header */ headerFree(h); headerFree(s); #if defined(WITH_GPG) if (sigtarget) { unlink(sigtarget); xmlFree(sigtarget); } #endif return (cur); } /* * Scan one directory for RPM files this is where the recursive handling * is done. */ static rpmDataPtr rpmOneDirScan(rpmDirPtr dir, rpmSubdirPtr tree) { rpmSubdirPtr subtree; rpmDataPtr ret = NULL, cur; char *filename; static char path[2000]; struct stat buf; int len; DIR *d; struct dirent *file; /* * Create the directory for the HTML pages */ if ((rpm2html_dump_html) && (dir->html)) { if (tree->htmlpath[0] != '\0') snprintf(path, sizeof(path), "%s/%s", dir->dir, tree->htmlpath); else snprintf(path, sizeof(path), "%s", dir->dir); createDirectory(path); } /* * Scan the repository. */ if (tree->rpmpath[0] != '\0') snprintf(path, sizeof(path), "%s/%s", dir->rpmdir, tree->rpmpath); else snprintf(path, sizeof(path), "%s", dir->rpmdir); if (rpm2htmlVerbose > 1) printf("Scanning directory %s\n", path); d = opendir(path); if (d == NULL) { fprintf(stderr, "Listing of %s failed: %s\n", path, strerror(errno)); rpmRemoveSubdir(tree); rpmFreeSubdir(tree); tree = NULL; return (NULL); } else { while ((file = readdir(d)) != NULL) { cur = NULL; filename = file->d_name; len = strlen(filename); /* * Compute the full path */ if (tree->rpmpath[0] != '\0') snprintf(path, sizeof(path), "%s/%s/%s", dir->rpmdir, tree->rpmpath, filename); else snprintf(path, sizeof(path), "%s/%s", dir->rpmdir, filename); /* * Stat() the file to detect directory and symlimks */ if (lstat(path, &buf) != 0) { fprintf(stderr, "Couldn't stat(%s)\n", path); continue; } /* * Check for RPM files by looking at the suffix * Note that SuSE source RPMs have a ".spm" suffix * We may or may not follow symlinks to RPM files */ if (((len >= 5) && (!strcasecmp(&filename[len - 4], ".rpm"))) || ((len >= 5) && (!strcasecmp(&filename[len - 4], ".spm")))) { if ((S_ISLNK(buf.st_mode)) && (dir->rpm_symlinks == 0)) { if (rpm2htmlVerbose > 1) fprintf(stderr, "Dropping symlink %s\n", path); continue; } cur = rpmOpen(filename, dir, tree); } /* * Don't follow of analyze symlinks, */ else if ((S_ISLNK(buf.st_mode)) && (dir->follow_symlinks == 0)) { if (rpm2htmlVerbose > 1) fprintf(stderr, "Dropping symlink %s\n", path); continue; } /* * Check for RDF files by looking at the suffix */ else if ((len >= 5) && (!strcasecmp(&filename[len - 4], ".rdf"))) { cur = rpmOpenRdf(filename, dir, tree); } /* * Else if this is a directory, recurse ! */ else if (S_ISDIR(buf.st_mode)) { if (filename[0] != '.') { subtree = rpmNewSubdir(tree, filename, NULL, NULL, NULL, 0); cur = rpmOneDirScan(dir, subtree); } } if (cur != NULL) ret = rpmAddList(ret, cur); } } closedir(d); /* * Dump the pages related to this directory. */ if (ret != NULL) ret = dumpDirIndex(dir, tree, ret); else { rpmRemoveSubdir(tree); rpmFreeSubdir(tree); tree = NULL; } return (ret); } /* * Scan a directory for RPM files. */ static rpmDataPtr rpmDirScan(rpmDirPtr dir, rpmSubdirPtr tree) { rpmSubdirPtr cur; rpmDataPtr ret; if ((rpm2html_dump_html) && (dir->html) && (dir->build_tree != 0)) { dir->root = rpmCreateRealRoot(); } cur = rpmNewSubdir(tree, dir->name, dir->subdir == NULL ? "" : dir->subdir, "", dir->color, dir->html); ret = rpmOneDirScan(dir, cur); rpmDumpHtmlRealRoot(dir); return (ret); } /* * Scan the local RPM database for RPM files. */ static rpmDataPtr rpmBaseScan(rpmDirPtr dir) { static char path[2000]; rpmDataPtr ret = NULL, cur; rpmdb db; Header h = NULL; char *prefix = "/"; rpmdbMatchIterator mi; #ifdef WITH_SQL dir->no = sql_get_distrib_by_directory(dir->rpmdir); #endif /* * Create the directory for the HTML pages */ if ((rpm2html_dump_html) && (dir->html)) { if (dir->subdir) snprintf(path, sizeof(path), "%s/%s", dir->dir, dir->subdir); else snprintf(path, sizeof(path), "%s", dir->dir); createDirectory(path); } /* * Create the directory for the RDF pages */ if (rpm2html_rdf_dir != NULL) { if (dir->subdir) snprintf(path, sizeof(path), "%s/%s", rpm2html_rdf_dir, dir->subdir); else snprintf(path, sizeof(path), "%s", rpm2html_rdf_dir); createDirectory(path); } if (rpm2htmlVerbose) printf("Scanning the database of installed RPMs\n"); if (dir->dbpath != NULL) addMacro(NULL, "_dbpath", NULL, dir->dbpath, -7); /* Added by A.Gibert */ if (rpmdbOpen(prefix, &db, O_RDONLY, 0644)) { return (NULL); } mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, NULL, 0); while ((h = rpmdbNextIterator(mi)) != NULL) { cur = rpmAnalyze(NULL, NULL, NULL, h, NULL, dir, NULL, 0, 0); if (cur != NULL) ret = rpmAddList(ret, cur); } rpmdbFreeIterator(mi); rpmdbClose(db); return (ret); } /* * Scan one directory only */ void rpmDirScanOneDir(const char *directory) { rpmDirPtr dir; rpmDataPtr cur; /* * first try to find the distrib */ dir = dirList; while (dir != NULL) { if (!strcasecmp(dir->rpmdir, directory)) break; dir = dir->next; } if (dir == NULL) { fprintf(stderr, "rpmDirScanOneDir(%s): distribution not found\n", directory); return; } if (rpm2htmlVerbose) printf("indexing %s\n", dir->name); /* * Allocate a directory tree. */ dirTree = rpmNewSubdir(NULL, "", "", "", NULL, 1); cur = NULL; /* * Override default setting. */ if ((dir->maint == NULL) && (rpm2html_maint != NULL)) dir->maint = xmlStrdup(rpm2html_maint); if ((dir->mail == NULL) && (rpm2html_mail != NULL)) dir->mail = xmlStrdup(rpm2html_mail); if ((dir->ftp == NULL) && (rpm2html_ftp != NULL)) dir->ftp = xmlStrdup(rpm2html_ftp); if ((dir->ftpsrc == NULL) && (rpm2html_ftpsrc != NULL)) dir->ftpsrc = xmlStrdup(rpm2html_ftpsrc); if ((dir->dir == NULL) && (rpm2html_dir != NULL)) dir->dir = xmlStrdup(rpm2html_dir); if ((dir->host == NULL) && (rpm2html_host != NULL)) dir->host = xmlStrdup(rpm2html_host); if ((dir->name == NULL) && (rpm2html_name != NULL)) dir->name = xmlStrdup(rpm2html_name); if ((dir->url == NULL) && (rpm2html_url != NULL)) dir->url = xmlStrdup(rpm2html_url); if (dir->rpmdir == NULL) { fprintf(stderr, "?!? rpmDir without directory ?!? disabled !\n"); } else if (!strncmp(dir->rpmdir, "localbase", 9)) { /* Scan the local RPM database instead of a directory */ cur = rpmBaseScan(dir); } else if (dir->ftp == NULL) { fprintf(stderr, "Directory %s disabled : no ftp field\n", dir->rpmdir); } else { #ifdef WITH_SQL dir->no = sql_get_distrib_by_directory(dir->rpmdir); #endif if (rpm2htmlVerbose) printf("Scanning directory %s for RPMs\n", dir->rpmdir); cur = rpmDirScan(dir, dirTree); } } /* * Scan one distribution only */ void rpmDirScanOneDist(const char *dist) { rpmDirPtr dir; rpmDataPtr cur; /* * first try to find the distrib */ dir = dirList; while (dir != NULL) { if (!strcasecmp(dir->name, dist)) break; if (!strcasecmp(dir->subdir, dist)) break; if (!strcasecmp(dir->rpmdir, dist)) break; dir = dir->next; } if (dir == NULL) { dir = dirList; while (dir != NULL) { if (!strstr(dir->name, dist)) break; if (!strstr(dir->subdir, dist)) break; if (!strstr(dir->rpmdir, dist)) break; dir = dir->next; } } if (dir == NULL) { fprintf(stderr, "rpmDirScanOneDist(%s): distribution not found\n", dist); return; } if (rpm2htmlVerbose) printf("indexing %s\n", dir->name); /* * Allocate a directory tree. */ dirTree = rpmNewSubdir(NULL, "", "", "", NULL, 1); cur = NULL; /* * Override default setting. */ if ((dir->maint == NULL) && (rpm2html_maint != NULL)) dir->maint = xmlStrdup(rpm2html_maint); if ((dir->mail == NULL) && (rpm2html_mail != NULL)) dir->mail = xmlStrdup(rpm2html_mail); if ((dir->ftp == NULL) && (rpm2html_ftp != NULL)) dir->ftp = xmlStrdup(rpm2html_ftp); if ((dir->ftpsrc == NULL) && (rpm2html_ftpsrc != NULL)) dir->ftpsrc = xmlStrdup(rpm2html_ftpsrc); if ((dir->dir == NULL) && (rpm2html_dir != NULL)) dir->dir = xmlStrdup(rpm2html_dir); if ((dir->host == NULL) && (rpm2html_host != NULL)) dir->host = xmlStrdup(rpm2html_host); if ((dir->name == NULL) && (rpm2html_name != NULL)) dir->name = xmlStrdup(rpm2html_name); if ((dir->url == NULL) && (rpm2html_url != NULL)) dir->url = xmlStrdup(rpm2html_url); if (dir->rpmdir == NULL) { fprintf(stderr, "?!? rpmDir without directory ?!? disabled !\n"); } else if (!strncmp(dir->rpmdir, "localbase", 9)) { /* Scan the local RPM database instead of a directory */ cur = rpmBaseScan(dir); } else if (dir->ftp == NULL) { fprintf(stderr, "Directory %s disabled : no ftp field\n", dir->rpmdir); } else { #ifdef WITH_SQL dir->no = sql_get_distrib_by_directory(dir->rpmdir); #endif if (rpm2htmlVerbose) printf("Scanning directory %s for RPMs\n", dir->rpmdir); cur = rpmDirScan(dir, dirTree); } if (dir->root != NULL) { rpmDestroyRealRoot(dir->root); dir->root = NULL; } rpmFreeSubdir(dirTree); dirTree = NULL; } /* * Scan all registered directories. * One fist check for completeness of the information in * the rpmDir structure. */ rpmDataPtr rpmDirScanAll(void) { rpmDirPtr dir, next; rpmDataPtr ret = NULL, cur; #ifndef WITH_SQL int maxLists = 50; rpmDataPtr *rpmLists; int nbLists = 0; int i; #endif /* * first reverse the list .... */ dir = dirList; dirList = NULL; while (dir != NULL) { next = dir->next; dir->next = dirList; dirList = dir; dir = next; } dir = dirList; /* * Allocate a directory tree. */ dirTree = rpmNewSubdir(NULL, "", "", "", NULL, 1); #ifndef WITH_SQL rpmLists = (rpmDataPtr *) xmlMalloc(maxLists * sizeof(rpmDataPtr)); if (rpmLists == NULL) { fprintf(stderr, "rpmDirScanAll : running out of memory !\n"); exit(1); } #endif while (dir != NULL) { cur = NULL; /* * Complete with default setting. */ if ((dir->maint == NULL) && (rpm2html_maint != NULL)) dir->maint = xmlStrdup(rpm2html_maint); if ((dir->mail == NULL) && (rpm2html_mail != NULL)) dir->mail = xmlStrdup(rpm2html_mail); if ((dir->ftp == NULL) && (rpm2html_ftp != NULL)) dir->ftp = xmlStrdup(rpm2html_ftp); if ((dir->ftpsrc == NULL) && (rpm2html_ftpsrc != NULL)) dir->ftpsrc = xmlStrdup(rpm2html_ftpsrc); if ((dir->dir == NULL) && (rpm2html_dir != NULL)) dir->dir = xmlStrdup(rpm2html_dir); if ((dir->host == NULL) && (rpm2html_host != NULL)) dir->host = xmlStrdup(rpm2html_host); if ((dir->name == NULL) && (rpm2html_name != NULL)) dir->name = xmlStrdup(rpm2html_name); if ((dir->url == NULL) && (rpm2html_url != NULL)) dir->url = xmlStrdup(rpm2html_url); if (dir->rpmdir == NULL) { fprintf(stderr, "?!? rpmDir without directory ?!? disabled !\n"); } else if (!strncmp(dir->rpmdir, "localbase", 9)) { /* Scan the local RPM database instead of a directory */ cur = rpmBaseScan(dir); } else if (dir->ftp == NULL) { fprintf(stderr, "Directory %s disabled : no ftp field\n", dir->rpmdir); } else { #ifdef WITH_SQL dir->no = sql_get_distrib_by_directory(dir->rpmdir); #endif if (rpm2htmlVerbose) printf("Scanning directory %s for RPMs\n", dir->rpmdir); cur = rpmDirScan(dir, dirTree); } #ifdef WITH_SQL /* * The packages list will be reextratced from the * database at the end, minimize memory consumption */ rpmlistCleanup(); #else if (cur != NULL) { if (nbLists >= maxLists) { maxLists *= 2; rpmLists = (rpmDataPtr *) xmlRealloc(rpmLists, maxLists * sizeof(rpmDataPtr)); if (rpmLists == NULL) { fprintf(stderr, "rpmDirScanAll : running out of memory!\n"); exit(1); } } rpmLists[nbLists] = cur; nbLists++; } #endif if (dir->root != NULL) { rpmDestroyRealRoot(dir->root); dir->root = NULL; } dir = dir->next; } #ifndef WITH_SQL for (i = 0; i < nbLists; i++) ret = rpmAddList(ret, rpmLists[i]); xmlFree(rpmLists); #endif return (ret); } /* * Cleanup the global variables from this module */ void rpmopenCleanup(void) { if (buffer != NULL) xmlFree(buffer); buffer = NULL; buffer_size = 50 * 1024 * sizeof(char); } rpm2html-1.11.2/stringbuf.c0000664000076400007640000000703707217421437014220 0ustar hanyhany/* * stringbuf.h: interface for the String buffering module. * * daniel@veillard.com */ #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include "stringbuf.h" #include "memory.h" /* * Not the default, too heavy on CPU ... */ #ifdef WITH_STRING_BUF #define CLEANUP_FREQUENCY 2000 /* * An hash table for the Strings */ #define HASH_SIZE 65536 typedef struct stringHash { struct stringHash *next; /* next clash in the hash table */ int use; /* number of references */ const char *val; /* the string value */ } stringHash, *stringHashPtr; stringHashPtr stringHashTable[HASH_SIZE]; /* * Hash table initialization. */ static int stringHashInitialized = 0; static void stringHashInitialize(void) { int i; for (i = 0; i < HASH_SIZE; i++) { stringHashTable[i] = NULL; } stringHashInitialized = 1; } /* * Compute an hash key */ static int stringGetHash(const char *str) { unsigned short res = 0; while (*str != 0) res += *(str++); return((int) (res % HASH_SIZE)); } /* * Cleanup the hash table for unused entries */ void stringTableCleanup(void) { int key; int used = 0, entries = 0; stringHashPtr cur; stringHashPtr prev; for (key =0;key < HASH_SIZE;key++) { if (stringHashTable[key] != NULL) used++; while (stringHashTable[key] != NULL) { if (stringHashTable[key]->use == 0) { cur = stringHashTable[key]->next; stringHashTable[key]->val = NULL; stringHashTable[key]->use = 0; stringHashTable[key]->next = NULL; xmlFree(stringHashTable[key]); stringHashTable[key] = cur; } else { entries++; prev = stringHashTable[key]; cur = stringHashTable[key]->next; while (cur != NULL) { if (cur->use == 0) { xmlFree(cur->val); prev->next = cur->next; cur->next = NULL; xmlFree(cur); cur = prev->next; } else { entries++; prev = cur; cur = cur->next; } } goto next_key; } } next_key: } printf("String Buffer: %d entries, %d hash\n", entries, used); } /* * Duplicate an "external" string. Search the string in the * list if not found, add it, otherwise increment the counter. */ const char *stringAdd(const char *str) { int key; stringHashPtr cur; static int toCleanup = CLEANUP_FREQUENCY; if (stringHashInitialized == 0) stringHashInitialize(); toCleanup--; if (toCleanup <= 0) { toCleanup = CLEANUP_FREQUENCY; stringTableCleanup(); } key = stringGetHash(str); cur = stringHashTable[key]; while (cur != NULL) { if (!strcmp(str, cur->val)) { cur->use++; return(cur->val); } cur = cur->next; } cur = xmlMalloc(sizeof(stringHash)); cur->val = xmlStrdup(str); cur->use = 1; cur->next = stringHashTable[key]; stringHashTable[key] = cur; return(cur->val); } /* * Free a duplicate of the string. Decrement the counter, if zero, * free the string and remove it from the list. */ void stringFree(const char *str) { int key; stringHashPtr cur; key = stringGetHash(str); cur = stringHashTable[key]; while (cur != NULL) { if (!strcmp(str, cur->val)) { cur->use--; /* TODO : garbage collect ... */ return; } cur = cur->next; } printf("stringFree : %s not found !\n", str); } #else /* ! WITH_STRING_BUF */ const char *stringAdd(const char *str) { return(xmlStrdup(str)); } void stringFree(const char *str) { xmlFree((char *) str); } #endif /* !WITH_STRING_BUF */ rpm2html-1.11.2/sql.c0000664000076400007640000024524311452634006013011 0ustar hanyhany/* * sql.c: front-end for MySQL database */ #include "config.h" #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /******** #include ********/ #include #include #include #include #include "rpm2html.h" #include "rpmdata.h" /******** #include "rpmdata.h" ********/ #include "sql.h" #include "html.h" /* #define SQL_DEBUG_TIMING */ #define SQL_DEBUG_MEM #define SQL_MAX_DISTRIBS 500 /************************************************************************ * * * Generic inititialisation/close of the DB * * * ************************************************************************/ static MYSQL *sql = NULL; static const char *myhost, *mybase, *myuser, *mypasswd; int init_sql(const char *host, const char *base, const char *user, const char *passwd) { int attempts = 0; /* * Close the previous connection if any */ if (sql != NULL) { close_sql(); if (myhost != NULL) free((char *) myhost); myhost = NULL; if (mybase != NULL) free((char *) mybase); mybase = NULL; if (myuser != NULL) free((char *) myuser); myuser = NULL; if (mypasswd != NULL) free((char *) mypasswd); mypasswd = NULL; } if (host == NULL) host = getenv("MySQL_HOST"); if (host == NULL) host = "localhost"; if (base == NULL) base = getenv("MySQL_BASE"); if (base == NULL) base = "rpmfind"; if (passwd == NULL) passwd = getenv("MySQL_PASS"); if (user == NULL) user = getenv("MySQL_USER"); if (user == NULL) user = getenv("USER"); if (user == NULL) user = getenv("USERNAME"); if (user == NULL) user = getenv("LOGNAME"); sql = mysql_init(NULL); if (mysql_errno(sql)) { fprintf(stderr, "mysql_init failed: %s\n", mysql_error(sql)); return(-1); } for (attempts = 0; ;attempts ++) { mysql_real_connect(sql, host, user, passwd, base, 0, NULL, 0); if (mysql_errno(sql)) { if ((attempts == 0) && (passwd == NULL)) { fprintf(stderr, "No passwd defined, use MySQL_PASS env\n"); } if (attempts >= 20) { fprintf(stderr, "mysql: connect as %s to %s on host %s failed: %s\n", user, base, host, mysql_error(sql)); return(-1); } else { fprintf(stderr, "mysql: retrying connect as %s to %s on host %s failed: %s\n", user, base, host, mysql_error(sql)); } } else { break; } sleep(15); } myhost = strdup(host); mybase = strdup(base); myuser = strdup(user); mypasswd = strdup(passwd); sql_check_tables(); return(0); } int close_sql(void) { mysql_close(sql); if (mysql_errno(sql)) { fprintf(stderr, "mysql_close failed: %s\n", mysql_error(sql)); return(-1); } sql = NULL; return(0); } int restart_sql(void) { int attempts = 0; /* * Close the previous connection if any */ if (sql != NULL) { close_sql(); sql = NULL; } sql = mysql_init(NULL); if (mysql_errno(sql)) { fprintf(stderr, "mysql_init failed: %s\n", mysql_error(sql)); return(-1); } for (attempts = 0; ;attempts ++) { mysql_real_connect(sql, myhost, myuser, mypasswd, mybase, 0, NULL, 0); if (mysql_errno(sql)) { if (attempts >= 20) { fprintf(stderr, "mysql: reconnect as %s to %s on host %s failed: %s\n", myuser, mybase, myhost, mysql_error(sql)); return(-1); } } else { break; } sleep(15); } sql_check_tables(); return(0); } /* * Handle disconnects by doing a reconnect and a retry. */ int do_sql_query(const char *query, int len) { int res; if (sql == NULL) { res = restart_sql(); if (res != 0) return(res); } res = mysql_real_query(sql, query, len); if ((res == CR_SERVER_GONE_ERROR) || (res == CR_SERVER_LOST)) { res = restart_sql(); if (res != 0) return(res); res = mysql_real_query(sql, query, len); } return(res); } /************************************************************************ * * * Generic functions to access the tables * * * ************************************************************************/ #define MAX_QUERY 8000 #define SMALL_QUERY 500 int sql_update_id(const char *table, int id, const char *field, const char *value) { MYSQL_RES *result; char query[MAX_QUERY]; int nb_fields = 0; int left = MAX_QUERY - 1; int len; char *end; if ((table == NULL) || (field == NULL) || (value == NULL)) return(-1); len = snprintf(query, left, "UPDATE %s SET %s='", table, field); if (len < 0) { fprintf(stderr, "sql_update_id : %s(%d).%s overflow\n", table, id, field); return(-1); } end = &query[len]; left -= len; len = strlen(value); if (len * 2 >= left) { fprintf(stderr, "sql_update_id : %s(%d).%s overflow\n", table, id, field); return(-1); } len = mysql_escape_string(end, value, len); left -= len; if (left <= 0) { fprintf(stderr, "sql_update_id : %s(%d).%s overflow\n", table, id, field); return(-1); } end += len; len = snprintf(end, left, "' WHERE ID=%d", id); if (len < 0) { fprintf(stderr, "sql_update_id : %s(%d).%s overflow\n", table, id, field); return(-1); } end += len; query[MAX_QUERY - 1] = 0; if (do_sql_query(query, (unsigned int) (end - query))) { printf("sql_update_id: UPDATE %s %d failed: %s\n", table, id, mysql_error(sql)); return(-1); } result = mysql_store_result(sql); if (result != NULL) { nb_fields = mysql_num_fields(result); mysql_free_result(result); } else { nb_fields = 1; } if(mysql_errno(sql)) { fprintf(stderr, "sql_update_id UPDATE error: %s\n", mysql_error(sql)); return(-1); } return(nb_fields); } int sql_blind_insert(const char *table, const char *key, const char *value, int id) { MYSQL_RES *result; char query[MAX_QUERY]; int left = MAX_QUERY - 1; int len; char *end; int insert = -1; if ((table == NULL) || (key == NULL) || (value == NULL)) return(-1); /* * Search first for the ID if it already exists */ if (id > 0) { len = snprintf(query, left, "INSERT INTO %s (ID, %s) VALUES (%d, '", table, key, id); if (len < 0) { fprintf(stderr, "sql_blind_insert : %s(%d).%s overflow\n", table, id, key); return(-1); } end = &query[len]; left -= len; len = strlen(value); if (len * 2 >= left) { fprintf(stderr, "sql_blind_insert : %s(%d).%s overflow\n", table, id, key); return(-1); } len = mysql_escape_string(end, value, len); left -= len; if (left <= 0) { fprintf(stderr, "sql_blind_insert : %s(%d).%s overflow\n", table, id, key); return(-1); } end += len; len = snprintf(end, left, "')"); if (len < 0) { fprintf(stderr, "sql_blind_insert : %s(%d).%s overflow\n", table, id, key); return(-1); } end += len; query[MAX_QUERY - 1] = 0; } else { len = snprintf(query, left, "INSERT INTO %s (%s) VALUES ('", table, key); if (len < 0) { fprintf(stderr, "sql_blind_insert : %s.%s overflow\n", table, key); return(-1); } end = &query[len]; left -= len; len = strlen(value); if (len * 2 >= left) { fprintf(stderr, "sql_blind_insert : %s.%s overflow\n", table, key); return(-1); } len = mysql_escape_string(end, value, len); left -= len; if (left <= 0) { fprintf(stderr, "sql_blind_insert : %s.%s overflow\n", table, key); return(-1); } end += len; len = snprintf(end, left, "')"); if (len < 0) { fprintf(stderr, "sql_blind_insert : %s.%s overflow\n", table, key); return(-1); } end += len; query[MAX_QUERY - 1] = 0; } query[MAX_QUERY - 1] = 0; if (do_sql_query(query, (unsigned int) (end - query))) { #ifdef SQL_DEBUG fprintf(stderr, "sql_blind_insert Error: %s\n", mysql_error(sql)); #endif return(-1); } result = mysql_store_result(sql); insert = mysql_insert_id(sql); if (result) { mysql_free_result(result); return(insert); } if(mysql_errno(sql)) { fprintf(stderr, "sql_blind_insert Error: %s\n", mysql_error(sql)); return(-1); } return(insert); } int sql_update(const char *table, const char *name, const char *field, const char *value) { MYSQL_RES *result; MYSQL_ROW row; char query[MAX_QUERY]; int id; int nb_fields = 0; int left = MAX_QUERY - 1; int len; char *end; if ((name == NULL) || (table == NULL) || (field == NULL) || (value == NULL)) return(-1); /* * Search first for the ID if it already exists */ snprintf(query, MAX_QUERY - 1, "SELECT ID FROM %s WHERE Name='%s'", table, name); query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_update: SELECT failed\n"); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (row[0] == NULL) { printf("sql_update: select ID for %s returns NULL !\n", name); return(-1); } if (sscanf(row[0], "%d", &id) != 1) { printf("sql_update: ID non numeric %s\n", row[0]); return(-1); } left = MAX_QUERY - 1; len = snprintf(query, left, "UPDATE %s SET %s='", table, field); if (len < 0) { fprintf(stderr, "sql_update : %s(%d).%s overflow\n", table, id, field); return(-1); } end = &query[len]; left -= len; len = strlen(value); if (len * 2 >= left) { fprintf(stderr, "sql_update : %s(%d).%s overflow\n", table, id, field); return(-1); } len = mysql_escape_string(end, value, len); left -= len; if (left <= 0) { fprintf(stderr, "sql_update : %s(%d).%s overflow\n", table, id, field); return(-1); } end += len; len = snprintf(end, left, "' WHERE ID=%d", id); if (len < 0) { fprintf(stderr, "sql_update : %s(%d).%s overflow\n", table, id, field); return(-1); } end += len; query[MAX_QUERY - 1] = 0; mysql_free_result(result); if (do_sql_query(query, (unsigned int) (end - query))) { printf("sql_update: UPDATE failed: %s\n", mysql_error(sql)); return(-1); } result = mysql_store_result(sql); if (result != NULL) { nb_fields = mysql_num_fields(result); mysql_free_result(result); } else { return(1); } /* Do not loop ... only the first */ return(nb_fields); } mysql_free_result(result); if (nb_fields == 0) { /* * Propagate an insert */ snprintf(query, MAX_QUERY - 1, "INSERT INTO %s (Name,%s) VALUES ('%s','%s')", table, field, name, value); query[MAX_QUERY - 1] = 0; if (mysql_query(sql, query)) { printf("sql_update: INSERT failed: %s\n", mysql_error(sql)); return(-1); } result = mysql_store_result(sql); if (result != NULL) { nb_fields = mysql_num_fields(result); mysql_free_result(result); } else { return(1); } } } if(mysql_errno(sql)) { fprintf(stderr, "sql_update Error: %s\n", mysql_error(sql)); return(-1); } return(nb_fields); } int sql_get_key(const char *table, const char *name, const char *value) { int id; MYSQL_RES *result; MYSQL_ROW row; char query[MAX_QUERY]; int left = MAX_QUERY - 1; int len; char *end; if ((table == NULL) || (name == NULL)) return(-1); /* * Search first for the ID if it already exists */ len = snprintf(query, left, "SELECT ID FROM %s WHERE %s='", table, name); if (len < 0) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } end = &query[len]; left -= len; len = strlen(value); if (len * 2 >= left) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } len = mysql_escape_string(end, value, len); left -= len; if (left <= 0) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } end += len; len = snprintf(end, left, "'"); if (len < 0) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } end += len; query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_get_key: SELECT %s failed %s\n", name, mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { /* * Lookup the first ID and return it */ if (row[0] == NULL) { mysql_free_result(result); printf("sql_get_key: select returns NULL !\n"); return(-1); } if (sscanf(row[0], "%d", &id) != 1) { mysql_free_result(result); printf("sql_get_key: ID non numeric %s\n", row[0]); return(-1); } mysql_free_result(result); return(id); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } /* * Do a creation */ query[SMALL_QUERY - 1] = 0; len = snprintf(query, left, "INSERT INTO %s (%s) VALUES ('", table, name); if (len < 0) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } end = &query[len]; left -= len; len = strlen(value); if (len * 2 >= left) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } len = mysql_escape_string(end, value, len); left -= len; if (left <= 0) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } end += len; len = snprintf(end, left, "')"); if (len < 0) { fprintf(stderr, "sql_get_key : %s(%s).%s overflow\n", table, name, value); return(-1); } end += len; query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_get_key: INSERT %s failed %s\n", name, mysql_error(sql)); return(-1); } id = mysql_insert_id(sql); result = mysql_store_result(sql); if (result != NULL) mysql_free_result(result); return(id); } int sql_read_key(const char *table, const char *name) { int id; MYSQL_RES *result; MYSQL_ROW row; char query[SMALL_QUERY]; if ((table == NULL) || (name == NULL)) return(-1); /* * Search for the ID it has to exist */ snprintf(query, SMALL_QUERY - 1, "SELECT ID FROM %s WHERE Name='%s'", table, name); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_read_key: SELECT %s failed %s\n", name, mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { /* * Lookup the first ID and return it */ if (row[0] == NULL) { mysql_free_result(result); printf("sql_read_key: select returns NULL !\n"); return(-1); } if (sscanf(row[0], "%d", &id) != 1) { mysql_free_result(result); printf("sql_read_key: ID non numeric %s\n", row[0]); return(-1); } mysql_free_result(result); return(id); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } return(-1); } int sql_read_info_key(const char *table, const char *name, const char *value) { int id; MYSQL_RES *result; MYSQL_ROW row; char query[SMALL_QUERY]; if ((table == NULL) || (name == NULL) || (value == NULL)) return(-1); /* * Search for the ID it has to exist */ snprintf(query, SMALL_QUERY - 1, "SELECT ID FROM %s WHERE %s='%s'", table, name, value); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_read_info_key: SELECT %s failed %s\n", name, mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { /* * Lookup the first ID and return it */ if (row[0] == NULL) { mysql_free_result(result); printf("sql_read_info_key: select returns NULL !\n"); return(-1); } if (sscanf(row[0], "%d", &id) != 1) { mysql_free_result(result); printf("sql_read_info_key: ID non numeric %s\n", row[0]); return(-1); } mysql_free_result(result); return(id); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } return(-1); } /************************************************************************ * * * Tables handling * * * ************************************************************************/ int sql_rebuild_config(void) { const char *query = "CREATE TABLE Config ( \n\ ID int(11) NOT NULL auto_increment, \n\ Name varchar(50) NOT NULL, \n\ Value varchar(255), \n\ PRIMARY KEY (ID), \n\ KEY Name (Name(10)) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_config: CREATE TABLE Config failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_vendors(void) { const char *query = "CREATE TABLE Vendors ( \n\ ID int(11) NOT NULL auto_increment, \n\ Name varchar(255) NOT NULL, \n\ URL varchar(255), \n\ Key1 text, \n\ Key2 text, \n\ Key3 text, \n\ Description text, \n\ PRIMARY KEY (ID), \n\ KEY Name (Name(10)) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_vendors: CREATE TABLE Vendors failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_distributions(void) { const char *query = "CREATE TABLE Distributions ( \n\ ID int(11) NOT NULL auto_increment, \n\ Name varchar(255) NOT NULL, \n\ URL varchar(255), \n\ Key1 text, \n\ Key2 text, \n\ Key3 text, \n\ Description text, \n\ PRIMARY KEY (ID), \n\ KEY Name (Name(10)) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_ditributions: CREATE TABLE Distributions failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_searches(void) { const char *query = "CREATE TABLE Searches ( \n\ URL varchar(255) NOT NULL, \n\ name varchar(255) NOT NULL, \n\ active int, \n\ UNIQUE(URL), \n\ UNIQUE(name) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_searches: CREATE TABLE Searches failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_mirrors(void) { const char *query = "CREATE TABLE Mirrors ( \n\ ID int(11), \n\ URL varchar(255) NOT NULL, \n\ Country int(11), \n\ UNIQUE(URL) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_mirrors: CREATE TABLE Mirrors failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_metadata(void) { const char *query = "CREATE TABLE Metadata ( \n\ URL varchar(255) NOT NULL, \n\ Maintainer int(11), \n\ Country int(11), \n\ UNIQUE(URL) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_metadata: CREATE TABLE Metadata failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_distribs(void) { const char *query = "CREATE TABLE Distribs ( \n\ ID int(11) NOT NULL auto_increment, \n\ Name varchar(255) NOT NULL, \n\ Vendor int(11), \n\ Directory varchar(255), \n\ Path varchar(100) NOT NULL, \n\ URL varchar(255), \n\ URLSrc varchar(255), \n\ Html varchar(8), \n\ Color varchar(10), \n\ Key1 text, \n\ Key2 text, \n\ Description text, \n\ PRIMARY KEY (ID), \n\ KEY Name (Name(10)) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_distribs: CREATE TABLE Distribs failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_packages(void) { const char *query = "CREATE TABLE Packages ( \n\ ID int(11) NOT NULL auto_increment, \n\ filename varchar(255) NOT NULL, \n\ Name varchar(50) NOT NULL, \n\ Version varchar(50) NOT NULL, \n\ Release varchar(50) NOT NULL, \n\ Arch varchar(15) NOT NULL, \n\ Dist int(11), \n\ URL varchar(255), \n\ URLSrc varchar(255), \n\ Vendor int(11), \n\ Packager int(11), \n\ Category varchar(255), \n\ Summary varchar(255), \n\ Description text, \n\ Copyright varchar(255), \n\ Date int(11), \n\ Size int(11), \n\ Os varchar(12), \n\ PRIMARY KEY (ID), \n\ KEY filename (filename(80)), \n\ KEY Name (Name(15)) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_packages: CREATE TABLE Packages failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_files(void) { const char *query = "CREATE TABLE Files ( \n\ ID int(11) NOT NULL, \n\ Path varchar(35) NOT NULL, \n\ UNIQUE KEY id (ID,Path(35)), \n\ INDEX (ID), \n\ INDEX (Path) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_files: CREATE TABLE Files failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_provides(void) { const char *query = "CREATE TABLE Provides ( \n\ ID int(11) NOT NULL, \n\ Resource varchar(35) NOT NULL, \n\ UNIQUE KEY id (ID,Resource(35)), \n\ INDEX (ID), \n\ INDEX (Resource) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_provides: CREATE TABLE Provides failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_requires(void) { const char *query = "CREATE TABLE Requires ( \n\ ID int(11) NOT NULL, \n\ Resource varchar(35) NOT NULL, \n\ Rel char(2), \n\ Value varchar(20), \n\ UNIQUE KEY id (ID,Resource(35)), \n\ INDEX (ID), \n\ INDEX (Resource) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_requires: CREATE TABLE Requires failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_rebuild_queries(void) { const char *query = "CREATE TABLE Queries ( \n\ ID int(11) NOT NULL auto_increment,\n\ Value varchar(50) NOT NULL, \n\ Count int(11) NOT NULL, \n\ Results int(11) NOT NULL, \n\ UNIQUE KEY id (ID,Value(35)), \n\ INDEX (ID), \n\ INDEX (Value) \n\ )"; if (mysql_query(sql,query)) { printf("sql_rebuild_queries: CREATE TABLE Queries failed %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_check_tables(void) { const char *query = "SHOW TABLES"; MYSQL_RES *result; MYSQL_ROW row; int config = 0; int distribs = 0; int requires = 0; int provides = 0; int vendors = 0; int mirrors = 0; int metadata = 0; int packages = 0; int searches = 0; int files = 0; int queries = 0; int distributions = 0; int rebuilt = 0; if (mysql_query(sql,query)) { printf("sql_check_tables: SHOW TABLES failed %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (row[0] == NULL) { mysql_free_result(result); printf("sql_check_tables: SHOW TABLES returns NULL !\n"); return(-1); } if (!strcmp(row[0], "Config")) config = 1; if (!strcmp(row[0], "Distribs")) distribs = 1; if (!strcmp(row[0], "Vendors")) vendors = 1; if (!strcmp(row[0], "Mirrors")) mirrors = 1; if (!strcmp(row[0], "Metadata")) metadata = 1; if (!strcmp(row[0], "Packages")) packages = 1; if (!strcmp(row[0], "Files")) files = 1; if (!strcmp(row[0], "Requires")) requires = 1; if (!strcmp(row[0], "Provides")) provides = 1; if (!strcmp(row[0], "Queries")) queries = 1; if (!strcmp(row[0], "Distributions")) distributions = 1; if (!strcmp(row[0], "Searches")) searches = 1; } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } if (!config) { fprintf(stderr, "Table Config disapeared: rebuilding it\n"); if (!sql_rebuild_config()) rebuilt++; } if (!vendors) { fprintf(stderr, "Table Vendors disapeared: rebuilding it\n"); if (!sql_rebuild_vendors()) rebuilt++; } if (!distribs) { fprintf(stderr, "Table Distribs disapeared: rebuilding it\n"); if (!sql_rebuild_distribs()) rebuilt++; } if (!mirrors) { fprintf(stderr, "Table Mirrors disapeared: rebuilding it\n"); if (!sql_rebuild_mirrors()) rebuilt++; } if (!metadata) { fprintf(stderr, "Table Metadata disapeared: rebuilding it\n"); if (!sql_rebuild_metadata()) rebuilt++; } if (!packages) { fprintf(stderr, "Table Packages disapeared: rebuilding it\n"); if (!sql_rebuild_packages()) rebuilt++; } if (!files) { fprintf(stderr, "Table Files disapeared: rebuilding it\n"); if (!sql_rebuild_files()) rebuilt++; } if (!requires) { fprintf(stderr, "Table Requires disapeared: rebuilding it\n"); if (!sql_rebuild_requires()) rebuilt++; } if (!provides) { fprintf(stderr, "Table Provides disapeared: rebuilding it\n"); if (!sql_rebuild_provides()) rebuilt++; } if (!queries) { fprintf(stderr, "Table Queries disapeared: rebuilding it\n"); if (!sql_rebuild_queries()) rebuilt++; } if (!distributions) { fprintf(stderr, "Table Distributions disapeared: rebuilding it\n"); if (!sql_rebuild_distributions()) rebuilt++; } if (!searches) { fprintf(stderr, "Table Searches disapeared: rebuilding it\n"); if (!sql_rebuild_searches()) rebuilt++; } return(rebuilt); } /************************************************************************ * * * Specific rpm2html functions * * * ************************************************************************/ int sql_add_dist_mirror(int distrib, const char *URL, int country) { if (URL == NULL) return(-1); if (distrib < 0) return(-1); return(sql_blind_insert("Mirrors", "URL", URL, distrib)); } int sql_add_mirror(const char *Name, const char *URL, int country) { int distrib; if ((Name == NULL) || (URL == NULL)) return(-1); distrib = sql_read_key("Distribs", Name); if (distrib < 0) return(distrib); return(sql_blind_insert("Mirrors", "URL", URL, distrib)); } int sql_add_file(const char *filename, int package) { if ((filename == NULL) || (package <= 0)) return(-1); if (strlen(filename) > 35) return(0); return(sql_blind_insert("Files", "Path", filename, package)); } int sql_add_provides(int package, const char *resource) { if ((resource == NULL) || (package <= 0)) return(-1); if (strlen(resource) > 35) return(0); return(sql_blind_insert("Provides", "Resource", resource, package)); } int sql_add_requires(int package, const char *resource, rpm_dep_flag rel, const char *value) { int record; if ((resource == NULL) || (package <= 0)) return(-1); if (strlen(resource) > 35) return(0); record = sql_blind_insert("Requires", "Resource", resource, package); if ((rel != RPM2HTML_REQ_NONE) && (value != NULL) && (strlen(value) <= 50)) { char query[SMALL_QUERY]; switch (rel) { case RPM2HTML_REQ_LT: snprintf(query, SMALL_QUERY - 1, "UPDATE Requires SET Rel='<',Value='%s' WHERE ID=%d", value, record); break; case RPM2HTML_REQ_LEQ: snprintf(query, SMALL_QUERY - 1, "UPDATE Requires SET Rel='<=',Value='%s' WHERE ID=%d", value, record); break; case RPM2HTML_REQ_GT: snprintf(query, SMALL_QUERY - 1, "UPDATE Requires SET Rel='>',Value='%s' WHERE ID=%d", value, record); break; case RPM2HTML_REQ_GEQ: snprintf(query, SMALL_QUERY - 1, "UPDATE Requires SET Rel='>=',Value='%s' WHERE ID=%d", value, record); break; case RPM2HTML_REQ_EQU: snprintf(query, SMALL_QUERY - 1, "UPDATE Requires SET Rel='=',Value='%s' WHERE ID=%d", value, record); break; case RPM2HTML_REQ_NONE: query[0] = 0; } query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_add_requires: UPDATE Requires %d failed %s\n", record, mysql_error(sql)); return(record); } } return(record); } int sql_add_vendor(const char *Name, const char *URL, const char *Description) { int id; if (Name == NULL) return(-1); id = sql_get_key("Vendors", "Name", Name); if (id <= 0) { id = sql_blind_insert("Vendors", "Name", Name, 0); if (id <= 0) return(id); } if (URL != NULL) sql_update_id("Vendors", id, "URL", URL); if (Description != NULL) sql_update_id("Vendors", id, "Description", Description); return(id); } int sql_add_distribution(const char *Name, const char *URL, const char *Description) { int id; if (Name == NULL) return(-1); id = sql_get_key("Distributions", "Name", Name); if (id <= 0) { id = sql_blind_insert("Distributions", "Name", Name, 0); if (id <= 0) return(id); } if (URL != NULL) sql_update_id("Distributions", id, "URL", URL); if (Description != NULL) sql_update_id("Distributions", id, "Description", Description); return(id); } int sql_get_package_id(const char *filename) { int id; MYSQL_RES *result; MYSQL_ROW row; char query[MAX_QUERY]; int left = MAX_QUERY - 1; int len; char *end; static int queries = 0; if (filename == NULL) return(0); queries++; /* * Search first for the ID if it already exists */ len = snprintf(query, left, "SELECT ID FROM Packages WHERE filename='%s'", filename); if (len < 0) { fprintf(stderr, "sql_get_package_id : %s overflow\n", filename); return(0); } query[len] = 0; if (mysql_query(sql,query)) { printf("sql_get_package_id: SELECT %s failed %s\n", filename, mysql_error(sql)); return(0); } result = mysql_use_result(sql); if (result) { if ((row = mysql_fetch_row(result))) { /* * Lookup the first ID and return it */ if (row[0] == NULL) { mysql_free_result(result); printf("sql_get_package_id: select returns NULL !\n"); return(0); } if (sscanf(row[0], "%d", &id) != 1) { mysql_free_result(result); printf("sql_get_package_id: ID non numeric %s\n", row[0]); return(0); } mysql_free_result(result); return(id); } mysql_free_result(result); } if (mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } printf("%d New package %s\n", queries, filename); return(0); } int sql_get_top_queries(int count) { int id; MYSQL_RES *result; MYSQL_ROW row; char query[MAX_QUERY]; int left = MAX_QUERY - 1; int len; char *end; static int queries = 0; if (count <= 0) count = 100; queries++; /* * Search first for the ID if it already exists */ len = snprintf(query, left, "select Value, Count from Queries order by count desc limit %d", count); if (len < 0) { fprintf(stderr, "sql_get_top_queries : overflow\n"); return(0); } query[len] = 0; if (mysql_query(sql,query)) { printf("sql_get_top_queries : SELECT failed %s\n", mysql_error(sql)); return(0); } result = mysql_use_result(sql); if (result) { printf("\n"); while ((row = mysql_fetch_row(result))) { /* * Lookup the first ID and return it */ if ((row[0] == NULL) || (row[1] == NULL)) { mysql_free_result(result); fprintf(stderr, "sql_get_top_queries: select returns NULL !\n"); break; } printf("%s\n", row[1], row[0]); } printf("\n"); mysql_free_result(result); } if (mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } return(0); } int sql_add_package(const char *filename, const char *Name, const char *Version, const char *Release, const char *Arch, int dist, const char *URL, const char *URLSrc, int vendor, const char *Packager, const char *Category, const char *Summary, const char *Description, const char *Copyright, int Date, int Size, const char *Os, const char *Distribution, const char *Vendor) { int id; int nb_fields = 0; char installed_filename[500]; if (filename == NULL) { sprintf(installed_filename, "localbase/%s-%s-%s.%s.rpm", Name,Version,Release,Arch); filename = installed_filename; } if (dist < 0) return(-1); if ((Name == NULL) || (Version == NULL) || (Release == NULL) || (Arch == NULL)) return(-1); id = sql_get_key("Packages", "filename", filename); if (id <= 0) return(-1); nb_fields = 1; if (rpm2htmlVerbose > 1) printf("Adding %s ID %d\n", filename, id); if (Name != NULL) nb_fields += sql_update_id("Packages", id, "Name", Name); if (Version != NULL) nb_fields += sql_update_id("Packages", id, "Version", Version); if (Release != NULL) nb_fields += sql_update_id("Packages", id, "Release", Release); if (Release != NULL) nb_fields += sql_update_id("Packages", id, "Arch", Arch); if (Category != NULL) nb_fields += sql_update_id("Packages", id, "Category", Category); if (URL != NULL) nb_fields += sql_update_id("Packages", id, "URL", URL); if (URLSrc != NULL) nb_fields += sql_update_id("Packages", id, "URLSrc", URLSrc); if (dist >= 0) { char str[30]; snprintf(str, 30, "%d", dist); str[29] = 0; nb_fields += sql_update_id("Packages", id, "Dist", str); } if (Summary != NULL) { nb_fields += sql_update_id("Packages", id, "Summary", Summary); } if (Description != NULL) { nb_fields += sql_update_id("Packages", id, "Description", Description); } if (Copyright != NULL) nb_fields += sql_update_id("Packages", id, "Copyright", Copyright); if (Date != 0) { char str[30]; snprintf(str, 30, "%d", Date); str[29] = 0; nb_fields += sql_update_id("Packages", id, "Date", str); } if (Size != 0) { char str[30]; snprintf(str, 30, "%d", Size); str[29] = 0; nb_fields += sql_update_id("Packages", id, "Size", str); } if (Os != NULL) { nb_fields += sql_update_id("Packages", id, "Os", Os); } if (Packager != NULL) { char str[30]; int packager = sql_add_vendor(Packager, NULL, NULL); if (packager > 0) { snprintf(str, 30, "%d", packager); str[29] = 0; nb_fields += sql_update_id("Packages", id, "Packager", str); } } if (Distribution != NULL) { char str[30]; int packager = sql_add_distribution(Distribution, NULL, NULL); if (packager > 0) { snprintf(str, 30, "%d", packager); str[29] = 0; nb_fields += sql_update_id("Packages", id, "Vendor", str); } } /*************** if (vendor > 0) { char str[30]; snprintf(str, 30, "%d", vendor); str[29] = 0; nb_fields += sql_update_id("Packages", id, "Vendor", str); } ***************/ return(id); } int sql_get_distrib_by_name(const char *Name) { int ret; if (Name == NULL) return(-1); ret = sql_read_key("Distribs", Name); #ifdef SQL_DEBUG fprintf(stderr, "sql_get_distrib_by_name(%s) => %d\n", Name, ret); #endif return(ret); } int sql_get_distrib_by_directory(const char *Directory) { int ret; if (Directory == NULL) return(-1); ret = sql_get_key("Distribs", "Directory", Directory); #ifdef SQL_DEBUG fprintf(stderr, "sql_get_distrib_by_directory(%s) => %d\n", Directory, ret); #endif return(ret); } int sql_add_distrib(const char *Name, const char *Vendor, const char *Directory, const char *Path, const char *URL, const char *URLSrc, const char *Description, const char *Html, const char *Color) { int id, vendor; int nb_fields = 0; char VendorStr[15]; if (Name == NULL) return(-1); id = sql_get_key("Distribs", "Name", Name); nb_fields = 1; if (Vendor != NULL) { vendor = sql_get_key("Vendors", "Name", Vendor); sprintf(VendorStr, "%d", vendor); nb_fields += sql_update_id("Distribs", id, "Vendor", VendorStr); } if (Directory != NULL) nb_fields += sql_update_id("Distribs", id, "Directory", Directory); if (Path != NULL) nb_fields += sql_update_id("Distribs", id, "Path", Path); if (URL != NULL) nb_fields += sql_update_id("Distribs", id, "URL", URL); if (URLSrc != NULL) nb_fields += sql_update_id("Distribs", id, "URLSrc", URLSrc); if (Html != NULL) nb_fields += sql_update_id("Distribs", id, "Html", Html); if (Color != NULL) nb_fields += sql_update_id("Distribs", id, "Color", Color); if (Description != NULL) nb_fields += sql_update_id("Distribs", id, "Description", Description); return(nb_fields); } void sql_add_config_info(const char *name, const char *value) { sql_update("Config", name, "Value", value); } void sql_add_metadata_base(const char *URL) { sql_blind_insert("Metadata", "URL", URL, -1); } /************************************************************************ * * * Cleanup functions * * * ************************************************************************/ int sql_remove_package(int id) { char query[SMALL_QUERY]; if (id <= 0) return(-1); /* * remove the ID from the package list */ snprintf(query, SMALL_QUERY - 1, "DELETE FROM Packages WHERE ID=%d", id); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_remove_package: DELETE package %d failed %s\n", id, mysql_error(sql)); return(-1); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } /* * remove the associated files from the Files list */ snprintf(query, SMALL_QUERY - 1, "DELETE FROM Files WHERE ID=%d", id); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_remove_package: DELETE Files %d failed %s\n", id, mysql_error(sql)); return(-1); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } /* * remove the associated Provides entries */ snprintf(query, SMALL_QUERY - 1, "DELETE FROM Provides WHERE ID=%d", id); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_remove_package: DELETE Provides %d failed %s\n", id, mysql_error(sql)); return(-1); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } /* * remove the associated Requires entries */ snprintf(query, SMALL_QUERY - 1, "DELETE FROM Requires WHERE ID=%d", id); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_remove_package: DELETE Requires %d failed %s\n", id, mysql_error(sql)); return(-1); } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); return(-1); } /* * Remove the RDF and HTML files. * TODO */ return(-1); } int sql_check_packages(void) { MYSQL_RES *result; MYSQL_ROW row; char *query = "SELECT filename,ID FROM Packages"; struct stat buf; int id; int ids[2500]; /* Do not remove more than 2500 package per run */ int index; int total = 0; if (rpm2htmlVerbose) printf("Database cleanup\n"); sqlInitSqlDistributionList(); index = 0; /* * Search first for the ID if it already exists */ if (mysql_query(sql,query)) { printf("sql_check_packages: SELECT from Packages failed: %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if ((row[0] == NULL) || (row[1] == NULL)) { printf("sql_check_packages: Path or ID is NULL !\n"); continue; } if (!strncmp(row[0], "localbase", 9)) continue; if ((stat(row[0], &buf) < 0) || (buf.st_size < 50)) { /* * Need to remove the package from the database. */ if (sscanf(row[1], "%d", &id) != 1) { printf("sql_check_packages: ID non numeric %s\n", row[1]); continue; } ids[index++] = id; if (rpm2htmlVerbose) printf("Removing %s ID %d\n", row[0], id); if (index >= 2500) break; } } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sql_update Error: %s\n", mysql_error(sql)); return(-1); } /* * Do the cleanup. */ if (rpm2htmlVerbose) printf("Database cleanup : removing %d entries...\n", index); for (id = 0;id < index;id++) { sql_remove_package(ids[id]); } printf("Database cleanup : removed %d entries\n", index); return(total); } /************************************************************************ * * * Package lists extraction * * * ************************************************************************/ int sqlDirListInitialized = 0; rpmDirPtr sqlDirList[SQL_MAX_DISTRIBS]; int sqlVendorListInitialized = 0; int sqlVendorListLen; char **sqlVendorList; int sqlDistributionListInitialized = 0; int sqlDistributionListLen; char **sqlDistributionList; int sqlResourceListInitialized = 0; int sqlResourceListLen = 0; int sqlResourceListMax = 0; char **sqlResourceList; char * sqlRpmAnalyzeResourceRow(MYSQL_ROW row) { const char *name; char **tmp, *ret; if (row == NULL) return(NULL); name = row[0]; if (name == NULL) return(NULL); if (sqlResourceListLen >= sqlResourceListMax) { sqlResourceListMax *= 2; tmp = (char **) xmlRealloc(sqlResourceList, (sqlResourceListMax) * sizeof(char *)); if (sqlResourceList == NULL) { fprintf(stderr, "sqlInitSqlResourceList Error: out of memory\n"); return(NULL); } sqlResourceList = tmp; } ret = sqlResourceList[sqlResourceListLen++] = xmlStrdup(name); return(ret); } void sqlInitSqlResourceList(void) { MYSQL_RES *result; MYSQL_ROW row; char *query; int i; if (sqlResourceListInitialized != 0) return; #ifdef SQL_DEBUG_MEM printf("sqlInitSqlResourceList\n"); #endif if (rpm2htmlVerbose) printf("sqlInitSqlResourceList query\n"); /* * Allocate the array */ sqlResourceListLen = 0; sqlResourceListMax = 1000; sqlResourceList = (char **) xmlMalloc((sqlResourceListMax) * sizeof(char *)); if (sqlResourceList == NULL) { fprintf(stderr, "sqlInitSqlResourceList Error: out of memory\n"); return; } /* * query the database for the values */ query = "select Resource from Provides group by Resource"; if (mysql_query(sql,query)) { printf("sqlInitSqlResourceList: SELECT from Provides failed: %s\n", mysql_error(sql)); return; } i = 0; result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (sqlRpmAnalyzeResourceRow(row) != NULL) i++; } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sqlInitSqlResourceList Error: %s\n", mysql_error(sql)); return; } if (rpm2htmlVerbose) printf("sqlInitSqlResourceList done: %d entries\n", i); sqlResourceListInitialized++; return; } char * sqlRpmAnalyzeDistributionRow(MYSQL_ROW row) { const char *id; const char *name; char **tmp; int distribution; if (row == NULL) return(NULL); id = row[0]; name = row[1]; if ((id == NULL) || (name == NULL)) return(NULL); if (sscanf(id, "%d", &distribution) != 1) return(NULL); if ((distribution <= 0) || (distribution > 100000)) { fprintf(stderr, "Dist number out of range %d\n", distribution); return(NULL); } if (distribution >= sqlDistributionListLen) { int i = sqlDistributionListLen; sqlDistributionListLen = distribution + 100; tmp = (char **) xmlRealloc(sqlDistributionList, (sqlDistributionListLen) * sizeof(char *)); if (sqlDistributionList == NULL) { fprintf(stderr, "sqlInitSqlDistributionList Error: out of memory\n"); return(NULL); } sqlDistributionList = tmp; memset(&sqlDistributionList[i], 0, sizeof(char *) * (sqlDistributionListLen - i)); } sqlDistributionList[distribution] = xmlStrdup(name); return(sqlDistributionList[distribution]); } void sqlInitSqlDistributionList(void) { MYSQL_RES *result; MYSQL_ROW row; char *query; int i; if (sqlDistributionListInitialized != 0) return; #ifdef SQL_DEBUG_MEM printf("sqlInitSqlDistributionList\n"); #endif if (rpm2htmlVerbose) printf("sqlInitSqlDistributionList query\n"); /* * Allocate the array */ sqlDistributionListLen = 100; sqlDistributionList = (char **) xmlMalloc((sqlDistributionListLen) * sizeof(char *)); if (sqlDistributionList == NULL) { fprintf(stderr, "sqlInitSqlDistributionList Error: out of memory\n"); return; } memset(sqlDistributionList, 0, (sqlDistributionListLen) * sizeof(char *)); /* * query the database for the values */ query = "select ID,Name from Distributions"; if (mysql_query(sql,query)) { printf("sqlInitSqlDistributionList: SELECT from Distributions failed: %s\n", mysql_error(sql)); return; } i = 0; result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (sqlRpmAnalyzeDistributionRow(row) != NULL) i++; } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sqlInitSqlDistributionList Error: %s\n", mysql_error(sql)); return; } if (rpm2htmlVerbose) printf("sqlInitSqlDistributionList done: %d entries\n", i); sqlDistributionListInitialized++; return; } char * sqlRpmAnalyzeVendorRow(MYSQL_ROW row) { const char *id; const char *name; char **tmp; int vendor; if (row == NULL) return(NULL); id = row[0]; name = row[1]; if ((id == NULL) || (name == NULL)) return(NULL); if (sscanf(id, "%d", &vendor) != 1) return(NULL); if ((vendor <= 0) || (vendor > 100000)) { fprintf(stderr, "Dist number out of range %d\n", vendor); return(NULL); } if (vendor >= sqlVendorListLen) { int i = sqlVendorListLen; sqlVendorListLen = vendor + 100; tmp = (char **) xmlRealloc(sqlVendorList, (sqlVendorListLen) * sizeof(char *)); if (sqlVendorList == NULL) { fprintf(stderr, "sqlInitSqlVendorList Error: out of memory\n"); return(NULL); } sqlVendorList = tmp; memset(&sqlVendorList[i], 0, sizeof(char *) * (sqlVendorListLen - i)); } sqlVendorList[vendor] = xmlStrdup(name); return(sqlVendorList[vendor]); } void sqlInitSqlVendorList(void) { MYSQL_RES *result; MYSQL_ROW row; char *query; int i; if (sqlVendorListInitialized != 0) return; #ifdef SQL_DEBUG_MEM printf("sqlInitSqlVendorList\n"); #endif if (rpm2htmlVerbose) printf("sqlInitSqlVendorList query\n"); /* * Allocate the array */ sqlVendorListLen = 100; sqlVendorList = (char **) xmlMalloc((sqlVendorListLen) * sizeof(char *)); if (sqlVendorList == NULL) { fprintf(stderr, "sqlInitSqlVendorList Error: out of memory\n"); return; } memset(&sqlVendorList[0], 0, sizeof(char *) * sqlVendorListLen); /* * query the database for the values */ query = "select ID,Name from Vendors"; if (mysql_query(sql,query)) { printf("sqlInitSqlVendorList: SELECT from Vendors failed: %s\n", mysql_error(sql)); return; } i = 0; result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (sqlRpmAnalyzeVendorRow(row) != NULL) i++; } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sqlInitSqlVendorList Error: %s\n", mysql_error(sql)); return; } if (rpm2htmlVerbose) printf("sqlInitSqlVendorList done: %d entries\n", i); sqlVendorListInitialized++; return; } rpmDirPtr sqlRpmAnalyzeDirRow(MYSQL_ROW row) { rpmDirPtr ret; const char *id; const char *name; const char *vendor; const char *directory; const char *path; const char *url; const char *urlSrc; const char *html; const char *color; int dist; if (row == NULL) return(NULL); id = row[0]; name = row[1]; vendor = row[2]; directory = row[3]; path = row[4]; url = row[5]; urlSrc = row[6]; html = row[7]; color = row[8]; if ((id == NULL) || (name == NULL) || (directory == NULL) || (path == NULL) || (url == NULL)) return(NULL); if (sscanf(id, "%d", &dist) != 1) return(NULL); if ((dist <= 0) || (dist > SQL_MAX_DISTRIBS)) { fprintf(stderr, "Dist number out of range %d\n", dist); return(NULL); } ret = (rpmDirPtr) xmlMalloc(sizeof(rpmDir)); if (ret == NULL) return(NULL); memset(ret, 0, sizeof(rpmDir)); /* Generic stuff */ if (rpm2html_dir != NULL) ret->dir = xmlStrdup(rpm2html_dir); if (rpm2html_host != NULL) ret->host = xmlStrdup(rpm2html_host); if (rpm2html_maint != NULL) ret->maint = xmlStrdup(rpm2html_maint); if (rpm2html_mail != NULL) ret->mail = xmlStrdup(rpm2html_mail); if (rpm2html_url != NULL) ret->url = xmlStrdup(rpm2html_url); /* specific stuff */ ret->no = dist; ret->rpmdir = xmlStrdup(directory); ret->subdir = xmlStrdup(path); ret->name = xmlStrdup(name); ret->ftp = xmlStrdup(url); if (color != NULL) ret->color = xmlStrdup(color); else ret->color = xmlStrdup("#ffffff"); if (urlSrc != NULL) ret->ftpsrc = xmlStrdup(urlSrc); return(ret); } void sqlInitSqlDirList(void) { char host[200]; rpmDirPtr cur; MYSQL_RES *result; MYSQL_ROW row; char *query; int i; if (sqlDirListInitialized != 0) return; #ifdef SQL_DEBUG_MEM printf("sqlInitSqlDirList\n"); #endif gethostname(host, sizeof(host)); currentTime = time(NULL); rpm2html_rpm2html_thishost = &host[0]; readConfigSql(); if (rpm2html_host == NULL) { rpm2html_host = strdup(rpm2html_rpm2html_thishost); } for (i = 0; i < SQL_MAX_DISTRIBS;i++) sqlDirList[i] = NULL; if (rpm2htmlVerbose) printf("sqlInitSqlDirList query\n"); query = "select ID,Name,Vendor,Directory,Path,URL,URLSrc,Html,Color from Distribs"; if (mysql_query(sql,query)) { printf("sqlInitSqlDirList: SELECT from Packages failed: %s\n", mysql_error(sql)); return; } i = 0; result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { cur = sqlRpmAnalyzeDirRow(row); if (cur != NULL) { sqlDirList[cur->no] = cur; i++; } } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sqlInitSqlDirList Error: %s\n", mysql_error(sql)); return; } if (rpm2htmlVerbose) printf("sqlInitSqlDirList done: %d entries\n", i); sqlDirListInitialized++; return; } rpmDataPtr sqlRpmAnalyzeRow(MYSQL_ROW row) { rpmDataPtr ret; const char *id; const char *name; const char *version; const char *release; const char *arch; const char *date; const char *summary; const char *filename; const char *distrib; const char *group; const char *os; const char *packager; const char *vendor; int dist; if (row == NULL) return(NULL); id = row[0]; name = row[1]; version = row[2]; release = row[3]; arch = row[4]; date = row[5]; summary = row[6]; filename = row[7]; distrib = row[8]; group = row[9]; os = row[10]; packager = row[11]; vendor = row[12]; if ((id == NULL) || (name == NULL) || (version == NULL) || (release == NULL) || (arch == NULL) || (date == NULL) || (summary == NULL) || (filename == NULL) || (distrib == NULL)) return(NULL); ret = (rpmDataPtr) xmlMalloc(sizeof(rpmData)); if (ret == NULL) return(NULL); memset(ret, 0, sizeof(rpmData)); ret->name = xmlStrdup(name); ret->version = xmlStrdup(version); ret->release = xmlStrdup(release); ret->arch = xmlStrdup(arch); ret->summary = xmlStrdup(summary); ret->name = xmlStrdup(name); ret->filename = xmlStrdup(filename); if (os == NULL) ret->os = xmlStrdup("Linux"); else ret->os = xmlStrdup(os); if (group != NULL) ret->group = xmlStrdup(group); sscanf(date, "%d", (int *) &(ret->date)); if (packager != NULL) { int tmp = 0; sscanf(packager, "%d", (int *) &tmp); if ((tmp > 0) && (tmp < sqlVendorListLen)) { if (sqlVendorList[tmp] != NULL) ret->vendor = xmlStrdup(sqlVendorList[tmp]); } } if (vendor != NULL) { int tmp = 0; sscanf(vendor, "%d", (int *) &tmp); if ((tmp > 0) && (tmp < sqlDistributionListLen)) { if (sqlVendorList[tmp] != NULL) ret->distribution = xmlStrdup(sqlDistributionList[tmp]); } } if (ret->vendor == NULL) ret->vendor = xmlStrdup("Unknown"); if (ret->distribution == NULL) ret->distribution = xmlStrdup("Unknown"); sscanf(distrib, "%d", &dist); ret->dir = sqlDirList[dist]; if ((ret->dir != NULL) && (ret->dir->rpmdir != NULL)) { int len = strlen(ret->dir->rpmdir); if (!strncmp(ret->filename, ret->dir->rpmdir, len)) { char *start, *end; start = &(ret->filename[len]); while (*start == '/') start++; end = &start[strlen(start) - 1]; while ((end >= start) && (*end != '/')) end--; if (end > start) { char *tmp; tmp = xmlMalloc((end - start) + 1); if (tmp != NULL) { strncpy(tmp, start, end - start); tmp[end - start] = 0; ret->subdir = tmp; } } } } return(ret); } rpmDataPtr sqlRpmByDate(void) { rpmDataPtr list = NULL; rpmDataPtr cur, last = NULL; MYSQL_RES *result; MYSQL_ROW row; char *query; sqlInitSqlDirList(); sqlInitSqlVendorList(); sqlInitSqlDistributionList(); if (rpm2htmlVerbose) printf("sqlRpmByDate query\n"); query = "select ID,Name,Version,Release,Arch,Date,Summary,filename,Dist,Category,Os,Packager,Vendor from Packages where Date IS NOT NULL and Date < UNIX_TIMESTAMP() + 300000 order by Date desc limit 1000"; /* * Search first for the ID if it already exists */ if (mysql_query(sql,query)) { printf("sqlRpmByDate: SELECT from Packages failed: %s\n", mysql_error(sql)); return(NULL); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { cur = sqlRpmAnalyzeRow(row); if (cur != NULL) { if (last == NULL) list = cur; else last->next = cur; last = cur; } } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sqlRpmByDate Error: %s\n", mysql_error(sql)); return(NULL); } if (rpm2htmlVerbose) printf("sqlRpmByDate done\n"); return(list); } void sql_top_index(void) { sqlInitSqlDirList(); dumpTopIndex(sqlDirList); } rpmDataPtr sqlRpmAll(void) { rpmDataPtr list = NULL; rpmDataPtr cur, last = NULL; MYSQL_RES *result; MYSQL_ROW row; char *query; sqlInitSqlDirList(); dumpTopIndex(sqlDirList); sqlInitSqlVendorList(); sqlInitSqlDistributionList(); if (rpm2htmlVerbose) printf("sqlRpmAll query\n"); query = "select ID,Name,Version,Release,Arch,Date,Summary,filename,Dist,Category,Os,Packager,Vendor from Packages"; /* * Search first for the ID if it already exists */ if (mysql_query(sql,query)) { printf("sqlRpmByDate: SELECT from Packages failed: %s\n", mysql_error(sql)); return(NULL); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { cur = sqlRpmAnalyzeRow(row); if (cur != NULL) { if (last == NULL) list = cur; else last->next = cur; last = cur; rpmAddSoftware(cur); } } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sqlRpmByDate Error: %s\n", mysql_error(sql)); return(NULL); } if (rpm2htmlVerbose) printf("sqlRpmAll done\n"); return(list); } void sqlListsCleanup(void) { int i; #ifdef SQL_DEBUG_MEM printf("sqlListsCleanup\n"); #endif if (sqlDirListInitialized) { #ifdef SQL_DEBUG_MEM printf("sqlListsCleanup: freeing sqlDirList\n"); #endif for (i = 0 ; i < SQL_MAX_DISTRIBS; i++) { if (sqlDirList[i] != NULL) rpmDirFree(sqlDirList[i]); sqlDirList[i] = NULL; } sqlDirListInitialized = 0; } if (sqlVendorListInitialized) { #ifdef SQL_DEBUG_MEM printf("sqlListsCleanup: freeing sqlVendorList\n"); #endif for (i = 1 ; i < sqlVendorListLen;i++) { if (sqlVendorList[i] != NULL) xmlFree(sqlVendorList[i]); sqlVendorList[i] = NULL; } xmlFree(sqlVendorList); sqlVendorListInitialized = 0; } if (sqlDistributionListInitialized) { #ifdef SQL_DEBUG_MEM printf("sqlListsCleanup: freeing sqlDistributionList\n"); #endif for (i = 0 ; i < sqlDistributionListLen;i++) { if (sqlDistributionList[i] != NULL) xmlFree(sqlDistributionList[i]); sqlDistributionList[i] = NULL; } xmlFree(sqlDistributionList); sqlDistributionListInitialized = 0; } if (sqlResourceListInitialized) { #ifdef SQL_DEBUG_MEM printf("sqlListsCleanup: freeing sqlResourceList\n"); #endif for (i = 0 ; i < sqlResourceListLen;i++) { if (sqlResourceList[i] != NULL) xmlFree(sqlResourceList[i]); sqlResourceList[i] = NULL; } xmlFree(sqlResourceList); sqlResourceListInitialized = 0; } } /************************************************************************ * * * Export functions * * * ************************************************************************/ void sql_dump_rdf_full_index(void) { MYSQL_RES *result; MYSQL_ROW row; char query[SMALL_QUERY]; gzFile rdf; char *filename; char *dist; char *name; char *version; char *release; char *arch; char *summary; char *subdir; char *psubdir; char *rpmdir; char *start, *end; int distrib; int len; char path[500]; if (!rpm2html_dump_rdf_resources) return; if (!rpm2html_rdf_resources_dir) return; if ((rpm2html_host == NULL) || (rpm2html_url == NULL)) return; /* * Open the RDF resource descritpion. */ mkdir(rpm2html_rdf_resources_dir, 0755); snprintf(path, 500, "%s/fullIndex.rdf.gz", rpm2html_rdf_resources_dir); path[499] = 0; rdf = gzopen(path, "w9"); if (rdf == NULL) { fprintf(stderr, "unable to write to %s\n", path); return; } gzprintf(rdf, "\n"); gzprintf(rdf, "\n"); /* * Query the database for the information providing the resource. */ snprintf(query, SMALL_QUERY, "select filename,Dist,Name,Version,Release,Arch,Summary from Packages"); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql, query)) { printf("sql_dump_rdf_full_index: SELECT from Packages failed: %s\n", mysql_error(sql)); gzprintf(rdf, "\n"); fclose(rdf); return; } result = mysql_use_result(sql); if (result == NULL) { printf("sql_dump_rdf_full_index: SELECT from Packages failed: %s\n", mysql_error(sql)); gzprintf(rdf, "\n"); fclose(rdf); return; } while((row = mysql_fetch_row(result))) { filename = row[0]; dist = row[1]; name = row[2]; version = row[3]; release = row[4]; arch = row[5]; summary = row[6]; if ((filename == NULL) || (dist == NULL) || (name == NULL) || (summary == NULL)) { continue; } if (!strncmp(filename, "localbase", 9)) continue; if (sscanf(dist, "%d", &distrib) != 1) continue; if ((distrib < 1) || (distrib >= SQL_MAX_DISTRIBS) || (sqlDirList[distrib] == NULL)) continue; subdir = sqlDirList[distrib]->subdir; rpmdir = sqlDirList[distrib]->rpmdir; len = strlen(rpmdir); if (strncmp(filename, rpmdir, len)) { fprintf(stderr, "%s out of subdir %s\n", filename, subdir); continue; } start = &(filename[len]); while (*start == '/') start++; end = &start[strlen(start) - 1]; while ((end >= start) && (*end != '/')) end--; if (end <= start) { psubdir = xmlStrdup(""); } else { psubdir = xmlMalloc((end - start) + 1); if (psubdir == NULL) { fprintf(stderr, "Out of memory\n"); continue; } strncpy(psubdir, start, end - start); psubdir[end - start] = 0; } gzprintf(rdf, " \n", sqlDirList[distrib]->ftp,psubdir,name,version,release,arch); gzprintf(rdf, " %s\n", name); gzprintf(rdf, " %s\n", convertXML(summary)); gzprintf(rdf, " \n"); xmlFree(psubdir); } gzprintf(rdf, "\n"); gzclose(rdf); mysql_free_result(result); if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } } void sql_dump_rdf(const char *resource) { MYSQL_RES *result; MYSQL_ROW row; char query[MAX_QUERY]; FILE *rdf; char *filename; char *dist; char *name; char *version; char *release; char *arch; char *os; char *packager; char *date; char *size; char *vendorstr; char *subdir; char *psubdir; char *rpmdir; char *start, *end; int distrib; int vendor; int person; int len; char path[500]; if (resource == NULL) return; if (resource[0] == '/') return; if (!rpm2html_dump_rdf_resources) return; if (!rpm2html_rdf_resources_dir) return; if ((rpm2html_host == NULL) || (rpm2html_url == NULL)) return; /* * Open the RDF resource descritpion. */ mkdir(rpm2html_rdf_resources_dir, 0755); snprintf(path, 500, "%s/%s.rdf", rpm2html_rdf_resources_dir, resource); path[499] = 0; rdf = fopen(path, "w"); if (rdf == NULL) { fprintf(stderr, "unable to write to %s\n", path); return; } fprintf(rdf, "\n"); fprintf(rdf, "\n"); /* * Query the database for the information providing the resource. */ snprintf(query, MAX_QUERY, "select Packages.filename,Packages.Dist,Packages.Name,Packages.Version,Packages.Release,Packages.Arch,Packages.Os,Packages.Packager,Packages.Date,Packages.Size,Packages.Vendor from Packages,Provides where Provides.Resource=\"%s\" and Provides.ID = Packages.ID", resource); query[MAX_QUERY - 1] = 0; if (mysql_query(sql, query)) { printf("sql_dump_rdf: SELECT from Packages failed: %s\n", mysql_error(sql)); fprintf(rdf, "\n"); fclose(rdf); return; } result = mysql_use_result(sql); if (result == NULL) { printf("sql_dump_rdf: SELECT from Packages failed: %s\n", mysql_error(sql)); fprintf(rdf, "\n"); fclose(rdf); return; } while((row = mysql_fetch_row(result))) { filename = row[0]; dist = row[1]; name = row[2]; version = row[3]; release = row[4]; arch = row[5]; os = row[6]; packager = row[7]; date = row[8]; size = row[9]; vendorstr = row[10]; if ((filename == NULL) || (dist == NULL) || (name == NULL) || (version == NULL) || (release == NULL) || (arch == NULL) || (os == NULL) || (date == NULL) || (vendorstr == NULL) || (size == NULL)) { continue; } if (!strncmp(filename, "localbase", 9)) continue; if (sscanf(dist, "%d", &distrib) != 1) continue; if ((distrib < 1) || (distrib >= SQL_MAX_DISTRIBS) || (sqlDirList[distrib] == NULL)) continue; if (vendorstr != NULL) { if (sscanf(vendorstr, "%d", &vendor) != 1) continue; } if ((vendor < 1) || (vendor >= sqlDistributionListLen) || (sqlDistributionList[vendor] == NULL)) continue; if (packager != NULL) { if (sscanf(packager, "%d", &person) != 1) continue; } if ((person < 1) || (person >= sqlVendorListLen) || (sqlVendorList[person] == NULL)) continue; subdir = sqlDirList[distrib]->subdir; rpmdir = sqlDirList[distrib]->rpmdir; len = strlen(rpmdir); if (strncmp(filename, rpmdir, len)) { fprintf(stderr, "%s out of subdir %s\n", filename, subdir); continue; } start = &(filename[len]); while (*start == '/') start++; end = &start[strlen(start) - 1]; while ((end >= start) && (*end != '/')) end--; if (end <= start) { psubdir = xmlStrdup(""); } else { psubdir = xmlMalloc((end - start) + 1); if (psubdir == NULL) { fprintf(stderr, "Out of memory\n"); continue; } strncpy(psubdir, start, end - start); psubdir[end - start] = 0; } fprintf(rdf, " ftp,psubdir,name,version,release,arch); fprintf(rdf, "href=\"../%s/%s/%s-%s-%s.%s.rdf\">\n", subdir,psubdir,name,version,release,arch); fprintf(rdf, " %s\n", name); fprintf(rdf, " %s\n", version); fprintf(rdf, " %s\n", release); fprintf(rdf, " %s\n", arch); fprintf(rdf, " %s\n", os); if (packager == NULL) fprintf(rdf, " Unknown\n"); else fprintf(rdf, " %s\n", convertXML(sqlDistributionList[vendor])); fprintf(rdf, " %s\n", convertXML(sqlVendorList[person])); fprintf(rdf, " %s\n", date); fprintf(rdf, " %s\n", size); fprintf(rdf, " %s\n", subdir); fprintf(rdf, " \n"); xmlFree(psubdir); } fprintf(rdf, "\n"); fclose(rdf); mysql_free_result(result); if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } } void sql_show_config(void) { MYSQL_RES *result; MYSQL_ROW row; int id, i; int index = 0; int ids[500]; char query[SMALL_QUERY]; printf(";\n; Configuration file for rpm2html\n"); printf("; http://rpmfind.net/linux/rpm2html/\n;\n\n"); mysql_query(sql,"SELECT Name,Value FROM Config"); result = mysql_use_result(sql); while((row = mysql_fetch_row(result))) { if (row[0] == NULL) { printf("\n"); } else { if (!strcmp(row[0], "maint")) printf("; maintainer of the local rpm mirror\n"); else if (!strcmp(row[0], "mail")) printf("; mail for the maintainer\n"); else if (!strcmp(row[0], "dir")) printf("; Directory to store the HTML pages produced\n"); else if (!strcmp(row[0], "url")) printf("; The relative URL for front pages\n"); else if (!strcmp(row[0], "header")) printf("; Extra link in the navigation bar\n"); else if (!strcmp(row[0], "html")) printf("; Export the local packages in HTML format\n"); else if (!strcmp(row[0], "tree")) printf("; Build the tree for the distributions\n"); else if (!strcmp(row[0], "rdf")) printf("; Export the local packages in RDF format\n"); else if (!strcmp(row[0], "rdf_dir")) printf("; Directory to store the RDf tree\n"); else if (!strcmp(row[0], "rdf_resources")) printf("; Compile a list of resources in RDF format\n"); else if (!strcmp(row[0], "rdf_resources_dir")) printf("; Directory to store the RDf resources tree\n"); if (row[1] == NULL) printf("%s\n\n", row[0]); else printf("%s=%s\n\n", row[0], row[1]); } } mysql_free_result(result); if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } /* * Dump the Metadata */ printf(";\n; The metadata mirrors list\n;\n\n[metadata]\n"); mysql_query(sql,"SELECT URL FROM Metadata"); result = mysql_use_result(sql); while((row = mysql_fetch_row(result))) { if (row[0] != NULL) { printf("mirror=%s\n", row[0]); } } mysql_free_result(result); if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } /* * Dump the distributions information * 1/ collect the list of IDs for the distribs */ printf("\n\n;\n; The distribution list\n;\n\n"); mysql_query(sql,"SELECT ID FROM Distribs"); result = mysql_use_result(sql); while((row = mysql_fetch_row(result))) { if (row[0] != NULL) { if (sscanf(row[0], "%d", &id) == 1) { ids[index++] = id; } } } mysql_free_result(result); /* * Dump each distribution separately. */ for (i = 0;i < index;i++) { snprintf(query, SMALL_QUERY - 1, "SELECT Directory,Name,Vendor,Path,URL,URLSrc,Description,Html,Color \ FROM Distribs WHERE ID=%d", ids[i]); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_show_config: SELECT Distrib %d failed: %s\n", ids[i], mysql_error(sql)); continue; } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (row[0] == NULL) break; printf("[%s]\n", row[0]); if (row[1] != NULL) printf("name=%s\n", row[1]); if (row[3] != NULL) printf("subdir=%s\n", row[3]); if (row[4] != NULL) printf("ftp=%s\n", row[4]); if (row[5] != NULL) printf("ftpsrc=%s\n", row[5]); if (row[7] != NULL) printf("html=%s\n", row[7]); if (row[8] != NULL) printf("color=%s\n", row[8]); } } mysql_free_result(result); /* * Extract the mirrors for this distribution. */ snprintf(query, SMALL_QUERY - 1, "SELECT URL FROM Mirrors WHERE ID=%d", ids[i]); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_show_config: SELECT Mirrors %d failed: %s\n", ids[i], mysql_error(sql)); printf("\n\n"); continue; } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (row[0] == NULL) continue; printf("mirror=%s\n", row[0]); } } mysql_free_result(result); printf("\n\n"); } printf(";\n; End of the configuration file for rpm2html\n;\n"); } void sql_show_metadata(void) { MYSQL_RES *result; MYSQL_ROW row; mysql_query(sql,"SELECT URL FROM Metadata"); result = mysql_use_result(sql); while((row = mysql_fetch_row(result))) { if (row[0] == NULL) printf("NULL !\n"); else { printf("%s\n", row[0]); } } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } } void sql_show_mirrors(void) { MYSQL_RES *result; MYSQL_ROW row; mysql_query(sql,"SELECT URL FROM Mirrors"); result = mysql_use_result(sql); while((row = mysql_fetch_row(result))) { if (row[0] == NULL) printf("NULL !\n"); else { printf("%s\n", row[0]); } } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } } void sql_show_vendors(void) { MYSQL_RES *result; MYSQL_ROW row; mysql_query(sql,"SELECT Name, URL FROM Vendors"); result = mysql_use_result(sql); while((row = mysql_fetch_row(result))) { if (row[0] == NULL) printf("NULL !\n"); else { if (row[1] == NULL) printf("%s : no url\n", row[0]); else printf("%s : %s\n", row[0], row[1]); } } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } } void sql_show_distribs(void) { MYSQL_RES *result; MYSQL_ROW row; mysql_query(sql,"SELECT Name, Path, URL FROM Distribs"); result = mysql_use_result(sql); while((row = mysql_fetch_row(result))) { if (row[0] == NULL) printf("NULL !\n"); else { if (row[1] == NULL) printf("%s : no Path\n", row[0]); else { if (row[2] == NULL) printf("%s : %s : no url\n", row[0], row[1]); else printf("%s : %s : %s\n", row[0], row[1], row[2]); } } } if(mysql_errno(sql)) { fprintf(stderr, "Error: %s\n", mysql_error(sql)); } } int sql_show_table_stats(const char *table, const char *key) { char query[MAX_QUERY]; MYSQL_RES *result; MYSQL_ROW row; int res; /* * Search first for the ID if it already exists */ snprintf(query, MAX_QUERY - 1, "SELECT COUNT(%s) FROM %s", key, table); query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_show_table_stats: SELECT COUNT failed: %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { /* * Lookup the value and return it */ if (row[0] == NULL) { mysql_free_result(result); printf("sql_show_table_stats: select count returns NULL !\n"); return(-1); } if (sscanf(row[0], "%d", &res) != 1) { mysql_free_result(result); printf("sql_show_table_stats: value non numeric %s\n", row[0]); return(-1); } mysql_free_result(result); if (res <= 0) printf(" %s is empty\n", table); else printf(" %s contains %d records\n", table, res); return(res); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sql_show_stats error: %s\n", mysql_error(sql)); } return(-1); } int sql_show_stats(void) { const char *query = "SHOW TABLES"; MYSQL_RES *result; MYSQL_ROW row; int tables = 0; int records = 0; if (mysql_query(sql,query)) { printf("sql_check_tables: SHOW TABLES failed %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (row[0] == NULL) { mysql_free_result(result); printf("sql_check_tables: SHOW TABLES returns NULL !\n"); return(-1); } tables++; } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sql_show_stats error: %s\n", mysql_error(sql)); } printf("%d tables in use\n", tables); records += sql_show_table_stats("Config", "Name"); records += sql_show_table_stats("Distribs", "Name"); records += sql_show_table_stats("Vendors", "Name"); records += sql_show_table_stats("Mirrors", "URL"); records += sql_show_table_stats("Metadata", "URL"); records += sql_show_table_stats("Packages", "Name"); records += sql_show_table_stats("Requires", "Resource"); records += sql_show_table_stats("Provides", "Resource"); records += sql_show_table_stats("Files", "Path"); printf("Total: %d records\n", records); return(records); } void sql_show_latests(void) { rpmDataPtr list; list = sqlRpmByDate(); if (list == NULL) { fprintf(stderr, "no package in database\n"); return; } dumpRpmByDate(list, 0); } void sql_show_resources(void) { int i; sqlInitSqlDirList(); sqlInitSqlResourceList(); sqlInitSqlDistributionList(); sqlInitSqlVendorList(); for (i = 0;i < sqlResourceListLen;i++) { if (sqlResourceList[i] == NULL) break; dumpRessRedirHtml(sqlResourceList[i]); if (rpm2html_dump_rdf_resources) sql_dump_rdf(sqlResourceList[i]); } if (rpm2htmlVerbose) fprintf(stderr, "Dumped %d redirrect resource pages\n", i); if (rpm2html_dump_rdf_resources) sql_dump_rdf_full_index(); sqlListsCleanup(); } void sql_reindex(void) { int i; int pid, status; sqlInitSqlDirList(); #ifdef SQL_DEBUG printf("sql_reindex\n"); #endif if (sqlDirListInitialized) { for (i = 0 ; i < SQL_MAX_DISTRIBS;i++) { if (sqlDirList[i] == NULL) continue; if (sqlDirList[i]->rpmdir != NULL) { printf("sqltools indexing: %s\n", sqlDirList[i]->name); pid = fork(); if (pid < 0) { fprintf(stderr, "fork failed \n"); continue; } if (pid == 0) { printf("%s %s %s %s\n", "./rpm2html", "-dir", sqlDirList[i]->rpmdir, "./rpm2html-local.config"); execlp("./rpm2html", "./rpm2html", "-dir", sqlDirList[i]->rpmdir, "./rpm2html-local.config", NULL); fprintf(stderr, "Unable to launch rpm2html\n"); exit(127); } do { if (waitpid(pid, &status, 0) == -1) { if (errno != EINTR) goto done; } else { if (status != 0) printf("indexing: %s exit %d\n", sqlDirList[i]->name, status); break; } } while(1); } } } done: sqlListsCleanup(); } void sql_show_index(void) { sqlInitSqlDirList(); sqlInitSqlDistributionList(); if (rpm2html_dump_rdf_resources) sql_dump_rdf_full_index(); sqlListsCleanup(); } void sql_show_all(void) { rpmDataPtr list; #ifdef SQL_DEBUG_TIMING time_t cur, last; last = time(NULL); #endif list = sqlRpmAll(); if (list == NULL) { fprintf(stderr, "no package in database\n"); return; } #ifdef SQL_DEBUG_TIMING cur = time(NULL); fprintf(stderr, "sqlRpmAll took %d seconds\n", (int)(cur - last)); last = cur; #endif rpmNameSort(&list, 0); dumpRpmByName(rpmSoftwareList, 0); #ifdef SQL_DEBUG_TIMING cur = time(NULL); fprintf(stderr, "dumpRpmByName took %d seconds\n", (int)(cur - last)); last = cur; #endif rpmGroupSort(&list, 0); dumpRpmByGroups(rpmSoftwareList, 0); #ifdef SQL_DEBUG_TIMING cur = time(NULL); fprintf(stderr, "dumpRpmByGroups took %d seconds\n", (int)(cur - last)); last = cur; #endif rpmVendorSort(&list, 0); dumpRpmByVendors(list, 0); #ifdef SQL_DEBUG_TIMING cur = time(NULL); fprintf(stderr, "dumpRpmByVendors took %d seconds\n", (int)(cur - last)); last = cur; #endif rpmDistribSort(&list, 0); dumpRpmByDistribs(list, 0); #ifdef SQL_DEBUG_TIMING cur = time(NULL); fprintf(stderr, "dumpRpmByDistribs took %d seconds\n", (int)(cur - last)); last = cur; #endif rpmDateSort(&list, 0); dumpRpmByDate(list, 0); #ifdef SQL_DEBUG_TIMING cur = time(NULL); fprintf(stderr, "dumpRpmByDate took %d seconds\n", (int)(cur - last)); last = cur; #endif rpmdataCleanup(); sleep(30); } /************************************************************************ * * * rpm2html configuration functions * * * ************************************************************************/ int readConfigSql(void) { char query[MAX_QUERY]; MYSQL_RES *result; MYSQL_ROW row; int dir = 0; /* * General configuration information */ snprintf(query, MAX_QUERY - 1, "SELECT Name,Value FROM Config"); query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_check_tables: SELECT Config failed %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if ((row[0] == NULL) || (row[1] == NULL)) { fprintf(stderr, "readConfigSql : found NULL value\n"); continue; } if (!strcmp(row[0], "dir")) dir = 1; addConfigEntry(RPM2HTML_NAME, row[0], row[1]); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sql_show_stats error: %s\n", mysql_error(sql)); } if (dir == 0) { fprintf(stderr, "readConfigSql : no directory\n"); return(-1); } /* * The metadata mirror list. */ snprintf(query, MAX_QUERY - 1, "SELECT URL FROM Metadata"); query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_check_tables: SELECT Metadata failed %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (row[0] == NULL) { fprintf(stderr, "readConfigSql : found NULL metadata\n"); continue; } addConfigEntry("metadata", "mirror", row[0]); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sql_show_stats error: %s\n", mysql_error(sql)); } /* * The distribution lists */ snprintf(query, MAX_QUERY - 1, "SELECT Directory,Name,URL,URLSrc,Path FROM Distribs"); query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_check_tables: SELECT Distribs failed %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if (row[0] == NULL) { fprintf(stderr, "readConfigSql : found NULL distro\n"); continue; } if (row[1] != NULL) addConfigEntry(row[0], "name", row[1]); if (row[2] != NULL) addConfigEntry(row[0], "ftp", row[2]); if (row[3] != NULL) addConfigEntry(row[0], "ftpsrc", row[3]); if (row[4] != NULL) addConfigEntry(row[0], "subdir", row[4]); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sql_show_stats error: %s\n", mysql_error(sql)); } /* * The Mirrors */ snprintf(query, MAX_QUERY - 1, "SELECT Distribs.Directory,Mirrors.URL FROM Distribs,Mirrors WHERE Distribs.ID = Mirrors.ID"); query[MAX_QUERY - 1] = 0; if (mysql_query(sql,query)) { printf("sql_check_tables: SELECT Distribs failed %s\n", mysql_error(sql)); return(-1); } result = mysql_use_result(sql); if (result) { while((row = mysql_fetch_row(result))) { if ((row[0] == NULL) || (row[1] == NULL)) { fprintf(stderr, "readConfigSql : found NULL mirror\n"); continue; } addConfigEntry(row[0], "mirror", row[1]); } mysql_free_result(result); } if(mysql_errno(sql)) { fprintf(stderr, "sql_show_stats error: %s\n", mysql_error(sql)); } /* * TODO: add the language(s) stuff */ return(0); } void sqlConfigEntry(const char *rpmdir, const char *name, const char *value) { int distrib; if (rpm2htmlVerbose > 1) printf("sqlConfigEntry(\"%s\", \"%s\", \"%s\")\n", rpmdir, name, value); /* * case of global option for rpm2html. */ if (!strcasecmp(rpmdir, RPM2HTML_NAME)) { sql_add_config_info(name, value); return; } /* * Options for the metadata mirrors. */ if (!strcasecmp(rpmdir, "metadata")) { if (!strcasecmp(name, "mirror")) { sql_add_metadata_base(value); } else { printf("Config file : %s entry for [metadata] ignored\n", name); } return; } /* * option for a directory. */ if (!strcasecmp(name, "name")) { sql_add_distrib(value, NULL, rpmdir, NULL, NULL, NULL, NULL, NULL, NULL); } else if (!strcasecmp(name, "subdir")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) sql_update_id("Distribs", distrib, "Path", value); else fprintf(stderr, "database has no distrib: %s", rpmdir); } else if (!strcasecmp(name, "url")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) sql_update_id("Distribs", distrib, "URL", value); else fprintf(stderr, "database has no distrib: %s", rpmdir); } else if (!strcasecmp(name, "ftp")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) sql_update_id("Distribs", distrib, "URL", value); else fprintf(stderr, "database has no distrib: %s", rpmdir); } else if (!strcasecmp(name, "ftpsrc")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) sql_update_id("Distribs", distrib, "URLSrc", value); else fprintf(stderr, "database has no distrib: %s", rpmdir); } else if (!strcasecmp(name, "html")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) sql_update_id("Distribs", distrib, "Html", value); else fprintf(stderr, "database has no distrib: %s", rpmdir); } else if (!strcasecmp(name, "color")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) sql_update_id("Distribs", distrib, "Color", value); else fprintf(stderr, "database has no distrib: %s", rpmdir); } else if (!strcasecmp(name, "mirror")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) sql_add_dist_mirror(distrib, value, 0); else fprintf(stderr, "database has no distrib: %s", rpmdir); } else { printf("Config file : %s entry for [%s] ignored\n", name, rpmdir); } } rpm2html-1.11.2/sqltools.c0000664000076400007640000001016507274074744014101 0ustar hanyhany/* * sqltools.c: front-end program for MySQL database */ #include "config.h" #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif /******** #include ********/ #include "rpm2html.h" #include "rpmdata.h" #include "sql.h" void usage(const char *name) { printf("%s: usage\n", name); printf(" config: dump a config file from the database\n"); printf(" stats: show database usage statistics\n"); printf(" reindex: reindex all distro one by one\n"); printf(" check: remove superfluous entries from the database\n"); printf(" vendors: list the registered vendors\n"); printf(" distribs: list the registered distribs\n"); printf(" metadata: list the registered metadata servers\n"); printf(" mirrors: list the registered mirrors\n"); printf(" latests: list the latest packages\n"); printf(" index: regenerates the full index RDF\n"); printf(" add distrib name [vendor [directory [path [url [ urlsrc [description]]]]]]\n"); printf(" add vendor name [url [description]]\n"); printf(" add mirror distrib url\n"); printf(" queries : dump the most requested queries\n"); exit(1); } int main(int argc, char **argv) { int res; if (getenv("DEBUG_SQLTOOLS") == NULL) rpm2htmlVerbose = 0; if (argc < 2) usage(argv[0]); if (init_sql(NULL, NULL, NULL, NULL) < 0) exit(1); res = sql_check_tables(); if (res > 0) { printf("rebuilt %d tables\n", res); } if (!strcmp(argv[1], "vendors")) sql_show_vendors(); else if (!strcmp(argv[1], "metadata")) sql_show_metadata(); else if (!strcmp(argv[1], "mirrors")) sql_show_mirrors(); else if (!strcmp(argv[1], "distribs")) sql_show_distribs(); else if (!strcmp(argv[1], "config")) sql_show_config(); else if (!strcmp(argv[1], "stats")) sql_show_stats(); else if (!strcmp(argv[1], "latests")) sql_show_latests(); else if (!strcmp(argv[1], "all")) sql_show_all(); else if (!strcmp(argv[1], "resources")) sql_show_resources(); else if (!strcmp(argv[1], "check")) sql_check_packages(); else if (!strcmp(argv[1], "topindex")) sql_top_index(); else if (!strcmp(argv[1], "index")) sql_show_index(); else if (!strcmp(argv[1], "reindex")) sql_reindex(); else if (!strcmp(argv[1], "queries")) sql_get_top_queries(300); else if (!strcmp(argv[1], "add")) { if (argc < 5) usage(argv[0]); if (!strcmp(argv[2], "distrib")) { char *Name = NULL; char *Path = NULL; char *Directory = NULL; char *Vendor = NULL; char *URL = NULL; char *URLSrc = NULL; char *Description = NULL; char *Color = NULL; char *Html = NULL; if ((argc > 3) && (argv[3][0] != 0)) Name = argv[3]; if ((argc > 4) && (argv[4][0] != 0)) Vendor = argv[4]; if ((argc > 5) && (argv[5][0] != 0)) Directory = argv[5]; if ((argc > 6) && (argv[6][0] != 0)) Path = argv[6]; if ((argc > 7) && (argv[7][0] != 0)) URL = argv[7]; if ((argc > 8) && (argv[8][0] != 0)) URLSrc = argv[8]; if ((argc > 9) && (argv[9][0] != 0)) Description = argv[9]; res = sql_add_distrib(Name, Vendor, Directory, Path, URL, URLSrc, Description, Color, Html); printf("updated %d fields\n", res); } else if (!strcmp(argv[2], "vendor")) { char *Name = NULL; char *URL = NULL; char *Description = NULL; if ((argc > 3) && (argv[3][0] != 0)) Name = argv[3]; if ((argc > 4) && (argv[4][0] != 0)) URL = argv[4]; if ((argc > 5) && (argv[5][0] != 0)) Description = argv[5]; res = sql_add_vendor(Name, URL, Description); printf("updated %d fields\n", res); } else if (!strcmp(argv[2], "mirror")) { char *Name = NULL; char *URL = NULL; if ((argc > 3) && (argv[3][0] != 0)) Name = argv[3]; if ((argc > 4) && (argv[4][0] != 0)) URL = argv[4]; res = sql_add_mirror(Name, URL, 0); printf("updated %d fields\n", res); } } if (close_sql() < 0) return(1); exit(0); } rpm2html-1.11.2/config.h0000664000076400007640000000741411466345217013470 0ustar hanyhany/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.in by autoheader. */ #define USE_RPM310 1 #define USE_RPMIO 1 #define HAVE_RPM42 1 /* Define to 1 if you have the header file. */ #define HAVE_CTYPE_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_DB1_DB_H */ /* Define to 1 if you have the header file. */ #define HAVE_DB_185_H 1 /* Define to 1 if you have the header file. */ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `gethostname' function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `intl' library (-lintl). */ /* #undef HAVE_LIBINTL */ /* Define to 1 if you have the `rpm' library (-lrpm). */ #define HAVE_LIBRPM 1 /* use templating engine libtemplate */ #define HAVE_LIBTEMPLATE 1 /* Define to 1 if you have the header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the header file. */ #define HAVE_RPM_RPMIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_RPM_RPMLEGACY_H 1 /* Define to 1 if you have the header file. */ #define HAVE_RPM_RPMLIB_H 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the header file. */ #define HAVE_STDARG_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_SYS_DIR_H */ /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_SYS_NDIR_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 /* Define to 1 if you have the header file. */ #define HAVE_ZLIB_H 1 /* Name of package */ #define PACKAGE "rpm2html" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1.11.2" rpm2html-1.11.2/html.h0000664000076400007640000000233107214744510013153 0ustar hanyhany/* * html.h : resources concerning the dump as an HTML base. * * See Copyright for the status of this software. * * $Id: html.h,v 1.20 2000/12/10 18:19:52 veillard Exp $ */ #ifndef __RPM_HTML_H__ #define __RPM_HTML_H__ extern void dumpDirIcon(void); extern void createDirectory(const char *dirname); extern void dumpAllRessHtml(int installed); extern void dumpRpmHtml(rpmDataPtr rpm, rpmSubdirPtr tree); extern void dumpRpmByGroups(rpmDataPtr list, int installed); extern void dumpRpmByDistribs(rpmDataPtr list, int installed); extern void dumpRpmByVendors(rpmDataPtr list, int installed); extern void dumpRpmByDate(rpmDataPtr list, int installed); extern void dumpRpmByName(rpmDataPtr list, int installed); extern rpmDataPtr dumpDirIndex(rpmDirPtr dir, rpmSubdirPtr tree, rpmDataPtr list); extern void dumpIndex(time_t start_time, int installed); extern void rpmDumpHtmlRealRoot(rpmDirPtr dir); extern const char *rpmName(rpmDataPtr cur); extern const char *resourceName(const char *resource); extern int checkDate(const char *filename, time_t stamp); extern void dumpRessRedirHtml(const char *name); char *convertHTML(const char *str); char *convertXML(const char *str); #endif /* __RPM_HTML_H__ */ rpm2html-1.11.2/language.h0000664000076400007640000000540407177124727014010 0ustar hanyhany/* * language.h : definitions for the Localization support. * * See Copyright for the status of this software. * * $Id: language.h,v 1.13 2000/10/29 22:51:03 veillard Exp $ */ #ifndef __RPM2HTML_LANGUAGE_H__ #define __RPM2HTML_LANGUAGE_H__ #define LANG_HTML_SUFFIX 0 #define LANG_GENERATED 1 #define LANG_INDEX_HTML 2 #define LANG_GROUP_HTML 3 #define LANG_BYDATE_HTML 4 #define LANG_BYNAME_HTML 5 #define LANG_VENDOR_HTML 6 #define LANG_DISTRIB_HTML 7 #define LANG_WELCOME_REPOSITORY 8 #define LANG_RPM2HTML_INTRO 9 #define LANG_STATS 10 #define LANG_INSTALLED_STATS 11 #define LANG_LIST 12 #define LANG_INDEX_GROUP 13 #define LANG_INDEX_CREATION 14 #define LANG_INDEX_NAME 15 #define LANG_INDEX_VENDOR 16 #define LANG_INDEX_DISTRIB 17 #define LANG_INDEX_INSTALL 18 #define LANG_SOURCES_REPOSITORY 19 #define LANG_LOCAL_MIRROR 20 #define LANG_MIRRORS 21 #define LANG_GENERATION_TIME 22 #define LANG_SECONDS 23 #define LANG_WELCOME_INSTALL 24 #define LANG_FROM 25 #define LANG_NAME 26 #define LANG_DISTRIBUTION 27 #define LANG_VERSION 28 #define LANG_VENDOR 29 #define LANG_RELEASE 30 #define LANG_BUILD_DATE 31 #define LANG_INSTALL_DATE 32 #define LANG_GROUP 33 #define LANG_BUILD_HOST 34 #define LANG_SIZE 35 #define LANG_RPM_SRC 36 #define LANG_PACKAGER 37 #define LANG_URL 38 #define LANG_SUMMARY 39 #define LANG_PROVIDE 40 #define LANG_REQUIRE 41 #define LANG_COPYRIGHT 42 #define LANG_FILES 43 #define LANG_NO_FILES 44 #define LANG_NO_SUMMARY 45 #define LANG_RPM_RESOURCE 46 #define LANG_PROVIDED_BY 47 #define LANG_SORTED_BY_GROUP 48 #define LANG_OF_GROUP 49 #define LANG_SORTED_BY_DISTRIB 50 #define LANG_OF_DISTRIB 51 #define LANG_SORTED_BY_VENDOR 52 #define LANG_OF_VENDOR 53 #define LANG_SORTED_BY_CDATE 54 #define LANG_SORTED_BY_IDATE 55 #define LANG_LESS_3D_OLD 56 #define LANG_LESS_1W_OLD 57 #define LANG_LESS_2W_OLD 58 #define LANG_LESS_1M_OLD 59 #define LANG_MORE_1M_OLD 60 #define LANG_I_LESS_3D_OLD 61 #define LANG_I_LESS_1W_OLD 62 #define LANG_I_LESS_2W_OLD 63 #define LANG_I_LESS_1M_OLD 64 #define LANG_I_MORE_1M_OLD 65 #define LANG_SORTED_BY_NAME 66 #define LANG_NO_DESCRIPTION 67 #define LANG_UNKNOWN 68 #define LANG_NONE 69 #define LANG_NO_GROUP 70 #define LANG_NO_HOST 71 #define LANG_INDEX 72 #define LANG_BEGINNING_LETTER 73 #define LANG_WARNING_RESOURCES 74 #define LANG_CHOOSE_ANOTHER 75 #define LANG_MORE 76 #define LANG_CHANGELOG 77 #define LANG_SUBDIRS 78 #define LANG_TREE_HTML 79 #define LANG_BROWSE_TREE 80 #define LANG_SEARCH_FORM 81 #define LANG_SIGNATURES 82 #define LANG_RDF_CHANNEL 83 /* * Array containing the localized language strings. */ extern char *localizedStrings[]; /* * Functions. */ extern int readLanguageFile(char *filename); extern int writeLanguageFile(char *filename); #endif /* __RPM2HTML_LANGUAGE_H__ */ rpm2html-1.11.2/memory.h0000664000076400007640000000046007217421437013523 0ustar hanyhany/* * memory.h: interface for the memory allocation debugger. * * daniel@veillard.com */ #ifndef _RPM2HTML_DEBUG_MEMORY_ALLOC_ #define _RPM2HTML_DEBUG_MEMORY_ALLOC_ /* #define NO_DEBUG_MEMORY */ #include #include #endif /* _RPM2HTML_DEBUG_MEMORY_ALLOC_ */ rpm2html-1.11.2/rdf_api.h0000664000076400007640000000705607565426467013645 0ustar hanyhany/* * rdf_api.h : interface definitions to read and write RDF schemas * * See Copyright for the status of this software. * * $Id: rdf_api.h,v 1.12 2002/11/16 11:34:15 veillard Exp $ */ #ifndef __RDF_API_H__ #define __RDF_API_H__ #include #include #include "rdf.h" /* * An RDF schema is basically an XML document. */ typedef xmlDocPtr rdfSchema; /* * An RDF namespace is an XML namespace/Ns */ typedef xmlNsPtr rdfNamespace; /* * Any RDF element is an XML element. */ typedef xmlNodePtr rdfElement; /* * An RDF description is an RDF element and usually * a direct child of the root for simple descriptions. */ typedef rdfElement rdfDescription; /* * The value of an element can be either: * - A piece of Text : char * RDF_LEAF * - A collection tag : * - Bag, RDF_BAG * - Seq RDF_SEQ * - Alt RDF_ALT * - An rdfDescription RDF_DESC */ #define RDF_LEAF 1 #define RDF_BAG 2 #define RDF_SEQ 3 #define RDF_ALT 4 #define RDF_DESC 5 /* * An RDF Bag is and RDF element with possibly multiple child */ typedef rdfElement rdfBag; /* * An RDF Seq is and RDF element an enumeration of childs */ typedef rdfElement rdfSeq; /* * Basic routines reading/writing an RDF file. */ rdfSchema rdfRead(const char *filename); void rdfWrite(rdfSchema rdf, const char *filename); void rdfWriteMemory(rdfSchema rdf, char **buffer, int *size); /* * An RDF schema is a collection of RDF descriptions. */ rdfSchema rdfNewSchema(void); void rdfDestroySchema(rdfSchema rdf); rdfDescription rdfFirstDescription(rdfSchema schema); rdfDescription rdfNextDescription(rdfDescription desc); rdfDescription rdfAddDescription(rdfSchema schema, const char *id, const char *about); char *rdfGetDescriptionId(rdfSchema schema, rdfDescription desc); char *rdfGetDescriptionAbout(rdfSchema schema, rdfDescription desc); char *rdfGetElementResource(rdfSchema schema, rdfElement elem); #define rdfGetDescriptionHref(s, d) rdfGetDescriptionAbout((s), (d)) void rdfSetElementResource(rdfSchema schema, rdfElement elem, const char *URI); /* * Namespace handling. */ rdfNamespace rdfNewNamespace(rdfSchema rdf, const char *url, const char *ns); rdfNamespace rdfGetNamespace(rdfSchema rdf, const char *href); rdfNamespace rdfGetRdfNamespace(rdfSchema rdf); /* * Routines to read/write values, which can be either final ones or * subtree. */ int rdfGetValue(rdfDescription desc, const char *property, rdfNamespace ns, char **value, rdfElement *elem); void rdfSetValue(rdfDescription desc, const char *property, rdfNamespace ns, const char *value); void rdfSetTree(rdfDescription desc, const char *property, rdfNamespace ns, rdfElement elem); void rdfRemoveProperty(rdfDescription desc, const char *property, rdfNamespace ns); /* * Routines to read/write bags */ rdfBag rdfBagCreate(rdfSchema schema, rdfDescription desc, const char *property, rdfNamespace ns); rdfElement rdfBagAddValue(rdfBag bag, const char *property, rdfNamespace ns, const char *value, rdfElement elem); /* * Routines to walk bags and sequences. */ rdfElement rdfFirstChild(rdfElement bag); rdfElement rdfNextElem(rdfElement desc); /* * Direct access to Element values. */ int rdfElemGetType(rdfElement elem); char *rdfElemGetValue(rdfElement elem); char *rdfElemGetPropertyName(rdfElement elem); rdfNamespace rdfElemGetNamespace(rdfElement elem); void rdfElemSetValue(rdfElement elem, const char *value); #endif /* __RDF_API_H__ */ rpm2html-1.11.2/rdf.h0000664000076400007640000000112611452634006012760 0ustar hanyhany/* * rdf.h : interfaces for the RDF encoding/decoding of RPM information. * * See Copyright for the status of this software. * * $Id: rdf.h,v 1.8 2010/10/05 14:36:54 hany Exp $ */ #ifndef __INCLUDE_RDF_H__ #define __INCLUDE_RDF_H__ extern rpmDataPtr rpmOpenRdfFile(char *file); extern rpmDataPtr rpmOpenRdf(char *nameRpm, rpmDirPtr dir, rpmSubdirPtr tree); extern void dumpRpmRdf(rpmDataPtr rpm, rpmSubdirPtr tree); extern void dumpAllResRdf(void); extern void dumpResRdf(rpmRessPtr res); extern void dumpAproposRdf(void); extern void dumpDistListRdf(void); #endif /* __INCLUDE_RDF_H__ */ rpm2html-1.11.2/rpm2html.h0000664000076400007640000000553011466345163013765 0ustar hanyhany/* * rpm2html.h : general resources about rpm2html * * See Copyright for the status of this software. * * $Id: rpm2html.h,v 1.83 2010/11/09 22:25:55 hany Exp $ */ #ifndef __RPM2HTML_H__ #define __RPM2HTML_H__ #include "memory.h" #include "stringbuf.h" /* * General setup default values overriden by config file. */ #define RPM2HTML_NAME "rpm2html" #define RPM2HTML_VER "1.11.2" #define RPM2HTML_URL "http://www.nongnu.org/rpm2html/" #define RPM2HTML_MAINT "Peter Hanecak" #define RPM2HTML_MAIL "hany@hany.sk" /* * Constants. */ #define MAX_COLOR_PER_LINE 4 #define MAX_TABLE_LENGHT 20 #define MAX_PAGE_LENGHT 250 #define PACKAGE_FIELD_WIDTH 250 #define DESCRIPTION_FIELD_WIDTH 450 #define SYSTEM_FIELD_WIDTH 95 #define MAX_EXTRA_HEADERS 10 #define MAX_NAME_LIST_LENGHT 75 #define DEFAULT_RDF_COUNT_LIMIT 20 typedef enum rpm_dep_flag { RPM2HTML_REQ_NONE = 0, RPM2HTML_REQ_LT = 1, RPM2HTML_REQ_LEQ, RPM2HTML_REQ_GT, RPM2HTML_REQ_GEQ, RPM2HTML_REQ_EQU } rpm_dep_flag; /* * Unmodifiable variables. */ extern char *rpm2html_rpm2html_name; /* OK */ extern char *rpm2html_rpm2html_ver; /* OK */ extern char *rpm2html_rpm2html_url; /* OK */ extern char *rpm2html_rpm2html_thishost; /* * global variables. */ extern int rpm2htmlVerbose; extern char *rpm2html_maint; /* OK */ extern char *rpm2html_mail; /* OK */ extern char *rpm2html_help; extern char *rpm2html_dir; /* OK */ extern char *rpm2html_name; /* OK */ extern char *rpm2html_url; /* OK */ #ifdef WITH_SQL extern char *rpm2html_search; #endif extern char *rpm2html_ftp; /* OK */ extern char *rpm2html_ftpsrc; /* OK */ extern char *rpm2html_host; /* OK */ extern int rpm2html_dump_rdf; extern int rpm2html_dump_rdf_resources; extern int rpm2html_dump_html; extern int rpm2html_dump_html_only_if_rpm_newer; #ifdef HAVE_LIBTEMPLATE extern char *rpm2html_html_template; #endif extern char *rpm2html_rdf_dir; /* OK */ extern char *rpm2html_rdf_resources_dir; /* OK */ extern int rpm2html_rdf_count_limit; extern int rpm2html_build_tree; extern int rpm2html_cve_linking; extern int rpm2html_no_sql; extern int rpm2html_protect_emails; extern int rpm2html_files; extern int rpm2html_size; extern int rpm2html_install_files; extern int rpm2html_install_size; extern char *rpm2html_headers_name[MAX_EXTRA_HEADERS]; /* OK */ extern char *rpm2html_headers_url[MAX_EXTRA_HEADERS]; /* OK */ extern int rpm2html_nb_extra_headers; extern int nb_metadata_mirrors; extern int max_metadata_mirrors; extern char **metadata_mirrors; extern int readConfigFile(char *filename); extern void addConfigEntry(char *rpmdir, char *name, char *value); extern void reinitialize(void); extern char *xmlStrdupHTML(const char *str); extern void rpmDirCleanupAll(void); extern void cleanupCleanup(void); extern void htmlCleanup(void); extern void rpmopenCleanup(void); #endif /* __RPM2HTML_H__ */ rpm2html-1.11.2/rpmdata.h0000664000076400007640000002271011452634006013637 0ustar hanyhany/* * rpmdata.h : describes the data gathered for each RPM analyzed. * * See Copyright for the status of this software. * * $Id: rpmdata.h,v 1.58 2010/10/05 14:36:54 hany Exp $ */ #ifndef __RPMDATA_H__ #define __RPMDATA_H__ #include #if defined(HAVE_RPM_RPMLEGACY_H) #define _RPM_4_4_COMPAT #include #endif #if defined(HAVE_RPM_RPMIO_H) #include #endif #include /* * Structure associated with a local directory containing RPM files. */ #define MAX_ARCHS (sizeof(int) * 8) typedef struct rpm_dir { struct rpm_dir *next; /* next in list */ int no; /* ID in SQL base */ int vendor; /* vendor ID in SQL base */ char *color; /* The bgcolor for the pages :-) */ char *dir; /* where to store the HTML files */ char *subdir; /* subdirectory for multiple archive */ char *ftp; /* The host URL it's mirrored from */ char *ftpsrc; /* The host URL where src.rpm can be found */ char *host; /* Hostname for the server */ char *mail; /* mail contact for this directory */ char *maint; /* Maintainer name for this directory */ char *name; /* Name for this repository */ char *rpmdir; /* The local repository */ char *trust; /* Confidences in the files */ char *url; /* The output URL */ int files; /* number of files */ int installbase; /* Is this from an installed base */ int size; /* aggregated size of files */ int nb_mirrors; /* numbers of mirrors */ int max_mirrors; /* numbers of slot allocated */ char **mirrors; /* Urls for download */ int html; /* Should we build the HTML pages */ int build_tree; /* Should we build the filesystem tree */ int follow_symlinks; /* Should we follow all symlinks */ int rpm_symlinks; /* Should we open links to RPM files */ struct rpm_realdir *root; /* The corresponding filesystem tree */ char *dbpath; /* The rpm db path */ /* Added by A. Gibert */ } rpmDir, *rpmDirPtr; /* * Structure associated with a local directory containing HTML files. * We build a tree providing an actual map of the generated site. */ typedef struct rpm_subdir { struct rpm_subdir *parent; /* Parent directory ususally .. */ char *name; /* subdirectory name */ char *color; /* Color for the HTML output */ char *htmlpath; /* full path w.r.t. rpm2html_url */ char *rpmpath; /* full path w.r.t. rpm2html_dir */ int html; /* Should we build the HTML pages */ int nb_subdirs; /* number of subdirectories */ int max_subdirs; /* number of subdirectories allocated */ struct rpm_subdir **subdirs;/* list of the subdirectories */ } rpmSubdir, *rpmSubdirPtr; /* * Structure associated with a real directory containing files owned * by RPM packages. It reflect the content of user's filesystem if * it installed the packages. */ #define RPM_ELEM_DIRECTORY 0x1 /* File or directory ? */ typedef struct rpm_realdir { struct rpm_realdir *parent; /* Parent directory */ char *name; /* directory name */ int nb_elem; /* number of files (and subdirs) */ int max_elem; /* size of allocated arrays */ /* pointers to an array of either */ void **elems; /* filename or subdir rpm_realdir */ char **names; /* pointer to the array of names */ char *flags; /* pointer to array of flags */ } rpmRealDir, *rpmRealDirPtr; /* * structure associated with an architecture. */ typedef struct rpm_arch { struct rpm_arch *next; /* next in the list */ char *os; /* the Operating System name */ char *arch; /* the CPU architecture */ } rpmArch, *rpmArchPtr; /* * structure associated with an rpm */ typedef struct rpm_data { struct rpm_data *next; /* next in the full list of RPMs */ struct rpm_data *nextSoft; /* next software */ struct rpm_data *nextArch; /* RPM for same software on other archs */ struct rpm_data *nextHash; /* next in the hash list */ /* * These information need to be kept until the end of the processing * to allow the dump of resources directories. */ rpmDirPtr dir; /* directory infos */ char *url; /* URL for the software */ char *filename; /* name of the file */ const char *name; /* name of the software */ char *summary; /* 1 line summary */ const char *group; /* type of software */ const char *version; /* version of the software */ const char *release; /* software release */ const char *arch; /* the architecture system */ const char *os; /* the target system */ const char *distribution; /* general OS distribution */ const char *vendor; /* general OS vendor */ time_t date; /* date of packaging */ int_32 size; /* size of the software */ const char *subdir; /* subdirectory holding the rpm */ struct rpm_extra_data *extra;/* see below */ } rpmData, *rpmDataPtr; typedef struct rpm_extra_data { /* * These information are loaded and discarded as soon as the * HTML and RDF pages are built. */ char *packager; /* the packager */ char *description; /* short description */ char *copyright; /* software copyright */ char *changelog; /* changelog */ char *srcrpm; /* source RPM */ time_t stamp; /* modification file of the archive */ char *host; /* build host */ int nb_resources; /* #of resources provided */ int max_resources; /* #of resources slot allocated */ struct rpm_resource **resources;/* list of them */ int nb_requires; /* #of resources required */ int max_requires; /* #of resources slot allocated */ struct rpm_resource **requires;/* list of them */ char *filelist; /* the filelist */ int nb_sigs; /* #of signatures required */ int max_sigs; /* #of signatures slot allocated */ struct rpm_sig **sigs; /* list of them */ } rpmExtraData, *rpmExtraDataPtr; /* * structure associated with a resource */ typedef struct rpm_resource { struct rpm_resource *next; /* next in the list */ struct rpm_resource *nextHash;/* next in the hash table list */ char *name; /* name of the resource */ char *version; /* version of the resource */ rpm_dep_flag flag; /* flag of the resource */ int nb_provider; /* #of resources provided */ int max_provider; /* #of resources slot allocated */ time_t stamp; /* max stamp of the provider */ struct rpm_data **provider; /* list of them */ } rpmRess, *rpmRessPtr; /* * structure associated with signature */ typedef struct rpm_sig { int size; /* size of signature */ int tag; /* signature tag */ int type; /* signature type */ int *sig; /* signature */ #if defined(WITH_GPG) char *resolve; /* resolved signature */ #endif } rpmSig, *rpmSigPtr; /* * Variables. */ extern int rpm2htmlVerbose; extern int force; extern time_t currentTime; extern const char *archNames[MAX_ARCHS]; extern int nbArchs; extern rpmDataPtr rpmSoftwareList; /* avoid different archs clash */ extern rpmRessPtr ressList; extern rpmArchPtr archList; extern rpmRessPtr ressInstalledList; extern rpmDirPtr dirList; extern rpmSubdirPtr dirTree; extern rpmRealDirPtr treeRoot; /* * Functions */ extern rpmSubdirPtr rpmNewSubdir(rpmSubdirPtr dir, const char *name, const char *htmlpath, const char *rpmpath, const char *color, int html); extern void rpmRemoveSubdir(rpmSubdirPtr tree); extern void rpmFreeSubdir(rpmSubdirPtr tree); extern void rpmDirFree(rpmDirPtr dir); extern void rpmAddSoftware(rpmDataPtr rpm); extern void rpmDataPrint(rpmDataPtr rpm); extern rpmDataPtr rpmSearchSoftware(const char *name, const char *version, const char *release, const char *arch); /* extern void rpmDataPrintAll(void); */ extern rpmRessPtr rpmRessAdd(char *ress, rpmDataPtr rpm, int installed); extern rpmRessPtr rpmRequAdd(char *requ, char *requv, rpm_dep_flag requf, rpmDataPtr rpm, int installed); extern rpmArchPtr rpmArchAdd(char *os, char *arch); extern rpmDataPtr rpmOpen(char *nameRpm, rpmDirPtr dir, rpmSubdirPtr tree); extern rpmDataPtr rpmDirScanAll(void); extern void rpmDirScanOneDist(const char *dist); extern void rpmDirScanOneDir(const char *directory); extern char *extractEMail(char *string); extern char *protectEmail(char *string); extern rpmDataPtr rpmAddList(rpmDataPtr old, rpmDataPtr newlist); extern void rpmGroupSort(rpmDataPtr *list, int installed); extern void rpmDistribSort(rpmDataPtr *list, int installed); extern void rpmVendorSort(rpmDataPtr *list, int installed); extern void rpmDateSort(rpmDataPtr *list, int installed); extern void rpmNameSort(rpmDataPtr *list, int installed); extern void rpmRessSort(rpmRessPtr ress); extern rpmRealDirPtr rpmCreateRealRoot(void); extern void rpmDestroyRealRoot(rpmRealDirPtr dir); extern void rpmAddRealFile(rpmRealDirPtr root, const char *file, rpmDataPtr rpm); extern rpmRealDirPtr rpmMergeRealRoots(rpmRealDirPtr root1, rpmRealDirPtr root2); extern void rpmFreeExtraData(rpmDataPtr rpm); extern void rpmdataCleanup(void); extern void rpmlistCleanup(void); extern void rpmDataListFree(rpmDataPtr *base); extern void rpmRessListFree(rpmRessPtr *base); extern void rpmDirListFree(rpmDirPtr *base); #endif /* __RPMDATA_H__ */ rpm2html-1.11.2/sql.h0000664000076400007640000000470207274074166013023 0ustar hanyhany/* * sql.h : header for the database fron-end of rpm2html */ #ifndef __RPM2HTML_SQL_H__ #define __RPM2HTML_SQL_H__ /* * Connection handling */ int init_sql(const char *host, const char *base, const char *user, const char *passwd); int close_sql(void); /* * Init stuff */ void sqlInitSqlDistributionList(void); void sqlListsCleanup(void); /* * Configuration I/O */ int readConfigSql(void); void sqlConfigEntry(const char *rpmdir, const char *name, const char *value); /* * Table handling */ int sql_check_tables(void); int sql_rebuild_vendors(void); int sql_rebuild_distribs(void); int sql_rebuild_mirrors(void); int sql_rebuild_files(void); int sql_rebuild_provides(void); int sql_rebuild_requires(void); /* * display/dump */ void sql_show_vendors(void); void sql_show_mirrors(void); void sql_show_metadata(void); void sql_show_config(void); void sql_show_distribs(void); int sql_show_stats(void); void sql_show_resources(void); void sql_show_index(void); void sql_show_all(void); void sql_top_index(void); /* * Reindex */ void sql_reindex(void); /* * Update of pages */ void sql_show_latests(void); int sql_get_top_queries(int count); /* * Insertion/Update of records */ int sql_get_package_id(const char *filename); int sql_add_distrib(const char *Name, const char *Vendor, const char *Path, const char *Directory, const char *URL, const char *URLSrc, const char *Description, const char *Html, const char *Color); int sql_get_distrib_by_name(const char *Name); int sql_get_distrib_by_directory(const char *Directory); int sql_add_vendor(const char *Name, const char *URL, const char *Description); int sql_add_dist_mirror(int distrib, const char *URL, int country); int sql_add_mirror(const char *Name, const char *URL, int country); int sql_add_package(const char *filename, const char *Name, const char *Version, const char *Release, const char *Arch, int dist, const char *URL, const char *URLSrc, int vendor, const char *Packager, const char *Category, const char *Summary, const char *Description, const char *Copyright, int Date, int Size, const char *Os, const char *Distribution, const char *Vendor); int sql_add_file(const char *filename, int package); int sql_add_provides(int package, const char *resource); int sql_add_requires(int package, const char *resource, rpm_dep_flag rel, const char *value); /* * Checking/Removal of records */ int sql_remove_package(int id); int sql_check_packages(void); #endif /* __RPM2HTML_SQL_H__ */ rpm2html-1.11.2/stringbuf.h0000664000076400007640000000033506623461063014216 0ustar hanyhany/* * stringbuf.h: interface for the String buffering module. */ #ifndef __STRINGBUF_H__ #define __STRINGBUF_H__ const char *stringAdd(const char *str); void stringFree(const char *str); #endif /* __STRINGBUF_H__ */ rpm2html-1.11.2/COPYING0000664000076400007640000000000011466345456013072 0ustar hanyhanyrpm2html-1.11.2/depcomp0000664000076400007640000000000011466345456013411 0ustar hanyhany