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