Small cleanup in DLEP code to make sure session cleanup does not block
[oonf.git] / files / create_debian_package.sh
index 12634ad..30d40db 100755 (executable)
@@ -30,6 +30,7 @@ fi
 # calculate version and tarball names
 VERSION=`git describe --abbrev=0| sed -e "s/^v//"`
 FULLVERSION=`git describe`
+VERSIONCOUNT=`git rev-list v${VERSION}..HEAD --count`
 
 TARPREFIX=${TARGET}_${VERSION}
 TARBALL=${BUILDDIR}/${TARPREFIX}.orig.tar.gz
@@ -41,12 +42,18 @@ then
     exit 1
 fi
 
-if [ ! -f ${SOURCE}/src/${TARGET}/debian_changelog ]
+if [ ! -f ${SOURCE}/src/${TARGET}/debian/changelog ]
 then
     echo "Could not find target '${TARGET}' debian changelog"
     exit 1
 fi
 
+if [ ! -f ${SOURCE}/src/${TARGET}/debian/control ]
+then
+    echo "Could not find target '${TARGET}' debian control file"
+    exit 1
+fi
+
 # create clean build directory
 if [ -d ${BUILDDIR} ]
 then
@@ -74,22 +81,17 @@ tar xf ${TARBALL}
 # build debian directory from template
 cd ${TARPREFIX}
 
-cp ${SOURCE}/src/${TARGET}/debian_changelog ./debian/changelog
-cp ${SOURCE}/src/${TARGET}/debian_control ./debian/control
+cp -r ${SOURCE}/src/${TARGET}/debian ./
 cp ${SOURCE}/files/default_licence.txt ./debian/copyright
 
 # adapt changelog template
-sed -i  -e "s@SHORTVERSION@${VERSION}@" \
-        -e "s@FULLVERSION@${FULLVERSION}@" \
-        -e "s@DATETIME@`date -R`@" \
-        ./debian/changelog
+sed -i -e "s@SHORTVERSION@${VERSION}-${VERSIONCOUNT}@" \
+       -e "s@FULLVERSION@${FULLVERSION}@" \
+       -e "s@DATETIME@`date -R`@" \
+       ./debian/changelog
 
 # adapt rules template
-sed -i  -e "s@SOURCEDIR@${BUILDDIR}/${TARPREFIX}@" \
-        -e "s@SOURCETOOLCHAIN@${TOOLCHAIN}@" \
-        -e "s@TARGETNAME@${TARGET}@" \
-        -e "s@INSTALLDESTDIR@${BUILDDIR}/${TARPREFIX}/debian/${TARGET}@" \
-        ./debian/rules
+sed -i -e "s@SOURCETOOLCHAIN@${TOOLCHAIN}@" ./debian/rules
 
 # create debian package
 debuild -us -uc ${ARCH}