Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration files to generate a Debian package #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.so
*.lo
*.la
debian/libpam-latch
16 changes: 16 additions & 0 deletions debian/README.Debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This version of pam-latch supports using a config file, eg:
/etc/latch/latch.conf to hold configuration. This file needn't
be world readable and isn't per default in debian. You can change this
with the command ``dpkg-reconfigure -plow libpam-latch''.

In order to use this configuration file you simply type something like
the following in your pam-file (eg. /etc/pam.d/ssh):

auth required pam_latch.so config=/etc/latch/latch.conf accounts=/etc/latch/latch.accounts operation=operation otp=yes

And edit /etc/latch/latch.conf to your liking.

This is not neccesarily a good idea.


Fran Dieguez <[email protected]> -- Thu, 4 Dec 2014 18:59:27 +0100
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pam-latch (0.1-0) trusty; urgency=medium

* Initial release

-- Fran Dieguez <[email protected]> Thu, 4 Dec 2014 18:59:27 +0100
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7
1 change: 1 addition & 0 deletions debian/conffiles
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/latch/latch.conf
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: pam-latch
Section: admin
Priority: extra
Maintainer: Fran Dieguez <[email protected]>
Standards-Version: 3.9.5
Build-Depends: libpam0g-dev, libcurl4-openssl-dev, debhelper (>= 5.0.0), libssl-dev, autotools-dev, debconf (>= 0.2.26)

