-
Notifications
You must be signed in to change notification settings - Fork 2
/
reproducible-faketools.spec
218 lines (194 loc) · 5.79 KB
/
reproducible-faketools.spec
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
#
# spec file for package reproducible-faketools
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: reproducible-faketools
Version: 0.4.2
Release: 0
Summary: Fake system tools for reproducible builds
License: MIT
Group: Development/Tools/Other
Url: https://github.com/bmwiedemann/reproducible-faketools
Source0: %{name}-%{version}.tar.xz
Requires: hostname
Requires: coreutils
BuildArch: noarch
%description
These tools are meant to help with reproducible builds.
This works by masking standard UNIX tools in build environments
with versions that give more predictable output when $SOURCE_DATE_EPOCH
is set but just redirect to the normal version otherwise.
%prep
%setup
%build
echo dummy file because an rpm cannot be empty > README.random
%install
%make_install
%package hostname
Summary: replacement hostname
Requires: reproducible-faketools
%description hostname
a script to enhance the reproducibility of the output of hostname
%files hostname
%defattr(-, root, root, 0755)
/usr/local/bin/hostname
/usr/local/bin/uname
%package date
Summary: replacement date
Requires: reproducible-faketools
%description date
a script to enhance the reproducibility of the output of date
%files date
%defattr(-, root, root, 0755)
/usr/local/bin/date
%package find
Summary: replacement find
Requires: reproducible-faketools
%description find
a script to enhance the reproducibility of the output of find
%files find
%defattr(-, root, root, 0755)
/usr/local/bin/find
%package ar
Summary: replacement ar
Requires: reproducible-faketools
%description ar
a script to enhance the reproducibility of the output of ar
%files ar
%defattr(-, root, root, 0755)
/usr/local/bin/ar
/usr/local/bin/strip
%package tar
Summary: replacement tar
Requires: reproducible-faketools
Requires: tar >= 1.28
%description tar
a script to enhance the reproducibility of the output of tar
by adding --sort and --mtime options
%files tar
%defattr(-, root, root, 0755)
/usr/local/bin/gzip
/usr/local/bin/tar
%package ant
Summary: replacement ant
Requires: reproducible-faketools
Requires: strip-nondeterminism
%description ant
a script to enhance the reproducibility of the output of ant
%files ant
%defattr(-, root, root, 0755)
/usr/local/bin/ant
%package filesys
Summary: sorted filesystem
Requires: disorderfs
%description filesys
a script to make sure readdir on filesystems is always sorted during build
WARNING: do not use outside OBS or osc build --vm-type=kvm
%files filesys
%defattr(-, root, root, 0755)
/etc/profile.d/disorderfs.sh
%post filesys
chmod 4755 /usr/bin/fusermount || :
mknod /dev/fuse c 10 229 || :
%package pid
Summary: use fixed pid
Requires: reproducible-faketools
%description pid
a script to wrap su to start a build with a fixed process id
to enhance the reproducibility of some packages
%files pid
%defattr(-, root, root, 0755)
/usr/local/bin/su
%package aslr
Summary: disable address space layout randomization
Requires(post): procps
%description aslr
disable address space layout randomization
to test if programs that use memory pointers like edje_cc
work more reproducibly under these conditions
%files aslr
%defattr(-, root, root, 0644)
/etc/sysctl.d/01-disable-aslr.conf
%post aslr
sysctl --system
%postun aslr
sysctl -w kernel.randomize_va_space=2
%package random
Summary: reduce sources of explicit randomness
%description random
reduce sources of explicit randomness
by replacing /dev/random and urandom
%files random
%doc README.random
%post random
rm -f /dev/{,u}random
mknod /dev/random c 1 5
mknod /dev/urandom c 1 5
%postun random
rm -f /dev/{,u}random
mknod /dev/random c 1 8
mknod /dev/urandom c 1 9
%package zip
Summary: replacement zip
Requires: p7zip
Requires: perl
Requires: reproducible-faketools
%description zip
a script to enhance the reproducibility of the output of zip
by replacing it with a wrapper to 7z
%files zip
%defattr(-, root, root, 0755)
/usr/local/bin/zip
/usr/local/bin/reproducible-zip.pl
%package faketime
Summary: fake time via LD_PRELOAD
RemovePathPostfixes: -faketime
Requires: libfaketime
Requires: reproducible-faketools
%description faketime
a script to enhance the reproducibility of the output
by replacing time(2) and fstat(2) library calls to return our notion of time
%files faketime
%defattr(-, root, root, 0755)
/usr/local/bin/rpmbuild-faketime
%package strace
Summary: run build with strace
RemovePathPostfixes: -strace
Requires: strace
Conflicts: reproducible-faketools-faketime
%description strace
a script to facilitate the debugging of reproducibility issues
by running rpmbuild with strace to find how files are created
%files strace
%defattr(-, root, root, 0755)
/usr/local/bin/rpmbuild-strace
%package j1
Summary: run build with single-thread
RemovePathPostfixes: -j1
Requires: util-linux
Conflicts: reproducible-faketools-faketime
Conflicts: reproducible-faketools-dettrace
Conflicts: reproducible-faketools-strace
%description j1
a script to facilitate the debugging of reproducibility issues
by running rpmbuild with taskset 1 to reduce parallelism
%files j1
%defattr(-, root, root, 0755)
/usr/local/bin/rpmbuild-j1
%files
%defattr(-, root, root, 0755)
%license LICENSE.md
%doc README.md
/usr/local/lib/%{name}*
%changelog