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