summaryrefslogtreecommitdiff
path: root/packaging/rpm.spec
blob: 266689409420c7d1b5cee2618c58ac0d3dca4f79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# run internal testsuite?
%bcond_without check


Name:           rpm
Version:        4.9.1
Release:        1
Summary:        The RPM package management system
Url:            http://www.rpm.org/
Group:          System/Base
Source0:        http://rpm.org/releases/rpm-4.9.x/rpm-%{version}.tar.bz2
Source1:        libsymlink.attr
Source11:       db-4.8.30.tar.gz
Source20:       macros
Source21:       find-docs.sh
Source22:       device-sec-policy
Source1001: packaging/rpm.manifest 

Patch1:         db.diff
# quilt patches start here
Patch3:         rpm-4.5.90-pkgconfig-path.patch
Patch4:         rpm-4.5.90-gstreamer-provides.patch
Patch5:         rpm-4.8.0-tilde.patch
Patch6:         rpm-macros.patch
Patch7:         rpm-4.9.0-tizen-arm.patch
Patch10:        remove-translations.patch
Patch11:        rpm-shorten-changelog.patch
Patch12:        no_rep_autop.diff
Patch13:        finddebuginfo.diff
Patch14:        debugsource-package.diff
Patch15:        debugsubpkg.diff
Patch24:        autodeps.diff
Patch49:        mimetype.diff
Patch52:        firmware.diff
Patch56:        buildidprov.diff
Patch64:        pythondeps.diff
Patch65:        fontprovides.diff
Patch66:        rpm-gst-provides.patch
Patch76:        fileattrs.diff
Patch80:        optflags.patch
Patch81:        build_pack_4.9.1_fix.patch
Patch82:        lib_rpmdb_4.9.1_fix.patch
Patch83:        rpmbuild_4.9.1_fix.patch
Patch84:        rpmbuild_rpmfc_4.9.1_fix.patch
Patch85:        rpmio_base64_4.9.1_fix.patch
Patch86:        rpmlib_format_value_4.9.1_fix.patch
Patch87:        security_4.9.1.patch
Patch90:        disableperl.patch

# Partially GPL/LGPL dual-licensed and some bits with BSD
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
License:        GPLv2+
##PYTHON##

Requires:       curl

BuildRequires:  bzip2-devel >= 1.0.5
BuildRequires:  elfutils-devel >= 0.112
BuildRequires:  elfutils-libelf-devel
BuildRequires:  libfile-devel
BuildRequires:  gettext-tools
BuildRequires:  libcap-devel
BuildRequires:  liblua-devel >= 5.1
BuildRequires:  pkgconfig(ncurses)
# The popt version here just documents an older known-good version
BuildRequires:  popt-devel >= 1.10.2
BuildRequires:  readline-devel
BuildRequires:  xz-devel >= 4.999.8
BuildRequires:  zlib-devel
BuildRequires:  nss-devel
BuildRequires:  uthash-devel  
BuildRequires:  libxml2-devel  
BuildRequires:  libattr-devel  
BuildRequires:  pkgconfig(libsmack)


%description
The RPM Package Manager (RPM) is a powerful command line driven
package management system capable of installing, uninstalling,
verifying, querying, and updating software packages. Each software
package consists of an archive of files along with information about
the package like its version, a description, etc.

%package libs
License:        GPLv2+ and LGPLv2+ with exceptions
Summary:        Libraries for manipulating RPM packages
Group:          Development/Libraries
Requires:       rpm = %{version}

%description libs
This package contains the RPM shared libraries.

%package devel
License:        GPLv2+ and LGPLv2+ with exceptions
Summary:        Development files for manipulating RPM packages
Group:          Development/Libraries
Requires:       libfile-devel
Requires:       rpm = %{version}

%description devel
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs that
manipulate RPM packages and databases. These files are intended to
simplify the process of creating graphical package managers or any
other tools that need an intimate knowledge of RPM packages in order
to function.

This package should be installed if you want to develop programs that
will manipulate RPM packages and databases.

%package build
Summary:        Scripts and executable programs used to build packages
Group:          Development/Tools
Requires:       binutils
Requires:       bzip2
Requires:       /bin/cpio
Requires:       diffutils
Requires:       elfutils >= 0.128
Requires:       file
Requires:       /bin/find
Requires:       /bin/awk
Requires:       /bin/grep
Requires:       /bin/gzip
Requires:       lzma
Requires:       patch >= 2.5
Requires:       pkgconfig
Requires:       rpm = %{version}
Requires:       /bin/sed
Requires:       unzip
Requires:       xz

