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