From ba6eb1478d24dc32d4e123951e2f62c75b4b88bd Mon Sep 17 00:00:00 2001 From: olibre Date: Tue, 14 Jul 2015 18:40:09 +0200 Subject: Use CPack to generate rpm/deb packages Removed old unmaintained packages/rpm/doxygen.spec.in Provided cmake/packaging.cmake needs tunning on different distributions --- CMakeLists.txt | 3 ++ cmake/packaging.cmake | 78 +++++++++++++++++++++++++++ packages/rpm/doxygen.spec.in | 126 ------------------------------------------- 3 files changed, 81 insertions(+), 126 deletions(-) create mode 100644 cmake/packaging.cmake delete mode 100644 packages/rpm/doxygen.spec.in diff --git a/CMakeLists.txt b/CMakeLists.txt index b0def45..5752044 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,3 +136,6 @@ add_subdirectory(addon/doxywizard) enable_testing() add_subdirectory(testing) + +include(packaging) # set CPACK_xxxx properties +include(CPack) diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake new file mode 100644 index 0000000..40e0710 --- /dev/null +++ b/cmake/packaging.cmake @@ -0,0 +1,78 @@ +# set CPack properties +# This file has been inspired from: +# - http://sourceforge.net/p/klusters/klusters/ci/5a65c7732890d371ca6c74a6167b13c995c54bc3/tree/CMakeLists.txt +# - http://www.cmake.org/Wiki/CMake:CPackPackageGenerators +# - http://www.cmake.org/cmake/help/v3.3/module/CPack.html +# TODO: add doxywizard in package + +set(CPACK_PACKAGE_NAME ${PROJECT_NAME} ) +set(CPACK_PACKAGE_VERSION ${VERSION}) +set(CPACK_PACKAGE_CONTACT "Dimitri van Heesch") +set(CPACK_PACKAGE_VENDOR "Dimitri van Heesch") +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) +set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md) +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Generate documentation from C, C++, Java, Python and other languages") +set(CPACK_PACKAGE_DESCRIPTION "Doxygen is the de facto standard tool for generating documentation from annotated C++ sources. +But it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, Fortran, VHDL, Tcl, D (some extent) and IDL (Corba, Microsoft, and UNO/OpenOffice flavors). + +Doxygen can be used in three ways: + + 1. Generate documentation from annotated source files in various format: on-line documentation (HTML), off-line reference manual (LaTeX), and also: RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. + 2. Extract the code structure from undocumented source files. This is very useful to quickly find your way in large source distributions. Doxygen can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically. + 3. Create normal documentation (as the doxygen user manual and web-site http://doxygen.org/). + +Install the doxygen-latex package to build LaTeX based documents. +Install the libclang1 package to use the 'clang assisted parsing'.") +set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Matthias Klose ") +set(CPACK_RPM_PACKAGE_LICENSE "GPLv2") +set(CPACK_DEBIAN_PACKAGE_SECTION "devel") +set(CPACK_RPM_PACKAGE_GROUP "Development/Tools") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://doxygen.org/") +set(CPACK_RPM_PACKAGE_URL "http://doxygen.org/") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc0.1 (>= 2.17-91) [kfreebsd-amd64, kfreebsd-i386], libc0.3 (>= 2.12) [hurd-i386], libc6 (>= 2.11) [hppa], libc6 (>= 2.14) [amd64], libc6 (>= 2.16) [x32], libc6 (>= 2.17) [arm64, ppc64el], libc6 (>= 2.19) [sh4], libc6 (>= 2.4) [armel, armhf, i386, m68k, mips, mipsel, s390x, sparc64], libc6 (>= 2.6) [powerpc, powerpcspe, ppc64, sparc], libc6.1 (>= 2.4) [alpha], libclang1-3.5 (>= 3.2) [not hppa, hurd-i386, m68k, ppc64, sh4, sparc, sparc64, x32], libgcc1 [x32], libgcc1 (>= 1:4.1.1) [not arm64, armel, armhf, hppa, hurd-i386, m68k, x32], libgcc1 (>= 1:4.4.0) [armel, armhf], libgcc1 (>= 1:4.7) [arm64], libgcc1 (>= 4.2.1) [hurd-i386], libgcc2 (>= 4.2.1) [m68k], libgcc4 (>= 4.1.1) [hppa], libsqlite3-0 (>= 3.6.0) [not ppc64], libstdc++6 [x32], libstdc++6 (>= 4.1.1) [ppc64], libstdc++6 (>= 4.9) [not ppc64, x32], libxapian22 [not ppc64]") +set(CPACK_RPM_PACKAGE_REQUIRES "/sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv, libstdc++ >= 2.96") +set(CPACK_DEBIAN_PACKAGE_SUGGESTS "doxygen-latex, doxygen-doc, doxygen-gui, graphviz, libclang1") +set(CPACK_RPM_PACKAGE_SUGGESTS "doxygen-latex, doxygen-doc, doxygen-gui, graphviz, libclang1") +set(CPACK_DEBIAN_PACKAGE_CONFLICTS "graphviz (<< 1.12)") + +if(WIN32) + set(CPACK_GENERATOR "NSIS") + +elseif(APPLE) + set( CPACK_GENERATOR "ZIP,PackageMaker,Bundle" ) + set( CPACK_DMG_VOLUME_NAME ${PROJECT_NAME} ) + set( CPACK_SYSTEM_NAME "OSX" ) + +elseif(UNIX) + # Determine distribution and release + execute_process(COMMAND lsb_release -si OUTPUT_VARIABLE distribution OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND lsb_release -sc OUTPUT_VARIABLE release OUTPUT_STRIP_TRAILING_WHITESPACE) + #xecute_process(COMMAND uname -i OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND uname -m OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(distribution STREQUAL "Debian" OR distribution STREQUAL "Ubuntu") + set(CPACK_GENERATOR "DEB") + execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) + set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}) + + elseif(distribution MATCHES "openSUSE.*") + set(CPACK_GENERATOR "RPM") + set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${release}.${CPACK_RPM_PACKAGE_ARCHITECTURE}) + + elseif(distribution STREQUAL "Fedora") + set(CPACK_GENERATOR "RPM") + set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.fc${release}.${CPACK_RPM_PACKAGE_ARCHITECTURE}) + + elseif(distribution STREQUAL "Scientific") + set(CPACK_GENERATOR "RPM") + set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${release}.${CPACK_RPM_PACKAGE_ARCHITECTURE}) + + else() + set(CPACK_GENERATOR "RPM;TGZ;STGZ") + set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${release}.${CPACK_RPM_PACKAGE_ARCHITECTURE}) + endif() + +else() + # other operating system (not Windows/Apple/Unix) +endif() diff --git a/packages/rpm/doxygen.spec.in b/packages/rpm/doxygen.spec.in deleted file mode 100644 index f78322a..0000000 --- a/packages/rpm/doxygen.spec.in +++ /dev/null @@ -1,126 +0,0 @@ -%define name doxygen - -# optionally pass --with-doxywizard to rpmbuild - -%define contentdir /var/www -%define suexec_caller doxygen -%define buildroot /var/tmp/%{name}-%{version}-%{revision}root - -Summary: A documentation system for C/C++. -Name: doxygen -Version: %{version} -Release: %{revision} -URL: http://www.stack.nl/~dimitri/doxygen/index.html -Vendor: Dimitri van Heesch -License: GNU General Public License -Group: Development/Tools -Source: %{name}-%{version}.src.tar.gz -BuildRoot: %{buildroot} -BuildRequires: libstdc++-devel >= 2.96, /usr/bin/perl, /usr/bin/latex, /usr/bin/dvips, /usr/bin/gs -Requires: /sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv, libstdc++ >= 2.96 -Provides: doxygen = %{mmn} - -%description -Doxygen can generate an online class browser (in HTML) and/or a -reference manual (in LaTeX) from a set of documented source files. The -documentation is extracted directly from the sources. Doxygen can -also be configured to extract the code structure from undocumented -source files. - -%if %{?_with_doxywizard:1}%{!?_with_doxywizard:0} -%package doxywizard -Group: Development/Libraries -Summary: GUI Interface for doxygen. -Requires: doxygen = %{mmn} -Requires: qt >= 3.3 -Provides: doxywizard = %{mmn} -# Obsoletes: - -%description doxywizard -Doxygen can generate an online class browser (in HTML) and/or a -reference manual (in LaTeX) from a set of documented source files. The -documentation is extracted directly from the sources. Doxygen can -also be configured to extract the code structure from undocumented -source files. - -This is the GUI interface for doxygen. It requires qt and X11 to -install. -%endif - -%if %{?_with_doxysearch:1}%{!?_with_doxysearch:0} -%package doxysearch -Group: Development/Libraries -Summary: external indexer and search engine for doxygen. -Requires: doxygen = %{mmn} -Requires: libxapian-devel >= 1.2 -Provides: doxysearch.cgi = %{mmn} -Provides: doxyindexer = %{mmn} -# Obsoletes: - -%description doxysearch -External indexing and search tools for searching through doxygen -generated HTML documentation. -%endif - -%prep -%setup -q -n %{name}-%{version} -./configure %{?_with_doxywizard} %{?_with_doxysearch} --prefix $RPM_BUILD_ROOT/usr - -%build -make %{?_smp_mflags} -make %{?_smp_mflags} pdf - -%install -rm -rf $RPM_BUILD_ROOT -make install - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) - -%doc README.md LICENSE LANGUAGE.HOWTO examples ./latex/*.pdf -%doc /usr/man/man1/doxygen.1.gz - -%{_bindir}/doxygen - -%if %{?_with_doxywizard:1}%{!?_with_doxywizard:0} -%files doxywizard -%defattr(-,root,root) -%{_bindir}/doxywizard -%doc /usr/man/man1/doxywizard.1.gz -%endif - -%if %{?_with_doxysearch:1}%{!?_with_doxysearch:0} -%files doxysearch -%defattr(-,root,root) -%{_bindir}/doxyindexer -%{_bindir}/doxysearch.cgi -%doc /usr/man/man1/doxyindexer.1.gz -%doc /usr/man/man1/doxysearch.1.gz -%endif - -%changelog -* Tue Dec 25 2012 Dimitri van Heesch 1.8.3 -- added doxyindexer and doxysearch - -* Fri Apr 18 2008 Kenneth Porter 1.5.5-1 -- consolidate with and without doxywizard spec files with rpm macro -- add gs BuildPrereq - -* Sun Nov 18 2007 Kevin McBride 1.5.4 -- consolidated manual package in lieu of --excludedocs flag for rpm --install - -* Mon Oct 10 2005 Kevin McBride 1.4.5 -- fixed versioning bugs. - -* Tue Oct 4 2005 Kevin McBride 1.4.5 -- added obsoletes and proides sections. - -* Sun Sep 20 2005 Kevin McBride 1.4.4 -- modified rpm spec file for Fedora Core acceptance criteria. - -* Sun Aug 7 2005 Kevin McBride 1.4.4 -- created initial rpm spec file for doxygen-1.4.4 - -- cgit v0.12 From 8c0c80e44e1e9cb1ce4e88a3e1d01b65536dc60c Mon Sep 17 00:00:00 2001 From: olibre Date: Tue, 21 Jul 2015 01:39:09 +0200 Subject: Rework the generation of packages DEB/RPM/... (CPack) --- CMakeLists.txt | 2 +- cmake/packaging.cmake | 88 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 59 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5752044..c5f71cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,5 +137,5 @@ add_subdirectory(addon/doxywizard) enable_testing() add_subdirectory(testing) -include(packaging) # set CPACK_xxxx properties +include(cmake/packaging.cmake) # set CPACK_xxxx properties include(CPack) diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake index 40e0710..a85ce33 100644 --- a/cmake/packaging.cmake +++ b/cmake/packaging.cmake @@ -1,48 +1,76 @@ -# set CPack properties -# This file has been inspired from: -# - http://sourceforge.net/p/klusters/klusters/ci/5a65c7732890d371ca6c74a6167b13c995c54bc3/tree/CMakeLists.txt +##### set CPack properties ##### +# +# Good doc/tutorial/example: # - http://www.cmake.org/Wiki/CMake:CPackPackageGenerators # - http://www.cmake.org/cmake/help/v3.3/module/CPack.html -# TODO: add doxywizard in package +# - http://sourceforge.net/p/klusters/klusters/ci/master/tree/CMakeLists.txt +# +# This cmake script should generate same packages (deb,rpm) as: +# - http://mirror.debian.ikoula.com/debian/pool/main/d/doxygen +# - http://archive.ubuntu.com/ubuntu/pool/main/d/doxygen (http://old-releases.ubuntu.com/ubuntu/pool/main/d/doxygen) +# - http://rpmfind.net/linux/rpm2html/search.php?query=doxygen -set(CPACK_PACKAGE_NAME ${PROJECT_NAME} ) -set(CPACK_PACKAGE_VERSION ${VERSION}) -set(CPACK_PACKAGE_CONTACT "Dimitri van Heesch") -set(CPACK_PACKAGE_VENDOR "Dimitri van Heesch") -set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) -set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md) +set(CPACK_STRIP_FILES ON) +set(CPACK_PACKAGE_NAME ${PROJECT_NAME} ) +set(CPACK_PACKAGE_VERSION ${VERSION}) +set(CPACK_PACKAGE_CONTACT "Dimitri van Heesch") +set(CPACK_PACKAGE_VENDOR "Dimitri van Heesch") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Generate documentation from C, C++, Java, Python and other languages") set(CPACK_PACKAGE_DESCRIPTION "Doxygen is the de facto standard tool for generating documentation from annotated C++ sources. -But it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, Fortran, VHDL, Tcl, D (some extent) and IDL (Corba, Microsoft, and UNO/OpenOffice flavors). + But many other popular programming languages are supported: + C, Objective-C, C#, PHP, Java, Python, Fortran, VHDL, Tcl, D (some extent) and IDL (Corba, Microsoft, and UNO/OpenOffice flavors). + . + Three usages: + . + 1. Generate documentation from annotated source files to various format: + - On-line documentation (HTML) + - Off-line reference manual (LaTeX, RTF, PostScript, hyperlinked PDF, compressed HTML, Unix man pages) + . + 2. Extract the code structure from undocumented source files. + Also generate include dependency graphs, inheritance diagrams, and collaboration diagrams. + Useful to quickly understand code organization in large source distributions. + . + 3. Create normal documentation (as the doxygen user manual and web-site http://doxygen.org/) + . + Install the doxygen-latex package to build LaTeX based documents. + Install the libclang1 package to use the 'clang assisted parsing'.") -Doxygen can be used in three ways: +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) +set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md) - 1. Generate documentation from annotated source files in various format: on-line documentation (HTML), off-line reference manual (LaTeX), and also: RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. - 2. Extract the code structure from undocumented source files. This is very useful to quickly find your way in large source distributions. Doxygen can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically. - 3. Create normal documentation (as the doxygen user manual and web-site http://doxygen.org/). - -Install the doxygen-latex package to build LaTeX based documents. -Install the libclang1 package to use the 'clang assisted parsing'.") -set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) -set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Matthias Klose ") +# Variables specific to CPack RPM generator +set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) set(CPACK_RPM_PACKAGE_LICENSE "GPLv2") -set(CPACK_DEBIAN_PACKAGE_SECTION "devel") set(CPACK_RPM_PACKAGE_GROUP "Development/Tools") -set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://doxygen.org/") set(CPACK_RPM_PACKAGE_URL "http://doxygen.org/") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc0.1 (>= 2.17-91) [kfreebsd-amd64, kfreebsd-i386], libc0.3 (>= 2.12) [hurd-i386], libc6 (>= 2.11) [hppa], libc6 (>= 2.14) [amd64], libc6 (>= 2.16) [x32], libc6 (>= 2.17) [arm64, ppc64el], libc6 (>= 2.19) [sh4], libc6 (>= 2.4) [armel, armhf, i386, m68k, mips, mipsel, s390x, sparc64], libc6 (>= 2.6) [powerpc, powerpcspe, ppc64, sparc], libc6.1 (>= 2.4) [alpha], libclang1-3.5 (>= 3.2) [not hppa, hurd-i386, m68k, ppc64, sh4, sparc, sparc64, x32], libgcc1 [x32], libgcc1 (>= 1:4.1.1) [not arm64, armel, armhf, hppa, hurd-i386, m68k, x32], libgcc1 (>= 1:4.4.0) [armel, armhf], libgcc1 (>= 1:4.7) [arm64], libgcc1 (>= 4.2.1) [hurd-i386], libgcc2 (>= 4.2.1) [m68k], libgcc4 (>= 4.1.1) [hppa], libsqlite3-0 (>= 3.6.0) [not ppc64], libstdc++6 [x32], libstdc++6 (>= 4.1.1) [ppc64], libstdc++6 (>= 4.9) [not ppc64, x32], libxapian22 [not ppc64]") set(CPACK_RPM_PACKAGE_REQUIRES "/sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv, libstdc++ >= 2.96") -set(CPACK_DEBIAN_PACKAGE_SUGGESTS "doxygen-latex, doxygen-doc, doxygen-gui, graphviz, libclang1") set(CPACK_RPM_PACKAGE_SUGGESTS "doxygen-latex, doxygen-doc, doxygen-gui, graphviz, libclang1") -set(CPACK_DEBIAN_PACKAGE_CONFLICTS "graphviz (<< 1.12)") + +# Variables specific to CPack DEB generator +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) +set(CPACK_DEBIAN_PACKAGE_SECTION "devel") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://doxygen.org/") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS YES) #set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libclang1-3.6, libgcc1, libsqlite3-0, libstdc++6, libxapian22") +set(CPACK_DEBIAN_PACKAGE_SUGGESTS "doxygen-latex, doxygen-doc, doxygen-gui, graphviz, libclang1") +set(CPACK_DEBIAN_PACKAGE_CONFLICTS "graphviz (<< 1.12)") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Matthias Klose ") # Ubuntu Developers + +# Variables specific to CPack NSIS generator +set(CPACK_NSIS_MUI_ICON ${CMAKE_CURRENT_SOURCE_DIR}/addon/doxywizard/doxywizard.ico) +set(CPACK_NSIS_URL_INFO_ABOUT "http://doxygen.org/") +set(CPACK_NSIS_PACKAGE_NAME ${PROJECT_NAME}) + +# Variables specific to CPack DragNDrop generator +set(CPACK_DMG_FORMAT "UDBZ") # UDRO=UDIF-Read-Only, UDZO=zlib, UDBZ=bzip2 -- See hdiutil +set(CPACK_DMG_VOLUME_NAME ${PROJECT_NAME}) +set(CPACK_DMG_BACKGROUND_IMAGE ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen_logo.eps) if(WIN32) - set(CPACK_GENERATOR "NSIS") + set(CPACK_GENERATOR "ZIP;NSIS") elseif(APPLE) - set( CPACK_GENERATOR "ZIP,PackageMaker,Bundle" ) - set( CPACK_DMG_VOLUME_NAME ${PROJECT_NAME} ) - set( CPACK_SYSTEM_NAME "OSX" ) + set(CPACK_GENERATOR "ZIP;DragNDrop;PackageMaker;Bundle" ) + set(CPACK_SYSTEM_NAME "OSX" ) elseif(UNIX) # Determine distribution and release @@ -54,7 +82,7 @@ elseif(UNIX) if(distribution STREQUAL "Debian" OR distribution STREQUAL "Ubuntu") set(CPACK_GENERATOR "DEB") execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) - set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}) + set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}) elseif(distribution MATCHES "openSUSE.*") set(CPACK_GENERATOR "RPM") -- cgit v0.12