From 5e4edc0b1400bc90a4ea1821ca3756c141a81931 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 11 Aug 2017 17:58:22 +0200 Subject: [PATCH] Debian packaging: init --- Makefile | 3 +++ apache/Makefile | 7 +++---- apache/mod_authn_subauth.conf | 10 +++++++++ apache/mod_authn_subauth.load | 1 + client/Makefile | 6 ++++++ debian/README | 6 ++++++ debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 30 +++++++++++++++++++++++++++ debian/copyright | 24 +++++++++++++++++++++ debian/libapache2-mod-subauth.apache2 | 3 +++ debian/rules | 27 ++++++++++++++++++++++++ debian/source/format | 1 + debian/subauth.service | 8 +++++++ pam/Makefile | 6 ++++++ server/Makefile | 6 ++++++ 16 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 apache/mod_authn_subauth.conf create mode 100644 apache/mod_authn_subauth.load create mode 100644 debian/README create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/libapache2-mod-subauth.apache2 create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/subauth.service diff --git a/Makefile b/Makefile index 71af79b..4f71f76 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ EXTRA_RUNDIRS=run CFLAGS+=$(LIBUCW_CFLAGS) $(LIBUCW_JSON_CFLAGS) LIBS+=$(LIBUCW_LIBS) $(LIBUCW_JSON_LIBS) +install:: +.PHONY: install + include $(s)/server/Makefile include $(s)/client/Makefile include $(s)/pam/Makefile diff --git a/apache/Makefile b/apache/Makefile index 4383fe5..022b70c 100644 --- a/apache/Makefile +++ b/apache/Makefile @@ -9,9 +9,8 @@ $(o)/apache/mod_authn_subauth.so: SO_RUNDIR=$(APACHE2_RUNDIR) $(o)/apache/mod_authn_subauth.oo: CFLAGS+=$(APACHE2_CFLAGS) -Wno-redundant-decls .PHONY: install-apache +install:: install-apache install-apache: install -d -m 755 $(DESTDIR)$(INSTALL_APACHE2_MOD_DIR) $(DESTDIR)$(INSTALL_APACHE2_CONFIG_DIR)/mods-available - install -m 755 run/$(APACHE2_RUNDIR)/mod_authn_subauth.so $(DESTDIR)$(INSTALL_APACHE2_MOD_DIR)/ -# install -m 644 $(s)/apache2/etc/mod_authn_subauth.load $(DESTDIR)$(INSTALL_APACHE2_CONFIG_DIR)/mods-available/ - -INSTALL_TARGETS+=install-apache + install -m 755 $(o)/apache/mod_authn_subauth.so $(DESTDIR)$(INSTALL_APACHE2_MOD_DIR)/ + install -m 644 $(s)/apache/mod_authn_subauth.load $(DESTDIR)$(INSTALL_APACHE2_CONFIG_DIR)/mods-available/ diff --git a/apache/mod_authn_subauth.conf b/apache/mod_authn_subauth.conf new file mode 100644 index 0000000..287ab23 --- /dev/null +++ b/apache/mod_authn_subauth.conf @@ -0,0 +1,10 @@ +# Example configuration for mod_authz_subauth + +# +# AuthType basic +# AuthName "Prove yourself!" +# AuthBasicProvider subauth +# # SubAuthSocket /var/run/subauthd.socket +# SubAuthZone web +# Require valid-user +# diff --git a/apache/mod_authn_subauth.load b/apache/mod_authn_subauth.load new file mode 100644 index 0000000..4f4de53 --- /dev/null +++ b/apache/mod_authn_subauth.load @@ -0,0 +1 @@ +LoadModule authn_subauth /usr/lib/apache2/modules/mod_authn_subauth.so diff --git a/client/Makefile b/client/Makefile index 608c26c..4ab4e29 100644 --- a/client/Makefile +++ b/client/Makefile @@ -3,3 +3,9 @@ DIRS+=client PROGS+=$(o)/client/subauth $(o)/client/subauth: $(o)/client/subauth.o + +.PHONY: install-client +install:: install-client +install-client: + install -d -m 755 $(DESTDIR)$(INSTALL_BIN_DIR) + install -m 755 $(o)/client/subauth $(DESTDIR)$(INSTALL_BIN_DIR) diff --git a/debian/README b/debian/README new file mode 100644 index 0000000..db0a861 --- /dev/null +++ b/debian/README @@ -0,0 +1,6 @@ +The Debian Package subauth +---------------------------- + +FIXME + + -- Martin Mares Fri, 11 Aug 2017 16:55:33 +0200 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..69930d7 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +subauth (0.9) unstable; urgency=low + + * Initial Release. + + -- Martin Mares Fri, 11 Aug 2017 16:55:33 +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..ab09e39 --- /dev/null +++ b/debian/control @@ -0,0 +1,30 @@ +Source: subauth +Section: unknown +Priority: optional +Maintainer: Martin Mares +Build-Depends: debhelper (>= 9), dh-systemd, libucw-dev, libucw-json-dev, libgcrypt20-dev, libpam0g-dev, apache2-dev +Standards-Version: 3.9.5 +Homepage: http://mj.ucw.cz/sw/ +Vcs-Git: git://git.ucw.cz/subauth.git +Vcs-Browser: http://www.ucw.cz/gitweb/?p=subauth.git;a=summary + +Package: subauth +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Sub-authentication daemon + The sub-authentication daemon allows users to define secondary + passwords and authentication tokens for specific services. + +Package: libpam-subauth +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: PAM module for the sub-authentication daemon + This package provides the glue between the sub-authentication + service and Linux Pluggable Authentication Modules. + +Package: libapache2-mod-subauth +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Apache2 module for the sub-authentication daemon + This package provides the glue between the sub-authentication + service and Apache2 authentication. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..cf19c12 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: subauth +Source: + +Files: * +Copyright: 2017 Martin Mares +License: GPL-2.0+ + +License: GPL-2.0+ + This program 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". diff --git a/debian/libapache2-mod-subauth.apache2 b/debian/libapache2-mod-subauth.apache2 new file mode 100644 index 0000000..ab7d9ce --- /dev/null +++ b/debian/libapache2-mod-subauth.apache2 @@ -0,0 +1,3 @@ +mod obj/apache/mod_authn_subauth.so +mod apache/mod_authn_subauth.load +mod apache/mod_authn_subauth.conf diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..6343182 --- /dev/null +++ b/debian/rules @@ -0,0 +1,27 @@ +#!/usr/bin/make -f +#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 $@ --with=apache2,systemd + +override_dh_auto_configure: + ./configure PREFIX=/usr + +override_dh_auto_install: + make DESTDIR=debian/subauth install-server install-client + make DESTDIR=debian/libpam-subauth INSTALL_LIB_DIR=/lib/$(DEB_HOST_MULTIARCH) install-pam +### make DESTDIR=debian/libapache2-mod-subauth install-apache 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/debian/subauth.service b/debian/subauth.service new file mode 100644 index 0000000..1fb5913 --- /dev/null +++ b/debian/subauth.service @@ -0,0 +1,8 @@ +[Unit] +Description=Sub-authentication daemon + +[Service] +ExecStart=/usr/sbin/subauthd + +[Install] +WantedBy=multi-user.target diff --git a/pam/Makefile b/pam/Makefile index 06e68ad..04edf03 100644 --- a/pam/Makefile +++ b/pam/Makefile @@ -4,3 +4,9 @@ PROGS+=$(o)/pam/pam_subauth.so $(o)/pam/pam_subauth.so: $(o)/pam/pam_subauth.oo $(o)/pam/pam_subauth.so: LIBS+=-lpam + +.PHONY: install-pam +install:: install-pam +install-pam: + install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR)/security + install -m 644 $(o)/pam/pam_subauth.so $(DESTDIR)$(INSTALL_LIB_DIR)/security diff --git a/server/Makefile b/server/Makefile index b4b6446..68f6d1b 100644 --- a/server/Makefile +++ b/server/Makefile @@ -6,3 +6,9 @@ CONFIGS+=subauthd $(o)/server/subauthd: $(addprefix $(o)/server/, subauthd.o cmd.o auth.o temp.o) $(o)/server/subauthd: LIBS+=$(LIBGCRYPT_LIBS) $(o)/server/auth.o: CFLAGS+=$(LIBGCRYPT_CFLAGS) + +.PHONY: install-server +install:: install-server +install-server: + install -d -m 755 $(DESTDIR)$(INSTALL_SBIN_DIR) + install -m 755 $(o)/server/subauthd $(DESTDIR)$(INSTALL_SBIN_DIR) -- 2.39.2