7810ddcbd6a8f9af0a748dd5e70d9741ee0f494f
[platform/upstream/elfutils.git] / packaging / elfutils.spec
1 %define keepstatic 1
2 Name:           elfutils
3 Version:        0.153
4 Release:        0
5 License:        GPL-2.0-with-osi-exception
6 Summary:        Higher-level library to access ELF
7 Url:            http://elfutils.fedorahosted.org
8 Group:          System/Libraries
9 Source:         elfutils-%{version}.tar.bz2
10 Source2:        baselibs.conf
11 BuildRequires:  automake
12 BuildRequires:  bison
13 BuildRequires:  bzip2-devel
14 BuildRequires:  flex
15 BuildRequires:  xz-devel
16 BuildRequires:  zlib-devel
17 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
18
19 %description
20 This package provides a higher-level library to access ELF files. This
21 is a part of elfutils package.
22
23 %package -n libasm
24 Summary:        A collection of utilities and DSOs to handle compiled objects
25 Group:          Development/Tools/Other
26
27 %description -n libasm
28 Elfutils is a collection of utilities, including ld (a linker), nm (for
29 listing symbols from object files), size (for listing the section sizes
30 of an object or archive file), strip (for discarding symbols), readline
31 (the see the raw ELF file structures), and elflint (to check for
32 well-formed ELF files).  Also included are numerous helper libraries
33 which implement DWARF, ELF, and machine-specific ELF handling.
34
35 %package -n libasm-devel
36 License:        GPL-2.0-with-osi-exception
37 Summary:        A collection of utilities and DSOs to handle compiled objects
38 Group:          Development/Tools/Other
39 Requires:       glibc-devel,
40 Requires:       libasm = %{version}
41
42 %description -n libasm-devel
43 Elfutils is a collection of utilities, including ld (a linker), nm (for
44 listing symbols from object files), size (for listing the section sizes
45 of an object or archive file), strip (for discarding symbols), readline
46 (the see the raw ELF file structures), and elflint (to check for
47 well-formed ELF files).  Also included are numerous helper libraries
48 which implement DWARF, ELF, and machine-specific ELF handling.
49
50 %package -n libebl
51 License:        GPL-2.0-with-osi-exception
52 Summary:        A collection of utilities and DSOs to handle compiled objects
53 Group:          Development/Tools/Other
54 Provides:       libebl = %{version}
55 Obsoletes:      libebl < %{version}
56
57 %description -n libebl
58 Elfutils is a collection of utilities, including ld (a linker), nm (for
59 listing symbols from object files), size (for listing the section sizes
60 of an object or archive file), strip (for discarding symbols), readline
61 (the see the raw ELF file structures), and elflint (to check for
62 well-formed ELF files).  Also included are numerous helper libraries
63 which implement DWARF, ELF, and machine-specific ELF handling.
64
65 %package -n libebl-devel
66 License:        GPL-2.0-with-osi-exception
67 Summary:        Include Files and Libraries mandatory for Development
68 Group:          Development/Libraries/C and C++
69 Requires:       glibc-devel,
70 Requires:       libdw-devel = %{version}
71 Requires:       libebl = %{version}
72
73 %description -n libebl-devel
74 This package contains all necessary include files and libraries needed
75 to develop applications that require these.
76
77 %package -n libelf
78 License:        GPL-2.0-with-osi-exception
79 Summary:        Library to read and write ELF files
80
81 %description -n libelf
82 This package provides a high-level library to read and write ELF files.
83 This is a part of elfutils package.
84
85 %package -n libelf-devel
86 License:        GPL-2.0-with-osi-exception
87 Summary:        Include Files and Libraries mandatory for Development
88 Group:          Development/Libraries/C and C++
89 Requires:       glibc-devel,
90 Requires:       libelf = %{version}
91 Conflicts:      libelf0-devel
92
93 %description -n libelf-devel
94 This package contains all necessary include files and libraries needed
95 to develop applications that require these.
96
97 %package -n libdw
98 License:        GPL-2.0-with-osi-exception
99 Summary:        Library to access DWARF debugging information
100
101 %description -n libdw
102 This package provides a high-level library to access the DWARF debugging
103 information.  This is a part of elfutils package.
104
105 %package -n libdw-devel
106 License:        GPL-2.0-with-osi-exception
107 Summary:        Include Files and Libraries mandatory for Development
108 Group:          Development/Libraries/C and C++
109 Requires:       glibc-devel,
110 Requires:       libdw = %{version}
111 Requires:       libelf-devel = %{version}
112
113 %description -n libdw-devel
114 This package contains all necessary include files and libraries needed
115 to develop applications that require these.
116
117 %prep
118 %setup -q -n elfutils-%{version}
119
120 %build
121 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
122 DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
123 TIME="\"$(date -d "${modified}" "+%%R")\""
124 find . -type f -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
125 autoreconf -fi
126 %configure --program-prefix=eu-
127 make %{?_smp_mflags}
128
129 %install
130 %make_install
131 # remove unneeded files
132 ls -lR %{buildroot}%{_libdir}/libelf*
133
134 %post -n libebl -p /sbin/ldconfig
135
136 %post -n libelf -p /sbin/ldconfig
137
138 %post -n libdw -p /sbin/ldconfig
139
140 %postun -n libebl -p /sbin/ldconfig
141
142 %postun -n libelf -p /sbin/ldconfig
143
144 %postun -n libdw -p /sbin/ldconfig
145
146 %files
147 %defattr(-,root,root)
148 %{_bindir}/*
149
150 %files -n libasm
151 %defattr(-,root,root)
152 %{_libdir}/libasm.so.*
153 %{_libdir}/libasm-%{version}.so
154
155 %files -n libasm-devel
156 %defattr(-,root,root)
157 %{_libdir}/libasm.so
158 %{_libdir}/libasm.a
159 %dir %{_includedir}/elfutils
160 %{_includedir}/elfutils/libasm.h
161
162 %files -n libebl
163 %defattr(-,root,root)
164 %{_libdir}/elfutils
165
166 %files -n libebl-devel
167 %defattr(-,root,root)
168 %{_libdir}/libebl.a
169 %dir %{_includedir}/elfutils
170 %{_includedir}/elfutils/libebl.h
171
172 %files -n libelf
173 %defattr(-,root,root)
174 %{_libdir}/libelf.so.*
175 %{_libdir}/libelf-%{version}.so
176
177 %files -n libelf-devel
178 %defattr(-,root,root)
179 %{_libdir}/libelf.so
180 %{_libdir}/libelf.a
181 #%{_libdir}/libelf_pic.a
182 %{_includedir}/libelf.h
183 %{_includedir}/gelf.h
184 %{_includedir}/nlist.h
185 %dir %{_includedir}/elfutils
186 %{_includedir}/elfutils/elf-knowledge.h
187 %{_includedir}/elfutils/version.h
188
189 %files -n libdw
190 %defattr(-,root,root)
191 %{_libdir}/libdw.so.*
192 %{_libdir}/libdw-%{version}.so
193
194 %files -n libdw-devel
195 %defattr(-,root,root)
196 %{_libdir}/libdw.a
197 %{_libdir}/libdw.so
198 %{_includedir}/dwarf.h
199 %dir %{_includedir}/elfutils
200 %{_includedir}/elfutils/libdw.h
201 %{_includedir}/elfutils/libdwfl.h
202
203 %changelog