Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

LyX /

Creating LyX RPM

Categories: Linux
<< | Page list | >>

Notes on how to create a RPM for your Linux distribution.

1.  Recommended method

The recommended method of building an RPM is described in the file lyx.rpm.README that can be found in the development/ directory of the LyX distribution. Here is its actual content:

Included from LyXVCS:lyxgit/development/lyx.rpm.README


Here is what to do to make a binary rpm using the spec file lyx.spec.
The description below apply only to the Intel platform, but only minor
changes should be needed for other platforms.

1) Install qt-4.2.2 or later. If you are using RPMs, make sure to install
   the qt-devel packages as well.

2) Install LaTeX. You can do this using RPMs from your distribution that
   might be split in multiple packages (e.g. texlive, texlive-latex),
   or you can install TeXLive straight from the DVD.

3) Copy lyx.spec to the SPECS directory (on Redhat, this is located at
   /usr/src/redhat/SPECS, on other systems at /usr/src/packages/SPECS)

4) Copy the tarball (lyx-2.x.y.tar.gz) to your SOURCES directory (located
   in the same path as SPECS, e.g. /usr/src/packages/SOURCES).

5) Issue the command

	rpmbuild -bb /usr/src/packages/SPECS/lyx.spec

(adjust the path if needed)

This builds the binary rpm, and puts it in /usr/src/packages/RPMS/i386
(alternatively in /i586 or /x86_64, depending on your system).
Note that building lyx requires about 150M free space on your disk.

6) Now install the package:

	rpm -Uvh /usr/src/redhat/RPMS/i386/lyx-2.x.y-1.i386.rpm

(again, adjust the path and filename as needed)

If you get dependency errors about qt4 or tetex/texlive, then you need to
use the --nodeps option (because you installed qt4 or TeX not in
rpm form):

        rpm -Uvh --nodeps /usr/src/redhat/RPMS/i386/lyx-2.x.y-1.i386.rpm

(again, adjust the path and filename as needed)

You should not get any more errors.

mw@moni.msci.memphis.edu

If this does not work for you, try the instructions below that seem to work on RedHat and Mandriva.

2.  Alternative advices

2.1  Building/installing RPM-package on RedHat

In a post by Paul Smith on the user's list at 2006-02-20:

> Certainly, I can help you with my best pleasure. The procedure is as follows:
>
> 1. download the source of LyX 1.3.7 from
>
> ftp://ftp.lyx.org/pub/lyx/stable/lyx-1.3.7.tar.gz
>
> 2. uncompress it;
>
> 3. go inside the directory where it is uncompressed the source of LyX;
>
> 4. on the command line run the command:
>
> ./configure  --with-frontend=qt --with-pspell
>
> 5. run the command make;
>
> 6. become superuser and run checkinstall.
>
> Your rpm will be built at the end! That is not too difficult, believe me.

Comment: Won't he need some Qt-related packages in order to build it?

Comment 2: This procedure is not recommended at all. checkinstall is known to fail sometimes with LyX, and it also gets the dependencies wrong. Far better is to use the included spec file. This goes like the following:

- unpack source
- cd to the unpacked dir
- edit development/lyx.spec to set the desired frontend
- cp development/lyx.spec /usr/src/packages/SPECS
- cp lib/images/lyx.xpm /usr/src/packages/SOURCES
- cp <orig tar file>.gz /usr/src/packages/SOURCES
- rpmbuild -ba /usr/src/packages/SPECS/lyx.spec

Then you will find the generated package somewhere under /usr/src/packages/RPMS.

2.2  Building a CentOS 5.x/RedHat Enterprise Linux 5.x RPMs

Note: In order to build LyX 1.5.x on CentOS 5.x and RedHat Enterprise Linux 5.x, Qt4 must be installed and the QT4DIR environment variable set. Building on the previous instructions:

- Using your favorite package manager, ensure the tetex, ImageMagick, python, and qt4 -devel packages are installed
- unpack the source
- cp <unpack dir>/development/lyx.spec /usr/src/redhat/SPECS
- cp <unpack dir>/lib/images/lyx.xpm /usr/src/redhat/SOURCES
- cp <orig tar file>.gz /usr/src/redhat/SOURCES
- export QT4DIR=/usr/lib/qt4 or QT4DIR=/usr/lib64/qt4 (depending on your architecture)
- rpmbuild -ba /usr/src/redhat/SPECS/lyx.spec

The generated RPM will be under /usr/src/redhat/RPMS.

NOTES:

  • This appears to work on CentOS 4 as well.
  • Rather than extracting the entire archive in step 2 above, it is easier to only extract the two files you need:
tar -jxvf {archive}.tar.bz2 lyx-{ver}/development/lyx lyx-{ver}/spec/lib/images/lyx.xpm
  • qt4-devel package is required, not just qt4
  • in some cases, LyX also needs the latex-xft-fonts rpm to properly display equation symbols on-screen
  • There is no need to extract any files off the tar archive, just issue rpmbuild -tb <path to .tar.gz file> and you are done (you need to have root permissions)
  • BTW, I have CentOS5.6 with Qt3 and Qt4, and had to manually edit the path for the configure script to find the Qt4 binaries instead of the Qt3 binaries, particularly moc. On your shell prompt, issue echo $PATH to get your PATH environment variable, then copy it without the Qt3 part and add the Qt4 part, issue export PATH=<edited path>. I guess this is related to the Qt4 packages or my system.

2.3  Building the latest Development Version from GIT on Fedora

As of the latest Fedora releases, LyX is included in the official repositories. If you want to try out the latest and greatest from the developers, you can create your own RPM and install them. The shell script below simplifies the entire process.

The following method is known to work on Fedora 15, 16, 17 systems (and tested on a VirtualBox hosted Fedora 17 virtual machine created from scratch).

Download the lyx-fedora script to a local directory and "chmod 755 lyx-fedora", then run "./lyx-fedora help".

The lyx-fedora script can be found in the git repository at http://www.lyx.org/trac/browser/lyxgit/development/tools/lyx-fedora

3.  Contributors

  • Paul Smith
  • Georg Baum
  • Scott Ainsworth
  • Carl Fischer (CentOS 4 Notes)
  • Kayvan Sylvan (Fedora build for development versions)

Linux

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2014-12-08 12:22 UTC