chiark / gitweb /
Look for CuraEngine in ..../CuraEngine/build/CuraEngine[.exe]
[cura.git] / package.sh
index 50330ac39cb815d4530136f570e0d70d7d4fed1b..06cd8a3b94294e2b2e17a285af0bed016baad03b 100755 (executable)
@@ -268,12 +268,14 @@ if [ "$BUILD_TARGET" = "debian_i386" ]; then
        cp -a Power/power scripts/linux/${BUILD_TARGET}/usr/share/cura/
        echo $BUILD_VERSION > scripts/linux/${BUILD_TARGET}/usr/share/cura/Cura/version
        cat scripts/linux/debian_control | sed "s/\[BUILD_VERSION\]/${FULL_VERSION}/" | sed 's/\[ARCH\]/i386/' > scripts/linux/${BUILD_TARGET}/DEBIAN/control
-       sudo chown root:root scripts/linux/${BUILD_TARGET} -R
-       sudo chmod 755 scripts/linux/${BUILD_TARGET}/usr -R
-       sudo chmod 755 scripts/linux/${BUILD_TARGET}/DEBIAN -R
-       cd scripts/linux
-       dpkg-deb -Zgzip --build ${BUILD_TARGET} $(dirname ${TARGET_DIR})/cura_${FULL_VERSION}_i386.deb
-       sudo chown `id -un`:`id -gn` ${BUILD_TARGET} -R
+       fakeroot sh -ec "
+        chown root:root scripts/linux/${BUILD_TARGET} -R
+        chmod 755 scripts/linux/${BUILD_TARGET}/usr -R
+        chmod 755 scripts/linux/${BUILD_TARGET}/DEBIAN -R
+        cd scripts/linux
+        dpkg-deb -Zgzip --build ${BUILD_TARGET} $(dirname ${TARGET_DIR})/cura_${FULL_VERSION}_i386.deb
+        chown `id -un`:`id -gn` ${BUILD_TARGET} -R
+        "
        exit
 fi
 
@@ -298,12 +300,14 @@ if [ "$BUILD_TARGET" = "debian_amd64" ]; then
        cp -a Power/power scripts/linux/${BUILD_TARGET}/usr/share/cura/
        echo $BUILD_VERSION > scripts/linux/${BUILD_TARGET}/usr/share/cura/Cura/version
        cat scripts/linux/debian_control | sed "s/\[BUILD_VERSION\]/${FULL_VERSION}/" | sed 's/\[ARCH\]/amd64/' > scripts/linux/${BUILD_TARGET}/DEBIAN/control
-       sudo chown root:root scripts/linux/${BUILD_TARGET} -R
-       sudo chmod 755 scripts/linux/${BUILD_TARGET}/usr -R
-       sudo chmod 755 scripts/linux/${BUILD_TARGET}/DEBIAN -R
-       cd scripts/linux
-       dpkg-deb -Zgzip --build ${BUILD_TARGET} $(dirname ${TARGET_DIR})/cura_${FULL_VERSION}_amd64.deb
-       sudo chown `id -un`:`id -gn` ${BUILD_TARGET} -R
+       fakeroot sh -ec "
+        chown root:root scripts/linux/${BUILD_TARGET} -R
+        chmod 755 scripts/linux/${BUILD_TARGET}/usr -R
+        chmod 755 scripts/linux/${BUILD_TARGET}/DEBIAN -R
+        cd scripts/linux
+        dpkg-deb -Zgzip --build ${BUILD_TARGET} $(dirname ${TARGET_DIR})/cura_${FULL_VERSION}_amd64.deb
+        chown `id -un`:`id -gn` ${BUILD_TARGET} -R
+       "
        exit
 fi
 
@@ -328,12 +332,14 @@ if [ "$BUILD_TARGET" = "debian_armhf" ]; then
        cp -a Power/power scripts/linux/${BUILD_TARGET}/usr/share/cura/
        echo $BUILD_VERSION > scripts/linux/${BUILD_TARGET}/usr/share/cura/Cura/version
        cat scripts/linux/debian_control | sed "s/\[BUILD_VERSION\]/${FULL_VERSION}/" | sed 's/\[ARCH\]/armhf/' > scripts/linux/${BUILD_TARGET}/DEBIAN/control
-       sudo chown root:root scripts/linux/${BUILD_TARGET} -R
-       sudo chmod 755 scripts/linux/${BUILD_TARGET}/usr -R
-       sudo chmod 755 scripts/linux/${BUILD_TARGET}/DEBIAN -R
-       cd scripts/linux
-       dpkg-deb --build ${BUILD_TARGET} $(dirname ${TARGET_DIR})/cura_${BUILD_VERSION}-${BUILD_TARGET}.deb
-       sudo chown `id -un`:`id -gn` ${BUILD_TARGET} -R
+       fakeroot sh -ec "
+        chown root:root scripts/linux/${BUILD_TARGET} -R
+        chmod 755 scripts/linux/${BUILD_TARGET}/usr -R
+        chmod 755 scripts/linux/${BUILD_TARGET}/DEBIAN -R
+        cd scripts/linux
+        dpkg-deb --build ${BUILD_TARGET} $(dirname ${TARGET_DIR})/cura_${BUILD_VERSION}-${BUILD_TARGET}.deb
+        chown `id -un`:`id -gn` ${BUILD_TARGET} -R
+       "
        exit
 fi
 
@@ -439,7 +445,9 @@ function buildFedora() {
     fi
 
     mkdir -pv "$_dstRpmDir/$_mockRelease"
-    mock \
+    # Need to use /usr/bin/mock because depending on $PATH, if /usr/sbin/mock is
+    # run instead, it will give an error.
+    /usr/bin/mock \
       $_mockReleaseArg \
       --resultdir="$_dstRpmDir/$_mockRelease" \
       "$_srpmFile"