%description build
The rpm-build package contains the scripts and executable programs
that are used to build packages using the RPM Package Manager.


%package security-plugin
Summary: MSM security plugin for rpm
Group: Development/Libraries
Requires: rpm = %{version}-%{release}
Requires: libsmack
Requires: libxml2
Requires: file

%description security-plugin
This package contains the MSM security plugin for rpm that performs
security-related functionality. 

%prep
%setup -q  -n rpm-%{version}
tar xzf %{SOURCE11}
ln -s db-4.8.30 db
chmod -R u+w db/*
rm -f rpmdb/db.h

%patch1 -p0
%patch3 -p1 -b .pkgconfig-path
#%patch4 -p1 -b .gstreamer-prov
%patch5 -p1 -b .tilde
%patch6 -p1 -b .vendor
%patch7 -p1 -b .arm
%patch10 -p1
%patch11 -p1
%patch12 -p0
%patch13 -p0
%patch14 -p0
#%patch15 -p0
#%patch24 -p0
#%patch49 -p0
#%patch52 -p0
#%patch56 -p0
#%patch64 -p0
#%patch65 -p0
#%patch66 -p0
#%patch76 -p0
%patch80 -p1
%patch81 -p1
%patch82 -p1
%patch83 -p1
%patch84 -p1
%patch85 -p1
%patch86 -p1
%patch87 -p1 -b .msm
%patch90 -p1


rm -f m4/libtool.m4
rm -f m4/lt*.m4

%build
cp %{SOURCE1001} .
CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
CFLAGS="%{optflags}"
export CPPFLAGS CFLAGS LDFLAGS

# Using configure macro has some unwanted side-effects on rpm platform
# setup, use the old-fashioned way for now only defining minimal paths.

libtoolize -f -c
./autogen.sh \
    --prefix=%{_prefix} \
    --sysconfdir=%{_sysconfdir} \
    --localstatedir=%{_localstatedir} \
    --sharedstatedir=%{_localstatedir}/lib \
    --libdir=%{_libdir} \
%if %{with python}
    --enable-python \
%endif
    --with-lua \
    --with-cap  \
    --with-msm

make %{?_smp_mflags}

%install

%make_install
find %{buildroot} -regex ".*\\.la$" | xargs rm -f --

mkdir -p %{buildroot}%{_sysconfdir}/rpm
mkdir -p %{buildroot}%{_libdir}/rpm
install -m 644 %{SOURCE1} %{buildroot}%{_libdir}/rpm/fileattrs/libsymlink.attr
install -m 644 %{SOURCE22} ${RPM_BUILD_ROOT}%{_sysconfdir}/device-sec-policy
mkdir -p %{buildroot}%{_localstatedir}/lib/rpm

#install -m 755 scripts/firmware.prov %{buildroot}%{_prefix}/lib/rpm
#install -m 755 scripts/debuginfo.prov %{buildroot}%{_prefix}/lib/rpm

for dbi in \
    Basenames Conflictname Dirnames Group Installtid Name Packages \
    Providename Provideversion Requirename Requireversion Triggername \
    Filedigests Pubkeys Sha1header Sigmd5 Obsoletename \
    __db.001 __db.002 __db.003 __db.004 __db.005 __db.006 __db.007 \
    __db.008 __db.009
do
    touch %{buildroot}%{_localstatedir}/lib/rpm/$dbi
done

#macros

mkdir -p %{buildroot}%{_libdir}/rpm/tizen
install -m 755 %{SOURCE21} %{buildroot}%{_libdir}/rpm/tizen
install -m 644 %{SOURCE20} %{buildroot}%{_libdir}/rpm/tizen

# avoid dragging in tonne of perl libs for an unused script
chmod 0644 %{buildroot}/%{_libdir}/rpm/perldeps.pl

rm -rf %{buildroot}%{_mandir}/*/man?
%clean
rm -rf %{buildroot}

%if %{with check}
%check
make check
%endif

%remove_docs
rm -rf %{buildroot}/usr/share/man
%find_lang rpm

