From 0807c2fdfea2901ba20650a7e062d1197e31a4a6 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 20 Mar 2015 13:49:52 +0300 Subject: [PATCH] Add a native Debian package. --- .gitignore | 8 +++++ CMakeLists.txt | 4 +++ debian/changelog | 5 +++ debian/compat | 1 + debian/control | 53 ++++++++++++++++++++++++++++++++ debian/copyright | 33 ++++++++++++++++++++ debian/docs | 1 + debian/libslvs1-dev.install | 1 + debian/libslvs1.install | 1 + debian/menu | 7 +++++ debian/rules | 18 +++++++++++ debian/solvespace.install | 3 ++ debian/solvespace.sharedmimeinfo | 8 +++++ debian/source/format | 1 + debian/source/options | 3 ++ src/CMakeLists.txt | 2 +- 16 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100644 debian/libslvs1-dev.install create mode 100644 debian/libslvs1.install create mode 100644 debian/menu create mode 100755 debian/rules create mode 100644 debian/solvespace.install create mode 100644 debian/solvespace.sharedmimeinfo create mode 100644 debian/source/format create mode 100644 debian/source/options diff --git a/.gitignore b/.gitignore index a00d07b1..a511f80a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,11 @@ /CMakeCache.txt /cbuild/ *.trace # OpenGL apitrace files +/debian/tmp/ +/debian/*.log +/debian/*.substvars +/debian/files +/debian/solvespace/ +/debian/libslvs1/ +/debian/libslvs1-dev/ +/obj-*/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 803a67ce..4535bb6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,10 @@ if(WIN32) -DWIN32_LEAN_AND_MEAN=1) endif() +if((CMAKE_CXX_PLATFORM_ID STREQUAL "Linux") AND CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_EXE_LINKER_FLAGS}") +endif() + # dependencies CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..a561717c --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +solvespace (2.1) unstable; urgency=low + + * Initial Release. + + -- whitequark Fri, 20 Mar 2015 12:39:28 +0300 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..62d0cb0d --- /dev/null +++ b/debian/control @@ -0,0 +1,53 @@ +Source: solvespace +Section: graphics +Priority: optional +Maintainer: whitequark +Build-Depends: debhelper (>= 9), cmake, libpng12-dev, zlib1g-dev, libjson-c-dev, + libfontconfig1-dev, libgtkmm-2.4-dev, libpangomm-1.4-dev, + libgl-dev, libglu-dev, libglew-dev, + libgd-perl +Standards-Version: 3.9.5 +Homepage: http://solvespace.com +Vcs-Git: git://github.com/whitequark/solvespace +Vcs-Browser: https://github.com/whitequark/solvespace + +Package: solvespace +Architecture: any +Multi-Arch: foreign +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: SolveSpace is a parametric 2d/3d CAD + SolveSpace is a parametric 2d/3d CAD program. Applications include: + . + * modeling 3d parts — draw with extrudes, revolves, and Boolean + (union / difference) operations; + * modeling 2d parts — draw the part as a single section, and export DXF, + PDF, SVG; use 3d assembly to verify fit; + * 3d-printed parts — export the STL or other triangle mesh expected by + most 3d printers; + * preparing CAM data — export 2d vector art for a waterjet machine or + laser cutter; or generate STEP or STL, for import into third-party + CAM software for machining; + * mechanism design — use the constraint solver to simulate planar or + spatial linkages, with pin, ball, or slide joints; + * plane and solid geometry — replace hand-solved trigonometry and + spreadsheets with a live dimensioned drawing. + +Package: libslvs1 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: SolveSpace geometric kernel + SolveSpace is a parametric 2d/3d CAD. libslvs contains the geometric + kernel of SolveSpace, built as a library. + +Package: libslvs1-dev +Section: libs +Architecture: any +Multi-Arch: same +Depends: libslvs1, ${misc:Depends} +Description: SolveSpace geometric kernel (development files) + SolveSpace is a parametric 2d/3d CAD. libslvs contains the geometric + kernel of SolveSpace, built as a library. + . + This package includes development files for libslvs. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..8740eb7a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,33 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: solvespace +Source: https://github.com/whitequark/solvespace + +Files: * +Copyright: 2008-2013 Jonathan Westhues. +License: GPL-3.0+ + +Files: debian/* +Copyright: 2015 Peter Zotov +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. +# Please avoid to pick license terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..9b1f1bc0 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +COPYING.txt diff --git a/debian/libslvs1-dev.install b/debian/libslvs1-dev.install new file mode 100644 index 00000000..7adf7a61 --- /dev/null +++ b/debian/libslvs1-dev.install @@ -0,0 +1 @@ +usr/include/slvs.h diff --git a/debian/libslvs1.install b/debian/libslvs1.install new file mode 100644 index 00000000..0869500e --- /dev/null +++ b/debian/libslvs1.install @@ -0,0 +1 @@ +usr/lib/**/libslvs.so* diff --git a/debian/menu b/debian/menu new file mode 100644 index 00000000..d8b2603e --- /dev/null +++ b/debian/menu @@ -0,0 +1,7 @@ +?package(solvespace):needs="X11" section="Applications/Graphics" \ + title="SolveSpace" command="/usr/bin/solvespace" \ + hints="CAD" \ + icon16x16="/usr/share/pixmaps/solvespace-16x16.xpm" \ + icon24x24="/usr/share/pixmaps/solvespace-24x24.xpm" \ + icon32x32="/usr/share/pixmaps/solvespace-32x32.xpm" \ + icon48x48="/usr/share/pixmaps/solvespace-48x48.xpm" diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..ce59924b --- /dev/null +++ b/debian/rules @@ -0,0 +1,18 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#DH_VERBOSE = 1 + +# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + +# main packaging script based on dh7 syntax +%: + dh $@ + +# debmake generated override targets +# This is example for Cmake (See http://bugs.debian.org/641051 ) +override_dh_auto_configure: + dh_auto_configure -- \ + -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) diff --git a/debian/solvespace.install b/debian/solvespace.install new file mode 100644 index 00000000..ff23693b --- /dev/null +++ b/debian/solvespace.install @@ -0,0 +1,3 @@ +usr/bin/solvespace +usr/share/icons +usr/share/applications diff --git a/debian/solvespace.sharedmimeinfo b/debian/solvespace.sharedmimeinfo new file mode 100644 index 00000000..4f6e2cf5 --- /dev/null +++ b/debian/solvespace.sharedmimeinfo @@ -0,0 +1,8 @@ + + + + SolveSpace sketch + + + + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 00000000..4f0669c2 --- /dev/null +++ b/debian/source/options @@ -0,0 +1,3 @@ +tar-ignore = "*.sublime-*" +tar-ignore = "cbuild" +tar-ignore = ".git" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b59b4775..9f9f5352 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -76,7 +76,7 @@ set_target_properties(slvs PROPERTIES if(NOT WIN32) install(TARGETS slvs - LIBRARY DESTINATION lib + LIBRARY DESTINATION lib/${CMAKE_LIBRARY_PATH} # multiarch PUBLIC_HEADER DESTINATION include) endif()