From Fedora Project Wiki
Getting the .desktop files, the .spec file, and the main index file right is a tedious business, and dependent on the particular collection of languages being processed. doc-publican-rpm automates this process.
The basic process is as follows:
- d-p-r first reads and remembers the config file. It uses the last part of the directory name as the name of the package. The name and email are only used if the user did not provide a .spec.old file.
- d-p-r then recurses through publican's tmp directory and makes a list of languages.
- For each language, it reads the Article_Info.xml file which contains information helpful to building the .desktop file
- It then makes a scratch directory (which will eventually be deleted) which will populate the tar file
- The html files and all child directories are copied from Publican's tmp/ directories into the scratch directory. It recurses through these directories so that a guide with many image subdirectories is still handled properly.
- Next, it makes three .desktop files; one for GNOME, one for KDE and one for XFCE and LXDE. (in version 2.x and earlier, there are only two; XFCE and LXDE hare GNOME's .desktop file).
- An index.html file is constructed which tests the user's selected language and uses it to launch the appropriate html. The .desktop file points to this file. If the user has Javascript enabled, this file is never seen, but if Javascript is disabled, the user is presented with a menu of languages.
- Icons are copied from /usr/share/doc-publican-rpm into the scratch directory
- The source tar is now made from the scratch directory and the scratch directory deleted
- A new .spec file is created using the description and changelog from the .spec.old if it exists. If not, a dummy description and changelog is provided. The rest of the spec file is created new for the current set of languages.
- rpmbuild is run to generate the RPM