%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%posttrans
# XXX this is klunky and ugly, rpm itself should handle this
dbstat=/usr/lib/rpm/rpmdb_stat
if [ -x "$dbstat" ]; then
    if "$dbstat" -e -h /var/lib/rpm 2>&1 | grep -q "doesn't match environment version \| Invalid argument"; then
        rm -f /var/lib/rpm/__db.*
    fi
fi
exit 0


%files  -f rpm.lang
%manifest rpm.manifest
%defattr(-,root,root,-)
%doc GROUPS COPYING CREDITS
%exclude /usr/lib/rpm/rpmdb_loadcvt
%dir %{_sysconfdir}/rpm

%attr(0755, root, root)   %dir %{_localstatedir}/lib/rpm
%attr(0644, root, root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_localstatedir}/lib/rpm/*
%attr(0755, root, root) %dir %{_libdir}/rpm

/bin/rpm
%{_bindir}/rpmkeys
%{_bindir}/rpmspec
%{_bindir}/rpm2cpio
%{_bindir}/rpmdb
%{_bindir}/rpmsign
%{_bindir}/rpmquery
%{_bindir}/rpmverify

%{_libdir}/rpm-plugins/exec.so
%{_libdir}/rpm-plugins/sepolicy.so
%{_libdir}/rpm/elfdeps


%{_libdir}/rpm/macros
%{_libdir}/rpm/tizen/macros
%{_libdir}/rpm/rpmpopt*
%{_libdir}/rpm/rpmrc

%{_libdir}/rpm/rpmdb_*
%{_libdir}/rpm/rpm.daily
%{_libdir}/rpm/rpm.log
%{_libdir}/rpm/rpm2cpio.sh
%{_libdir}/rpm/tgpg

%{_libdir}/rpm/platform

%files libs
%manifest rpm.manifest
%defattr(-,root,root)
%{_libdir}/librpm*.so.*

%files build
%manifest rpm.manifest
%defattr(-,root,root)
%{_bindir}/rpmbuild
%{_bindir}/gendiff

%{_libdir}/rpm/fileattrs/*.attr
%{_libdir}/rpm/script.req

%{_libdir}/rpm/brp-*
%{_libdir}/rpm/check-buildroot
%{_libdir}/rpm/check-files
%{_libdir}/rpm/check-prereqs
%{_libdir}/rpm/check-rpaths*
%{_libdir}/rpm/debugedit
%{_libdir}/rpm/find-debuginfo.sh
%{_libdir}/rpm/tizen/find-docs.sh
%{_libdir}/rpm/find-lang.sh
%{_libdir}/rpm/find-provides
%{_libdir}/rpm/find-requires
%{_libdir}/rpm/javadeps
%{_libdir}/rpm/mono-find-provides
%{_libdir}/rpm/mono-find-requires
%{_libdir}/rpm/ocaml-find-provides.sh
%{_libdir}/rpm/ocaml-find-requires.sh
%{_libdir}/rpm/osgideps.pl
%{_libdir}/rpm/perldeps.pl
%{_libdir}/rpm/libtooldeps.sh
%{_libdir}/rpm/pkgconfigdeps.sh
%{_libdir}/rpm/perl.prov
#%{_libdir}/rpm/debuginfo.prov
#%{_libdir}/rpm/firmware.prov
%{_libdir}/rpm/perl.req
%{_libdir}/rpm/tcl.req
%{_libdir}/rpm/pythondeps.sh
%{_libdir}/rpm/rpmdeps
%{_libdir}/rpm/config.guess
%{_libdir}/rpm/config.sub
%{_libdir}/rpm/mkinstalldirs
%{_libdir}/rpm/desktop-file.prov
%{_libdir}/rpm/fontconfig.prov

%{_libdir}/rpm/macros.perl
%{_libdir}/rpm/macros.python
%{_libdir}/rpm/macros.php



%files devel
%manifest rpm.manifest
%defattr(-,root,root)
%{_includedir}/rpm
%{_libdir}/librp*[a-z].so
%{_bindir}/rpmgraph
%{_libdir}/pkgconfig/rpm.pc


%files security-plugin
%manifest rpm.manifest
%defattr(-,root,root)
%{_libdir}/rpm-plugins/msm.so
%config(noreplace) %{_sysconfdir}/device-sec-policy