summaryrefslogtreecommitdiff
path: root/pear/template.spec
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2003-06-16 08:27:47 +0000
committerTomas V.V.Cox <cox@php.net>2003-06-16 08:27:47 +0000
commitd93e9fea6afdf39bd783300a1dc7cb5fdbf8756f (patch)
treefc75eeadc9c817c38e8c952f22d7ec0ae4007624 /pear/template.spec
parentd335b38a375e293aa6e5ff2ee3556525026eac66 (diff)
downloadphp-git-d93e9fea6afdf39bd783300a1dc7cb5fdbf8756f.tar.gz
Better file relocation and invert post/postun logic
Diffstat (limited to 'pear/template.spec')
-rw-r--r--pear/template.spec48
1 files changed, 34 insertions, 14 deletions
diff --git a/pear/template.spec b/pear/template.spec
index dc6c66550e..9bf356c7f5 100644
--- a/pear/template.spec
+++ b/pear/template.spec
@@ -8,7 +8,7 @@ Source: http://@master_server@/get/@package@-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-root
URL: http://@master_server@/
Prefix: %{_prefix}
-Docdir: @doc_dir@/@package@
+#Docdir: @doc_dir@/@package@
BuildArchitectures: @arch@
@extra_headers@
@@ -16,29 +16,49 @@ BuildArchitectures: @arch@
@description@
%prep
-#rm -rf Console_Getopt-%{version} package.xml
-#mkdir -p Console_Getopt-%{version}
-#ln -s Console_Getopt-%{version}/package.xml package.xml
-%setup -q -D -n @package@-%{version}
-mv ../package.xml .
+rm -rf %{buildroot}/*
+# XXX Source files location is missing here in pear cmd
+pear -v -c %{buildroot}/pearrc \
+ -d php_dir=%{_libdir}/php/pear \
+ -d doc_dir=/docs \
+ -d bin_dir=%{_bindir} \
+ -d data_dir=%{_libdir}/php/pear/data \
+ -d test_dir=%{_libdir}/php/pear/tests \
+ -d ext_dir=%{_libdir} \
+ -s
%build
echo BuildRoot=%{buildroot}
-%post
+%postun
pear uninstall --nodeps -r @package@
+rm @rpm_xml_dir@/@package@.xml
-%postun
+%post
pear install --nodeps -r @rpm_xml_dir@/@package@.xml
%install
-rm -rf %{buildroot}/*
-pear -q install -R %{buildroot} -n package.xml
+pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \
+ $RPM_SOURCE_DIR/@package@-%{version}.tgz
+rm %{buildroot}/pearrc
+rm %{buildroot}/%{_libdir}/php/pear/.filemap
+rm %{buildroot}/%{_libdir}/php/pear/.lock
+rm -rf %{buildroot}/%{_libdir}/php/pear/.registry
+if [ -d "%{buildroot}/docs/@package@/doc" ]; then
+ rm -rf $RPM_BUILD_DIR/doc
+ mv %{buildroot}/docs/@package@/doc $RPM_BUILD_DIR
+ rm -rf %{buildroot}/docs
+fi
mkdir -p %{buildroot}@rpm_xml_dir@
+tar -xzf $RPM_SOURCE_DIR/@package@-%{version}.tgz package.xml
cp -p package.xml %{buildroot}@rpm_xml_dir@/@package@.xml
+#rm -rf %{buildroot}/*
+#pear -q install -R %{buildroot} -n package.xml
+#mkdir -p %{buildroot}@rpm_xml_dir@
+#cp -p package.xml %{buildroot}@rpm_xml_dir@/@package@.xml
+
%files
-%defattr(-,root,root)
-%doc @doc_files@
-@files@
-@rpm_xml_dir@/@package@.xml
+ %defattr(-,root,root)
+ %doc @doc_files@
+ /