Skip to content

Commit

Permalink
Merge pull request #1489 from hadfl/pam_radius
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it authored Jul 20, 2024
2 parents 4fe572b + 043a9ff commit a57345f
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 0 deletions.
79 changes: 79 additions & 0 deletions build/pam_radius/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

. ../../lib/build.sh

PROG=pam_radius
VER=2.0.0
PKG=ooce/security/pam_radius
SUMMARY="RADIUS PAM module"
DESC="PAM to RADIUS authentication module"

test_relver '>=' 151051 && set_clangver

set_builddir $PROG-release_${VER//./_}

XFORM_ARGS="
-DPREFIX=${PREFIX#/}
-DPROG=$PROG
"

NO_SONAME_EXPECTED=1

LDFLAGS[i386]+=" -lssp_ns"

save_variables CFLAGS LDFLAGS

pre_make() {
typeset arch=$1

restore_variables CFLAGS LDFLAGS

subsume_arch $arch CFLAGS
subsume_arch $arch LDFLAGS

CFLAGS+=" $CTF_CFLAGS"
CFLAGS+=" -DCONF_FILE=\\\"/etc$PREFIX/$PROG/${PROG}_auth.conf\\\""
LDFLAGS+=" -L${SYSROOT[$arch]}/usr/${LIBDIRS[$arch]} -lsocket"
}

pre_install() {
typeset arch=$1

PAMDIR=$PREFIX/lib/${LIBDIRS[$arch]/lib/security}

logcmd $MKDIR -p $DESTDIR$PAMDIR || logerr "mkdir failed"
logcmd $MKDIR -p $DESTDIR/etc$PREFIX/$PROG || logerr "mkdir failed"

logcmd $CP $TMPDIR/$BUILDDIR/${PROG}_auth.so $DESTDIR$PAMDIR \
|| logerr "copying PAM module failed"
logcmd $CP $TMPDIR/$BUILDDIR/${PROG}_auth.conf $DESTDIR/etc$PREFIX/$PROG \
|| logerr "copying PAM config failed"

# no install target
false
}

init
download_source $PROG release_${VER//./_}
patch_source
prep_build
build
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
18 changes: 18 additions & 0 deletions build/pam_radius/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

license LICENSE license=GPLv2

<transform dir path=etc/$(PREFIX)/$(PROG) -> set mode 0700>
<transform file path=etc/$(PREFIX)/$(PROG) -> set mode 0600>
<transform file path=etc/$(PREFIX)/$(PROG) -> set preserve renamenew>

14 changes: 14 additions & 0 deletions build/pam_radius/patches/ldflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
this fixes linking ssp_ns for the 32-bit build

diff -wpruN --no-dereference '--exclude=*.orig' a~/Makefile a/Makefile
--- a~/Makefile 1970-01-01 00:00:00
+++ a/Makefile 1970-01-01 00:00:00
@@ -65,7 +65,7 @@ src/md5.o: src/md5.c src/md5.h
# gcc -shared pam_radius_auth.o md5.o -lpam -lc -o pam_radius_auth.so
#
pam_radius_auth.so: src/pam_radius_auth.o src/md5.o
- $(CC) $(LDFLAGS) $^ -lpam -o pam_radius_auth.so
+ $(CC) $^ -lpam -o pam_radius_auth.so $(LDFLAGS)

######################################################################
#
1 change: 1 addition & 0 deletions build/pam_radius/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ldflags.patch
1 change: 1 addition & 0 deletions doc/baseline
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ extra.omnios ooce/runtime/tcl
extra.omnios ooce/security/gnupg
extra.omnios ooce/security/minisign
extra.omnios ooce/security/oath-toolkit
extra.omnios ooce/security/pam_radius
extra.omnios ooce/server/apache-24
extra.omnios ooce/server/apache-24/modules/fcgid
extra.omnios ooce/server/apache-24/modules/subversion
Expand Down
1 change: 1 addition & 0 deletions doc/baseline.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extra.omnios ooce/print/cups
extra.omnios ooce/security/gnupg
extra.omnios ooce/security/minisign
extra.omnios ooce/security/oath-toolkit
extra.omnios ooce/security/pam_radius
extra.omnios ooce/system/htop
extra.omnios ooce/terminal/minicom
extra.omnios ooce/text/datamash
Expand Down
1 change: 1 addition & 0 deletions doc/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
| ooce/security/gnupg | 2.4.5 | https://gnupg.org/download/ | [omniosorg](https://github.com/omniosorg)
| ooce/security/minisign | 0.11 | https://github.com/jedisct1/minisign/releases | [omniosorg](https://github.com/omniosorg)
| ooce/security/oath-toolkit | 2.6.11 | https://download.savannah.nongnu.org/releases/oath-toolkit/ | [omniosorg](https://github.com/omniosorg)
| ooce/security/pam_radius | 2.0.0 | https://github.com/FreeRADIUS/pam_radius/tags | [omniosorg](https://github.com/omniosorg)
| ooce/server/apache-24 | 2.4.61 | https://downloads.apache.org/httpd/ | [omniosorg](https://github.com/omniosorg)
| ooce/server/apache-24/modules/fcgid | 2.3.9 | https://downloads.apache.org/httpd/mod_fcgid/ | [omniosorg](https://github.com/omniosorg)
| ooce/server/apache-24/modules/wsgi | 5.0.0 | https://github.com/GrahamDumpleton/mod_wsgi/tags/ | [cgrzemba](https://github.com/cgrzemba)
Expand Down
1 change: 1 addition & 0 deletions doc/pkglist.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ ooce/multimedia/x265
ooce/library/libde265
ooce/database/mariadb-common
ooce/library/icu4c
ooce/security/pam_radius
###############################################################################
.SYSROOT
ooce/audio/flac
Expand Down

0 comments on commit a57345f

Please sign in to comment.