patch [#26063] Fix deb package versioning (Patch for #26062)
[blender-staging.git] / build_files / package_spec / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 SVN_URL := https://svn.blender.org/svnroot/bf-blender/trunk/blender
5 REV := $(shell dpkg-parsechangelog | sed -rne 's,^Version: .*[+~]svn([0-9]+).*,\1,p')
6 VER := $(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
7 REL := $(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]+\.[0-9]+).*,\1,p')
8 TARBALL = blender_$(VER).orig.tar.gz
9 BLDDIR = debian/cmake
10
11 %:
12         dh $@ -Scmake -B$(BLDDIR) --parallel --with python3 --without python-support
13
14 override_dh_auto_configure:
15         # blender spesific CMake options
16         dh_auto_configure -- \
17                 -DCMAKE_BUILD_TYPE:STRING=Release \
18                 -DWITH_PYTHON_INSTALL:BOOL=OFF \
19                 -DWITH_OPENCOLLADA:BOOL=OFF
20
21 override_dh_install:
22         dh_install
23
24         # remove duplicated docs
25         rm -rf debian/blender-snapshot/usr/share/doc/blender
26
27 override_dh_python3:
28         dh_python3 -V 3.1-3.2 /usr/share/blender/$(REL)/scripts
29
30 get-orig-source:
31         rm -rf get-orig-source $(TARBALL)
32         mkdir get-orig-source
33         svn -q export -r $(REV) $(SVN_URL) get-orig-source/blender-$(VER)
34         GZIP='--best --no-name' tar czf $(TARBALL) -C get-orig-source blender-$(VER)
35         rm -rf get-orig-source
36         @echo "$(TARBALL) created; move it to the right destination to build the package"