Skip to content

Commit

Permalink
Fix system install
Browse files Browse the repository at this point in the history
  • Loading branch information
prodrigestivill authored and trufae committed Apr 15, 2024
1 parent 043093e commit a24d726
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions config.mk.acr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ HOST_OS=@HOST_OS@
LIBDIR=@LIBDIR@
INSTALL_LIB=@INSTALL_LIB@

R2_LIBR_PLUGINS_DIR=$(shell r2 -H R2_LIBR_PLUGINS)
R2PM_USRPLUGIN_DIR=$(shell r2 -H R2_USER_PLUGINS)
LIBEXT=$(shell r2 -H R2_LIBEXT)
#LIBYARA_CFLAGS=@LIBYARA_CFLAGS@
Expand Down
26 changes: 16 additions & 10 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include ../config.mk
CFLAGS+=-g

MOD=core_yara
RULESDIR=rules-yara3

all: $(MOD).$(LIBEXT)

Expand All @@ -15,20 +16,25 @@ clean:
mrproper: clean
rm -f Makefile

RULESDIR=$(R2PM_USRPLUGIN_DIR)/rules-yara3
install:
${INSTALL_LIB} ${MOD}.${LIBEXT} $(R2_LIBR_PLUGINS_DIR)/${MOD}.${LIBEXT}
mkdir -p $(R2_LIBR_PLUGINS_DIR)/$(RULESDIR)
cp -f ../rules/*.yara $(R2_LIBR_PLUGINS_DIR)/$(RULESDIR)/

user-install install:
user-install:
${INSTALL_LIB} ${MOD}.${LIBEXT} $(R2PM_USRPLUGIN_DIR)/${MOD}.${LIBEXT}
mkdir -p $(RULESDIR)
cp -rf ../rules/*.yara $(RULESDIR)
mkdir -p $(R2PM_USRPLUGIN_DIR)/$(RULESDIR)
cp -f ../rules/*.yara $(R2PM_USRPLUGIN_DIR)/$(RULESDIR)/

symstall:
ln -fs ${PWD}/${MOD}.${LIBEXT} $(R2PM_USRPLUGIN_DIR)/$(MOD).$(LIBEXT)
rm -rf $(R2PM_USRPLUGIN_DIR)/yara
mkdir -p $(RULESDIR)
for a in *.gz ; do ln -fs $(PWD)/$$a $(RULESDIR)/$$a ; done
mkdir -p $(R2PM_USRPLUGIN_DIR)/$(RULESDIR)
for a in *.gz ; do ln -fs $(PWD)/$$a $(R2PM_USRPLUGIN_DIR)/$(RULESDIR)/$$a ; done

user-uninstall uninstall:
uninstall:
rm -f ${R2_LIBR_PLUGINS_DIR}/$(MOD).$(LIBEXT)
rm -rf $(R2_LIBR_PLUGINS_DIR)/$(RULESDIR)

user-uninstall:
rm -f ${R2PM_USRPLUGIN_DIR}/$(MOD).$(LIBEXT)
rm -rf $(RULESDIR)
rm -rf ${R2PM_USRPLUGIN_DIR}/yara
rm -rf $(R2PM_USRPLUGIN_DIR)/$(RULESDIR)

0 comments on commit a24d726

Please sign in to comment.