openwall / openwall/john

Add proper "make install" and clean up "--prefix" / "--with-systemwide" handling

Open
#4,281 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

We do have a make install, but it currently only (opportunistically) installs bash and zsh completions, and into directories unaffected by --prefix. The rest of its logic is somehow commented out:

install: strip shell-completion
#ifneq ($(prefix), ../run)
#       @echo Copying binaries to $(prefix)
#       $(MKDIR) $(prefix)
#       $(CP) -p -P -R ../run/*.{py,pl,rb} $(PROJ) $(prefix)
#       @echo Copying data and config files to $(prefix)
#       $(MKDIR) $(prefix)
#       $(CP) -p -P -R ../run/*.{chr,conf,lst} $(prefix)
#endif

Other than that, we already handle --prefix mostly similarly to how other typical autoconf'ed software does it:

dnl -DJOHN_SYSTEMWIDE
AC_ARG_WITH(systemwide, [AS_HELP_STRING([--with-systemwide],[install for all users])],,[with_systemwide=no])
AC_PREFIX_DEFAULT([../run])
dnl Handle --prefix -> JOHN_SYSTEMWIDE
dnl A prefix of /usr/local will mean execs in /usr/local/bin and the rest
dnl in /usr/local/share/john
AS_IF([test $prefix != "../run" && test $prefix != "NONE" ],
   [CFLAGS="$CFLAGS -DJOHN_SYSTEMWIDE -DJOHN_SYSTEMWIDE_EXEC='\"$prefix/bin\"' -DJOHN_SYSTEMWIDE_HOME='\"$prefix/share/john\"'"],
   [AS_IF([test $with_systemwide != no], [CFLAGS="$CFLAGS -DJOHN_SYSTEMWIDE"
   prefix=/usr/libexec/john])]
)

I think we should rework the logic around --with-systemwide, though. Do we know of existing users of the present logic?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing make install target and the configure logic for --prefix and --with-systemwide shown in the issue. Trace how the current prefix values affect executable, data, and completion destinations. Done means make install consistently installs the project under the selected prefix and the systemwide behavior is clearly defined and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.