From b1374196f9623a20e3cd7a941cbf92518aa3aed6 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sun, 14 Dec 2014 13:49:26 +0100 Subject: [PATCH] Add debian packaging stuff --- LICENSE.md | 14 +++++++ Make.Rules | 87 +++++++++++++++++++++++++++++++++++++++++++ Makefile | 28 ++++++++++++++ debian/.gitignore | 3 ++ debian/changelog | 6 +++ debian/control | 9 +++++ debian/debhelper.log | 22 +++++++++++ debian/files | 1 + debian/rules | 26 +++++++++++++ debian/source/format | 1 + debian/source/options | 1 + debian/substvars | 3 ++ 12 files changed, 201 insertions(+) create mode 100644 LICENSE.md create mode 100644 Make.Rules create mode 100644 Makefile create mode 100644 debian/.gitignore create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/debhelper.log create mode 100644 debian/files create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/options create mode 100644 debian/substvars diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..ee7d6a5 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/Make.Rules b/Make.Rules new file mode 100644 index 0000000..d5fadc8 --- /dev/null +++ b/Make.Rules @@ -0,0 +1,87 @@ +# +## Optional prefixes: +# + +# common 'packaging' directoty + +FAKEROOT=$(DESTDIR) + +# Autoconf-style prefixes are activated when $(prefix) is defined. +# Otherwise binaries and libraries are installed in /{lib,sbin}/, +# header files in /usr/include/ and documentation in /usr/man/man?/. +# These choices are motivated by the fact that getcap and setcap are +# administrative operations that could be needed to recover a system. + +ifndef lib +lib=$(shell ldd /usr/bin/ld|egrep "ld-linux|ld.so"|cut -d/ -f2) +endif + +ifdef prefix +exec_prefix=$(prefix) +lib_prefix=$(exec_prefix) +inc_prefix=$(lib_prefix) +man_prefix=$(prefix)/share +else +prefix=/usr +exec_prefix= +lib_prefix=$(exec_prefix) +inc_prefix=$(prefix) +man_prefix=$(prefix)/share +endif + +# Target directories + +MANDIR=$(FAKEROOT)$(man_prefix)/man +SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin +INCDIR=$(FAKEROOT)$(inc_prefix)/include +LIBDIR=$(FAKEROOT)$(lib_prefix)/$(lib) +PKGCONFIGDIR=$(FAKEROOT)$(prefix)/$(lib)/pkgconfig + +# common defines for libcap +LIBTITLE=pam-email +VERSION=0 +MINOR=1 +# + +# Compilation specifics + +KERNEL_HEADERS := $(topdir)/libcap/include/uapi +IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include + +CC := gcc +CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 +BUILD_CC := $(CC) +BUILD_CFLAGS := $(CFLAGS) $(IPATH) +AR := ar +RANLIB := ranlib +DEBUG = -g #-DDEBUG +WARNINGS=-Wall -Wwrite-strings \ + -Wpointer-arith -Wcast-qual -Wcast-align \ + -Wstrict-prototypes -Wmissing-prototypes \ + -Wnested-externs -Winline -Wshadow +LD=$(CC) -Wl,-x -shared +LDFLAGS := #-g + +SYSTEM_HEADERS = /usr/include +INCS=$(topdir)/libcap/include/sys/capability.h +LDFLAGS += -L$(topdir)/libcap +CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) +PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi) +INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi) +DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi) +LIBATTR := yes + +# When installing setcap, set its inheritable bit to be able to place +# capabilities on files. It can be used in conjunction with pam_cap +# (associated with su and certain users say) to make it useful for +# specially blessed users. If you wish to drop this install feature, +# use this command when running install +# +# make RAISE_SETFCAP=no install +# +RAISE_SETFCAP := $(LIBATTR) + +# Global cleanup stuff + +LOCALCLEAN=rm -f *~ core +DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8d61e6a --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +# +# Makefile for pam-email +# +topdir=$(shell pwd) +include Make.Rules + +# +# flags +# + +all install clean: %: %-here + $(MAKE) -C src $@ + +all-here: + +install-here: + +clean-here: + $(LOCALCLEAN) + +distclean: clean + $(DISTCLEAN) + +release: distclean + cd .. && tar --exclude cvf pam-email/.git pam-email-$(VERSION).$(MINOR).tar pam-email/* + +tagrelease: distclean + make release diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..141d3ad --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,3 @@ +!.gitignore +debhelper.log +tmp diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..181e0ae --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +pam-email (1:0.1.0) trusty; urgency=high + + * Initial release + + -- Peter Surda Sun, 15 Dec 2014 12:40:00 +0100 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..cb36a2d --- /dev/null +++ b/debian/control @@ -0,0 +1,9 @@ +Source: pam-email +Section: libs +Maintainer: Peter Surda +Build-Depends: libcurl-dev, libpam-dev + +Package: pam-email +Architecture: any +Multi-Arch: same +Description: Send tokens by email for authentication diff --git a/debian/debhelper.log b/debian/debhelper.log new file mode 100644 index 0000000..94879cd --- /dev/null +++ b/debian/debhelper.log @@ -0,0 +1,22 @@ +dh_auto_configure +override_dh_auto_build dh_auto_build +dh_auto_build +dh_auto_test +dh_prep +override_dh_auto_install dh_auto_install +dh_auto_install +dh_installdocs +dh_installchangelogs +dh_perl +dh_link +dh_compress +dh_fixperms +dh_strip +override_dh_makeshlibs dh_makeshlibs +dh_makeshlibs +dh_shlibdeps +dh_installdeb +dh_gencontrol +dh_md5sums +dh_builddeb +dh_builddeb diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..3318420 --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +pam-email_0.1.0_amd64.deb libs - diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..e7169cc --- /dev/null +++ b/debian/rules @@ -0,0 +1,26 @@ +#!/usr/bin/make -f + +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +CC := gcc +else +CC := $(DEB_HOST_GNU_TYPE)-gcc +endif + +%: + dh $@ + +override_dh_auto_build: + dh_auto_build -- CC=$(CC) BUILD_CC=gcc + +override_dh_auto_install: + dh_auto_install -- lib=lib/$(DEB_HOST_MULTIARCH) + +override_dh_makeshlibs: + dh_makeshlibs + +get-orig-source: + -uscan --upstream-version 0 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) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..8217775 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +tar-ignore = ".git" diff --git a/debian/substvars b/debian/substvars new file mode 100644 index 0000000..d1b5d10 --- /dev/null +++ b/debian/substvars @@ -0,0 +1,3 @@ +misc:Pre-Depends=multiarch-support +shlibs:Depends=libcurl3 (>= 7.16.2), libpam0g (>= 0.99.7.1) +misc:Depends=