]> TLD Linux GIT Repositories - packages/filesystem.git/blob - filesystem.spec
- PLD merge
[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 Summary:        Common directories
6 Summary(pl.UTF-8):      Wspólne katalogi
7 Name:           filesystem
8 Version:        4.1
9 Release:        4
10 License:        GPL
11 Group:          Base
12 BuildRequires:  automake
13 BuildRequires:  mktemp
14 BuildRequires:  rpm >= 4.4.9-56
15 Requires:       FHS >= 3.0
16 Provides:       browser-plugins(%{_target_base_arch})
17 %ifarch %{x8664}
18 Provides:       browser-plugins(i386)
19 %endif
20 Provides:       filesystem-debuginfo = %{version}-%{release}
21 Obsoletes:      filesystem-debuginfo < 3.0-36
22 Conflicts:      X11-libs < 1:7.7
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 # Adapter: This file does not like to be adapterized!
26
27 # disable rpm generated debug package, we handle it differently here
28 %define         _enable_debug_packages  0
29
30 %if "%{_lib}" == "lib64"
31 %define         with_lib64      1
32 %endif
33
34 # avoid rpm 4.4.9 adding rm -rf buildroot
35 %define         __spec_clean_body       %{nil}
36
37 # directory for "privilege separation" chroot
38 %define         _privsepdir     /usr/share/empty
39 # directory for *.idl files (for CORBA implementations)
40 %define         _idldir         /usr/share/idl
41
42 # we have to use numeric uids/groups. see comment beginning of the spec
43 %define         gid_logs        124
44 %define         gid_crontab     117
45
46 %description
47 This package contains common directories for packages that extend some
48 programs functionality, but don't require them themselves.
49
50 %description -l pl.UTF-8
51 Ten pakiet zawiera wspólne katalogi dla pakietów rozszerzających
52 funkcjonalność programów, ale nie wymagających ich.
53
54 %prep
55 %setup -qcT
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59
60 install -d \
61         $RPM_BUILD_ROOT/{initrd,selinux} \
62         $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,colors,menus}} \
63         $RPM_BUILD_ROOT/home/{users,services} \
64         $RPM_BUILD_ROOT/lib/{firmware,security,udev/{hwdb.d,rules.d}} \
65         $RPM_BUILD_ROOT/usr/include/{security,X11} \
66         $RPM_BUILD_ROOT/usr/lib/{ConsoleKit/run-session.d,browser-plugins,cgi-bin,cmake,mozilla/extensions,pkcs11,pkgconfig,initrd} \
67         $RPM_BUILD_ROOT/usr/share/{appdata,augeas/lenses/tests,backgrounds,cmake/Modules,defaults,factory/etc/pam.d,fontconfig/conf.avail,gnome/help,mate/help,man/man{n,l},man/pl/mann,metainfo,pkgconfig,soundfonts,sounds,themes/Default,thumbnailers,vala/vapi,wallpapers,wayland-sessions,xdg-desktop-portal/portals,xsessions} \
68         $RPM_BUILD_ROOT/usr/src/examples \
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 %clean
101 cd $RPM_BUILD_ROOT
102
103 check_filesystem_dirs() {
104         RPMFILE=%{_rpmdir}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm
105         TMPFILE=$(mktemp)
106         # note: we must exclude from check all existing dirs belonging to FHS
107         find | sed -e 's|^\.||g' -e '/^$/d' | LC_ALL=C sort | grep -v $TMPFILE | \
108         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
109
110         if rpm -qpl $RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -u $TMPFILE - ; then
111                 rm -rf $RPM_BUILD_ROOT
112         else
113                 echo -e "\nNot so good, some directories are not included in package\n"
114                 exit 1
115         fi
116         rm -f $TMPFILE
117 }
118
119 check_filesystem_dirs
120
121 %pretrans -p <lua>
122 -- this needs to be a dir
123 if posix.stat("/usr/include/X11", "type") == "link" then
124         posix.umask("0755");
125         os.rename("/usr/include/X11", "/usr/include/X11.rpmsave")
126         posix.mkdir("/usr")
127         posix.mkdir("/usr/include")
128         posix.mkdir("/usr/include/X11")
129         oldpwd = posix.getcwd()
130         posix.chdir("/usr/include/X11.rpmsave")
131         for i,j in pairs(posix.glob("*")) do
132                 os.rename(j, "/usr/include/X11/" .. j)
133         end
134         posix.chdir(oldpwd)
135 end
136
137 %post -p <lua>
138 posix.chown("/var/log/archive", 0, %{gid_logs})
139 posix.chown("/etc/cron.d", 0, %{gid_crontab})
140
141 %files -f %{name}.lang
142 %defattr(644,root,root,755)
143 %dir /boot/efi
144 %dir /boot/efi/EFI
145 %dir /etc/X11/xinit
146 %dir /etc/X11/xinit/xinitrc.d
147 %dir /etc/X11/xinit/xinput.d
148 %dir /etc/OpenCL
149 %dir /etc/OpenCL/vendors
150 %attr(751,root,root) %dir /etc/certs
151 %dir /etc/cron.d
152 %dir /etc/default
153 %dir /etc/fonts
154 %dir /etc/fonts/conf.d
155 %dir /etc/logrotate.d
156 %dir /etc/modprobe.d
157 %dir /etc/modules-load.d
158 %dir /etc/pki
159 %dir /etc/pki/CA
160 %dir /etc/pki/tls
161 %attr(751,root,root) %dir /etc/security
162 %dir /etc/skel
163 %dir /etc/sysconfig
164 %dir /etc/sysctl.d
165 %dir /etc/tmpwatch
166 %dir /etc/xdg
167 %dir /etc/xdg/autostart
168 %dir /etc/xdg/colors
169 %dir /etc/xdg/menus
170 %dir /etc/NetworkManager
171 %dir /etc/NetworkManager/dispatcher.d
172 %dir /home/users
173 %dir /home/services
174 %dir /initrd
175 %dir /lib/firmware
176 %dir /lib/security
177 # for library packages or other software with optional udev support not to pull udev
178 %dir /lib/udev
179 %dir /lib/udev/hwdb.d
180 %dir /lib/udev/rules.d
181 %dir /selinux
182 %dir /usr/include/X11
183 %dir /usr/include/security
184 %dir /usr/lib/ConsoleKit
185 %dir /usr/lib/ConsoleKit/run-session.d
186 %dir /usr/lib/browser-plugins
187 %dir /usr/lib/cgi-bin
188 %dir /usr/lib/cmake
189 %dir /usr/lib/initrd
190 %dir /usr/lib/mozilla
191 %dir /usr/lib/mozilla/extensions
192 %dir /usr/lib/pkcs11
193 %dir /usr/lib/pkgconfig
194 %dir /usr/share/appdata
195 %dir /usr/share/augeas
196 %dir /usr/share/augeas/lenses
197 %dir /usr/share/augeas/lenses/tests
198 %dir /usr/share/backgrounds
199 %dir /usr/share/cmake
200 %dir /usr/share/cmake/Modules
201 %dir /usr/share/defaults
202 %dir /usr/share/factory
203 %dir /usr/share/factory/etc
204 %dir /usr/share/factory/etc/pam.d
205 %dir /usr/share/fontconfig
206 %dir /usr/share/fontconfig/conf.avail
207 %dir /usr/share/gnome
208 %dir /usr/share/gnome/help
209 %dir /usr/share/mate
210 %dir /usr/share/mate/help
211 %dir /usr/share/metainfo
212 %dir /usr/share/help
213 %dir /usr/share/help/C
214 %dir /usr/share/man/man[nl]
215 %lang(pl) %dir /usr/share/man/pl/mann
216 %dir /usr/share/pkgconfig
217 %dir /usr/share/soundfonts
218 %dir /usr/share/sounds
219 %dir /usr/share/themes
220 %dir /usr/share/themes/Default
221 %dir /usr/share/thumbnailers
222 %dir /usr/share/vala
223 %dir /usr/share/vala/vapi
224 %dir /usr/share/wallpapers
225 %dir /usr/share/wayland-sessions
226 %dir /usr/share/xdg-desktop-portal
227 %dir /usr/share/xdg-desktop-portal/portals
228 %dir /usr/share/xsessions
229 %dir /usr/src/examples
230 %attr(700,root,root) %dir /var/lock/subsys
231 %attr(751,root,root) %dir /var/log/archive
232 %dir %{_aclocaldir}
233 %dir %{_desktopdir}
234 %dir %{_desktopdir}/docklets
235 %dir %{_desktopdir}/screensavers
236 %dir %{_iconsdir}
237 %dir %{_pixmapsdir}
238 %{_fontsdir}
239 %dir %{_idldir}
240 %dir %{_privsepdir}
241 %if %{with lib64}
242 %dir /lib64/security
243 %dir /usr/lib64/browser-plugins
244 %dir /usr/lib64/cmake
245 %dir /usr/lib64/initrd
246 %dir /usr/lib64/mozilla
247 %dir /usr/lib64/mozilla/extensions
248 %dir /usr/lib64/pkcs11
249 %dir /usr/lib64/pkgconfig
250 %endif
251
252 # debuginfo
253 %dir /usr/lib/debug
254 /usr/lib/debug/*
255
256 %dir /usr/src/debug