]> git.pld-linux.org Git - packages/filesystem.git/blob - filesystem.spec
8b5d629a13342178b13a0816f659ffd7fb13981d
[packages/filesystem.git] / filesystem.spec
1 #
2 # Conditional build:
3 %bcond_without  debuginfo       # build without debuginfo package
4
5 # disable bcond if debuginfo is disabled from rpmmacros
6 %if %{expand:%%define __sip_%{?_enable_debug_packages} 1}0%{?__sip_0:1}%{expand:%%undefine __sip_%{?_enable_debug_packages}}
7 %undefine       with_debuginfo
8 %endif
9
10 # disable rpm generated debug package in any way
11 %define         _enable_debug_packages  0
12
13 # avoid rpm 4.4.9 adding rm -rf buildroot
14 %define         __spec_clean_body       %{nil}
15 Summary:        Common directories
16 Summary(pl.UTF-8):      Wspólne katalogi
17 Name:           filesystem
18 Version:        3.0
19 Release:        15
20 License:        GPL
21 Group:          Base
22 BuildRequires:  automake
23 Requires:       FHS >= 2.3-15
24 Provides:       browser-plugins(%{_target_base_arch})
25 %ifarch %{x8664}
26 Provides:       browser-plugins(i386)
27 %endif
28 %ifarch ppc64
29 Provides:       browser-plugins(ppc)
30 %endif
31 %ifarch s390x
32 Provides:       browser-plugins(s390)
33 %endif
34 %ifarch sparc64
35 Provides:       browser-plugins(sparc)
36 %endif
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 # directory for "privilege separation" chroot
40 %define         _privsepdir     /usr/share/empty
41 # directory for *.idl files (for CORBA implementations)
42 %define         _idldir         /usr/share/idl
43
44 %description
45 This package contains common directories for packages that extend some
46 programs functionality, but don't require them themselves.
47
48 %description -l pl.UTF-8
49 Ten pakiet zawiera wspólne katalogi dla pakietów rozszerzających
50 funkcjonalność programów, ale nie wymagających ich.
51
52 %package debuginfo
53 Summary:        Common directories for debug information
54 Summary(pl.UTF-8):      Wspólne katalogi dla plików z informacjami dla debuggera
55 Group:          Development/Debug
56 Requires:       %{name} = %{version}-%{release}
57
58 %description debuginfo
59 This package provides common directories for debug information.
60
61 %description debuginfo -l pl.UTF-8
62 Ten pakiet udostępnia wspólne katalogi dla plików z informacjami dla
63 debuggera.
64
65 %prep
66 %setup -qcT
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70
71 install -d \
72         $RPM_BUILD_ROOT/{initrd,selinux,sys} \
73         $RPM_BUILD_ROOT/etc/{X11/xinit/xinitrc.d,certs,security,sysconfig/wmstyle,xdg/autostart} \
74         $RPM_BUILD_ROOT/home/{users,services} \
75         $RPM_BUILD_ROOT/lib/{firmware,security} \
76         $RPM_BUILD_ROOT/usr/include/security \
77         $RPM_BUILD_ROOT/usr/lib/{cgi-bin,browser-plugins,pkgconfig} \
78         $RPM_BUILD_ROOT/usr/share/{gnome/help,man/man{n,l},man/pl/mann,pkgconfig,sounds,themes/Default,wallpapers,wm-properties,xsessions} \
79         $RPM_BUILD_ROOT/usr/src/examples \
80         $RPM_BUILD_ROOT/var/lock/subsys \
81         $RPM_BUILD_ROOT{%{_aclocaldir},%{_desktopdir}/docklets,%{_iconsdir},%{_pixmapsdir}} \
82         $RPM_BUILD_ROOT%{_fontsdir}/{{100,75}dpi,OTF,Speedo,Type1/{afm,pfm},TTF,cyrillic,local,misc} \
83         $RPM_BUILD_ROOT{%{_idldir},%{_privsepdir}}
84
85 %if "%{_lib}" == "lib64"
86 install -d \
87         $RPM_BUILD_ROOT/lib64/security \
88         $RPM_BUILD_ROOT/usr/lib64/pkgconfig \
89         $RPM_BUILD_ROOT/usr/lib64/browser-plugins
90 %endif
91
92 %if %{with debuginfo}
93 install -d \
94         $RPM_BUILD_ROOT/usr/lib/debug/%{_lib} \
95         $RPM_BUILD_ROOT/usr/lib/debug%{_libdir} \
96         $RPM_BUILD_ROOT/usr/lib/debug/lib/security \
97         $RPM_BUILD_ROOT/usr/src/debug
98
99 %if "%{_lib}" == "lib64"
100 install -d \
101         $RPM_BUILD_ROOT/usr/lib/debug/lib64/security
102 %endif
103
104 find $RPM_BUILD_ROOT/usr/lib/debug -type d | while read line; do
105         echo "%exclude %dir ${line#$RPM_BUILD_ROOT}"
106 done > $RPM_BUILD_ROOT/usr/src/debug/%{name}-debuginfo.files
107 %endif
108
109 # create this for %clean
110 tar -cf checkfiles.tar -C $RPM_BUILD_ROOT .
111
112 %clean
113 mkdir -p $RPM_BUILD_ROOT
114 tar -xf checkfiles.tar -C $RPM_BUILD_ROOT
115 cd $RPM_BUILD_ROOT
116
117 check_filesystem_dirs() {
118         # %{_rpmfilename} is not expanded, so use
119         # %{name}-%{version}-%{release}.%{buildarch}.rpm
120         RPMFILE=%{_rpmdir}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm
121         RPMFILE2=%{?with_debuginfo:%{_rpmdir}/%{name}-debuginfo-%{version}-%{release}.%{_target_cpu}.rpm}
122         TMPFILE=$(mktemp)
123         # note: we must exclude from check all existing dirs belonging to FHS
124         find . | sed -e 's|^\.||g' -e 's|^$||g' | sort | grep -v $TMPFILE | grep -E -v '^/(etc|etc/X11|home|lib|lib64|usr|usr/include|usr/lib|usr/lib64|usr/share|usr/share/man|usr/share/man/pl|usr/src|var|var/lock)$' > $TMPFILE
125
126         # find finds also '.', so use option -B for diff
127         rpm -qpl $RPMFILE $RPMFILE2 | grep -v '^/$' | sort | diff -uB $TMPFILE - || :
128
129         rm -f $TMPFILE
130 }
131
132 check_filesystem_dirs
133
134 %files
135 %defattr(644,root,root,755)
136 %dir /etc/X11/xinit
137 %dir /etc/X11/xinit/xinitrc.d
138 %attr(751,root,root) %dir /etc/certs
139 %attr(751,root,root) %dir /etc/security
140 %dir /etc/sysconfig
141 %dir /etc/sysconfig/wmstyle
142 %dir /etc/xdg
143 %dir /etc/xdg/autostart
144 %dir /home/users
145 %attr(751,root,adm) %dir /home/services
146 %ghost %dir /initrd
147 %dir /lib/firmware
148 %dir /lib/security
149 %dir /selinux
150 %dir /sys
151 %dir /usr/include/security
152 %dir /usr/lib/browser-plugins
153 %dir /usr/lib/cgi-bin
154 %dir /usr/lib/pkgconfig
155 %dir /usr/share/gnome
156 %dir /usr/share/gnome/help
157 %dir /usr/share/man/man[nl]
158 %lang(pl) %dir /usr/share/man/pl/mann
159 %dir /usr/share/pkgconfig
160 %dir /usr/share/sounds
161 %dir /usr/share/themes
162 %dir /usr/share/themes/Default
163 %dir /usr/share/wallpapers
164 %dir /usr/share/wm-properties
165 %dir /usr/share/xsessions
166 %dir /usr/src/examples
167 %attr(700,root,root) %dir /var/lock/subsys
168 %dir %{_aclocaldir}
169 %dir %{_desktopdir}
170 %dir %{_desktopdir}/docklets
171 %dir %{_iconsdir}
172 %dir %{_pixmapsdir}
173 %{_fontsdir}
174 %dir %{_idldir}
175 %dir %{_privsepdir}
176 %if "%{_lib}" == "lib64"
177 %dir /lib64/security
178 %dir /usr/lib64/pkgconfig
179 %dir /usr/lib64/browser-plugins
180 %endif
181
182 %if %{with debuginfo}
183 %files debuginfo
184 %defattr(644,root,root,755)
185 %dir /usr/lib/debug
186 /usr/lib/debug/*
187
188 %dir /usr/src/debug
189 /usr/src/debug/filesystem-debuginfo.files
190 %endif
This page took 0.090739 seconds and 2 git commands to generate.