Work in progress integrating IP audit info in reports.
[timetracker.git] / WEB-INF / lib / pear / template.spec
1 Summary: PEAR: @summary@
2 Name: @rpm_package@
3 Version: @version@
4 Release: 1
5 License: @release_license@
6 Group: Development/Libraries
7 Source: http://@master_server@/get/@package@-%{version}.tgz
8 BuildRoot: %{_tmppath}/%{name}-root
9 URL: http://@master_server@/package/@package@
10 Prefix: %{_prefix}
11 BuildArchitectures: @arch@
12 @extra_headers@
13
14 %description
15 @description@
16
17 %prep
18 rm -rf %{buildroot}/*
19 %setup -c -T
20 # XXX Source files location is missing here in pear cmd
21 pear -v -c %{buildroot}/pearrc \
22         -d php_dir=%{_libdir}/php/pear \
23         -d doc_dir=/docs \
24         -d bin_dir=%{_bindir} \
25         -d data_dir=%{_libdir}/php/pear/data \
26         -d test_dir=%{_libdir}/php/pear/tests \
27         -d ext_dir=%{_libdir} \@extra_config@
28         -s
29
30 %build
31 echo BuildRoot=%{buildroot}
32
33 %postun
34 # if refcount = 0 then package has been removed (not upgraded)
35 if [ "$1" -eq "0" ]; then
36     pear uninstall --nodeps -r @possible_channel@@package@
37     rm @rpm_xml_dir@/@package@.xml
38 fi
39
40
41 %post
42 # if refcount = 2 then package has been upgraded
43 if [ "$1" -ge "2" ]; then
44     pear upgrade --nodeps -r @rpm_xml_dir@/@package@.xml
45 else
46     pear install --nodeps -r @rpm_xml_dir@/@package@.xml
47 fi
48
49 %install
50 pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \
51         $RPM_SOURCE_DIR/@package@-%{version}.tgz
52 rm %{buildroot}/pearrc
53 rm %{buildroot}/%{_libdir}/php/pear/.filemap
54 rm %{buildroot}/%{_libdir}/php/pear/.lock
55 rm -rf %{buildroot}/%{_libdir}/php/pear/.registry
56 if [ "@doc_files@" != "" ]; then
57      mv %{buildroot}/docs/@package@/* .
58      rm -rf %{buildroot}/docs
59 fi
60 mkdir -p %{buildroot}@rpm_xml_dir@
61 tar -xzf $RPM_SOURCE_DIR/@package@-%{version}.tgz package@package2xml@.xml
62 cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml
63
64 #rm -rf %{buildroot}/*
65 #pear -q install -R %{buildroot} -n package@package2xml@.xml
66 #mkdir -p %{buildroot}@rpm_xml_dir@
67 #cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml
68
69 %files
70     %defattr(-,root,root)
71     %doc @doc_files@
72     /