]> git.pld-linux.org Git - packages/filesystem.git/blob - filesystem.spec
/usr/share/factory for systemd template files
[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:        39
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 \
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 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 /etc/X11/xinit
186 %dir /etc/X11/xinit/xinitrc.d
187 %dir /etc/X11/xinit/xinput.d
188 %dir /etc/OpenCL
189 %dir /etc/OpenCL/vendors
190 %attr(751,root,root) %dir /etc/certs
191 %dir /etc/cron.d
192 %dir /etc/default
193 %dir /etc/init
194 %dir /etc/fonts
195 %dir /etc/fonts/conf.d
196 %dir /etc/logrotate.d
197 %dir /etc/modprobe.d
198 %dir /etc/pki
199 %dir /etc/pki/CA
200 %dir /etc/pki/tls
201 %attr(751,root,root) %dir /etc/security
202 %dir /etc/sysconfig
203 %dir /etc/tmpwatch
204 %dir /etc/xdg
205 %dir /etc/xdg/autostart
206 %dir /etc/xdg/menus
207 %dir /etc/NetworkManager
208 %dir /etc/NetworkManager/dispatcher.d
209 %dir /home/users
210 %dir /home/services
211 %dir /initrd
212 %dir /lib/firmware
213 %dir /lib/security
214 %dir /lib/systemd
215 %dir /lib/systemd/system
216 %dir /lib/udev
217 %dir /lib/udev/rules.d
218 %dir /run
219 %dir /selinux
220 %dir /sys
221 %if "%{pld_release}" != "ac"
222 %dir /usr/include/X11
223 %endif
224 %dir /usr/include/security
225 %dir /usr/lib/ConsoleKit
226 %dir /usr/lib/ConsoleKit/run-session.d
227 %dir /usr/lib/browser-plugins
228 %dir /usr/lib/cgi-bin
229 %dir /usr/lib/cmake
230 %dir /usr/lib/initrd
231 %dir /usr/lib/mozilla
232 %dir /usr/lib/mozilla/extensions
233 %dir /usr/lib/pkcs11
234 %dir /usr/lib/pkgconfig
235 %dir /usr/lib/tmpfiles.d
236 %dir /usr/share/appdata
237 %dir /usr/share/augeas
238 %dir /usr/share/augeas/lenses
239 %dir /usr/share/augeas/lenses/tests
240 %dir /usr/share/backgrounds
241 %dir /usr/share/cmake
242 %dir /usr/share/cmake/Modules
243 %dir /usr/share/color
244 %dir /usr/share/color/icc
245 %dir /usr/share/factory
246 %dir /usr/share/factory/etc
247 %dir /usr/share/factory/etc/pam.d
248 %dir /usr/share/fontconfig
249 %dir /usr/share/fontconfig/conf.avail
250 %dir /usr/share/gnome
251 %dir /usr/share/gnome/help
252 %dir /usr/share/mate
253 %dir /usr/share/mate/help
254 %dir /usr/share/help
255 %dir /usr/share/help/C
256 %dir /usr/share/man/man[nl]
257 %lang(pl) %dir /usr/share/man/pl/mann
258 %dir /usr/share/pkgconfig
259 %dir /usr/share/ppd
260 %dir /usr/share/soundfonts
261 %dir /usr/share/sounds
262 %dir /usr/share/themes
263 %dir /usr/share/themes/Default
264 %dir /usr/share/thumbnailers
265 %dir /usr/share/vala
266 %dir /usr/share/vala/vapi
267 %dir /usr/share/wallpapers
268 %dir /usr/share/wayland-sessions
269 %dir /usr/share/xsessions
270 %dir /usr/src/examples
271 %dir /var/lib/color
272 %dir /var/lib/color/icc
273 %attr(700,root,root) %dir /var/lock/subsys
274 %attr(751,root,root) %dir /var/log/archive
275 %dir %{_aclocaldir}
276 %dir %{_desktopdir}
277 %dir %{_desktopdir}/docklets
278 %dir %{_desktopdir}/screensavers
279 %dir %{_iconsdir}
280 %dir %{_pixmapsdir}
281 %{_fontsdir}
282 %dir %{_idldir}
283 %dir %{_privsepdir}
284 %if %{with lib64}
285 %dir /lib64/security
286 %dir /usr/lib64/browser-plugins
287 %dir /usr/lib64/cmake
288 %dir /usr/lib64/initrd
289 %dir /usr/lib64/mozilla
290 %dir /usr/lib64/mozilla/extensions
291 %dir /usr/lib64/pkcs11
292 %dir /usr/lib64/pkgconfig
293 %endif
294 %if %{with libx32}
295 %dir /libx32/security
296 %dir /usr/libx32/browser-plugins
297 %dir /usr/libx32/cmake
298 %dir /usr/libx32/initrd
299 %dir /usr/libx32/mozilla
300 %dir /usr/libx32/mozilla/extensions
301 %dir /usr/libx32/pkcs11
302 %dir /usr/libx32/pkgconfig
303 %endif
304
305 %if "%{pld_release}" == "ac"
306 %dir /usr/X11R6
307 %dir /usr/X11R6/man
308 /usr/X11R6/man/man*
309 %lang(it) /usr/X11R6/man/it
310 %lang(ko) /usr/X11R6/man/ko
311 %lang(pl) /usr/X11R6/man/pl
312 %dir /usr/X11R6/share
313
314 %dir /usr/share/wm-properties
315 %endif
316
317 # debuginfo
318 %dir /usr/lib/debug
319 /usr/lib/debug/*
320
321 %dir /usr/src/debug
This page took 0.08082 seconds and 4 git commands to generate.