Browse Source

Merge pc file substitutions with install stage, remove unnecessary file moves, and remove installation to qtdyn directory to install section

Michael Schloh von Bennewitz 23 years ago
parent
commit
3454096274
1 changed files with 34 additions and 25 deletions
  1. 34 25
      qt/qt.spec

+ 34 - 25
qt/qt.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [EVAL]
 Group:        XWindow
 License:      GPL
 Version:      3.2.1
-Release:      20030908
+Release:      20030910
 
 #   package library options (each 'yes' builds more libraries)
 %option       with_shared   no
@@ -194,10 +194,7 @@ AutoReqProv:  no
 %endif
 
     #   already install our shared libs, and clear out the rest
-    %{l_shtool} mkdir -f -p -m 755 \
-        $RPM_BUILD_ROOT%{l_prefix}/lib/qtdyn
-    %{l_tar} cf - lib/*.so* lib/*.prl lib/*.pc | %{l_tar} xf - \
-        -C $RPM_BUILD_ROOT%{l_prefix}/lib/qtdyn/
+    cp -rf lib dyn
     rm -f lib/*
 %endif
 
@@ -241,9 +238,6 @@ AutoReqProv:  no
 %endif
 
 %if "%{with_threads}" == "yes"
-    #   generate the multithreaded library definitions also
-    mv lib/qt.pc .
-
     #   run configure a second time to get threaded libs as well
     CC="%{l_cc}" \
     CXX="%{l_cxx}" \
@@ -282,29 +276,20 @@ AutoReqProv:  no
           sub-uic
     ) || exit $?
 %endif
-
-    #   patch the badly generated pkg-config (.pc) files
-    mv qt.pc lib
-    %{l_shtool} subst \
-        -e "s;-l/.*\.pc ;;g" \
-        -e "s;-L[^ \t]*[ \t];;g" \
-        -e "s;Libs:;Libs: %{l_ldflags} -L${l_x11_libdir};g" \
-        -e "s;\t; ;g" \
-        -e "s; \+; ;g" \
-        -e "s; *$;;g" \
-        lib/qt.pc \
-        lib/qt-mt.pc
-    %{l_shtool} subst \
-        -e "s;\(Libs.*$\);\1 -pthread;g" \
-        lib/qt-mt.pc
 %endif
 
 %install
     rm -rf $RPM_BUILD_ROOT
 
+    #   calculate X11 lib directory in advance
+    l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
+
     #   make directory structure
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/bin \
+%if "%{with_shared}" == "yes"
+        $RPM_BUILD_ROOT%{l_prefix}/lib/qtdyn \
+%endif
 %if "%{with_tools}" == "yes"
         $RPM_BUILD_ROOT%{l_prefix}/share/qt/templates \
         $RPM_BUILD_ROOT%{l_prefix}/share/qt/phrasebooks \
@@ -339,10 +324,34 @@ AutoReqProv:  no
         include/*.h $RPM_BUILD_ROOT%{l_prefix}/include/qt/
     %{l_shtool} install -c -m 644 \
         include/private/*.h $RPM_BUILD_ROOT%{l_prefix}/include/qt/private/
-    %{l_shtool} install -c -m 644 \
-        lib/*.pc $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
     %{l_shtool} install -c -m 644 \
         lib/*.a lib/*.prl $RPM_BUILD_ROOT%{l_prefix}/lib/
+    %{l_shtool} install -c -m 644 \
+        -e "s;\t; ;g" \
+        -e "s;\ \+; ;g" \
+        -e "s;\ *$;;g" \
+        -e "s;-[lL]\ *\-;\-;g" \
+        -e "s;-l\ *[^ ]*qt\.pc\ *;;g" \
+        -e "s;-L\ *.[^ ]*\ *;;g" \
+        -e "s;Libs:;Libs: %{l_ldflags} -L${l_x11_libdir};g" \
+        -e "s;\(\-l\);\-lqt \1;" \
+        lib/qt.pc $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
+%if "%{with_threads}" == "yes"
+    %{l_shtool} install -c -m 644 \
+        -e "s;\t; ;g" \
+        -e "s;\ \+; ;g" \
+        -e "s;\ *$;;g" \
+        -e "s;-[lL]\ *\-;\-;g" \
+        -e "s;-l\ *[^ ]*qt\-mt\.pc\ *;;g" \
+        -e "s;-L\ *.[^ ]*\ *;;g" \
+        -e "s;Libs:;Libs: %{l_ldflags} -L${l_x11_libdir};g" \
+        -e "s;\(\-l\);\-lqt\-mt \1;" \
+        lib/qt-mt.pc $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
+%endif
+%if "%{with_shared}" == "yes"
+    %{l_shtool} install -c -m 644 \
+        dyn/lib*.so* dyn/*.prl dyn/*.pc $RPM_BUILD_ROOT%{l_prefix}/lib/qtdyn/
+%endif
 %if "%{with_tools}" == "yes"
     %{l_shtool} install -c -m 644 \
         tools/designer/templates/*.ui $RPM_BUILD_ROOT%{l_prefix}/share/qt/templates/