[cctz] 01/03: Initial packaging

Anton Gladky gladk at moszumanska.debian.org
Wed Nov 15 19:12:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository cctz.

commit d335bb4309d960b88e5f9024983f6f934a6db366
Author: Anton Gladky <gladk at debian.org>
Date:   Wed Nov 15 19:55:21 2017 +0100

    Initial packaging
---
 debian/changelog                                   |  5 ++
 debian/compat                                      |  1 +
 debian/control                                     | 50 ++++++++++++++++
 debian/copyright                                   | 12 ++++
 debian/libcctz-dev.install                         |  2 +
 debian/libcctz-doc.docs                            |  1 +
 debian/libcctz-doc.examples                        |  1 +
 debian/libcctz2.install                            |  1 +
 .../0001-Compile-shared-lib-and-install-it.patch   | 39 ++++++++++++
 debian/patches/0002-Enable-tests-for-Debian.patch  | 70 ++++++++++++++++++++++
 debian/patches/series                              |  3 +
 debian/patches/use_system_zoneinfo.patch           | 15 +++++
 debian/rules                                       | 13 ++++
 debian/source/format                               |  1 +
 debian/tests/all                                   | 23 +++++++
 debian/tests/control                               |  2 +
 debian/watch                                       |  3 +
 17 files changed, 242 insertions(+)

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..b7857a1
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+cctz (2.1~git~a59b930afc8+dfsg1-1) unstable; urgency=medium
+
+  * Initial upload. (Closes: #881851)
+
+ -- Anton Gladky <gladk at debian.org>  Sat, 11 Nov 2017 10:21:55 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..8eb45cf
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,50 @@
+Source: cctz
+Maintainer: Debian Science Team <debian-science-maintainers at lists.alioth.debian.org>
+Uploaders: Anton Gladky <gladk at debian.org>
+Section: libs
+Priority: optional
+Build-Depends: cmake,
+               debhelper (>= 10)
+Standards-Version: 4.1.1
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/cctz.git
+Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/cctz.git
+Homepage: https://github.com/google/cctz
+
+Package: libcctz-dev
+Architecture: any
+Section: libdevel
+Depends: libcctz2 (= ${binary:Version}),
+         ${misc:Depends}
+Suggests: libcctz-doc
+Description: Library for computing dates, times and time zones, development files
+ CCTZ contains two libraries that cooperate with `<chrono>` to give C++
+ programmers all the necessary tools for computing with dates, times, and time
+ zones in a simple and correct manner.
+ .
+ This package contains the development files.
+
+Package: libcctz2
+Architecture: any
+Multi-Arch: same
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Description: Library for computing dates, times and time zones, shared library
+ CCTZ contains two libraries that cooperate with `<chrono>` to give C++
+ programmers all the necessary tools for computing with dates, times, and time
+ zones in a simple and correct manner.
+ .
+ This package contains the shared library.
+
+Package: libcctz-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Description: Library for computing dates, times and time zones, documentation
+ CCTZ contains two libraries that cooperate with `<chrono>` to give C++
+ programmers all the necessary tools for computing with dates, times, and time
+ zones in a simple and correct manner.
+ .
+ This package contains tools and documentation and examples.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..a95a40e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,12 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: cctz
+Source: https://github.com/google/cctz
+License: Apache-2.0
+
+Files: *
+Copyright: 2016 Google Inc.
+License: Apache-2.0
+
+License: Apache-2.0
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/Apache-2.0"
diff --git a/debian/libcctz-dev.install b/debian/libcctz-dev.install
new file mode 100644
index 0000000..f0f71a9
--- /dev/null
+++ b/debian/libcctz-dev.install
@@ -0,0 +1,2 @@
+usr/include
+usr/lib/*/libcctz.so
diff --git a/debian/libcctz-doc.docs b/debian/libcctz-doc.docs
new file mode 100644
index 0000000..b43bf86
--- /dev/null
+++ b/debian/libcctz-doc.docs
@@ -0,0 +1 @@
+README.md
diff --git a/debian/libcctz-doc.examples b/debian/libcctz-doc.examples
new file mode 100644
index 0000000..da3fa58
--- /dev/null
+++ b/debian/libcctz-doc.examples
@@ -0,0 +1 @@
+examples/*.cc
diff --git a/debian/libcctz2.install b/debian/libcctz2.install
new file mode 100644
index 0000000..7b7beea
--- /dev/null
+++ b/debian/libcctz2.install
@@ -0,0 +1 @@
+usr/lib/*/libcctz*.so.*
diff --git a/debian/patches/0001-Compile-shared-lib-and-install-it.patch b/debian/patches/0001-Compile-shared-lib-and-install-it.patch
new file mode 100644
index 0000000..473800c
--- /dev/null
+++ b/debian/patches/0001-Compile-shared-lib-and-install-it.patch
@@ -0,0 +1,39 @@
+From: Anton Gladky <gladk at debian.org>
+Date: Wed, 15 Nov 2017 19:04:21 +0100
+Subject: [PATCH 1/2] Compile shared lib and install it
+
+---
+ CMakeLists.txt | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 77b4233..6708b6c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,7 +28,7 @@ function(cctz_target_set_cxx_standard target)
+   endif()
+ endfunction()
+ 
+-add_library(cctz
++add_library(cctz SHARED
+   src/civil_time_detail.cc
+   src/time_zone_fixed.cc
+   src/time_zone_fixed.h
+@@ -49,6 +49,14 @@ add_library(cctz
+   )
+ cctz_target_set_cxx_standard(cctz)
+ add_library(cctz::cctz ALIAS cctz)
++set_target_properties(cctz PROPERTIES
++    OUTPUT_NAME "cctz"
++    VERSION ${VERSION}
++    SOVERSION ${SOVERSION}
++)
++INCLUDE(GNUInstallDirs)
++INSTALL(TARGETS cctz DESTINATION ${CMAKE_INSTALL_LIBDIR})
++INSTALL(DIRECTORY include/cctz DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ target_include_directories(cctz PUBLIC include)
+ 
+-- 
+2.15.0
+
diff --git a/debian/patches/0002-Enable-tests-for-Debian.patch b/debian/patches/0002-Enable-tests-for-Debian.patch
new file mode 100644
index 0000000..1aee948
--- /dev/null
+++ b/debian/patches/0002-Enable-tests-for-Debian.patch
@@ -0,0 +1,70 @@
+From: Anton Gladky <gladk at debian.org>
+Date: Wed, 15 Nov 2017 19:45:46 +0100
+Subject: [PATCH 2/2] Enable tests for Debian
+
+---
+ CMakeLists.txt | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6708b6c..5aa2352 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -80,11 +80,17 @@ endif()
+ 
+ if (BUILD_TESTING)
+   find_package(benchmark REQUIRED)
+-  find_package(GMock REQUIRED)
+-  find_package(GTest REQUIRED)
+   find_package(Threads REQUIRED)
++  SET (GOOGLETESTSRC
++                 /usr/src/googletest/googletest/src/gtest_main.cc
++                 /usr/src/googletest/googletest/src/gtest-all.cc
++                 )
++  include_directories("/usr/src/googletest/googlemock/")
++  include_directories("/usr/src/googletest/googletest/")
+ 
+-  add_executable(civil_time_test src/civil_time_test.cc)
++  add_executable(civil_time_test src/civil_time_test.cc
++                 ${GOOGLETESTSRC}
++                 )
+   cctz_target_set_cxx_standard(civil_time_test)
+   target_include_directories(civil_time_test PRIVATE ${GTEST_INCLUDE_DIRS})
+   target_link_libraries(civil_time_test
+@@ -94,7 +100,9 @@ if (BUILD_TESTING)
+     )
+   add_test(civil_time_test civil_time_test)
+ 
+-  add_executable(time_zone_lookup_test src/time_zone_lookup_test.cc)
++  add_executable(time_zone_lookup_test src/time_zone_lookup_test.cc
++                 ${GOOGLETESTSRC}
++                 )
+   cctz_target_set_cxx_standard(time_zone_lookup_test)
+   target_include_directories(time_zone_lookup_test PRIVATE ${GTEST_INCLUDE_DIRS})
+   target_link_libraries(time_zone_lookup_test
+@@ -104,12 +112,14 @@ if (BUILD_TESTING)
+     )
+   add_test(time_zone_lookup_test time_zone_lookup_test)
+ 
+-  add_executable(time_zone_format_test src/time_zone_format_test.cc)
++  add_executable(time_zone_format_test src/time_zone_format_test.cc
++                 ${GOOGLETESTSRC}
++                 )
++
+   cctz_target_set_cxx_standard(time_zone_format_test)
+   target_link_libraries(time_zone_format_test
+     cctz::cctz
+     ${CMAKE_THREAD_LIBS_INIT}
+-    GMock::Main
+     )
+   add_test(time_zone_format_test time_zone_format_test)
+ 
+@@ -126,4 +136,5 @@ if (BUILD_TESTING)
+   add_executable(benchmarks src/benchmarks.cc)
+   cctz_target_set_cxx_standard(benchmarks)
+   target_link_libraries(benchmarks cctz::cctz benchmark::benchmark)
++  add_test(benchmarks benchmarks)
+ endif()
+-- 
+2.15.0
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..cb3edcd
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+0001-Compile-shared-lib-and-install-it.patch
+0002-Enable-tests-for-Debian.patch
+use_system_zoneinfo.patch
diff --git a/debian/patches/use_system_zoneinfo.patch b/debian/patches/use_system_zoneinfo.patch
new file mode 100644
index 0000000..ebeecde
--- /dev/null
+++ b/debian/patches/use_system_zoneinfo.patch
@@ -0,0 +1,15 @@
+Description: use zoneinfo shipped with the system
+Author: Anton Gladky <gladk at debian.org>
+Last-Update: 2017-11-15
+
+--- cctz-2.1~git~a59b930afc8+dfsg1.orig/CMakeLists.txt
++++ cctz-2.1~git~a59b930afc8+dfsg1/CMakeLists.txt
+@@ -130,7 +130,7 @@ if (BUILD_TESTING)
+       time_zone_format_test
+       time_zone_lookup_test
+     PROPERTY
+-      ENVIRONMENT "TZDIR=${CMAKE_CURRENT_SOURCE_DIR}/testdata/zoneinfo"
++      ENVIRONMENT "TZDIR=/usr/share/zoneinfo"
+     )
+ 
+   add_executable(benchmarks src/benchmarks.cc)
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..2591ba1
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+include /usr/share/dpkg/pkg-info.mk
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+
+%:
+	dh $@ --buildsystem=cmake
+
+VERSION ?= $(shell echo $(DEB_VERSION_UPSTREAM) | cut -f1 -d"~")
+SOVERSION ?= $(shell echo $(DEB_VERSION_UPSTREAM) | cut -f1 -d".")
+
+override_dh_auto_configure:
+	dh_auto_configure -- -DVERSION="$(VERSION)" -DSOVERSION="$(SOVERSION)"
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/all b/debian/tests/all
new file mode 100755
index 0000000..54f84d4
--- /dev/null
+++ b/debian/tests/all
@@ -0,0 +1,23 @@
+#!/bin/sh
+# autopkgtest check: Build and run a programs against benchmark
+# (C) 2017
+# Author: Anton Gladky <gladk at debian.org>
+
+set -e
+CURDIR=$(pwd)
+
+for TEST in hello classic epoch_shift example1 example2 example3 example4 ; do
+    echo Test: $TEST
+    WORKDIR=$(mktemp -d)
+    echo $WORKDIR
+    trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+    cd $CURDIR
+    cp -r examples/$TEST.cc $WORKDIR/
+    cd $WORKDIR
+
+    g++ -lcctz $TEST.cc -o test
+    echo "build: OK"
+    [ -x test ]
+    ./test
+    echo "run: OK"
+done
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..4f1c8b6
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: all
+Depends: libcctz-dev, build-essential
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..d504d09
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=repacksuffix=+dfsg1,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|b|a)\d*)$/$1~$2/,dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$// \
+https://github.com/google/cctz/tags .*/(v\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cctz.git



More information about the debian-science-commits mailing list