patch from Dan Eicher, CPack/RPM working again
authorCampbell Barton <ideasman42@gmail.com>
Fri, 6 May 2011 23:59:15 +0000 (23:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 6 May 2011 23:59:15 +0000 (23:59 +0000)
build_files/cmake/packaging.cmake
build_files/package_spec/rpm/blender.spec.in [new file with mode: 0644]

index ee07857db260552f56a83f3bb26d7bcf251d6b97..07c5add52b007f69daecd8cda45a20a00ff0cc1f 100644 (file)
@@ -31,17 +31,20 @@ set(BUILD_REV ${MY_WC_REVISION})
 
 
 # Force Package Name
-set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
+set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CMAKE_SYSTEM_PROCESSOR})
 
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
        # RPM packages
        include(build_files/cmake/RpmBuild.cmake)
        if(RPMBUILD_FOUND AND NOT WIN32)
                set(CPACK_GENERATOR "RPM")
-               set(CPACK_SET_DESTDIR TRUE)
+               set(CPACK_RPM_PACKAGE_RELEASE "r${BUILD_REV}")
+               set(CPACK_SET_DESTDIR "true")
                set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
+               set(CPACK_PACKAGE_RELOCATABLE "false")
                set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
                set(CPACK_RPM_PACKAGE_GROUP "Amusements/Graphics")
+               set(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_SOURCE_DIR}/build_files/package_spec/rpm/blender.spec.in")
        endif()
 endif()
 
diff --git a/build_files/package_spec/rpm/blender.spec.in b/build_files/package_spec/rpm/blender.spec.in
new file mode 100644 (file)
index 0000000..32c9ef9
--- /dev/null
@@ -0,0 +1,69 @@
+# -*- rpm-spec -*-
+%global __python %{__python3}
+
+BuildRoot:      @CPACK_RPM_DIRECTORY@/@CPACK_PACKAGE_FILE_NAME@@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH@
+Summary:        @CPACK_RPM_PACKAGE_SUMMARY@
+Name:           @CPACK_RPM_PACKAGE_NAME@
+Version:        @CPACK_RPM_PACKAGE_VERSION@
+Release:        @CPACK_RPM_PACKAGE_RELEASE@
+License:        @CPACK_RPM_PACKAGE_LICENSE@
+Group:          @CPACK_RPM_PACKAGE_GROUP@
+Vendor:         @CPACK_RPM_PACKAGE_VENDOR@
+
+%define _rpmdir @CPACK_RPM_DIRECTORY@
+%define _rpmfilename @CPACK_RPM_FILE_NAME@
+%define _unpackaged_files_terminate_build 0
+%define _topdir @CPACK_RPM_DIRECTORY@
+
+%description
+Blender is an integrated 3d suite for modelling, animation, rendering,
+post-production, interactive creation and playback (games). Blender has its
+own particular user interface, which is implemented entirely in OpenGL and
+designed with speed in mind. Python bindings are available for scripting;
+import/export features for popular file formats like 3D Studio and Wavefront
+Obj are implemented as scripts by the community. Stills, animations, models
+for games or other third party engines and interactive content in the form of
+a standalone binary and/or a web plug-in are common products of Blender use.
+
+# This is a shortcutted spec file generated by CMake RPM generator
+# we skip _install step because CPack does that for us.
+# We do only save CPack installed tree in _prepr
+# and then restore it in build.
+%prep
+mv ${RPM_BUILD_ROOT} "@CPACK_TOPLEVEL_DIRECTORY@/tmpBBroot"
+
+%install
+if [ -e ${RPM_BUILD_ROOT} ];
+then
+  rm -rf ${RPM_BUILD_ROOT}
+fi
+mv "@CPACK_TOPLEVEL_DIRECTORY@/tmpBBroot" ${RPM_BUILD_ROOT}
+
+%clean
+rm -rf ${RPM_BUILD_ROOT}
+
+%post
+touch --no-create %{_datadir}/icons/hicolor
+if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
+fi 
+%{_bindir}/update-desktop-database %{_datadir}/applications || :
+
+%postun
+%{_bindir}/update-desktop-database %{_datadir}/applications
+touch --no-create %{_datadir}/icons/hicolor
+if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
+fi || :
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/%{name}
+%{_datadir}/%{name}/@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@
+%{_datadir}/icons/hicolor/*/apps/%{name}.*
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/doc/blender
+%{_mandir}/man1/blender.*
+
+%changelog
+@CPACK_RPM_SPEC_CHANGELOG@