]> TLD Linux GIT Repositories - packages/filesystem.git/blob - filesystem.spec
- drop upstart leftovers
[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:        44
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,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/fonts
157 %dir /etc/fonts/conf.d
158 %dir /etc/logrotate.d
159 %dir /etc/modprobe.d
160 %dir /etc/modules-load.d
161 %dir /etc/pki
162 %dir /etc/pki/CA
163 %dir /etc/pki/tls
164 %attr(751,root,root) %dir /etc/security
165 %dir /etc/skel
166 %dir /etc/sysconfig
167 %dir /etc/sysctl.d
168 %dir /etc/tmpwatch
169 %dir /etc/xdg
170 %dir /etc/xdg/autostart
171 %dir /etc/xdg/menus
172 %dir /etc/NetworkManager
173 %dir /etc/NetworkManager/dispatcher.d
174 %dir /home/users
175 %dir /home/services
176 %dir /initrd
177 %dir /lib/firmware
178 %dir /lib/security
179 # for library packages or other software with optional udev support not to pull udev
180 %dir /lib/udev
181 %dir /lib/udev/hwdb.d
182 %dir /lib/udev/rules.d
183 # tmpfs mounted by rc-scripts
184 %attr(1777,root,root) %dir /run
185 %dir /selinux
186 %dir /sys
187 %dir /usr/include/X11
188 %dir /usr/include/security
189 %dir /usr/lib/ConsoleKit
190 %dir /usr/lib/ConsoleKit/run-session.d
191 %dir /usr/lib/browser-plugins
192 %dir /usr/lib/cgi-bin
193 %dir /usr/lib/cmake
194 %dir /usr/lib/initrd
195 %dir /usr/lib/mozilla
196 %dir /usr/lib/mozilla/extensions
197 %dir /usr/lib/pkcs11
198 %dir /usr/lib/pkgconfig
199 %dir /usr/share/appdata
200 %dir /usr/share/augeas
201 %dir /usr/share/augeas/lenses
202 %dir /usr/share/augeas/lenses/tests
203 %dir /usr/share/backgrounds
204 %dir /usr/share/cmake
205 %dir /usr/share/cmake/Modules
206 %dir /usr/share/color
207 %dir /usr/share/color/icc
208 %dir /usr/share/fontconfig
209 %dir /usr/share/fontconfig/conf.avail
210 %dir /usr/share/gnome
211 %dir /usr/share/gnome/help
212 %dir /usr/share/mate
213 %dir /usr/share/mate/help
214 %dir /usr/share/help
215 %dir /usr/share/help/C
216 %dir /usr/share/man/man[nl]
217 %lang(pl) %dir /usr/share/man/pl/mann
218 %dir /usr/share/pkgconfig
219 %dir /usr/share/ppd
220 %dir /usr/share/soundfonts
221 %dir /usr/share/sounds
222 %dir /usr/share/themes
223 %dir /usr/share/themes/Default
224 %dir /usr/share/thumbnailers
225 %dir /usr/share/vala
226 %dir /usr/share/vala/vapi
227 %dir /usr/share/wallpapers
228 %dir /usr/share/wayland-sessions
229 %dir /usr/share/xsessions
230 %dir /usr/src/examples
231 %dir /var/lib/color
232 %dir /var/lib/color/icc
233 %attr(700,root,root) %dir /var/lock/subsys
234 %attr(751,root,root) %dir /var/log/archive
235 %dir %{_aclocaldir}
236 %dir %{_desktopdir}
237 %dir %{_desktopdir}/docklets
238 %dir %{_desktopdir}/screensavers
239 %dir %{_iconsdir}
240 %dir %{_pixmapsdir}
241 %{_fontsdir}
242 %dir %{_idldir}
243 %dir %{_privsepdir}
244 %if %{with lib64}
245 %dir /lib64/security
246 %dir /usr/lib64/browser-plugins
247 %dir /usr/lib64/cmake
248 %dir /usr/lib64/initrd
249 %dir /usr/lib64/mozilla
250 %dir /usr/lib64/mozilla/extensions
251 %dir /usr/lib64/pkcs11
252 %dir /usr/lib64/pkgconfig
253 %endif
254 %if %{with libx32}
255 %dir /libx32/security
256 %dir /usr/libx32/browser-plugins
257 %dir /usr/libx32/cmake
258 %dir /usr/libx32/initrd
259 %dir /usr/libx32/mozilla
260 %dir /usr/libx32/mozilla/extensions
261 %dir /usr/libx32/pkcs11
262 %dir /usr/libx32/pkgconfig
263 %endif
264
265 # debuginfo
266 %dir /usr/lib/debug
267 /usr/lib/debug/*
268
269 %dir /usr/src/debug