Selaa lähdekoodia

add fontconfig, gd and zlib support; add Perl API; cleanup packaging

Ralf S. Engelschall 21 vuotta sitten
vanhempi
commit
5456e139db
1 muutettua tiedostoa jossa 72 lisäystä ja 8 poistoa
  1. 72 8
      graphviz/graphviz.spec

+ 72 - 8
graphviz/graphviz.spec

@@ -23,6 +23,11 @@
 ##  SUCH DAMAGE.
 ##
 
+#   package versions
+%define       V_graphviz                     2.0
+%define       V_graphviz_perl_base           2.02
+%define       V_graphviz_perl_data_structure 0.12
+
 #   package information
 Name:         graphviz
 Summary:      Graph Visualization Tool
@@ -33,25 +38,34 @@ Distribution: OpenPKG
 Class:        BASE
 Group:        Graphics
 License:      GPL
-Version:      2.0
-Release:      20041214
+Version:      %{V_graphviz}
+Release:      20050114
 
 #   package options
 %option       with_x11   yes
+%option       with_perl  no
 
 #   list of sources
-Source0:      http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-%{version}.tar.gz
+Source0:      http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-%{V_graphviz}.tar.gz
+Source1:      http://www.cpan.org/modules/by-module/GraphViz/GraphViz-%{V_graphviz_perl_base}.tar.gz
+Source2:      http://www.cpan.org/modules/by-module/GraphViz/GraphViz-Data-Structure-%{V_graphviz_perl_data_structure}.tar.gz
 Patch0:       graphviz.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20040130, freetype, png, jpeg, gcc, make, flex, bison
-PreReq:       OpenPKG, openpkg >= 20040130, freetype, png, jpeg
+BuildPreReq:  OpenPKG, openpkg >= 20040130, gcc, make, flex, bison
+PreReq:       OpenPKG, openpkg >= 20040130
+BuildPreReq:  freetype, fontconfig, png, jpeg, gd
+PreReq:       freetype, fontconfig, png, jpeg, gd
 %if "%{with_x11}" == "yes"
 BuildPreReq:  X11
 PreReq:       X11
 %endif
+%if "%{with_perl}" == "yes"
+BuildPreReq:  perl, perl-sys, perl-openpkg
+PreReq:       perl, perl-sys
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -65,28 +79,48 @@ AutoReqProv:  no
 
 %track
     prog graphviz = {
-        version   = %{version}
+        version   = %{V_graphviz}
         url       = http://www.graphviz.org/pub/graphviz/ARCHIVE/
         regex     = graphviz-(\d+\.\d+(\.\d+)*)\.tar.gz
     }
+    prog graphviz:GraphViz = {
+        version   = %{V_graphviz_perl_base}
+        url       = http://www.cpan.org/modules/by-module/GraphViz/
+        regex     = GraphViz-(__VER__)\.tar\.gz
+    }
+    prog graphviz:GraphViz-Data-Structure = {
+        version   = %{V_graphviz_perl_data_structure}
+        url       = http://www.cpan.org/modules/by-module/GraphViz/
+        regex     = GraphViz-Data-Structure-(__VER__)\.tar\.gz
+    }
 
 %prep
     %setup -q
+    %setup -q -D -T -a 1
+    %setup -q -D -T -a 2
     %patch -p0
 
 %build
+    #   configure program
     CC="%{l_cc}" \
     CFLAGS="%{l_cflags -O}" \
+    LDFLAGS="%{l_ldflags}" \
     ./configure \
         --prefix=%{l_prefix} \
         --with-extraincludedir=%{l_prefix}/include \
         --with-extralibdir=%{l_prefix}/lib \
+        --with-fontconfigincludedir=%{l_prefix}/include \
+        --with-fontconfiglibdir=%{l_prefix}/lib \
         --with-freetypeincludedir=%{l_prefix}/include \
         --with-freetypelibdir=%{l_prefix}/lib \
         --with-pngincludedir=%{l_prefix}/include \
         --with-pnglibdir=%{l_prefix}/lib \
         --with-jpegincludedir=%{l_prefix}/include \
         --with-jpeglibdir=%{l_prefix}/lib \
+        --with-gdincludedir=%{l_prefix}/include \
+        --with-gdlibdir=%{l_prefix}/lib \
+        --with-zincludedir=%{l_prefix}/include \
+        --with-zlibdir=%{l_prefix}/lib \
         --without-tclsh \
         --without-wish \
 %if "%{with_x11}" == "yes"
@@ -98,17 +132,47 @@ AutoReqProv:  no
 %endif
         --disable-shared \
         --enable-static
+
+    #   build program
     %{l_make} %{l_mflags}
 
+%if "%{with_perl}" == "yes"
+    #   build Perl API
+    %{l_prefix}/bin/perl-openpkg prepare
+    PATH="`pwd`/dotneato:$PATH"
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} configure build
+%endif
+
 %install
+    #   install program
     rm -rf $RPM_BUILD_ROOT
     %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
-    rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
+
+%if "%{with_perl}" == "yes"
+    #   install Perl API
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} install
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} install
+    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
+%endif
+
+    #   post-adjust installation
+    mv $RPM_BUILD_ROOT%{l_prefix}/lib/graphviz/pkgconfig \
+       $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/graphviz/*.tcl
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/graphviz/doc/html
 %if "%{with_x11}" != "yes"
     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/graphviz/lefty
 %endif
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
-    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+
+    #   determine installation files
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+%if "%{with_perl}" == "yes"
+        `cat perl-openpkg-files` \
+%endif
+        '%doc %{l_prefix}/share/graphviz/doc/pdf/*'
 
 %files -f files