otpw: pass LDFLAGS

This commit is contained in:
Duncaen 2016-05-24 16:44:03 +02:00
parent 21459876fc
commit ff442d392b
2 changed files with 25 additions and 3 deletions

View file

@ -0,0 +1,23 @@
--- Makefile
+++ Makefile
@@ -17,9 +17,9 @@ TARGETS=otpw-gen demologin pam_otpw.so pam_otpw.8.gz otpw-gen.1.gz
all: $(TARGETS)
otpw-gen: otpw-gen.o rmd160.o md.o otpw.o
- $(CC) -o $@ $+
+ $(CC) -o $@ $+ $(LDFLAGS)
demologin: demologin.o otpw.o rmd160.o md.o
- $(CC) -o $@ $+ -lcrypt
+ $(CC) -o $@ $+ -lcrypt $(LDFLAGS)
otpw-gen.o: otpw-gen.c md.h otpw.h
otpw.o: otpw.c otpw.h md.h
@@ -28,7 +28,7 @@ rmd160.o: rmd160.c rmd160.h
otpw-l.o: otpw-l.c otpw.c otpw.h md.h
pam_otpw.o: pam_otpw.c otpw.h md.h
pam_otpw.so: pam_otpw.o otpw-l.o rmd160.o md.o
- ld --shared -o $@ $+ -lcrypt -lpam -lpam_misc
+ $(CC) -shared -o $@ $+ -lcrypt -lpam -lpam_misc $(LDFLAGS)
distribution:
git archive --prefix otpw-$(VERSION)/ -o otpw-$(VERSION).tar.gz v$(VERSION)

View file

@ -1,7 +1,7 @@
# Template file for 'otpw'
pkgname=otpw
version=1.5
revision=4
revision=5
conf_files="/etc/pam.d/ssh-otpw"
makedepends="pam-devel"
short_desc="A one-time password login package"
@ -12,8 +12,7 @@ distfiles="https://www.cl.cam.ac.uk/%7Emgk25/download/otpw-${version}.tar.gz"
checksum=98aca38a61c7713677b96f24426ca7053480c0fd077d91b1e99bc9f92ccb832a
do_build() {
sed -i "s|ld --shared|$CC -shared|" Makefile
make CC=$CC LD=$LD CFLAGS="$CFLAGS -fPIC" ${makejobs}
make CC=$CC LD=$LD CFLAGS="$CFLAGS -fPIC" LDFLAGS="$LDFLAGS" ${makejobs}
}
do_install() {
vinstall pam_otpw.so 755 /usr/lib/security