chiark / gitweb /
allow debian cross compilation to i386 or amd64 deb packages
authorhg42@gmx.net <hg42@gmx.net>
Fri, 17 Jan 2014 18:33:18 +0000 (19:33 +0100)
committerhg42@gmx.net <hg42@gmx.net>
Fri, 17 Jan 2014 18:33:18 +0000 (19:33 +0100)
package.sh
scripts/linux/debian/usr/bin/cura [deleted file]
scripts/linux/debian/usr/share/applications/cura.desktop [deleted file]
scripts/linux/debian_amd64/DEBIAN/control [new file with mode: 0644]
scripts/linux/debian_amd64/DEBIAN/postinst [moved from scripts/linux/debian/DEBIAN/postinst with 100% similarity, mode: 0644]
scripts/linux/debian_i386/DEBIAN/control [moved from scripts/linux/debian/DEBIAN/control with 100% similarity, mode: 0644]
scripts/linux/debian_i386/DEBIAN/postinst [new file with mode: 0644]

index 14d3009f6a1279a7240cb9ec759fbc7b5c533d0b..c5414c63d0d4cec7916c7908658e60db131a961e 100755 (executable)
@@ -12,7 +12,8 @@ BUILD_TARGET=${1:-all}
 #BUILD_TARGET=win32
 #BUILD_TARGET=linux
 #BUILD_TARGET=darwin
-#BUILD_TARGET=debian
+#BUILD_TARGET=debian_i386
+#BUILD_TARGET=debian_amd64
 
 ##Do we need to create the final archive
 ARCHIVE_FOR_DISTRIBUTION=1
@@ -139,10 +140,11 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
 fi
 
 #############################
-# Debian .deb
+# Debian 32bit .deb
 #############################
 
-if [ "$BUILD_TARGET" = "debian" ]; then
+if [ "$BUILD_TARGET" = "debian_i386" ]; then
+        export CXX="g++ -m32"
        if [ ! -d "Power" ]; then
                git clone https://github.com/GreatFruitOmsk/Power
        else
@@ -153,22 +155,55 @@ if [ "$BUILD_TARGET" = "debian" ]; then
        rm -rf CuraEngine
        git clone ${CURA_ENGINE_REPO}
        make -C CuraEngine
-       rm -rf scripts/linux/debian/usr/share/cura
-       mkdir -p scripts/linux/debian/usr/share/cura
-       cp -a Cura scripts/linux/debian/usr/share/cura/
-       cp -a CuraEngine/CuraEngine scripts/linux/debian/usr/share/cura/
-       cp scripts/linux/cura.py scripts/linux/debian/usr/share/cura/
-       cp -a Power/power scripts/linux/debian/usr/share/cura/
-       echo $BUILD_NAME > scripts/linux/debian/usr/share/cura/Cura/version
-       sudo chown root:root scripts/linux/debian -R
-       sudo chmod 755 scripts/linux/debian/usr -R
-       sudo chmod 755 scripts/linux/debian/DEBIAN -R
+       rm -rf scripts/linux/${BUILD_TARGET}/usr/share/cura
+       mkdir -p scripts/linux/${BUILD_TARGET}/usr/share/cura
+       cp -a Cura scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       cp -a CuraEngine/CuraEngine scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       cp scripts/linux/cura.py scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       cp -a Power/power scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       echo $BUILD_NAME > scripts/linux/${BUILD_TARGET}/usr/share/cura/Cura/version
+       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 debian ${TARGET_DIR}.deb
-       sudo chown `id -un`:`id -gn` debian -R
+       dpkg-deb --build ${BUILD_TARGET} $(dirname ${TARGET_DIR})/cura_${BUILD_NAME}-${BUILD_TARGET}.deb
+       sudo chown `id -un`:`id -gn` ${BUILD_TARGET} -R
        exit
 fi
 
+#############################
+# Debian 64bit .deb
+#############################
+
+if [ "$BUILD_TARGET" = "debian_amd64" ]; then
+        export CXX="g++ -m64"
+       if [ ! -d "Power" ]; then
+               git clone https://github.com/GreatFruitOmsk/Power
+       else
+               cd Power
+               git pull
+               cd ..
+       fi
+       rm -rf CuraEngine
+       git clone ${CURA_ENGINE_REPO}
+       make -C CuraEngine
+       rm -rf scripts/linux/${BUILD_TARGET}/usr/share/cura
+       mkdir -p scripts/linux/${BUILD_TARGET}/usr/share/cura
+       cp -a Cura scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       cp -a CuraEngine/CuraEngine scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       cp scripts/linux/cura.py scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       cp -a Power/power scripts/linux/${BUILD_TARGET}/usr/share/cura/
+       echo $BUILD_NAME > scripts/linux/${BUILD_TARGET}/usr/share/cura/Cura/version
+       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_NAME}-${BUILD_TARGET}.deb
+       sudo chown `id -un`:`id -gn` ${BUILD_TARGET} -R
+       exit
+fi
+
+
 #############################
 # Rest
 #############################
diff --git a/scripts/linux/debian/usr/bin/cura b/scripts/linux/debian/usr/bin/cura
deleted file mode 100755 (executable)
index bd9ef0e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-PYTHONPATH=$PYTHONPATH:/usr/share/cura/ /usr/bin/python /usr/share/cura/cura.py "$@"
diff --git a/scripts/linux/debian/usr/share/applications/cura.desktop b/scripts/linux/debian/usr/share/applications/cura.desktop
deleted file mode 100755 (executable)
index 23ff2d1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Cura
-Comment=Cura
-Icon=/usr/share/cura/Cura/resources/images/c.png
-Exec=/usr/bin/python /usr/share/cura/cura.py
-Path=/usr/share/cura/
-StartupNotify=true
-Terminal=false
-Categories=GNOME;GTK;Utility;
diff --git a/scripts/linux/debian_amd64/DEBIAN/control b/scripts/linux/debian_amd64/DEBIAN/control
new file mode 100644 (file)
index 0000000..eff3886
--- /dev/null
@@ -0,0 +1,14 @@
+Package: cura
+Version: 14.01
+Section: misc
+Priority: optional
+Architecture: amd64
+Essential: no
+Depends: python-wxgtk2.8, python-opengl, python-serial, python-numpy
+Maintainer: Daid <daid303@gmail.com>
+Provides: cura
+Installed-Size: 10000
+Description: Cura is a full software solution for 3D printing,
+ aimed at RepRaps and the Ultimaker. It's free software payed for
+ and maintained by Ultimaker.
+
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from scripts/linux/debian/DEBIAN/postinst
rename to scripts/linux/debian_amd64/DEBIAN/postinst
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from scripts/linux/debian/DEBIAN/control
rename to scripts/linux/debian_i386/DEBIAN/control
diff --git a/scripts/linux/debian_i386/DEBIAN/postinst b/scripts/linux/debian_i386/DEBIAN/postinst
new file mode 100644 (file)
index 0000000..1a24852
--- /dev/null
@@ -0,0 +1 @@
+#!/bin/sh