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