]> git.pld-linux.org Git - packages/filesystem.git/blob - filesystem.spec
- added /usr/share/defaults
[packages/filesystem.git] / filesystem.spec
1 # NOTE
2 # - do not use any other user/group than "root", as then we have to depend on "setup" package.
3 #   see the gid_xxx macros and post scriptlet
4 # FIXME: verify shows changed groups of dirs changed this way
5
6 # disable rpm generated debug package, we handle it differently here
7 %define         _enable_debug_packages  0
8
9 # avoid rpm 4.4.9 adding rm -rf buildroot
10 %define         __spec_clean_body       %{nil}
11 Summary:        Common directories
12 Summary(pl.UTF-8):      Wspólne katalogi
13 Name:           filesystem
14 Version:        4.0
15 Release:        46
16 License:        GPL
17 Group:          Base
18 BuildRequires:  automake
19 BuildRequires:  mktemp
20 BuildRequires:  rpm >= 4.4.9-56
21 Requires:       FHS >= 2.3-15
22 Provides:       browser-plugins(%{_target_base_arch})
23 %ifarch %{x8664}
24 Provides:       browser-plugins(i386)
25 %endif
26 %ifarch ppc64
27 Provides:       browser-plugins(ppc)
28 %endif
29 %ifarch s390x
30 Provides:       browser-plugins(s390)
31 %endif
32 %ifarch sparc64
33 Provides:       browser-plugins(sparc)
34 %endif
35 Provides:       filesystem-debuginfo = %{version}-%{release}
36 Obsoletes:      filesystem-debuginfo < 3.0-36
37 %if "%{pld_release}" != "ac"
38 Conflicts:      X11-libs < 1:7.7
39 %endif
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 # Adapter: This file does not like to be adapterized!
43
44 %if "%{_lib}" == "lib64"
45 %define         with_lib64      1
46 %endif
47 %if "%{_lib}" == "libx32"
48 %define         with_libx32     1
49 %define         with_lib64      1
50 %else
51 %ifarch %{x8664}
52 # x32 as additional ABI
53 %define         with_libx32     1
54 %endif
55 %endif
56
57 # directory for "privilege separation" chroot
58 %define         _privsepdir     /usr/share/empty
59 # directory for *.idl files (for CORBA implementations)
60 %define         _idldir         /usr/share/idl
61
62 # we have to use numeric uids/groups. see comment beginning of the spec
63 %define         gid_logs        124
64 %define         gid_crontab     117
65
66 %description
67 This package contains common directories for packages that extend some
68 programs functionality, but don't require them themselves.
69
70 %description -l pl.UTF-8
71 Ten pakiet zawiera wspólne katalogi dla pakietów rozszerzających
72 funkcjonalność programów, ale nie wymagających ich.
73
74 %prep
75 %setup -qcT
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79
80 install -d \
81         $RPM_BUILD_ROOT/{initrd,selinux,run,sys} \
82         $RPM_BUILD_ROOT/etc/{NetworkManager/dispatcher.d,X11/xinit/{xinput,xinitrc}.d,certs,cron.d,default,logrotate.d,fonts/conf.d,modprobe.d,pki/{CA,tls},security,skel,sysconfig,tmpwatch,xdg/{autostart,colors,menus}} \
83         $RPM_BUILD_ROOT/home/{users,services} \
84         $RPM_BUILD_ROOT/lib/{firmware,security,udev/{hwdb.d,rules.d},systemd/system} \
85         $RPM_BUILD_ROOT/usr/include/{security,X11} \
86         $RPM_BUILD_ROOT/usr/lib/{ConsoleKit/run-session.d,browser-plugins,cgi-bin,cmake,mozilla/extensions,pkcs11,pkgconfig,initrd,tmpfiles.d} \
87         $RPM_BUILD_ROOT/usr/share/{appdata,augeas/lenses/tests,backgrounds,cmake/Modules,color/icc,defaults,factory/etc/pam.d,fontconfig/conf.avail,gnome/help,mate/help,man/man{n,l},man/pl/mann,ppd,pkgconfig,soundfonts,sounds,themes/Default,thumbnailers,vala/vapi,wallpapers,wayland-sessions,xsessions} \
88         $RPM_BUILD_ROOT/usr/src/examples \
89         $RPM_BUILD_ROOT/var/lib/color/icc \
90         $RPM_BUILD_ROOT/var/lock/subsys \
91         $RPM_BUILD_ROOT/var/log/archive \
92         $RPM_BUILD_ROOT{%{_aclocaldir},%{_desktopdir}/{docklets,screensavers},%{_iconsdir},%{_pixmapsdir}} \
93         $RPM_BUILD_ROOT%{_fontsdir}/{{100,75}dpi,OTF,Speedo,Type1/{afm,pfm},TTF,cyrillic,local,misc} \
94         $RPM_BUILD_ROOT{%{_idldir},%{_privsepdir}} \
95         $RPM_BUILD_ROOT/boot/efi/EFI \
96         $RPM_BUILD_ROOT/etc/OpenCL/vendors
97
98 > %{name}.lang
99 install -d $RPM_BUILD_ROOT/usr/share/help/C
100
101 for lang in ar as ast bg bn_IN ca cs da de el en_GB es eu fa fi fr gl gu he hi hr hu id it ja ko kn lt lv mk ml mr nb nds nl oc pa pl ps pt pt_BR ro ru sk sl sr sr@latin sv ta te th tr uk vi zh_CN zh_HK zh_TW; do
102         install -d $RPM_BUILD_ROOT/usr/share/help/${lang}
103         echo "%%lang($lang) %dir /usr/share/help/${lang}" >> %{name}.lang
104 done
105
106 %if %{with lib64}
107 install -d \
108         $RPM_BUILD_ROOT/lib64/security \
109         $RPM_BUILD_ROOT/usr/lib64/{browser-plugins,cmake,initrd,mozilla/extensions,pkcs11,pkgconfig} \
110         $RPM_BUILD_ROOT/usr/lib/debug/lib64/security
111 %endif
112 %if %{with libx32}
113 install -d \
114         $RPM_BUILD_ROOT/libx32/security \
115         $RPM_BUILD_ROOT/usr/libx32/{browser-plugins,cmake,initrd,mozilla/extensions,pkcs11,pkgconfig} \
116         $RPM_BUILD_ROOT/usr/lib/debug/libx32/security
117 %endif
118
119 %if "%{pld_release}" == "ac"
120 rmdir $RPM_BUILD_ROOT/usr/include/X11
121 # X11
122 install -d $RPM_BUILD_ROOT/usr/X11R6/share
123 for manp in man{1,2,3,4,5,6,7,8} ; do
124         install -d $RPM_BUILD_ROOT/usr/X11R6/man/$manp
125         for mloc in it ko pl; do
126                 install -d $RPM_BUILD_ROOT/usr/X11R6/man/$mloc/$manp
127         done
128 done
129 install -d $RPM_BUILD_ROOT/usr/share/wm-properties
130 %endif
131
132 install -d \
133         $RPM_BUILD_ROOT/usr/lib/debug/%{_lib} \
134         $RPM_BUILD_ROOT/usr/lib/debug%{_libdir} \
135         $RPM_BUILD_ROOT/usr/lib/debug/{bin,sbin} \
136         $RPM_BUILD_ROOT/usr/lib/debug/usr/{bin,sbin} \
137         $RPM_BUILD_ROOT/usr/lib/debug/lib/security \
138         $RPM_BUILD_ROOT/usr/src/debug
139
140 # create this for %clean
141 tar -cf checkfiles.tar -C $RPM_BUILD_ROOT .
142
143 %clean
144 mkdir -p $RPM_BUILD_ROOT
145 tar -xf checkfiles.tar -C $RPM_BUILD_ROOT
146 cd $RPM_BUILD_ROOT
147
148 check_filesystem_dirs() {
149         RPMFILE=%{_rpmdir}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm
150         RPMFILE2=%{?with_debuginfo:%{_rpmdir}/%{name}-debuginfo-%{version}-%{release}.%{_target_cpu}.rpm}
151         TMPFILE=$(mktemp)
152         # note: we must exclude from check all existing dirs belonging to FHS
153         find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort | grep -v $TMPFILE | \
154         grep -E -v '^/(boot|etc|etc/X11|home|lib|lib64|libx32|usr|usr/include|usr/lib|usr/lib64|usr/libx32|usr/share|usr/share/man|usr/share/man/pl|usr/src|var|var/lib|var/lock|var/log)$' > $TMPFILE
155
156         # find finds also '.', so use option -B for diff
157         rpm -qpl $RPMFILE $RPMFILE2 | grep -v '^/$' | LC_ALL=C sort | diff -uB - $TMPFILE || :
158
159         rm -f $TMPFILE
160 }
161
162 check_filesystem_dirs
163
164 %if "%{pld_release}" != "ac"
165 %pretrans -p <lua>
166 -- this needs to be a dir
167 if posix.stat("/usr/include/X11", "type") == "link" then
168         posix.umask("0755");
169         os.rename("/usr/include/X11", "/usr/include/X11.rpmsave")
170         posix.mkdir("/usr")
171         posix.mkdir("/usr/include")
172         posix.mkdir("/usr/include/X11")
173         oldpwd = posix.getcwd()
174         posix.chdir("/usr/include/X11.rpmsave")
175         for i,j in pairs(posix.glob("*")) do
176                 os.rename(j, "/usr/include/X11/" .. j)
177         end
178         posix.chdir(oldpwd)
179 end
180 %endif
181
182 %post -p <lua>
183 posix.chown("/var/log/archive", 0, %{gid_logs})
184 posix.chown("/etc/cron.d", 0, %{gid_crontab})
185
186 %files -f %{name}.lang
187 %defattr(644,root,root,755)
188 %dir /boot/efi
189 %dir /boot/efi/EFI
190 %dir /etc/X11/xinit
191 %dir /etc/X11/xinit/xinitrc.d
192 %dir /etc/X11/xinit/xinput.d
193 %dir /etc/OpenCL
194 %dir /etc/OpenCL/vendors
195 %attr(751,root,root) %dir /etc/certs
196 %dir /etc/cron.d
197 %dir /etc/default
198 %dir /etc/fonts
199 %dir /etc/fonts/conf.d
200 %dir /etc/logrotate.d
201 %dir /etc/modprobe.d
202 %dir /etc/pki
203 %dir /etc/pki/CA
204 %dir /etc/pki/tls
205 %attr(751,root,root) %dir /etc/security
206 %dir /etc/skel
207 %dir /etc/sysconfig
208 %dir /etc/tmpwatch
209 %dir /etc/xdg
210 %dir /etc/xdg/autostart
211 %dir /etc/xdg/colors
212 %dir /etc/xdg/menus
213 %dir /etc/NetworkManager
214 %dir /etc/NetworkManager/dispatcher.d
215 %dir /home/users
216 %dir /home/services
217 %dir /initrd
218 %dir /lib/firmware
219 %dir /lib/security
220 %dir /lib/systemd
221 %dir /lib/systemd/system
222 # for library packages or other software with optional udev support not to pull udev
223 %dir /lib/udev
224 %dir /lib/udev/hwdb.d
225 %dir /lib/udev/rules.d
226 # tmpfs mounted by rc-scripts
227 %attr(1777,root,root) %dir /run
228 %dir /selinux
229 %dir /sys
230 %if "%{pld_release}" != "ac"
231 %dir /usr/include/X11
232 %endif
233 %dir /usr/include/security
234 %dir /usr/lib/ConsoleKit
235 %dir /usr/lib/ConsoleKit/run-session.d
236 %dir /usr/lib/browser-plugins
237 %dir /usr/lib/cgi-bin
238 %dir /usr/lib/cmake
239 %dir /usr/lib/initrd
240 %dir /usr/lib/mozilla
241 %dir /usr/lib/mozilla/extensions
242 %dir /usr/lib/pkcs11
243 %dir /usr/lib/pkgconfig
244 %dir /usr/lib/tmpfiles.d
245 %dir /usr/share/appdata
246 %dir /usr/share/augeas
247 %dir /usr/share/augeas/lenses
248 %dir /usr/share/augeas/lenses/tests
249 %dir /usr/share/backgrounds
250 %dir /usr/share/cmake
251 %dir /usr/share/cmake/Modules
252 %dir /usr/share/color
253 %dir /usr/share/color/icc
254 %dir /usr/share/defaults
255 %dir /usr/share/factory
256 %dir /usr/share/factory/etc
257 %dir /usr/share/factory/etc/pam.d
258 %dir /usr/share/fontconfig
259 %dir /usr/share/fontconfig/conf.avail
260 %dir /usr/share/gnome
261 %dir /usr/share/gnome/help
262 %dir /usr/share/mate
263 %dir /usr/share/mate/help
264 %dir /usr/share/help
265 %dir /usr/share/help/C
266 %dir /usr/share/man/man[nl]
267 %lang(pl) %dir /usr/share/man/pl/mann
268 %dir /usr/share/pkgconfig
269 %dir /usr/share/ppd
270 %dir /usr/share/soundfonts
271 %dir /usr/share/sounds
272 %dir /usr/share/themes
273 %dir /usr/share/themes/Default
274 %dir /usr/share/thumbnailers
275 %dir /usr/share/vala
276 %dir /usr/share/vala/vapi
277 %dir /usr/share/wallpapers
278 %dir /usr/share/wayland-sessions
279 %dir /usr/share/xsessions
280 %dir /usr/src/examples
281 %dir /var/lib/color
282 %dir /var/lib/color/icc
283 %attr(700,root,root) %dir /var/lock/subsys
284 %attr(751,root,root) %dir /var/log/archive
285 %dir %{_aclocaldir}
286 %dir %{_desktopdir}
287 %dir %{_desktopdir}/docklets
288 %dir %{_desktopdir}/screensavers
289 %dir %{_iconsdir}
290 %dir %{_pixmapsdir}
291 %{_fontsdir}
292 %dir %{_idldir}
293 %dir %{_privsepdir}
294 %if %{with lib64}
295 %dir /lib64/security
296 %dir /usr/lib64/browser-plugins
297 %dir /usr/lib64/cmake
298 %dir /usr/lib64/initrd
299 %dir /usr/lib64/mozilla
300 %dir /usr/lib64/mozilla/extensions
301 %dir /usr/lib64/pkcs11
302 %dir /usr/lib64/pkgconfig
303 %endif
304 %if %{with libx32}
305 %dir /libx32/security
306 %dir /usr/libx32/browser-plugins
307 %dir /usr/libx32/cmake
308 %dir /usr/libx32/initrd
309 %dir /usr/libx32/mozilla
310 %dir /usr/libx32/mozilla/extensions
311 %dir /usr/libx32/pkcs11
312 %dir /usr/libx32/pkgconfig
313 %endif
314
315 %if "%{pld_release}" == "ac"
316 %dir /usr/X11R6
317 %dir /usr/X11R6/man
318 /usr/X11R6/man/man*
319 %lang(it) /usr/X11R6/man/it
320 %lang(ko) /usr/X11R6/man/ko
321 %lang(pl) /usr/X11R6/man/pl
322 %dir /usr/X11R6/share
323
324 %dir /usr/share/wm-properties
325 %endif
326
327 # debuginfo
328 %dir /usr/lib/debug
329 /usr/lib/debug/*
330
331 %dir /usr/src/debug
This page took 0.161878 seconds and 3 git commands to generate.