Creating LyX RPM
Categories: Linux<< | Page list | >>
Notes on how to create a RPM for your Linux distribution.
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. firstname.lastname@example.org
If this does not work for you, try the instructions below that seem to work on RedHat and Mandriva.
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.
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.
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