Переглянути джерело

integrate apt4rpm stuff (still fully untested under run-time)

Ralf S. Engelschall 22 роки тому
батько
коміт
c3da906a7c
1 змінених файлів з 76 додано та 36 видалено
  1. 76 36
      apt/apt.spec

+ 76 - 36
apt/apt.spec

@@ -23,6 +23,11 @@
 ##  SUCH DAMAGE.
 ##
 
+#   package version
+%define       V_apt_base 0.5.15
+%define       V_apt_rev  3
+%define       V_apt4rpm  0.65.3
+
 #   package information
 Name:         apt
 Summary:      Advanced Packaging Tool
@@ -32,13 +37,14 @@ Packager:     The OpenPKG Project
 Distribution: OpenPKG [EVAL]
 Group:        Bootstrapping
 License:      GPL
-Version:      0.5.15cnc3
+Version:      %{V_apt_base}.%{V_apt_rev}
 Release:      20031128
 
 #   list of sources
-Source0:      http://moin.conectiva.com.br/files/AptRpm/attachments/apt-%{version}.tar.bz2
-Source1:      apt.conf
-Source2:      rpmpriorities
+Source0:      http://moin.conectiva.com.br/files/AptRpm/attachments/apt-%{V_apt_base}cnc%{V_apt_rev}.tar.bz2
+Source1:      http://osdn.dl.sourceforge.net/sourceforge/apt4rpm/apt4rpm-%{V_apt4rpm}.tar.bz2
+Source2:      apt.conf
+Source3:      rpmpriorities
 Patch0:       apt.patch
 
 #   build information
@@ -57,7 +63,9 @@ AutoReqProv:  no
     Dependencies are automatically handled.
 
 %prep
-    %setup -q
+    %setup -q -c
+    %setup -q -T -D -a 1
+    cd apt-%{V_apt_base}cnc%{V_apt_rev}
     %patch -p0 -P 0
 
     #   replace hard-coded paths with OpenPKG ones
@@ -77,40 +85,70 @@ AutoReqProv:  no
     %{l_prefix}/bin/autoconf
 
 %build
-    #   configure package
-    defines="-DOLD_FLATSCHEME"
-    case "%{l_platform -t}" in
-        *sunos* ) defines="$defines -DOPENPKG_SOLARIS" ;;
-    esac
-    CC="%{l_cc}" \
-    CPPFLAGS="%{l_cppflags} `%{l_prefix}/bin/rpm-config --cppflags` $defines" \
-    CFLAGS="%{l_cflags} `%{l_prefix}/bin/rpm-config --cflags`" \
-    LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/rpm-config --ldflags`" \
-    ./configure \
-        --prefix=%{l_prefix} \
-        --libdir=%{l_prefix}/lib/apt \
-        --localstatedir=%{l_prefix}/var/apt \
-        --disable-shared \
-        --enable-static \
-        --disable-nls \
-        --disable-docs
-
-    #   disable localization stuff
-    %{l_shtool} subst \
-        -e 's;^POFILES =.*$;POFILES =;g' \
-        -e 's;^GMOFILES =.*$;GMOFILES =;g' \
-        -e 's;^DUMMYPOFILES =.*$;DUMMYPOFILES =;g' \
-        -e 's;^CATALOGS =.*$;CATALOGS =;g' \
-        po/Makefile
-
-    #   build package
-    %{l_make} %{l_mflags}
+    #   configure and build Apt base package
+    ( cd apt-%{V_apt_base}cnc%{V_apt_rev}
+      #   configure package
+      defines="-DOLD_FLATSCHEME"
+      case "%{l_platform -t}" in
+          *sunos* ) defines="$defines -DOPENPKG_SOLARIS" ;;
+      esac
+      CC="%{l_cc}" \
+      CPPFLAGS="%{l_cppflags} `%{l_prefix}/bin/rpm-config --cppflags` $defines" \
+      CFLAGS="%{l_cflags} `%{l_prefix}/bin/rpm-config --cflags`" \
+      LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/rpm-config --ldflags`" \
+      ./configure \
+          --prefix=%{l_prefix} \
+          --libdir=%{l_prefix}/lib/apt \
+          --localstatedir=%{l_prefix}/var/apt \
+          --disable-shared \
+          --enable-static \
+          --disable-nls \
+          --disable-docs
+
+      #   disable localization stuff
+      %{l_shtool} subst \
+          -e 's;^POFILES =.*$;POFILES =;g' \
+          -e 's;^GMOFILES =.*$;GMOFILES =;g' \
+          -e 's;^DUMMYPOFILES =.*$;DUMMYPOFILES =;g' \
+          -e 's;^CATALOGS =.*$;CATALOGS =;g' \
+          po/Makefile
+
+      #   build package
+      %{l_make} %{l_mflags}
+    ) || exit $?
+
+    #   configure and build Apt4RPM add-on package
+    ( cd apt4rpm-%{V_apt4rpm}
+      %{l_shtool} subst \
+          -e 's;/${PACKAGE};;' \
+          configure
+      PATH="@l_prefix@/lib/openpkg:$PATH"
+      ./configure \
+          --prefix=%{l_prefix} \
+          --libdir=%{l_prefix}/lib/apt \
+          --enable-docs=no
+      %{l_make} %{l_mflags}
+    ) || exit $?
 
 %install
     rm -rf $RPM_BUILD_ROOT
 
-    #   install package
-    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
+    #   install Apt base package
+    ( cd apt-%{V_apt_base}cnc%{V_apt_rev}
+      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
+    ) || exit $?
+
+    #   install Apt4RPM add-on package
+    ( cd apt4rpm-%{V_apt4rpm}
+      %{l_shtool} subst \
+          -e 's;$(MAKE) $(AM_MAKEFLAGS) install-data-hook;true;' \
+          Makefile
+      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
+    ) || exit $?
+
+    #   remove unnecessary files
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/apt4rpm
 
     #   remove file that conflicts with 'grep' package
     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
@@ -133,7 +171,9 @@ AutoReqProv:  no
     strip $RPM_BUILD_ROOT%{l_prefix}/lib/apt/methods/* >/dev/null 2>&1 || true
 
     #   determine installation files
-    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%config %{l_prefix}/etc/apt/*'
 
 %files -f files