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