initial debian packaging

This commit is contained in:
Gabriel Francisco 2020-11-19 01:03:22 +00:00
parent e716322e21
commit 916eab1976
10 changed files with 299 additions and 0 deletions

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
mars (0.1astable114-1) unstable; urgency=medium
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
-- Gabriel Francisco <frc.gabriel@gmail.com> Thu, 19 Nov 2020 01:02:34 +0000

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
11

21
debian/control vendored Normal file
View File

@ -0,0 +1,21 @@
Source: mars
Section: misc
Priority: optional
Maintainer: Gabriel Francisco <frc.gabriel@gmail.com>
Build-Depends: debhelper (>= 11), dkms
Standards-Version: 4.1.3
Homepage: http://schoebel.github.io/mars/
#Vcs-Browser: https://salsa.debian.org/debian/sample
#Vcs-Git: https://salsa.debian.org/debian/sample.git
Package: mars-dkms
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: mars kernel module.
It generates and compare two builds using diffoscope.
MARS Light is a block-level storage replication solution implemented
in the form of a Linux kernel module.
.
It's almost a drop-in replacement for DRBD but it works
asynchronously and over arbitrary distances using a technology
similar to transaction logging of database systems.

31
debian/copyright vendored Normal file
View File

@ -0,0 +1,31 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mars
Source: https://github.com/schoebel/mars
Files: *
Copyright: 2010-2014 Thomas Schoebel-Theuer <tst@schoebel-theuer.de>
2011-2014 1&1 Internet AG <tst@1und1.de>
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.
Files: debian/*
Copyright: 2020 Gabriel Francisco <frc.gabriel@gmail.com>
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 <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

77
debian/mars-Kbuild vendored Normal file
View File

@ -0,0 +1,77 @@
#
# Makefile for MARS
#
KBUILD_CFLAGS += -fdelete-null-pointer-checks
obj-$(if $(KBUILD_EXTMOD),m,$(CONFIG_MARS)) := mars.o
mars-y := \
lamport.o \
brick_say.o \
brick_mem.o \
brick.o \
mars_generic.o \
lib_log.o \
lib_rank.o \
lib_limiter.o \
lib_timing.o \
lib_mapfree.o \
mars_net.o \
mars_server.o \
mars_client.o \
mars_aio.o \
mars_sio.o \
mars_bio.o \
mars_if.o \
mars_copy.o \
mars_trans_logger.o \
sy_old/sy_generic.o \
sy_old/sy_net.o \
sy_old/mars_proc.o \
sy_old/mars_main.o
ifdef CONFIG_DEBUG_KERNEL
KBUILD_CFLAGS += -fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once
# This is currently not really used.
# We urge people to maintain it by including it in debug versions
# (so the compiler may throw any complaints)
mars-y += \
mars_dummy.o \
mars_check.o \
mars_buf.o \
mars_usebuf.o \
endif
extra-y := mars_config.h buildtag.h
$(obj)/buildtag.h:
exec > $@;\
/bin/echo -e "/* Automatically generated -- DO NOT EDIT! */";\
if [ "$$MARSVERSION" != "" ]; then \
BUILDTAG="$$MARSVERSION"; \
elif git describe --tags >/dev/null 2>&1; then \
BUILDTAG="$$(git describe --tags)"; \
elif [ -e DISTVERSION ]; then \
BUILDTAG=$$(cat DISTVERSION); \
else \
BUILDTAG="no-buildtag-available"; \
fi; \
/bin/echo -e "#define BUILDTAG \"$$BUILDTAG\"";\
/bin/echo -e "#define BUILDHOST \"$$USER@`hostname`\"";\
/bin/echo -e "#define BUILDDATE \"$$(date '+%F %T')\""
cat $@;
GEN_CONFIG_SCRIPT := $(obj)/gen_config.pl
$(obj)/mars_config.h:
$(kecho) "building $@ ..."
if [ ! -x $(GEN_CONFIG_SCRIPT) ]; then \
$(kecho) "MARS: cannot execute script $(GEN_CONFIG_SCRIPT)"; \
/bin/false; \
fi; \
cat $(src)/Kconfig | $(GEN_CONFIG_SCRIPT) 2>/dev/null > $@;
cat $@

97
debian/mars-Makefile vendored Normal file
View File

