]> git.saurik.com Git - apt.git/commitdiff
avoid building simple packages with debhelper to speed it up a bit
authorDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 21 Jan 2011 21:03:42 +0000 (22:03 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 21 Jan 2011 21:03:42 +0000 (22:03 +0100)
test/integration/framework
test/integration/test-compressed-indexes

index f55cfddfab854ce6b1bb51bf9f0450d8a32ef985..5b83e7519e33ab719dfea627f34f9fd7263b8037 100644 (file)
@@ -219,9 +219,53 @@ buildsimplenativepackage() {
        else
                DISTSECTION="$(echo "$SECTION" | cut -d'/' -f 1)"
        fi
-       setupsimplenativepackage "$NAME" "$ARCH" "$VERSION" "$RELEASE" "$DEPENDENCIES" "$DESCRIPTION" "$SECTION"
-       buildpackage "incoming/${NAME}-${VERSION}" "$RELEASE" "$DISTSECTION"
+       local BUILDDIR=incoming/${NAME}-${VERSION}
+
+       msgninfo "Build package ${NAME} in ${VERSIOM} for ${RELEASE} in ${DISTSECTION}… "
+       mkdir -p $BUILDDIR/debian/source
+       echo "* most suckless software product ever" > ${BUILDDIR}/FEATURES
+       echo "#!/bin/sh
+echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME}
+
+       echo "Copyleft by Joe Sixpack $(date +%Y)" > ${BUILDDIR}/debian/copyright
+       echo "$NAME ($VERSION) $RELEASE; urgency=low
+
+  * Initial release
+
+ -- Joe Sixpack <joe@example.org>  $(date -R)" > ${BUILDDIR}/debian/changelog
+       echo "Source: $NAME
+Section: $SECTION
+Priority: optional
+Maintainer: Joe Sixpack <joe@example.org>
+Standards-Version: 3.9.1
+
+Package: $NAME
+Architecture: $ARCH" > ${BUILDDIR}/debian/control
+       test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> ${BUILDDIR}/debian/control
+       if [ -z "$DESCRIPTION" ]; then
+               echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
+ If you find such a package installed on your system,
+ YOU did something horribly wrong! They are autogenerated
+ und used only by testcases for APT and surf no other propose…" >> ${BUILDDIR}/debian/control
+       else
+               echo "Description: $DESCRIPTION" >> ${BUILDIR}/debian/control
+       fi
+       echo '3.0 (native)' > ${BUILDDIR}/debian/source/format
+       local SRCS="$( (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')"
+
+       mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin
+       cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME}
+       cp ${BUILDDIR}/${NAME} ${BUILDDIR}/debian/tmp/usr/bin
+       (cd ${BUILDDIR}; dpkg-gencontrol)
+       (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums)
+
+       dpkg-deb --build ${BUILDDIR}/debian/tmp incoming > /dev/null
+       echo "pool/${NAME}_${VERSION}_${ARCH}.deb" >> incoming/${RELEASE}.${DISTSECTION}.pkglist
+       for SRC in $SRCS; do
+               echo "pool/${SRC}" >> incoming/${RELEASE}.${DISTSECTION}.srclist
+       done
        rm -rf "incoming/${NAME}-${VERSION}"
+       msgdone "info"
 }
 
 buildpackage() {
index be33edbb79793060a3a827a8729b8abb24e0f091..99943574e1b621682ca490be5bdb6553c17602ee 100755 (executable)
@@ -16,11 +16,11 @@ local GOODPOLICY="$(aptcache policy testpkg)"
 local GOODSHOWSRC="$(aptcache showsrc testpkg)
 "
 
-test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3
+test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken'
 testequal "$GOODSHOW" aptcache show testpkg
-test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^  Candidate:' -e '^  Installed: (none)' -e '500 file:/' | wc -l) -eq 4
+test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^  Candidate:' -e '^  Installed: (none)' -e '500 file:/' | wc -l) -eq 4 || msgdie 'policy is broken'
 testequal "$GOODPOLICY" aptcache policy testpkg
-test $(echo "$GOODSHOWSRC" | grep -e '^Package: testpkg' -e '^Format: 3.0 (native)' -e '^Files:' -e '^Checksums-Sha256:' | wc -l) -eq 4
+test $(echo "$GOODSHOWSRC" | grep -e '^Package: testpkg' -e '^Format: 3.0 (native)' -e '^Files:' -e '^Checksums-Sha256:' | wc -l) -eq 4 || msgdie 'showsrc is broken'
 testequal "$GOODSHOWSRC" aptcache showsrc testpkg