patch-Makefile 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --- gradm.orig/Makefile 2014-05-29 00:51:00.000000000 +0200
  2. +++ gradm/Makefile 2014-06-23 12:13:04.000000000 +0200
  3. @@ -11,25 +11,25 @@ GRADM_PAM=gradm_pam
  4. GRSEC_DIR=/etc/grsec
  5. LLEX=/usr/bin/lex
  6. -FLEX=/usr/bin/flex
  7. -LEX := $(shell if [ -x $(FLEX) ]; then echo $(FLEX); else echo $(LLEX); fi)
  8. +FLEX?=/usr/bin/flex
  9. +LEX?=$(FLEX)
  10. LEXFLAGS=-Cfa -B
  11. #ubuntu broke byacc for who knows why, disable it
  12. #BYACC=/usr/bin/byacc
  13. -BISON=/usr/bin/bison
  14. +BISON?=/usr/bin/bison
  15. #YACC := $(shell if [ -x $(BYACC) ]; then echo $(BYACC); else echo $(BISON); fi)
  16. YACC=$(BISON)
  17. MKNOD=/bin/mknod
  18. #for dietlibc
  19. #CC=/usr/bin/diet /usr/bin/gcc
  20. -CC=/usr/bin/gcc
  21. -FIND=/usr/bin/find
  22. -STRIP=/usr/bin/strip
  23. -LIBS := $(shell if [ "`uname -m`" != "sparc64" -a "`uname -m`" != "x86_64" ]; then echo "-lfl" ; else echo "" ; fi)
  24. +CC?=/usr/bin/gcc
  25. +FIND?=/usr/bin/find
  26. +STRIP=
  27. OPT_FLAGS := -O2
  28. # for older versions of grsecurity, comment the above line and uncomment the below:
  29. #OPT_FLAGS := $(shell if [ "`uname -m`" != "sparc64" ] && [ "`uname -m`" != "x86_64" ]; then echo "-O2" ; else echo "-O2 -m64" ; fi)
  30. -CFLAGS := $(OPT_FLAGS) -Wcast-qual -DGRSEC_DIR=\"$(GRSEC_DIR)\" -D_LARGEFILE64_SOURCE
  31. +CFLAGS ?=
  32. +CFLAGS += -Wcast-qual -DGRSEC_DIR=\"$(GRSEC_DIR)\" -D_LARGEFILE64_SOURCE
  33. LDFLAGS=
  34. INSTALL = /usr/bin/install -c
  35. @@ -140,7 +140,6 @@ install: $(GRADM_BIN) gradm.8 policy grl
  36. @mkdir -p $(DESTDIR)/sbin
  37. @echo "Installing gradm..."
  38. @$(INSTALL) -m 0755 $(GRADM_BIN) $(DESTDIR)/sbin
  39. - @$(STRIP) $(DESTDIR)/sbin/$(GRADM_BIN)
  40. @if [ -f $(GRADM_PAM) ] ; then \
  41. echo "Installing gradm_pam..." ; \
  42. $(INSTALL) -m 4755 $(GRADM_PAM) $(DESTDIR)/sbin ; \
  43. @@ -148,7 +147,6 @@ install: $(GRADM_BIN) gradm.8 policy grl
  44. fi
  45. @echo "Installing grlearn..."
  46. @$(INSTALL) -m 0700 grlearn $(DESTDIR)/sbin
  47. - @$(STRIP) $(DESTDIR)/sbin/grlearn
  48. @mkdir -p -m 700 $(DESTDIR)$(GRSEC_DIR)
  49. @if [ ! -f $(DESTDIR)$(GRSEC_DIR)/policy ] ; then \
  50. if [ -f $(DESTDIR)$(GRSEC_DIR)/acl ] ; then \
  51. @@ -161,29 +159,6 @@ install: $(GRADM_BIN) gradm.8 policy grl
  52. @if [ ! -f $(DESTDIR)$(GRSEC_DIR)/learn_config ] ; then \
  53. $(INSTALL) -m 0600 learn_config $(DESTDIR)$(GRSEC_DIR) ; \
  54. fi
  55. - @if [ -z "`cut -d" " -f3 /proc/mounts | grep "^devfs"`" ] ; then \
  56. - rm -f $(DESTDIR)/dev/grsec ; \
  57. - if [ ! -e $(DESTDIR)/dev/grsec ] ; then \
  58. - mkdir -p $(DESTDIR)/dev ; \
  59. - $(MKNOD) -m 0622 $(DESTDIR)/dev/grsec c 1 13 ; \
  60. - fi \
  61. - fi
  62. - @if [ -d $(DESTDIR)/etc/udev/rules.d ] ; then \
  63. - echo "ACTION!=\"add|change\", GOTO=\"permissions_end\"" > $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
  64. - echo "KERNEL==\"grsec\", MODE=\"0622\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
  65. - echo "LABEL=\"permissions_end\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
  66. - fi
  67. - @if [ -f $(DESTDIR)/sbin/udevadm ] ; then \
  68. - $(DESTDIR)/sbin/udevadm trigger --action=change ; \
  69. - fi
  70. - @echo "Installing gradm manpage..."
  71. - @mkdir -p $(DESTDIR)$(MANDIR)/man8
  72. - @$(INSTALL) -m 0644 gradm.8 $(DESTDIR)$(MANDIR)/man8/$(GRADM_BIN).8
  73. - @if [ -x /sbin/$(GRADM_BIN) ] ; then \
  74. - if [ -z $(DESTDIR) ] && [ ! -f $(GRSEC_DIR)/pw ] ; then \
  75. - /sbin/$(GRADM_BIN) -P ; \
  76. - fi \
  77. - fi
  78. @true
  79. clean: