Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian package build #6

Merged
merged 12 commits into from Sep 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions CMakeLists.txt
Expand Up @@ -34,10 +34,13 @@ else ()
cmake_minimum_required (VERSION 3.13)
endif ()

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++11")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++11 -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -fPIC")

if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
kumagi marked this conversation as resolved.
Show resolved Hide resolved
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb")
endif ()

include (ExternalProject)
set_property(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@

## Introduction

Signed HTTP Exchange(SXG) is file format which contains an HTTP exchange
Signed HTTP Exchange (SXG) is file format which contains an HTTP exchange
(request and response) signed by a publisher's origin.
https://tools.ietf.org/html/draft-yasskin-http-origin-signed-responses-06

Expand Down
34 changes: 34 additions & 0 deletions packaging/build_deb
@@ -0,0 +1,34 @@
#!/bin/bash
#
# Builds the libsxg deb packages. The script must be run at the root
# directory of the libsxg source tree. The deb packages will be copied to
# the current directory.
#
# This script is written mainly for CI.

set -ex

readonly SRCDIR="${PWD}"
readonly DESTDIR="${SRCDIR}/$1"
readonly WORKDIR="$(mktemp -d --tmpdir build_deb.XXXXXX)"
readonly NAME='libsxg'
readonly VERSION='0.1'
readonly TARNAME="${NAME}_${VERSION}"
readonly TARGET_NAME='libsxg-dev'

echo "Working in ${WORKDIR}"
kumagi marked this conversation as resolved.
Show resolved Hide resolved

git archive --format=tar.gz --output="${WORKDIR}/${TARNAME}.orig.tar.gz" \
--prefix="${NAME}/" HEAD
cd "${WORKDIR}"
tar xf "${TARNAME}.orig.tar.gz"
cd "${NAME}"
ln -s packaging/debian .

debuild -uc -us -b

mkdir -p "${DESTDIR}"
cp ../*.deb "${DESTDIR}"
cd ../..

rm -rf "${WORKDIR}"
kumagi marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions packaging/debian/README.Debian
@@ -0,0 +1,9 @@
Signed HTTP Exchange library
----------------------------

Signed HTTP Exchange (SXG) is file format which contains an HTTP exchange
(request and response) signed by a publisher's origin.
If the publisher creates an SXG file with a valid signature, it will be treated
like a valid HTTP response regardless of the distribution channel.

-- Hiroki Kumazaki <kumagi@google.com> Wed, 18 Sep 2019 20:12:52 +0900
5 changes: 5 additions & 0 deletions packaging/debian/changelog
@@ -0,0 +1,5 @@
libsxg (0.1) unstable; urgency=medium

* Initial release

-- Hiroki Kumazaki <kumagi@google.com> Fri, 06 Sep 2019 16:09:52 +0900
1 change: 1 addition & 0 deletions packaging/debian/compat
@@ -0,0 +1 @@
10
19 changes: 19 additions & 0 deletions packaging/debian/control
@@ -0,0 +1,19 @@
Source: libsxg
Priority: optional
Maintainer: Hiroki Kumazaki <kumagi@google.com>
Build-Depends: debhelper (>= 10), cmake
Standards-Version: 4.1.3
Section: libs
Homepage: https://github.com/google/libsxg

Package: libsxg-dev
kumagi marked this conversation as resolved.
Show resolved Hide resolved
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: libssl-dev (>=1.1.1c), ${misc:Depends}
Description: Signed HTTP Exchange library.
Signed HTTP Exchange (SXG) is file format which contains an HTTP exchange
(request and response) signed by a publisher's origin.
https://tools.ietf.org/html/draft-yasskin-http-origin-signed-responses-06
If the publisher creates an SXG file with a valid signature, it will be
treated like a valid HTTP response regardless of the distribution channel.
24 changes: 24 additions & 0 deletions packaging/debian/copyright
@@ -0,0 +1,24 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: libsxg
Source: https://github.com/google/libsxg

Files: *
Copyright: 2019 Google LLC
License: Apache-2.0

License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".

16 changes: 16 additions & 0 deletions packaging/debian/rules
@@ -0,0 +1,16 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
dh $@

override_dh_auto_configure:
dh_auto_configure -- -DSKIP_TEST=TRUE \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release

override_dh_auto_install:
dh_auto_install --builddir
dh_install --sourcedir=debian/libsxg-dev/
1 change: 1 addition & 0 deletions packaging/debian/source/format
@@ -0,0 +1 @@
3.0 (quilt)
2 changes: 2 additions & 0 deletions packaging/debian/source/local-options
@@ -0,0 +1,2 @@
#abort-on-upstream-changes
#unapply-patches