Debian package updates by Jochen Kunkel
[openxpki.git] / trunk / package / suse / openxpki-i18n / openxpki-i18n.spec.in
blobd18cc77757cb046fbb8da168425b3664624f706a
1 ## Written 2006 by Martin Bartosch for the OpenXPKI project
2 ## Copyright (C) 2005-2006 by The OpenXPKI Project
5 # - OpenXPKI i18n package -
8 %define pkgname openxpki-i18n
9 %define filelist %{pkgname}-%{version}-filelist
10 %define NVR %{pkgname}-%{version}-%{release}
11 %define maketest 0
13 name: openxpki-i18n
14 summary: OpenXPKI Internationalization
15 version: _VERSION_
16 release: 1
17 vendor: OpenXPKI Project
18 packager: Martin Bartosch <m.bartosch@cynops.de>
19 license: Apache
20 group: Applications/CPAN
21 url: http://www.openxpki.org
22 buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
23 prefix: %(echo %{_prefix})
24 source: openxpki-i18n-%{version}.tar.gz
26 %description
27 OpenXPKI internationalization files.
29 %prep
30 %setup -q -n %{pkgname}-%{version}
31 chmod -R u+w %{_builddir}/%{pkgname}-%{version}
33 %build
34 %{__make}
35 %if %maketest
36 %{__make} test
37 %endif
39 %install
40 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
42 %{makeinstall} DESTDIR=%{buildroot}
45 cmd=/usr/share/spec-helper/compress_files
46 [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
47 [ -x $cmd ] && $cmd
49 # SuSE Linux
50 if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
51 then
55 # remove special files
57 # no empty directories
58 find %{buildroot}%{_prefix} \
59 -type d -depth \
60 -exec rmdir {} \; 2>/dev/null
62 %{__perl} -MFile::Find -le '
63 find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
64 #print "%doc CHANGES INSTALL LICENSE README";
65 for my $x (sort @dirs, @files) {
66 push @ret, $x unless indirs($x);
68 print join "\n", sort @ret;
70 sub wanted {
71 return if /auto$/;
73 local $_ = $File::Find::name;
74 my $f = $_; s|^\Q%{buildroot}\E||;
75 return unless length;
76 return $files[@files] = $_ if -f $f;
78 $d = $_;
79 /\Q$d\E/ && return for reverse sort @INC;
80 $d =~ /\Q$_\E/ && return
81 for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
83 $dirs[@dirs] = $_;
86 sub indirs {
87 my $x = shift;
88 $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
90 ' > %filelist
93 [ -z %filelist ] && {
94 echo "ERROR: empty %files listing"
95 exit -1
98 %clean
99 # [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
101 %files -f %filelist
102 %defattr(-,root,root)
104 %changelog
105 * Mon Nov 27 2006 m.bartosch@cynops.de
106 - Initial build.