Initial code release
[external/syslinux.git] / packaging / syslinux.spec
1 # -*- rpm -*-
2 Summary: Kernel loader which uses a FAT, ext2/3 or iso9660 filesystem or a PXE network
3 Name: syslinux
4 Version: 4.04
5 Release: 1
6 License: GPLv2
7 Url: http://syslinux.zytor.com/
8 Group: System/Boot
9 Source0: ftp://ftp.kernel.org/pub/linux/utils/boot/syslinux/%{name}-%{version}.tar.gz
10 ExclusiveArch: %{ix86} x86_64
11 Buildroot: %{_tmppath}/%{name}-%{version}-root
12 BuildRequires: nasm >= 0.98.39, perl
13 Source101: syslinux-rpmlintrc
14 # >> gbp-patch-tags         # auto-added by gbp
15 Patch0:    0001-btrfs-Correctly-determine-the-installation-subvolume.patch
16 # << gbp-patch-tags         # auto-added by gbp
17
18 Autoreq: 0
19 %ifarch x86_64
20 Requires: mtools
21 %define my_cc gcc
22 %else
23 Requires: mtools, libc.so.6
24 %define my_cc gcc -m32
25 %endif
26
27 # NOTE: extlinux belongs in /sbin, not in /usr/sbin, since it is typically
28 # a system bootloader, and may be necessary for system recovery.
29 %define _sbindir /sbin
30
31 %description
32 SYSLINUX is a suite of bootloaders, currently supporting DOS FAT
33 filesystems, Linux ext2/ext3 filesystems (EXTLINUX), PXE network boots
34 (PXELINUX), or ISO 9660 CD-ROMs (ISOLINUX).  It also includes a tool,
35 MEMDISK, which loads legacy operating systems from these media.
36
37 %package devel
38 Summary: Development environment for SYSLINUX add-on modules
39 Group: Development/Libraries
40 Requires: syslinux
41
42 %description devel
43 The SYSLINUX boot loader contains an API, called COM32, for writing
44 sophisticated add-on modules.  This package contains the libraries
45 necessary to compile such modules.
46
47 %package extlinux
48 Summary: The EXTLINUX bootloader, for booting the local system
49 Group: System/Boot
50 Requires: syslinux
51
52 %description extlinux
53 The EXTLINUX bootloader, for booting the local system, as well as all
54 the SYSLINUX/PXELINUX modules in /boot.
55
56 %package tftpboot
57 Summary: SYSLINUX modules in /var/lib/tftpboot, available for network booting
58 Group: Applications/Internet
59 Requires: syslinux
60
61 %description tftpboot
62 All the SYSLINUX/PXELINUX modules directly available for network
63 booting in the /var/lib/tftpboot directory.
64
65 %prep
66 %setup -q -n syslinux-%{version}
67
68 # >> gbp-apply-patches    # auto-added by gbp
69 %patch0 -p1
70 # << gbp-apply-patches    # auto-added by gbp
71
72 %build
73 make CC='%{my_cc}' clean
74 make CC='%{my_cc}' installer
75 make CC='%{my_cc}' -C sample tidy
76
77 %install
78 rm -rf %{buildroot}
79 make CC='%{my_cc}' install-all \
80         INSTALLROOT=%{buildroot} BINDIR=%{_bindir} SBINDIR=%{_sbindir} \
81         LIBDIR=%{_libdir} DATADIR=%{_datadir} \
82         MANDIR=%{_mandir} INCDIR=%{_includedir} \
83         TFTPBOOT=/var/lib/tftpboot EXTLINUXDIR=/boot/extlinux
84 make CC='%{my_cc}' -C sample tidy
85
86 %clean
87 rm -rf %{buildroot}
88
89 %files
90 %defattr(-,root,root)
91 %{_bindir}
92 %dir %{_datadir}/syslinux
93 %{_datadir}/syslinux/*.com
94 %{_datadir}/syslinux/*.exe
95 %{_datadir}/syslinux/*.c32
96 %{_datadir}/syslinux/*.bin
97 %{_datadir}/syslinux/*.0
98 %{_datadir}/syslinux/memdisk
99 %{_datadir}/syslinux/dosutil
100
101 %files devel
102 %defattr(-,root,root)
103 %doc COPYING NEWS README doc/*
104 %doc sample
105 %doc %{_mandir}/man*/*
106 %{_datadir}/syslinux/com32
107 %{_datadir}/syslinux/diag
108
109 %files extlinux
110 %defattr(-,root,root)
111 %{_sbindir}/extlinux
112 /boot/extlinux
113
114 %files tftpboot
115 %defattr(-,root,root)
116 /var/lib/tftpboot
117
118 %post extlinux
119 # If we have a /boot/extlinux.conf file, assume extlinux is our bootloader
120 # and update it.
121 if [ -f /boot/extlinux/extlinux.conf ]; then \
122         ln -sf /boot/extlinux/extlinux.conf /etc/extlinux.conf; \
123         extlinux --update /boot/extlinux ; \
124 elif [ -f /boot/extlinux.conf ]; then \
125         mkdir -p /boot/extlinux && \
126         mv /boot/extlinux.conf /boot/extlinux/extlinux.conf && \
127         extlinux --update /boot/extlinux ; \
128 fi