Commit c30ad79c authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Update debian patches for new update

parent 427f94d1
......@@ -2,7 +2,7 @@ amap (5.4-4parrot2) rolling-testing; urgency=medium
* Add ex maintainer team and add standard to 4.5.1
-- Nong Hoang Tu <dmknght@parrotsec.org> Sat, 23 Jan 2021 12:21:08 +0700
-- Nong Hoang Tu <dmknght@parrotsec.org> Tue, 02 Mar 2021 18:18:15 +0700
amap (5.4-4parrot1) rolling-testing; urgency=medium
......
Fix upstream build system to support the $DESTDIR variable
used by debhelper to install files in debian/amap/ instead
of in the root directory.
Catch failures and improve rules to not generate failures when
everything goes as expected.
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,15 +34,14 @@ debug: amap.c
$(CC) $(OPT_DEBUG) -o amapcrap amapcrap.c $(XLIBS) $(XLIBPATHS) $(XIPATHS) $(XDEFINES)
install: all
- @echo Installing to $(PREFIX), change this by running ./configure --prefix=path
- -mkdir -vp $(PREFIX)$(BINDIR) 2> /dev/null
- -mkdir -vp $(PREFIX)$(DATADIR) 2> /dev/null
- -mkdir -vp $(PREFIX)$(MANDIR) 2> /dev/null
- -test -e amap.exe || cp -f amap amap6 amapcrap $(PREFIX)$(BINDIR)
- -test -e amap.exe && cp -f amap.exe amapcrap.exe $(PREFIX)$(BINDIR) || echo
- -cp -f $(SCRIPTS) $(PREFIX)$(DATADIR)
- -cp -f $(MANPAGE) $(PREFIX)$(MANDIR)
- -test $(PREFIX)$(BINDIR)/amap6 || cd $(PREFIX)$(BINDIR) && ln -s amap amap6
+ @echo Installing to $(DESTDIR)$(PREFIX), change this by running ./configure --prefix=path
+ mkdir -vp $(DESTDIR)$(PREFIX)$(BINDIR) 2> /dev/null
+ mkdir -vp $(DESTDIR)$(PREFIX)$(DATADIR) 2> /dev/null
+ mkdir -vp $(DESTDIR)$(PREFIX)$(MANDIR) 2> /dev/null
+ test -e amap.exe || cp -fd amap amap6 amapcrap $(DESTDIR)$(PREFIX)$(BINDIR)
+ test -e amap.exe && cp -f amap.exe amapcrap.exe $(DESTDIR)$(PREFIX)$(BINDIR) || echo
+ cp -f $(SCRIPTS) $(DESTDIR)$(PREFIX)$(DATADIR)
+ cp -f $(MANPAGE) $(DESTDIR)$(PREFIX)$(MANDIR)
clean:
cd pcre-3.9 && make clean
The Debian packaging moves the "etc" directory out of the AMAP_PREFIX
directory because /usr/etc/ is not a FHS-compliant directory.
Adapt the upstream source code to still find the files in their new place.
--- a/amap-lib.c
+++ b/amap-lib.c
@@ -303,10 +303,7 @@ FILE *amap_open_file(char *fnam, char *t
strcat(file_name, AMAP_DEFAULT_FILENAME);
strcat(file_name, extension);
if ((f = fopen(file_name, "r")) == NULL) {
- strcpy(file_name, AMAP_PREFIX);
- if (file_name[strlen(file_name) - 1] != '/')
- strcat(file_name, "/");
- strcat(file_name, "etc/");
+ strcpy(file_name, "/etc/amap/");
strcat(file_name, AMAP_DEFAULT_FILENAME);
strcat(file_name, extension);
f = fopen(file_name, "r");
@@ -2057,12 +2054,8 @@ int amap_main(amap_struct_options *opt,
// ONLINE UPDATE //
if (opt->update) {
printf("Running Online Update for fingerprints, connecting to %s\n", AMAP_RESOURCE);
- if (opt->filename == NULL) {
- opt->filename = malloc(strlen(AMAP_PREFIX) + 5 + strlen(AMAP_DEFAULT_FILENAME) + 2);
- strcpy(opt->filename, AMAP_PREFIX);
- strcat(opt->filename, "/etc/");
- strcat(opt->filename, AMAP_DEFAULT_FILENAME);
- }
+ if (opt->filename == NULL)
+ opt->filename = strdup("/etc/amap/" AMAP_DEFAULT_FILENAME);
opt->file_log = malloc(strlen(opt->filename) + 6);
strcpy(opt->file_log, opt->filename);
opt->file_nmap = malloc(strlen(AMAP_RESOURCE) + strlen(opt->file_log) + 16);
add-destdir-support
fix-appdef-lookup-dir
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment