From 8181228ad8c1a3b3b850552cb9c727bb019bbc0c Mon Sep 17 00:00:00 2001 From: Victor Wagner Date: Wed, 2 Aug 2017 11:17:06 +0300 Subject: [PATCH] Wrote Makefile and create initial debian packaging file with dh_make --- .gitignore | 2 ++ Makefile | 51 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 18 +++++++++++++++- debian/README.Debian | 11 ++++++++++ debian/README.source | 10 +++++++++ debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 17 +++++++++++++++ debian/copyright | 38 +++++++++++++++++++++++++++++++++ debian/docs | 2 ++ debian/rules | 32 +++++++++++++++++++++++++++ debian/source/format | 1 + 12 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 debian/README.Debian create mode 100644 debian/README.source 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 100755 debian/rules create mode 100644 debian/source/format diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..88354cd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +engine +libengine-gost-openssl1.1* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..781e42e --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +# +# Use make BRANCH=something to build specific branch +# Upstrimv version is by default set to build date. +# Use make VERSION= something to override +# +BRANCH=master +VERSION := $(shell date +%Y%m%d) +PKGNAME=libengine-gost-openssl1.1 +ARCH := $(shell dpkg --print-architecture) +all: $(PKGNAME)_$(VERSION)-1_$(ARCH).deb + +tar: $(PKGNAME)_$(VERSION).orig.tar.bz2 + +# +# This rule updates GIT repository and creates tarball with +# original (upstream, i.e. distribution-agnostic) sources of engine +# +$(PKGNAME)_$(VERSION).orig.tar.bz2: engine/README.md + cd engine; git pull + cd engine; git archive --format tar \ + --prefix=$(PKGNAME)-$(VERSION)/ \ + master |bzip2 > ../$(PKGNAME)_$(VERSION).orig.tar.bz2 +# +# This rule does intital clone of engine git repository should it be +# absent +# +engine/README.md: + git clone https://github.com/gost-engine/engine.git + +# +# This rule actually build source and binare package starting with +# unpacked debian source directory +# + +$(PKGNAME)_$(VERSION)-1_$(ARCH).deb: $(PKGNAME)-$(VERSION)/debian/changelog + cd $(PKGNAME)-$(VERSION) + debuild +# +# This rule creates unpacked Debian source by copiing debian +# subdirectory from this git module into unpacked distribution-agnostic +# source. +# Note - change debian subdirectory here and not inside +# $(PKGNAME)-$(VERSION) if you want you changes survive invocation of +# this rule +# +$(PKGNAME)_$(VERSION)/debian/changelog: $(PKGNAME)_$(VERSION).orig.tar.bz2 $(wildcard debian/*) + rm -f $(PKGNAME)-$(VERSION) + tar xf $(PKGNAME)_$(VERSION).orig.tar.bz2 + cp -r debian $(PKGNAME)-$(VERSION)/debian + cd $(PKGNAME)-$(VERSION); dch -v $(VERSION)-1 "Build for $(ARCH)" + diff --git a/README.md b/README.md index 0db093c..8790dc8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ -# debpkg Debian packaging files for gost-engine +====================================== + +This repository contains supplemental files +and Makefile to build debian package for gost engine. + +This is intened for Debian 9 (stretch) and newer, which ships +openssl 1.1.0 and above. + +I prefer keep packaging files separately from main source tree. + +Running make in this directory should fetch engine sources and build +debian package (both source and binary for current architecture). + +You need git, build-essential and devscripts installed before running. +All other are listed as Build-Depends prerequesites and should they be +absent, they would be reported during installation. + diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..2971196 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,11 @@ +libengine-gost-openssl1.1 for Debian +------------------------------------ + +This package contain loadable module for OpenSSL 1.1.x, which implements +Russian GOST cryptograpy algorithms. + +This module can be enabled by adding -engine gost switch to most openssl +library command or by adding appropriate sections to the openssl.cnf +See readme gost for details + + -- Victor Wagner Wed, 02 Aug 2017 11:06:25 +0300 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..3640ec6 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,10 @@ +libengine-gost-openssl1.1 for Debian +------------------------------------ + + + + + + -- Victor Wagner Wed, 02 Aug 2017 11:06:25 +0300 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..4628d72 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +libengine-gost-openssl1.1 (20170802-1) unstable; urgency=low + + * Initial release + + -- Victor Wagner Wed, 02 Aug 2017 11:06:25 +0300 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..1bdae01 --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: libengine-gost-openssl1.1 +Section: libs +Priority: extra +Maintainer: Victor Wagner +Build-Depends: debhelper (>= 9), cmake, libssl-dev +Standards-Version: 3.9.5 +Homepage: https://github.com/gost-engine/engine +Vcs-Git: https://github.com/gost-engine/engine.git + +Package: libengine-gost-openssl1.1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Loadable module for openssl implementing GOST algorithms + This package contains loadable module for openssl library, which + implements (in software) Russian national standard (GOST) cryptograpy + algorithms. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..1b7c52d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,38 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libengine-gost-openssl1.1 +Source: + +Files: * +Copyright: + +License: + + + . + + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2017 Victor Wagner +License: GPL-2+ + 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 2 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 2 can be found in "/usr/share/common-licenses/GPL-2". + +# 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 0000000..99e0e35 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README.gost +README.md diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..27a1f57 --- /dev/null +++ b/debian/rules @@ -0,0 +1,32 @@ +#!/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 + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +# 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) +override_dh_install + + + 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) -- 2.39.5