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