@ -0,0 +1,97 @@
#
# Makefile for out-of-tree build of MARS module
#
#
# By Benjamin Kübler <benjamin.kuebler@1und1.de>
#
# usage make [ KDIR =/path/to/kernel/source ]
#
obj-$(CONFIG_MARS) += mars.o
mars-objs := \
lamport.o \
brick_say.o \
brick_mem.o \
brick.o \
mars_generic.o \
lib_log.o \
lib_rank.o \
lib_limiter.o \
lib_timing.o \
lib_mapfree.o \
mars_net.o \
mars_server.o \
mars_client.o \
mars_aio.o \
mars_sio.o \
mars_bio.o \
mars_if.o \
mars_copy.o \
mars_trans_logger.o \
sy_old/sy_generic.o \
sy_old/sy_net.o \
sy_old/mars_proc.o \
sy_old/mars_main.o
ifneq ($(KERNELRELEASE),)
# in-tree-build process
include Kbuild
else
# out-of-tree-build process
MARSSRC := $(shell pwd)
DESTDIR ?= /
KDIR ?= /lib/modules/$(shell uname -r)/build
.PHONY: greeting install default clean config
default: mars_config.h
$(MAKE) -C $(KDIR) M=$(PWD) modules
greeting:
@echo "Building MARS Module again: KDIR=$(KDIR)" ;
@if ! test -e $(KDIR)/Makefile ; then \
echo -e "Sorry, kernel makefile not found. You need to tell me a correct KDIR!\n" ; \
false; \
fi
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
config:
$(MAKE) -C $(KDIR) M=$(PWD) config
install:
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
extra-y := buildtag.h
buildtag.h:
exec > $@;\
/bin/echo -e "/* Automatically generated -- DO NOT EDIT! */";\
if [ "$$MARSVERSION" != "" ]; then \
BUILDTAG="$$MARSVERSION"; \
elif git describe --tags >/dev/null 2>&1; then \
BUILDTAG="$$(git describe --tags)"; \
elif [ -e DISTVERSION ]; then \
BUILDTAG=$$(cat DISTVERSION); \
else \
BUILDTAG="no-buildtag-available"; \
fi; \
/bin/echo -e "#define BUILDTAG \"$$BUILDTAG\"";\
/bin/echo -e "#define BUILDHOST \"$$USER@`hostname`\"";\
/bin/echo -e "#define BUILDDATE \"$$(date '+%F %T')\""
cat $@;
extra-y += mars_config.h
GEN_CONFIG_SCRIPT := $(MARSSRC)/gen_config.pl
mars_config.h: buildtag.h
if [ ! -x $(GEN_CONFIG_SCRIPT) ]; then \
$(kecho) "MARS: cannot execute script $(GEN_CONFIG_SCRIPT)"; \
/bin/false; \
fi; \
cat $(MARSSRC)/Kconfig | $(GEN_CONFIG_SCRIPT) 2>/dev/null > $@;
cat $@;
endif

5
debian/mars-dkms.dkms vendored Normal file
View File

@ -0,0 +1,5 @@
PACKAGE_NAME="mars"
PACKAGE_VERSION="0.1astable144"
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/kernel/drivers/block"
AUTOINSTALL="yes"

26
debian/mars-dkms.postinst vendored Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh
set -e
#DEBHELPER#
case "$1" in
install)
;;
configure|reconfigure)
# Get the version of the current loaded module:
old_version="$(cat /sys/module/mars/version 2>/dev/null)" || exit 0
# Get the version of the latest available module:
new_version="$(modinfo -F version mars 2>/dev/null)" || exit 0
# See if the new one is actually newer:
dpkg --compare-versions "$old_version" lt "$new_version" || exit 0
# Trigger an update notification that recommends a reboot:
touch /run/reboot-required || true
grep -Fqsx mars-dkms /run/reboot-required.pkgs || \
echo mars-dkms >> /run/reboot-required.pkgs || true
;;
*)
;;
esac
exit 0

35
debian/rules vendored Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# 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
include /usr/share/dpkg/default.mk
%:
dh $@ --with dkms
override_dh_install:
cp debian/mars-Makefile kernel/Makefile
cp debian/mars-Kbuild kernel/Kbuild
dh_install scripts/gen_config.pl usr/src/mars-$(DEB_VERSION_UPSTREAM)/
dh_install kernel/* usr/src/mars-$(DEB_VERSION_UPSTREAM)/
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM)
override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_test:
override_dh_auto_install:
override_dh_auto_clean:
@git checkout -- kernel

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)