From 5e96e45b998fa81e140c4b3d7c25442dd1d13fab Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 23 Jan 2012 10:59:27 +0100 Subject: [PATCH] dcron: build PIE binaries by default. --- .../patches/respect_cflags_and_ldflags.patch | 23 +++++++++++++++++++ srcpkgs/dcron/template | 11 +++++---- 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/dcron/patches/respect_cflags_and_ldflags.patch diff --git a/srcpkgs/dcron/patches/respect_cflags_and_ldflags.patch b/srcpkgs/dcron/patches/respect_cflags_and_ldflags.patch new file mode 100644 index 00000000000..431bdd653f3 --- /dev/null +++ b/srcpkgs/dcron/patches/respect_cflags_and_ldflags.patch @@ -0,0 +1,23 @@ +--- Makefile.orig 2012-01-23 10:56:26.473607101 +0100 ++++ Makefile 2012-01-23 10:57:43.806746482 +0100 +@@ -32,7 +32,6 @@ TABSRCS = crontab.c chuser.c + TABOBJS = crontab.o chuser.o + PROTOS = protos.h + LIBS = +-LDFLAGS = + DEFS = -DVERSION='"$(VERSION)"' \ + -DSCRONTABS='"$(SCRONTABS)"' -DCRONTABS='"$(CRONTABS)"' \ + -DCRONSTAMPS='"$(CRONSTAMPS)"' -DLOG_IDENT='"$(LOG_IDENT)"' \ +@@ -54,10 +53,10 @@ protos.h: $(SRCS) $(TABSRCS) + fgrep -h Prototype $(SRCS) $(TABSRCS) > protos.h + + crond: $(OBJS) +- $(CC) $(LDFLAGS) $^ $(LIBS) -o crond ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o crond + + crontab: $(TABOBJS) +- $(CC) $(LDFLAGS) $^ -o crontab ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o crontab + + %.o: %.c defs.h $(PROTOS) + $(CC) $(CFLAGS) $(CPPFLAGS) -c $(DEFS) $< -o $@ diff --git a/srcpkgs/dcron/template b/srcpkgs/dcron/template index e0252405643..cc8b86e6e4c 100644 --- a/srcpkgs/dcron/template +++ b/srcpkgs/dcron/template @@ -1,7 +1,7 @@ # Template file for 'dcron' pkgname=dcron version=4.5 -revision=14 +revision=15 distfiles="http://www.jimpryor.net/linux/releases/dcron-${version}.tar.gz" short_desc="Dillon's lightweight cron daemon" maintainer="Juan RP " @@ -22,15 +22,16 @@ conf_files="/var/spool/cron/root" provides="cron-daemon-0" replaces="cron-daemon>=0" +# Build PIE binaries by default. +CFLAGS="-fPIE" +LDFLAGS="-pie" -do_build() -{ +do_build() { make PREFIX=/usr CRONTAB_GROUP=users CRONTABS=/var/spool/cron \ CRONSTAMPS=/var/spool/cronstamps ${makejobs} } -do_install() -{ +do_install() { make DESTDIR=${DESTDIR} install for f in etc/cron.d etc/cron.hourly etc/cron.weekly etc/cron.monthly \