Package: libpam-latch
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: PAM module allowing authentication from Latch
This module lets you use the Latch (https://latch.elevenpaths.com/)
as a source of authentication (but not session or other) information
for PAM-enabled apps.
19 changes: 19 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
This package was created by Fran Dieguez <[email protected]>.

Copyright 2014, Fran Diegeuz <[email protected]>

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 program 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, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Full text of GPL is available in /usr/share/common-licenses/GPL-2
2 changes: 2 additions & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
etc
lib/security
31 changes: 31 additions & 0 deletions debian/latch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Configuration file for the latch UNIX plugin
#

# Identify your Application
# Application ID value
#
app_id = REPLACE_APP_ID_HERE

# Secret key value
#
secret_key = REPLACE_SECRET_KEY_HERE

# Latch host value
#
latch_host = https://latch.elevenpaths.com

#
# Default action when latch is not available
# Options: open, close
action = open

# Set timeout value
timeout = 8

# Operations
sshd-login = REPLACE_OPERATION_ID_HERE
sshd-keys = REPLACE_OPERATION_ID_HERE
login = REPLACE_OPERATION_ID_HERE
sudo = REPLACE_OPERATION_ID_HERE
su = REPLACE_OPERATION_ID_HERE
12 changes: 12 additions & 0 deletions debian/libpam-latch.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# Exit on error
set -e

. /usr/share/debconf/confmodule

if [ -e /etc/latch/latch.conf ]; then
db_input high pam-latch/app-id || true
db_input high pam-latch/app-secret || true
db_go
fi
2 changes: 2 additions & 0 deletions debian/libpam-latch.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
README.md
examples
1 change: 1 addition & 0 deletions debian/libpam-latch.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/* lib/security/
17 changes: 17 additions & 0 deletions debian/libpam-latch.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

. /usr/share/debconf/confmodule

if [ -e /etc/latch/latch.conf ] ; then

db_get high pam-latch/app-id
setup_appid=${RET:-LATCH_APP_ID}
sed -i "s/app_id = .*/app_id = $setup_appid/g" /etc/latch/latch.conf;

db_get high pam-latch/app-secret
setup_appsecretid=${RET:-LATCH_APP_SECRET_ID}
sed -i "s/secret_key = .*/secret_key = $setup_appsecretid/g" /etc/latch/latch.conf;
fi

#DEBHELPER#
.
1 change: 1 addition & 0 deletions debian/libpam-latch.substvarsold
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shlibs:Depends=libc6 (>= 2.7-1), libssl1.0.0
15 changes: 15 additions & 0 deletions debian/libpam-latch.templates
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Template: pam-latch/app-id
Type: string
Default: LATCH_APP_ID
Description: Latch application id:
Latch requires an application ID in order to work. Please go to
https://latch.elevenpaths.com/www/developers/editapplication,
create a new app and get your "Application ID"

Template: pam-latch/app-secret
Type: string
Default: LATCH_APP_SECRET_ID
Description: Latch application secret id:
Latch requires an application secret ID in order to
work. Copy here your "secret" from
https://latch.elevenpaths.com/www/developers/editapplication.
64 changes: 64 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/make -f
# -*- makefile -*-

arrange: arrange-stamp
arrange-stamp: install
touch arrange-stamp

binary: binary-stamp
binary-stamp: binary-arch binary-indep
touch binary-stamp

binary-arch: binary-arch-stamp
binary-arch-stamp: arrange
dh_testdir
dh_testroot
dh_installdocs
dh_installdebconf
dh_installchangelogs ChangeLog upstream
dh_link
dh_shlibdeps
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
touch binary-arch-stamp

binary-indep: binary-indep-stamp
binary-indep-stamp: arrange
touch binary-indep-stamp

build: build-stamp
build-stamp: config
dh_testdir
$(MAKE)
touch build-stamp

clean:
dh_testdir
dh_testroot
-$(MAKE) distclean
dh_autotools-dev_restoreconfig
dh_clean arrange-stamp binary-stamp binary-arch-stamp binary-indep-stamp build-stamp config-stamp install-stamp

config: config-stamp
config-stamp:
dh_testdir
dh_autotools-dev_updateconfig
./configure --prefix=/usr --with-pam_mods_dir=/lib/security --with-pam=/usr
touch config-stamp

install: install-stamp
install-stamp: build
dh_testdir
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/libpam-latch
mv debian/libpam-latch/usr/lib/pam_latch.so debian/libpam-latch/lib/security/pam_latch.so
# No, we _definitely_ don't need libtool's .la files in lib/security
rm -rf debian/libpam-latch/usr/lib/
touch install-stamp

.PHONY: build clean binary-indep binary-arch binary install force-clean
4 changes: 2 additions & 2 deletions pam/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ endif
lib_LTLIBRARIES = pam_latch.la
pam_latch_la_SOURCES = pam_latch.c ../lib/latch.c ../lib/latch.h ../lib/util.c ../lib/util.h
pam_latch_la_LDFLAGS = -module -avoid-version
bin_PROGRAMS = test
test_SOURCES = test.c
bin_PROGRAMS = latch-test
test_SOURCES = latch-test.c

pam_latch_LIBS = @LIBS@ -lpam -lcurl -lcrypto -lssl -ldl

Expand Down
20 changes: 10 additions & 10 deletions pam/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@OSLINUX_TRUE@am__append_1 = -lpam_misc
bin_PROGRAMS = test$(EXEEXT)
bin_PROGRAMS = latch-test$(EXEEXT)
subdir = pam
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
Expand Down Expand Up @@ -130,12 +130,12 @@ pam_latch_la_OBJECTS = $(am_pam_latch_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__v_lt_1 =
pam_latch_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(pam_latch_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS)
am_test_OBJECTS = test.$(OBJEXT)
am_test_OBJECTS = latch-test.$(OBJEXT)
test_OBJECTS = $(am_test_OBJECTS)
test_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
Expand All @@ -145,11 +145,11 @@ am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp =
am__depfiles_maybe =
Expand All @@ -162,15 +162,15 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
am__v_CCLD_1 =
SOURCES = $(pam_latch_la_SOURCES) $(test_SOURCES)
DIST_SOURCES = $(pam_latch_la_SOURCES) $(test_SOURCES)
am__can_run_installinfo = \
Expand Down Expand Up @@ -212,7 +212,7 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS =
DEFS =
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
Expand Down Expand Up @@ -397,7 +397,7 @@ clean-libLTLIBRARIES:
../lib/latch.lo: ../lib/$(am__dirstamp)
../lib/util.lo: ../lib/$(am__dirstamp)

pam_latch.la: $(pam_latch_la_OBJECTS) $(pam_latch_la_DEPENDENCIES) $(EXTRA_pam_latch_la_DEPENDENCIES)
pam_latch.la: $(pam_latch_la_OBJECTS) $(pam_latch_la_DEPENDENCIES) $(EXTRA_pam_latch_la_DEPENDENCIES)
$(AM_V_CCLD)$(pam_latch_la_LINK) -rpath $(libdir) $(pam_latch_la_OBJECTS) $(pam_latch_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
Expand Down Expand Up @@ -449,7 +449,7 @@ clean-binPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list

test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES)
test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES)
@rm -f test$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS)

Expand Down
File renamed without changes.