-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packages: added script to build debian source package
- Loading branch information
Richard Pospesel
committed
Feb 28, 2024
1 parent
19aa374
commit f20d823
Showing
12 changed files
with
210 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(deb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rules | ||
control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
find_program(TAR_EXECUTABLE NAMES tar) | ||
find_program(DPKG_SOURCE_EXECUTABLE NAMES dpkg-source) | ||
|
||
if (NOT TAR_EXECUTABLE) | ||
message(WARNING "tar not found; will not build debian source package") | ||
elseif (NOT DPKG_SOURCE_EXECUTABLE) | ||
message(WARNING "dpkg-source not found; will not build debian source package") | ||
else() | ||
|
||
# generate debian/rules file | ||
set(RULES_IN ${CMAKE_CURRENT_SOURCE_DIR}/debian/rules.in) | ||
set(RULES_OUT ${CMAKE_CURRENT_SOURCE_DIR}/debian/rules) | ||
configure_file(${RULES_IN} ${RULES_OUT} @ONLY) | ||
|
||
set(CONTROL_IN ${CMAKE_CURRENT_SOURCE_DIR}/debian/control.in) | ||
set(CONTROL_OUT ${CMAKE_CURRENT_SOURCE_DIR}/debian/control) | ||
configure_file(${CONTROL_IN} ${CONTROL_OUT} @ONLY) | ||
|
||
# Copy Rust source files and Cargo toml files into source tarball | ||
set(GOSLING_SOURCE "${CMAKE_SOURCE_DIR}/..") | ||
set(GOSLING_TARBALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/gosling-${CGOSLING_VERSION}") | ||
set(GOSLING_TARBALL "${CMAKE_CURRENT_BINARY_DIR}/gosling_${CGOSLING_VERSION}.orig.tar.gz") | ||
add_custom_command( | ||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/debian | ||
OUTPUT | ||
${GOSLING_TARBALL} | ||
${CMAKE_CURRENT_BINARY_DIR}/gosling_${CGOSLING_VERSION}.debian.tar.xz | ||
${CMAKE_CURRENT_BINARY_DIR}/gosling_${CGOSLING_VERSION}.dsc | ||
# build source tree | ||
COMMAND ${CMAKE_COMMAND} -E rm -rf ${GOSLING_TARBALL_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${GOSLING_TARBALL_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR} ${GOSLING_TARBALL_DIR}/source | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../LICENSE.md ${GOSLING_TARBALL_DIR}/. | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../README.md ${GOSLING_TARBALL_DIR}/. | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../Makefile ${GOSLING_TARBALL_DIR}/. | ||
# delete optional submodules | ||
COMMAND ${CMAKE_COMMAND} -E rm -rf ${GOSLING_TARBALL_DIR}/source/extern/Catch2 | ||
COMMAND ${CMAKE_COMMAND} -E rm -rf ${GOSLING_TARBALL_DIR}/source/extern/json | ||
|
||
# create source tar | ||
COMMAND tar -czf gosling_${CGOSLING_VERSION}.orig.tar.gz gosling-${CGOSLING_VERSION} | ||
# copy debian directory | ||
COMMAND cp -aP ${CMAKE_CURRENT_SOURCE_DIR}/debian ${GOSLING_TARBALL_DIR}/debian | ||
COMMAND ${CMAKE_COMMAND} -E rm ${GOSLING_TARBALL_DIR}/debian/*.in | ||
|
||
# build source package | ||
COMMAND dpkg-source -b ${GOSLING_TARBALL_DIR} | ||
) | ||
|
||
add_custom_target(cgosling_debian_source_package_target ALL | ||
DEPENDS | ||
${GOSLING_TARBALL} | ||
${CMAKE_CURRENT_BINARY_DIR}/gosling_${CGOSLING_VERSION}.debian.tar.xz | ||
${CMAKE_CURRENT_BINARY_DIR}/gosling_${CGOSLING_VERSION}.dsc | ||
) | ||
add_dependencies(cgosling_debian_source_package_target gosling_cpp_bindings_target) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
gosling (0.2.1-1) unstable; urgency=low | ||
|
||
* Initial release. | ||
|
||
-- Richard Pospesel <richard@blueprintforfreespeech.net> Fri, 23 Feb 2024 00:00:00 +0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Source: gosling | ||
Priority: optional | ||
Maintainer: Richard Pospesel <richard@blueprintforfreespeech.net> | ||
Build-Depends: debhelper-compat (= 13), cmake (>= 3.17), rustc (>= 1.63), cargo | ||
Standards-Version: 4.5.1 | ||
Homepage: https://gosling.technology | ||
Rules-Requires-Root: no | ||
|
||
Package: libcgosling0 | ||
Section: libs | ||
Architecture: any | ||
Multi-Arch: same | ||
Depends: ${misc:Depends}, ${shlibs:Depends} | ||
Suggests: tor | ||
Description: C bindings for Gosling crate | ||
Gosling is a library that allows developers to create | ||
applications which provide anonymous, secure, and | ||
private peer-to-peer functionality using Tor onion | ||
services. | ||
|
||
Package: libcgosling-dev | ||
Section: libdevel | ||
Architecture: any | ||
Multi-Arch: same | ||
Depends: libcgosling0 (= ${binary:Version}), ${misc:Depends} | ||
Description: C bindings for Gosling crate (development files) | ||
Gosling is a library that allows developers to create | ||
applications which provide anonymous, secure, and | ||
private peer-to-peer functionality using Tor onion | ||
services. | ||
. | ||
This package contains headers necessary to compile third-party | ||
modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Source: gosling | ||
Priority: optional | ||
Maintainer: Richard Pospesel <richard@blueprintforfreespeech.net> | ||
Build-Depends: debhelper-compat (= 13), cmake (>= 3.17), rustc (>= 1.63), cargo | ||
Standards-Version: 4.5.1 | ||
Homepage: https://gosling.technology | ||
Rules-Requires-Root: no | ||
|
||
Package: libcgosling@CGOSLING_MAJOR_VERSION@ | ||
Section: libs | ||
Architecture: any | ||
Multi-Arch: same | ||
Depends: ${misc:Depends}, ${shlibs:Depends} | ||
Suggests: tor | ||
Description: C bindings for Gosling crate | ||
Gosling is a library that allows developers to create | ||
applications which provide anonymous, secure, and | ||
private peer-to-peer functionality using Tor onion | ||
services. | ||
|
||
Package: libcgosling-dev | ||
Section: libdevel | ||
Architecture: any | ||
Multi-Arch: same | ||
Depends: libcgosling@CGOSLING_MAJOR_VERSION@ (= ${binary:Version}), ${misc:Depends} | ||
Description: C bindings for Gosling crate (development files) | ||
Gosling is a library that allows developers to create | ||
applications which provide anonymous, secure, and | ||
private peer-to-peer functionality using Tor onion | ||
services. | ||
. | ||
This package contains headers necessary to compile third-party | ||
modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: Gosling | ||
Upstream-Contact: Richard Pospesel <richard@blueprintforfreespeech.net> | ||
Source: https://gosling.technology | ||
|
||
Files: * | ||
Copyright: 2022-2024, Blueprint for Free Speech | ||
License: BSD-3-clause | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
3. The name of the author may not be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
. | ||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/make -f | ||
|
||
%: | ||
dh $@ | ||
|
||
override_dh_auto_build: | ||
$(MAKE) config-release | ||
$(MAKE) gosling_c_shared_bindings_target -C out/release | ||
$(MAKE) gosling_cpp_shared_bindings_target -C out/release | ||
|
||
override_dh_auto_install: | ||
dh_auto_install | ||
|
||
# | ||
# libcgosling0 | ||
# | ||
mkdir -p debian/libcgosling@CGOSLING_MAJOR_VERSION@/usr/lib/$(DEB_HOST_MULTIARCH) | ||
cp out/release/bindings/c/lib/libcgosling.so.@CGOSLING_VERSION@ debian/libcgosling@CGOSLING_MAJOR_VERSION@/usr/lib/$(DEB_HOST_MULTIARCH)/. | ||
cp -P out/release/bindings/c/lib/libcgosling.so.@CGOSLING_MAJOR_VERSION@ debian/libcgosling@CGOSLING_MAJOR_VERSION@/usr/lib/$(DEB_HOST_MULTIARCH)/. | ||
|
||
# | ||
# libcgosling-dev | ||
# | ||
mkdir -p debian/libcgosling-dev/usr/lib/$(DEB_HOST_MULTIARCH) | ||
cp -P out/release/bindings/c/lib/libcgosling.so debian/libcgosling-dev/usr/lib/$(DEB_HOST_MULTIARCH)/. | ||
|
||
mkdir -p debian/libcgosling-dev/usr/include/$(DEB_HOST_MULTIARCH) | ||
cp out/release/bindings/c/include/* debian/libcgosling-dev/usr/include/$(DEB_HOST_MULTIARCH)/. | ||
cp out/release/bindings/cpp/include/* debian/libcgosling-dev/usr/include/$(DEB_HOST_MULTIARCH)/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (quilt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# DEP-12: Per-package machine-readable metadata about Upstream | ||
# Please check * https://dep-team.pages.debian.net/deps/dep12/ | ||
# * https://wiki.debian.org/UpstreamMetadata | ||
Reference: | ||
Author: <please use full names and separate multiple author by the keyword "and"> | ||
Title: | ||
Journal: | ||
Year: | ||
Volume: | ||
Number: | ||
Pages: | ||
DOI: | ||
PMID: | ||
URL: | ||
eprint: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# You must remove unused comment lines for the released package. | ||
version=3 |