From 3270c063389da5f9bf4c6d95c2f3c483c6c622a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Fri, 29 Jun 2018 13:55:45 +0200 Subject: [PATCH] Initial structure for debian packaging --- .gitlab-ci.yml | 58 +++++++++++++++++++ Makefile | 7 +++ debian/changelog | 5 ++ debian/compat | 1 + debian/control | 15 +++++ debian/copyright | 26 +++++++++ debian/docs | 1 + debian/rules | 28 +++++++++ debian/source/format | 1 + ...lmmj-sync.rb => unipoly-mlmmj-ldap-sync.rb | 0 10 files changed, 142 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Makefile 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 rename unipoly-mlmmj-sync.rb => unipoly-mlmmj-ldap-sync.rb (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..59b84cf --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,58 @@ +stages: + - setup + - build + - checking + - deploy + +# Build package using dpkg-buildpackage +run-build: + stage: build + tags: + - debian + - generic + script: + - echo 'Acquire::http { Proxy "http://rapperswil:3142"; };' > /etc/apt/apt.conf.d/02proxy + - apt-get update -qy + - apt-get install -y dpkg-dev debhelper + - dpkg-buildpackage -us -uc + - mkdir build-artifacts + - mv ../unipoly-mlmmj-ldap-sync* build-artifacts/ + artifacts: + paths: + - build-artifacts + +# Check built package using lintian. +run-checking: + stage: checking + tags: + - debian + - generic + script: + - echo 'Acquire::http { Proxy "http://rapperswil:3142"; };' > /etc/apt/apt.conf.d/02proxy + - apt-get update -qy + - apt-get install -y lintian + - lintian -i build-artifacts/unipoly-mlmmj-ldap-sync*.changes + +# Deploy the built package to rapperswil +.run-deploy: + stage: deploy + variables: + only: + - tags + except: + - /^(?!master).+@/ + tags: + - debian + - generic + before_script: + - 'which ssh-agent || (apt-get update -qy && apt-get install openssh-client -y)' + - eval $(ssh-agent -s) + - echo "$CD_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null + - mkdir -p ~/.ssh + - echo "$CD_SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - apt-get update -qy + - apt-get install -y dput + - 'echo "$CD_MINIDINSTALL_CONFIG" > ~/.dput.cf' + - 'dput -u gnugen build-artifacts/unipoly-mlmmh-ldap-sync*.changes' diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..05ca64d --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +PREFIX ?= /usr + +build: + +install: + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp unipoly-mlmmj-ldap-sync.rb $(DESTDIR)$(PREFIX)/bin/unipoly-mlmmj-ldap-sync diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..53fa052 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +unipoly-mlmmj-ldap-sync (0.1) unstable; urgency=low + + * Let there be package. + + -- Timothée Floure Fri, 29 Jun 2018 12:02:05 +0200 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..36242ce --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: unipoly-mlmmj-ldap-sync +Section: admin +Priority: optional +Maintainer: Timothée Floure +Build-Depends: debhelper (>= 9) +Standards-Version: 4.1.1 +Homepage: https://gitlab.gnugen.ch/gnugen-externs/unipoly/mlmmj-ldap-sync +Vcs-Git: git://gitlab.gnugen.ch/gnugen-extenrs/unipoly/mlmmj-ldap-sync.git + +Package: unipoly-mlmmj-ldap-sync +Architecture: all +Depends: ruby, ruby-net-ldap, ruby-toml, ${misc:Depends} +Description: Cronjobs to maintain the synchronization of Unipoly's mailing lists. + This package installs cronjobs to maintain the synchronization between + unipoly's LDAP tree and mailing lists. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..f612ee2 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: * +Copyright: 2018 Timothée Floure +License: Apache-2.0 + +Files: debian/* +Copyright: 2018 Timothée Floure +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 + . + http://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". + diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..4b47ec8 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +RADME.md diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0b0627e --- /dev/null +++ b/debian/rules @@ -0,0 +1,28 @@ +#!/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) diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/unipoly-mlmmj-sync.rb b/unipoly-mlmmj-ldap-sync.rb similarity index 100% rename from unipoly-mlmmj-sync.rb rename to unipoly-mlmmj-ldap-sync.rb