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