From 687f096ef9092cde39b9e435d66e0406c4b9b44d Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Tue, 23 Jul 2019 19:45:38 +0800 Subject: [PATCH] pkg: deb package support --- CMakeLists.txt | 9 +++++++++ debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 23 +++++++++++++++++++++++ debian/copyright | 24 ++++++++++++++++++++++++ debian/libgio-qt-dev.install | 2 ++ debian/libgio-qt.install | 1 + debian/rules | 7 +++++++ debian/source/format | 1 + gio-qt/CMakeLists.txt | 13 ++++++++----- gio-qt/gio-qt.pc.in | 7 ++++--- 11 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/libgio-qt-dev.install create mode 100644 debian/libgio-qt.install create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/CMakeLists.txt b/CMakeLists.txt index 35fe142..1f91967 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,15 @@ cmake_minimum_required(VERSION 3.9.5) option(BUILD_UTILS "Build utilities" ON) +# Version +if (NOT PROJECT_VERSION) + set(PROJECT_VERSION "0.0.1") +endif() + +if (NOT PROJECT_VERSION_MAJOR) + set(PROJECT_VERSION_MAJOR 0) +endif() + # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..d4d1723 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +gio-qt (0.0.1) unstable; urgency=medium + + * Initial release + + -- Gary Wang Tue, 23 Jul 2019 19:49:31 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..17e9c0d --- /dev/null +++ b/debian/control @@ -0,0 +1,23 @@ +Source: gio-qt +Section: libs +Priority: optional +Maintainer: Gary Wang +Build-Depends: + debhelper (>= 9), + pkg-config, + qt5-default, + qt5-qmake, + libglib2.0-dev +Standards-Version: 3.9.8 +Homepage: https://github.com/linuxdeepin/gio-qt + +Package: libgio-qt +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Gio wrapper for Qt. + +Package: libgio-qt-dev +Architecture: any +Depends: libgio-qt, ${misc:Depends} +Description: Development package for libgio-qt. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ac554c3 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: gio-qt +Source: https://github.com/linuxdeepin/gio-qt + +Files: * +Copyright: 2019-2019 Deepin Technology Co., Ltd. +License: GPL-3+ + +License: GPL-3+ + This package 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". diff --git a/debian/libgio-qt-dev.install b/debian/libgio-qt-dev.install new file mode 100644 index 0000000..8dd0dcc --- /dev/null +++ b/debian/libgio-qt-dev.install @@ -0,0 +1,2 @@ +/usr/include/* +/usr/lib/*/pkgconfig diff --git a/debian/libgio-qt.install b/debian/libgio-qt.install new file mode 100644 index 0000000..e405ec7 --- /dev/null +++ b/debian/libgio-qt.install @@ -0,0 +1 @@ +/usr/lib/*/*.so* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..9ce0fb8 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f +include /usr/share/dpkg/default.mk + +export QT_SELECT = qt5 + +%: + dh $@ --parallel diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/gio-qt/CMakeLists.txt b/gio-qt/CMakeLists.txt index 40a7765..208c410 100644 --- a/gio-qt/CMakeLists.txt +++ b/gio-qt/CMakeLists.txt @@ -1,10 +1,7 @@ # Populate a CMake variable with the sources # TODO: portable headers? -# Some custom variables -set(DEST_DIR "${CMAKE_INSTALL_PREFIX}") - -CONFIGURE_FILE("gio-qt.pc.in" "gio-qt.pc" @ONLY) +configure_file ("gio-qt.pc.in" "gio-qt.pc" @ONLY) set (QGIO_PUBLIC_HEADER_FILES dgiovolumemanager.h @@ -30,6 +27,12 @@ add_library (gio-qt SHARED ${QGIO_PRIVATE_CPP_FILES} ) +set_target_properties( + gio-qt PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} +) + target_include_directories(gio-qt PRIVATE ${GIOMM_INCLUDE_DIRS} @@ -48,7 +51,7 @@ install (FILES ${QGIO_PUBLIC_HEADER_FILES} DESTINATION include/gio-qt ) -install (TARGETS gio-qt DESTINATION lib) +install_targets ("/${CMAKE_INSTALL_LIBDIR}" gio-qt) install (FILES "${CMAKE_CURRENT_BINARY_DIR}/gio-qt.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig diff --git a/gio-qt/gio-qt.pc.in b/gio-qt/gio-qt.pc.in index f3625ba..eb7ebc3 100644 --- a/gio-qt/gio-qt.pc.in +++ b/gio-qt/gio-qt.pc.in @@ -1,10 +1,11 @@ -prefix=@DEST_DIR@ -libdir=${prefix}/lib +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ includedir=${prefix}/include Name: gio-qt Description: Qt wrapper library for GIO. -Version: 0.1.0 +Version: @PROJECT_VERSION@ Requires: glibmm-2.4, Qt5Core Libs: -L${libdir} -lgio-qt