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
$(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/
--- /dev/null
+# Example configuration for mod_authz_subauth
+
+# <Location />
+# AuthType basic
+# AuthName "Prove yourself!"
+# AuthBasicProvider subauth
+# # SubAuthSocket /var/run/subauthd.socket
+# SubAuthZone web
+# Require valid-user
+# </Location>
--- /dev/null
+LoadModule authn_subauth /usr/lib/apache2/modules/mod_authn_subauth.so
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)
--- /dev/null
+The Debian Package subauth
+----------------------------
+
+FIXME
+
+ -- Martin Mares <mj@ucw.cz> Fri, 11 Aug 2017 16:55:33 +0200
--- /dev/null
+subauth (0.9) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Martin Mares <mj@ucw.cz> Fri, 11 Aug 2017 16:55:33 +0200
--- /dev/null
+Source: subauth
+Section: unknown
+Priority: optional
+Maintainer: Martin Mares <mj@ucw.cz>
+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.
--- /dev/null
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: subauth
+Source: <http://mj.ucw.cz/sw/>
+
+Files: *
+Copyright: 2017 Martin Mares <mj@ucw.cz>
+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 <http://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".
--- /dev/null
+mod obj/apache/mod_authn_subauth.so
+mod apache/mod_authn_subauth.load
+mod apache/mod_authn_subauth.conf
--- /dev/null
+#!/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
--- /dev/null
+3.0 (native)
--- /dev/null
+[Unit]
+Description=Sub-authentication daemon
+
+[Service]
+ExecStart=/usr/sbin/subauthd
+
+[Install]
+WantedBy=multi-user.target
$(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
$(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)